Merge branch 'angular-16-irish-monitor' of code-repo.d4science.org:MaDgIK/openaire-library into angular-16-irish-monitor
This commit is contained in:
commit
d2aa28225a
|
@ -865,7 +865,7 @@ export class ClaimResultSearchFormComponent {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
filter.countAllValues = filter.values.length;
|
||||
}
|
||||
return filters;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
<!-- schema.org-->
|
||||
<schema2jsonld *ngIf="dataProviderInfo"
|
||||
[data]=dataProviderInfo [URL]="canonicalUrl" type="datasource"
|
||||
[otherURL]="(dataProviderInfo.provenance)?provenanceUrls:null"></schema2jsonld>
|
||||
|
||||
<!-- Desktop view -->
|
||||
<div class="uk-visible@m landing uk-section uk-padding-remove tm-middle">
|
||||
<div *ngIf="!isMobile" class="tm-main">
|
||||
|
@ -95,11 +100,7 @@
|
|||
<div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')">
|
||||
<div class="uk-grid uk-grid-small" uk-grid>
|
||||
<div class="uk-width-expand">
|
||||
<!-- schema.org-->
|
||||
<schema2jsonld [data]=dataProviderInfo
|
||||
[URL]="canonicalUrl"
|
||||
type="datasource"
|
||||
[otherURL]="(dataProviderInfo.provenance)?provenanceUrls:null"></schema2jsonld>
|
||||
|
||||
<!-- Actions for mobile viewport -->
|
||||
<div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s">
|
||||
<div>
|
||||
|
|
|
@ -14,68 +14,79 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
|||
<div class="uk-flex uk-flex-middle"
|
||||
[ngClass]="isMobile ? ('uk-flex-column ' + (!(usedBy == 'landing') ? 'uk-margin-left uk-margin-xsmall-bottom' : '')) : 'uk-grid uk-grid-small uk-child-width-auto'"
|
||||
[attr.uk-grid]="!isMobile ? '' : null">
|
||||
<div *ngIf="properties.environment != 'production' && availableOn[0].fulltext" class="uk-flex uk-flex-middle"
|
||||
[ngClass]="isMobile ? 'uk-width-1-1' : 'uk-text-bolder'">
|
||||
<a [href]="availableOn[0].fulltext" target="_blank"
|
||||
class="uk-flex uk-flex-middle uk-button-link"
|
||||
[ngClass]="isMobile ? ((usedBy == 'landing') ? 'uk-width-1-1 uk-padding-small uk-padding-remove-horizontal' : '') : 'uk-flex-center'">
|
||||
<!-- <icon [flex]="true" [ratio]="0.7" name="download" visuallyHidden="download"></icon>-->
|
||||
<icon name="download" visuallyHidden="donwload" [flex]="true" [ratio]="(isMobile && usedBy == 'landing') ? 1 : 0.8"></icon>
|
||||
<span class="uk-margin-xsmall-left">Full-Text</span>
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="properties.environment != 'production' && isMobile && (usedBy == 'landing') && availableOn[0].fulltext" class="uk-width-1-1"><hr></div>
|
||||
<div *ngIf="availableOn[0].downloadUrl" [ngClass]="isMobile ? 'uk-width-1-1' : ''">
|
||||
<div class="uk-flex uk-flex-middle" [ngClass]="isMobile ? ((usedBy == 'landing') ? 'uk-padding-small uk-padding-remove-horizontal' : '') : ''">
|
||||
<span [class]="'uk-margin-xsmall-right ' + (availableOn[0].accessRightIcon == 'open_access' ? 'open-access' : 'closed-access')"
|
||||
uk-tooltip [title]="getAccessLabel(availableOn[0].accessRight)">
|
||||
<icon [name]="availableOn[0].accessRightIcon" [flex]="true" [ratio]="(isMobile && usedBy == 'landing') ? 1 : 0.8"></icon>
|
||||
</span>
|
||||
<ng-container *ngIf="!isMobile">
|
||||
<a uk-tooltip="Source" target="_blank"
|
||||
class="uk-flex uk-flex-middle uk-flex-center uk-button-link uk-text-bolder">
|
||||
<span>{{sliceString(availableOn[0].downloadNames.join("; "), 20)}}</span>
|
||||
<span>
|
||||
<!-- <icon [flex]="true" [name]="'expand_' + (isOpen?'less':'more')"></icon>-->
|
||||
<icon [flex]="true" [name]="(isOpen?'arrow_drop_up':'arrow_drop_down')"></icon>
|
||||
</span>
|
||||
</a>
|
||||
<div #dropElement uk-drop="mode: click; pos: bottom-left; flip: false; shift: false" class="uk-drop download-drop">
|
||||
<div class="uk-card uk-card-default uk-padding-small uk-padding-remove-horizontal uk-text-small uk-height-max-large uk-overflow-auto">
|
||||
<ng-container *ngTemplateOutlet="availableOnList"></ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="isMobile">
|
||||
<a #toggle class="uk-flex uk-flex-between uk-flex-middle uk-flex-center uk-width-expand uk-button-link">
|
||||
<span>{{sliceString(availableOn[0].downloadNames.join("; "), 20)}}</span>
|
||||
<span>
|
||||
<icon [flex]="true" ratio="1.5" name="arrow_right"></icon>
|
||||
</span>
|
||||
</a>
|
||||
<mobile-dropdown [toggle]="toggle">
|
||||
<div class="uk-text-emphasis uk-text-bolder uk-text-center uk-padding-small uk-padding-remove-vertical uk-text-uppercase">
|
||||
Sources
|
||||
</div>
|
||||
<div class="uk-text-small download-drop uk-padding uk-padding-remove-horizontal">
|
||||
<ng-container *ngTemplateOutlet="availableOnList"></ng-container>
|
||||
</div>
|
||||
</mobile-dropdown>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="inModal">
|
||||
<div class="uk-text-small uk-height-max-small uk-overflow-auto">
|
||||
<ng-container *ngTemplateOutlet="availableOnList"></ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="!inModal">
|
||||
<div *ngIf="properties.environment != 'production' && availableOn[0].fulltext" class="uk-flex uk-flex-middle"
|
||||
[ngClass]="isMobile ? 'uk-width-1-1' : 'uk-text-bolder'">
|
||||
<a [href]="availableOn[0].fulltext" target="_blank"
|
||||
class="uk-flex uk-flex-middle uk-button-link"
|
||||
[ngClass]="isMobile ? ((usedBy == 'landing') ? 'uk-width-1-1 uk-padding-small uk-padding-remove-horizontal' : '') : 'uk-flex-center'">
|
||||
<!-- <icon [flex]="true" [ratio]="0.7" name="download" visuallyHidden="download"></icon>-->
|
||||
<icon name="download" visuallyHidden="donwload" [flex]="true" [ratio]="(isMobile && usedBy == 'landing') ? 1 : 0.8"></icon>
|
||||
<span class="uk-margin-xsmall-left">Full-Text</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div *ngIf="properties.environment != 'production' && isMobile && (usedBy == 'landing') && availableOn[0].fulltext" class="uk-width-1-1"><hr></div><div *ngIf="availableOn[0].downloadUrl" [ngClass]="isMobile ? 'uk-width-1-1' : ''">
|
||||
<div class="uk-flex uk-flex-middle" [ngClass]="isMobile ? ((usedBy == 'landing') ? 'uk-padding-small uk-padding-remove-horizontal' : '') : ''">
|
||||
<span [class]="'uk-margin-xsmall-right ' + (availableOn[0].accessRightIcon == 'open_access' ? 'open-access' : 'closed-access')"
|
||||
uk-tooltip [title]="getAccessLabel(availableOn[0].accessRight)">
|
||||
<icon [name]="availableOn[0].accessRightIcon" [flex]="true" [ratio]="(isMobile && usedBy == 'landing') ? 1 : 0.8"></icon>
|
||||
</span>
|
||||
<ng-container *ngIf="!isMobile">
|
||||
<a uk-tooltip="Source" target="_blank"
|
||||
class="uk-flex uk-flex-middle uk-flex-center uk-button-link uk-text-bolder">
|
||||
<span>{{sliceString(availableOn[0].downloadNames.join("; "), 20)}}</span>
|
||||
<span>
|
||||
<!-- <icon [flex]="true" [name]="'expand_' + (isOpen?'less':'more')"></icon>-->
|
||||
<icon [flex]="true" [name]="(isOpen?'arrow_drop_up':'arrow_drop_down')"></icon>
|
||||
</span>
|
||||
</a>
|
||||
<div #dropElement uk-drop="mode: click; pos: bottom-left; flip: false; shift: false" class="uk-drop download-drop">
|
||||
<div class="uk-card uk-card-default uk-padding-small uk-padding-remove-horizontal uk-text-small uk-height-max-large uk-overflow-auto">
|
||||
<ng-container *ngTemplateOutlet="availableOnList"></ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="isMobile">
|
||||
<a #toggle class="uk-flex uk-flex-between uk-flex-middle uk-flex-center uk-width-expand uk-button-link">
|
||||
<span>{{sliceString(availableOn[0].downloadNames.join("; "), 20)}}</span>
|
||||
<span>
|
||||
<icon [flex]="true" ratio="1.5" name="arrow_right"></icon>
|
||||
</span>
|
||||
</a>
|
||||
<mobile-dropdown [toggle]="toggle">
|
||||
<div class="uk-text-emphasis uk-text-bolder uk-text-center uk-padding-small uk-padding-remove-vertical uk-text-uppercase">
|
||||
Sources
|
||||
</div>
|
||||
<div class="uk-text-small download-drop uk-padding uk-padding-remove-horizontal">
|
||||
<ng-container *ngTemplateOutlet="availableOnList"></ng-container>
|
||||
</div>
|
||||
</mobile-dropdown>
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</ng-container>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-template #availableOnList>
|
||||
<div *ngFor="let instance of availableOn let i=index" class="download-drop-item uk-flex uk-flex-top">
|
||||
<div *ngFor="let instance of availableOn let i=index" class="download-drop-item uk-flex uk-flex-top"
|
||||
[ngClass]="inModal ? 'uk-margin-small-bottom' : ''">
|
||||
<span
|
||||
[class]="'uk-margin-small-right ' + (instance.accessRightIcon == 'open_access' ? 'open-access' : 'closed-access')"
|
||||
uk-tooltip [title]="getAccessLabel(instance.accessRight)">
|
||||
<icon [name]="instance.accessRightIcon" [flex]="true"></icon>
|
||||
<icon [name]="instance.accessRightIcon" [flex]="true" [ratio]="inModal ? 0.8 : 1"></icon>
|
||||
</span>
|
||||
<div class="uk-width-expand uk-padding-small uk-padding-remove-left uk-padding-remove-vertical">
|
||||
<div class="uk-padding-small uk-padding-remove-left uk-padding-remove-vertical"
|
||||
[ngClass]="inModal ? 'uk-grid' : 'uk-width-expand'">
|
||||
<span class="uk-text-emphasis">
|
||||
<a *ngIf="instance.downloadUrl" [href]="instance.downloadUrl" target="_blank"
|
||||
class="title uk-link-text uk-text-bold custom-external uk-display-inline-block">
|
||||
|
@ -120,6 +131,7 @@ import {RouterHelper} from "../../utils/routerHelper.class";
|
|||
|
||||
export class AvailableOnComponent {
|
||||
@Input() isMobile: boolean = false;
|
||||
@Input() inModal: boolean = false;
|
||||
@Input() usedBy: "search" | "landing" = "search";
|
||||
@Input() prevPath: string = "";
|
||||
@Input() availableOn: HostedByCollectedFrom[];
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
<!-- Schema -->
|
||||
<schema2jsonld *ngIf="organizationInfo" [data]=organizationInfo
|
||||
[URL]="properties.domain + properties.baseLink+this.properties.searchLinkToOrganization+organizationInfo.relcanId"
|
||||
type="organization">
|
||||
</schema2jsonld>
|
||||
|
||||
<!-- Desktop view -->
|
||||
<div id="tm-main" class="uk-visible@m landing uk-section uk-padding-remove tm-middle">
|
||||
<div *ngIf="!isMobile" class="tm-main">
|
||||
|
@ -116,11 +122,7 @@
|
|||
<ng-container *ngIf="organizationInfo">
|
||||
<!-- Main content -->
|
||||
<div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')">
|
||||
<!-- Schema -->
|
||||
<schema2jsonld *ngIf="organizationInfo" [data]=organizationInfo
|
||||
[URL]="properties.domain + properties.baseLink+this.properties.searchLinkToOrganization+organizationInfo.relcanId"
|
||||
type="organization">
|
||||
</schema2jsonld>
|
||||
|
||||
<!-- Actions for mobile viewport -->
|
||||
<div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s">
|
||||
<div class="uk-margin-small-right">
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
<!-- schema.org-->
|
||||
<schema2jsonld *ngIf="projectInfo"
|
||||
[data]=projectInfo [URL]="properties.domain+properties.baseLink+properties.searchLinkToProject+projectId"
|
||||
type="project"></schema2jsonld>
|
||||
|
||||
<!-- Desktop view -->
|
||||
<div class=" uk-visible@m landing uk-section uk-padding-remove tm-middle">
|
||||
<div *ngIf="!isMobile" class="tm-main">
|
||||
|
@ -141,10 +146,7 @@
|
|||
<div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')">
|
||||
<div class="uk-grid uk-grid-small" uk-grid>
|
||||
<div class="uk-width-expand">
|
||||
<!-- schema.org-->
|
||||
<schema2jsonld [data]=projectInfo
|
||||
[URL]="properties.domain+properties.baseLink+properties.searchLinkToProject+projectId"
|
||||
type="project"></schema2jsonld>
|
||||
|
||||
<!-- Actions for mobile viewport -->
|
||||
<div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s">
|
||||
<div class="uk-margin-small-right">
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
<!-- schema.org-->
|
||||
<schema2jsonld *ngIf="resultLandingInfo && resultLandingInfo.record"
|
||||
[data]=resultLandingInfo.record [URL]="canonicalUrl"
|
||||
[searchActionRoute]="properties.searchLinkToResults"></schema2jsonld>
|
||||
|
||||
<!-- Desktop view -->
|
||||
<div id="tm-main" class="uk-visible@m landing uk-section uk-padding-remove tm-middle">
|
||||
<div *ngIf="!isMobile" class="tm-main">
|
||||
|
@ -161,11 +166,7 @@
|
|||
<!-- in small screens there is no sticky #graph_and_feedback so margin-top is medium (40px) -->
|
||||
<!-- else margin is medium (40px) - the actual height of uk-sticky-placeholder (graph_height - 20px -> margins of #graph_and_feedback) -->
|
||||
<div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')">
|
||||
<!-- schema.org-->
|
||||
<schema2jsonld *ngIf="resultLandingInfo.record" [data]=resultLandingInfo.record
|
||||
[URL]="canonicalUrl"
|
||||
[searchActionRoute]="properties.searchLinkToResults"></schema2jsonld>
|
||||
|
||||
|
||||
<!-- Actions for mobile viewport -->
|
||||
<div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s">
|
||||
<!-- Share -->
|
||||
|
|
|
@ -97,12 +97,12 @@ export class SearchAllComponent {
|
|||
|
||||
subs: Subscription[] = [];
|
||||
|
||||
quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = {
|
||||
filter: null,
|
||||
selected: true,
|
||||
filterId: "resultbestaccessright",
|
||||
value: "Open Access"
|
||||
};
|
||||
quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = null;//{
|
||||
// filter: null,
|
||||
// selected: true,
|
||||
// filterId: "resultbestaccessright",
|
||||
// value: "Open Access"
|
||||
// };
|
||||
|
||||
resultTypes = {publication: true, dataset: true, software: true, other: true};
|
||||
|
||||
|
@ -290,7 +290,7 @@ export class SearchAllComponent {
|
|||
this.fetchDatasets.clearSubscriptions();
|
||||
this.fetchPublications.clearSubscriptions();
|
||||
this.fetchSoftware.clearSubscriptions();
|
||||
this.fetchPublications.clearSubscriptions();
|
||||
this.fetchOrps.clearSubscriptions();
|
||||
this.fetchOrganizations.clearSubscriptions();
|
||||
this.fetchDataproviders.clearSubscriptions();
|
||||
this.fetchServices.clearSubscriptions();
|
||||
|
@ -603,9 +603,9 @@ export class SearchAllComponent {
|
|||
}
|
||||
if (entity == "result") {
|
||||
entity = "research-outcomes";
|
||||
if(!!this.openAccess) {
|
||||
this.parameters["resultbestaccessright"] = '"' + encodeURIComponent("Open Access") + '"';
|
||||
}
|
||||
// if(!!this.openAccess) {
|
||||
// this.parameters["resultbestaccessright"] = '"' + encodeURIComponent("Open Access") + '"';
|
||||
// }
|
||||
}
|
||||
this.router.navigate(["/search/find", entity], {queryParams: this.parameters});
|
||||
}
|
||||
|
|
|
@ -99,12 +99,12 @@ export class SearchResearchResultsComponent {
|
|||
public orderedFields = this.searchFields.RESULT_FIELDS_ORDERED;
|
||||
@ViewChild(NewSearchPageComponent, { static: true }) searchPage: NewSearchPageComponent;
|
||||
@Input() simpleView: boolean = true;
|
||||
quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = {
|
||||
filter: null,
|
||||
selected: true,
|
||||
filterId: "resultbestaccessright",
|
||||
value: "Open Access"
|
||||
};
|
||||
quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = null;//{
|
||||
// filter: null,
|
||||
// selected: true,
|
||||
// filterId: "resultbestaccessright",
|
||||
// value: "Open Access"
|
||||
// };
|
||||
@Input() includeOnlyResultsAndFilter: boolean = false;
|
||||
@Input() showBreadcrumb: boolean = false;
|
||||
@Output() searchPageUpdates = new EventEmitter();
|
||||
|
@ -551,6 +551,7 @@ export class SearchResearchResultsComponent {
|
|||
filter.countSelectedValues = oldFilter.countSelectedValues;
|
||||
filter.radioValue = oldFilter.radioValue;
|
||||
this.filters[index] = filter;
|
||||
this.searchPage.filterFilterValues(this.filters);
|
||||
this.updateOrderedFilter(filter);
|
||||
|
||||
this.cdr.detectChanges();
|
||||
|
|
|
@ -223,7 +223,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
|
|||
}
|
||||
}
|
||||
if (typeof document !== 'undefined') {
|
||||
this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
|
||||
this.subscriptions.push(this.indexInfoService.lastIndexDate.subscribe(lastIndexUpdate => {
|
||||
if (lastIndexUpdate) {
|
||||
this.indexUpdateDate = new Date(lastIndexUpdate);
|
||||
}
|
||||
|
|
|
@ -85,9 +85,11 @@ export class SearchFilterComponent implements OnInit, OnChanges {
|
|||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
if (changes.filter) {
|
||||
this.hasMoreValues = this.filter.values.length > this.filterValuesNum;
|
||||
this.hasMoreValues = (this.filter.countUnfilteredValues > 0 ? this.filter.countUnfilteredValues : this.filter.values.length) > this.filterValuesNum;
|
||||
// this.filter.values = this.filter.values.filter(value => !value.name.toLowerCase().includes('unknown') && !value.name.toLowerCase().includes('not available'));
|
||||
this.filter.values = this.filter.values.filter(value => value && value.name != "unidentified" && value.name != "Undetermined" && !value.name.toLowerCase().includes('unknown') && !value.name.toLowerCase().includes('not available'));
|
||||
// this.filter.values = this.filter.values.filter(value => value && value.name != "unidentified" && value.name != "Undetermined" && !value.name.toLowerCase().includes('unknown') && !value.name.toLowerCase().includes('not available')
|
||||
// && value.name.toLowerCase() != "null"
|
||||
// );
|
||||
|
||||
if (this.filter.filterType == "radio" || this.filter.filterType == "triplet") {
|
||||
this.filter.radioValue = "";
|
||||
|
|
|
@ -14,6 +14,7 @@ export class Filter{
|
|||
public countAllValues?: number = -1; // -1: not yet requested, 0: request failed, >0 OK
|
||||
// public isOpen?: boolean = false;
|
||||
public isViewAllOpen?: boolean = false;
|
||||
public countUnfilteredValues?: number = 0;
|
||||
}
|
||||
|
||||
export class Value{
|
||||
|
|
|
@ -11,7 +11,7 @@ export class RefineResultsUtils {
|
|||
|
||||
var searchFields:SearchFields = new SearchFields();
|
||||
var filters:Filter[] = [];
|
||||
if(data && fields){
|
||||
if(data && Object.keys(data).length > 0 && fields){
|
||||
for(let j=0; j<fields.length; j++) {
|
||||
|
||||
var filter:Filter = new Filter();
|
||||
|
@ -27,15 +27,16 @@ export class RefineResultsUtils {
|
|||
|
||||
let field = data[fields[j]];
|
||||
if(field){
|
||||
filter.countUnfilteredValues = field.length;
|
||||
for(let i=0; i<field.length; i++) {
|
||||
var value:Value = new Value();
|
||||
value.name = field[i].name;
|
||||
value.name =this.removePartAfterCharacters(value,"||");
|
||||
value.number = field[i].count;
|
||||
value.id = field[i].id;
|
||||
//if(RefineResultsUtils.includeValue(value)){
|
||||
if(RefineResultsUtils.includeValue(value)){
|
||||
filter.values.push(value);
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -51,11 +52,14 @@ export class RefineResultsUtils {
|
|||
return filters;
|
||||
}
|
||||
private static includeValue (field):boolean {
|
||||
if( !field || !field.name || field.name == "unidentified" || field.name == "Undetermined" ){
|
||||
return false;
|
||||
// if( !field || !field.name || field.name == "unidentified" || field.name == "Undetermined" ){
|
||||
if( field && field.name && field.name != "unidentified" && field.name != "Undetermined"
|
||||
&& !field.name.toLowerCase().includes('unknown') && !field.name.toLowerCase().includes('not available')
|
||||
&& field.name.toLowerCase() != "null") {
|
||||
return true;
|
||||
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
private static removePartAfterCharacters(field, characters):string {
|
||||
if( field.name.indexOf(characters) !=-1){
|
||||
|
|
|
@ -87,12 +87,12 @@ export class NavigationBarComponent implements OnInit, OnDestroy, OnChanges {
|
|||
public featuredAlignment: string = MenuAlignment.CENTER.valueOf();
|
||||
|
||||
public hasSearchBar: boolean = false;
|
||||
public resultsQuickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = {
|
||||
filter: null,
|
||||
selected: true,
|
||||
filterId: "resultbestaccessright",
|
||||
value: "Open Access"
|
||||
};
|
||||
public resultsQuickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = null;//{
|
||||
// filter: null,
|
||||
// selected: true,
|
||||
// filterId: "resultbestaccessright",
|
||||
// value: "Open Access"
|
||||
// };
|
||||
@ViewChild('search_input') search_input: SearchInputComponent;
|
||||
@ViewChild('canvas') canvas: ElementRef;
|
||||
public routerHelper: RouterHelper = new RouterHelper();
|
||||
|
|
|
@ -140,8 +140,8 @@ export class OpenAireJsonldConverterService {
|
|||
doc["description"] = [];
|
||||
if(project.description) {
|
||||
let parsing = new ParsingFunctions();
|
||||
let abstracts = parsing.parseDescription(project.description);
|
||||
doc["description"] = [abstracts && abstracts[0] ?(abstracts[0].substring(0,4997)+(abstracts[0].substring(0,4997).length == 4997?'...':'')):"" ];
|
||||
let abstracts = parsing.parseDescription(project.description, true);
|
||||
doc["description"] = [abstracts ?(abstracts.substring(0,4997)+(abstracts.substring(0,4997).length == 4997?'...':'')):"" ];
|
||||
} else {
|
||||
doc["description"].push(("project" + (project.title ? "," + project.title : "") + (project.funding && project.funding.funderName ? ", funder: " + project.funding.funderName : "") + (project.acronym ? "," + project.acronym : "")));
|
||||
}
|
||||
|
@ -178,8 +178,8 @@ convertDatasource(datasource: any, URL, otherUrl): Organization {
|
|||
doc["description"] = [];
|
||||
if(datasource.description) {
|
||||
let parsing = new ParsingFunctions();
|
||||
let abstracts = parsing.parseDescription(datasource.description);
|
||||
doc["description"] = [abstracts && abstracts[0] ?(abstracts[0].substring(0,4997)+(abstracts[0].substring(0,4997).length == 4997?'...':'')):"" ];
|
||||
let abstracts = parsing.parseDescription(datasource.description, true);
|
||||
doc["description"] = [abstracts ?(abstracts.substring(0,4997)+(abstracts.substring(0,4997).length == 4997?'...':'')):"" ];
|
||||
} else {
|
||||
doc["description"].push(datasource.title.name?datasource.title.name:datasource.officialName);
|
||||
}
|
||||
|
@ -242,8 +242,8 @@ convertDatasource(datasource: any, URL, otherUrl): Organization {
|
|||
const item = _.get(result, "result.metadata.oaf:entity.oaf:result.description", null);
|
||||
if (!item) return [ "" + this.getTitle(result)];
|
||||
let parsing = new ParsingFunctions();
|
||||
let abstracts = parsing.parseDescription(item);
|
||||
return [abstracts && abstracts[0] ?(abstracts[0].substring(0,4997)+(abstracts[0].substring(0,4997).length == 4997?'...':'')):"" ];
|
||||
let abstracts = parsing.parseDescription(item, true);
|
||||
return [abstracts ?(abstracts.substring(0,4997)+(abstracts.substring(0,4997).length == 4997?'...':'')):"" ];
|
||||
}
|
||||
|
||||
private getDateCreated(result: any): String[] {
|
||||
|
|
|
@ -175,6 +175,7 @@ export class FetchProjects {
|
|||
}
|
||||
}
|
||||
}
|
||||
this.filters[i].countAllValues = this.filters[i].values.length;
|
||||
}
|
||||
}
|
||||
if (filterquery == "") {
|
||||
|
@ -186,6 +187,7 @@ export class FetchProjects {
|
|||
this.funders = (this.filters[i].values);
|
||||
|
||||
}
|
||||
this.filters[i].countAllValues = this.filters[i].values.length;
|
||||
}
|
||||
//console.log(" this.funders:"+ this.funders);
|
||||
|
||||
|
|
|
@ -1,21 +1,34 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {EnvProperties} from './properties/env-properties';
|
||||
import {Observable, of} from "rxjs";
|
||||
import {BehaviorSubject, Observable, of} from "rxjs";
|
||||
import {catchError, map} from "rxjs/operators";
|
||||
import {properties} from "../../../environments/environment";
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: "root"
|
||||
})
|
||||
export class IndexInfoService {
|
||||
private lastIndexDateSubject: BehaviorSubject<any> = new BehaviorSubject<any>(null);
|
||||
|
||||
constructor(private http: HttpClient) {
|
||||
}
|
||||
|
||||
getLastIndexDate(properties: EnvProperties): Observable<any> {
|
||||
let url = properties.indexInfoAPI;
|
||||
return this.http.get((properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)): url).pipe(map(res => res['claim_load_date'])).pipe(catchError(err => {return of(null)}));
|
||||
get lastIndexDate(): Observable<any> {
|
||||
return this.lastIndexDateSubject.getValue() ? this.lastIndexDateSubject.asObservable() : this.getLastIndexDate();
|
||||
}
|
||||
|
||||
setLastIndexDate(value: any) {
|
||||
this.lastIndexDateSubject.next(value);
|
||||
}
|
||||
|
||||
getLastIndexDate(props: EnvProperties = properties): Observable<any> {
|
||||
let url = props.indexInfoAPI;
|
||||
return this.http.get((props.useLongCache)? (props.cacheUrl+encodeURIComponent(url)): url).pipe(map(res => {
|
||||
this.setLastIndexDate(res['claim_load_date']);
|
||||
return res['claim_load_date'];
|
||||
})).pipe(catchError(err => {return of(null)}));
|
||||
}
|
||||
getStatsLastDate(properties: EnvProperties): Observable<any> {
|
||||
let url = properties.indexInfoAPI;
|
||||
|
|
|
@ -173,16 +173,16 @@
|
|||
<!-- </div>-->
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="((result.hostedBy_collectedFrom || hasActions || result.measure?.bip.length || result.measure?.counts.length) && !isDeletedByInferenceModal) && showEntityActions"
|
||||
<div *ngIf="(result.hostedBy_collectedFrom || ((hasActions || result.measure?.bip.length || result.measure?.counts.length) && (!isDeletedByInferenceModal && showEntityActions)))"
|
||||
class="uk-text-small uk-margin-top" [class.uk-border-bottom]="!isMobile">
|
||||
<div uk-grid class="uk-grid uk-grid-small uk-text-xsmall uk-flex-middle uk-margin-xsmall-bottom"
|
||||
[class.uk-flex-between]="(result.measure?.bip.length || result.measure?.counts.length) && (result.hostedBy_collectedFrom?.length || hasActions)"
|
||||
[class.uk-flex-right]="!(result.measure?.bip.length || result.measure?.counts.length) && (result.hostedBy_collectedFrom?.length || hasActions)"
|
||||
[class.uk-flex-between]="!isDeletedByInferenceModal && (result.measure?.bip.length || result.measure?.counts.length) && (result.hostedBy_collectedFrom?.length || hasActions)"
|
||||
[class.uk-flex-right]="!isDeletedByInferenceModal && !(result.measure?.bip.length || result.measure?.counts.length) && (result.hostedBy_collectedFrom?.length || hasActions)"
|
||||
[class.uk-grid-divider]="!isMobile">
|
||||
<div *ngIf="result.hostedBy_collectedFrom?.length" class="uk-width-auto uk-visible@m">
|
||||
<availableOn [availableOn]="result.hostedBy_collectedFrom"></availableOn>
|
||||
<availableOn [availableOn]="result.hostedBy_collectedFrom" [inModal]="isDeletedByInferenceModal"></availableOn>
|
||||
</div>
|
||||
<div *ngIf="hasActions && result.id" class="uk-width-expand uk-visible@m">
|
||||
<div *ngIf="!isDeletedByInferenceModal && hasActions && result.id" class="uk-width-expand uk-visible@m">
|
||||
<entity-actions [cite]="cite" [share]="share" [linking]="linking"
|
||||
[deposit]="deposit" [embed]="embed"
|
||||
[type]="result.resultType"
|
||||
|
@ -211,7 +211,7 @@
|
|||
</entity-actions>
|
||||
</div>
|
||||
|
||||
<div *ngIf="result.oaRoutes || result.measure?.bip.length || result.measure?.counts.length"
|
||||
<div *ngIf="!isDeletedByInferenceModal && (result.oaRoutes || result.measure?.bip.length || result.measure?.counts.length)"
|
||||
class="metrics uk-text-xsmall uk-width-auto uk-flex uk-flex-middle uk-flex-right uk-text-meta uk-grid uk-grid-small uk-grid-divider"
|
||||
[ngClass]="isMobile ? '' : 'uk-padding-remove-horizontal'">
|
||||
<div *ngIf="result.oaRoutes" class="uk-first-column">
|
||||
|
@ -309,48 +309,55 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div *ngIf="result.hostedBy_collectedFrom?.length || hasActions" class="uk-hidden@m">
|
||||
<a class="uk-link-reset uk-flex uk-flex-middle">
|
||||
<icon [flex]="true" name="more_vert"></icon>
|
||||
</a>
|
||||
<div class="uk-dropdown" uk-dropdown="mode: click; pos: top-left; offset: 5; delay-hide: 0"> <!-- #element -->
|
||||
<ul class="uk-nav uk-dropdown-nav">
|
||||
<ng-container *ngIf="result.hostedBy_collectedFrom?.length">
|
||||
<availableOn [availableOn]="result.hostedBy_collectedFrom" [isMobile]="isMobile"></availableOn>
|
||||
<div class="uk-nav-divider"></div>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="hasActions">
|
||||
<entity-actions [cite]="cite" [share]="share" [linking]="linking"
|
||||
[deposit]="deposit" [embed]="embed"
|
||||
[type]="result.resultType"
|
||||
[result]="result" [id]="result.objId?result.objId:result.id"
|
||||
[url]="properties.domain + properties.baseLink + url + '?' + urlParam + '=' + result.id"
|
||||
[isMobile]="isMobile">
|
||||
<span *ngIf="orcid">
|
||||
<orcid-work *ngIf="showOrcid && result.identifiers && result.identifiers.size > 0"
|
||||
[resultId]="result.relcanId" [resultTitle]="result.title"
|
||||
[type]="result.resultType" [pageType]="'search'"
|
||||
[putCodes]="result.orcidPutCodes" [givenPutCode]="true" [identifiers]="result.identifiers"
|
||||
[isMobile]="isMobile">
|
||||
</orcid-work>
|
||||
</span>
|
||||
<span *ngIf="orcid" class="uk-width-expand uk-text-right">
|
||||
<span *ngIf="result.orcidCreationDates?.length > 0" class="uk-display-inline-block">
|
||||
<span class="uk-text-meta">
|
||||
Added in ORCID:
|
||||
<div *ngIf="result.hostedBy_collectedFrom?.length || (hasActions && !isDeletedByInferenceModal)" class="uk-hidden@m">
|
||||
<ng-container *ngIf="isDeletedByInferenceModal && result.hostedBy_collectedFrom?.length">
|
||||
<availableOn [availableOn]="result.hostedBy_collectedFrom" [inModal]="isDeletedByInferenceModal"></availableOn>
|
||||
<div class="uk-nav-divider"></div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="!isDeletedByInferenceModal">
|
||||
<a class="uk-link-reset uk-flex uk-flex-middle">
|
||||
<icon [flex]="true" name="more_vert"></icon>
|
||||
</a>
|
||||
<div class="uk-dropdown" uk-dropdown="mode: click; pos: top-left; offset: 5; delay-hide: 0"> <!-- #element -->
|
||||
<ul class="uk-nav uk-dropdown-nav">
|
||||
<ng-container *ngIf="result.hostedBy_collectedFrom?.length">
|
||||
<availableOn [availableOn]="result.hostedBy_collectedFrom" [isMobile]="isMobile"></availableOn>
|
||||
<div class="uk-nav-divider"></div>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="hasActions">
|
||||
<entity-actions [cite]="cite" [share]="share" [linking]="linking"
|
||||
[deposit]="deposit" [embed]="embed"
|
||||
[type]="result.resultType"
|
||||
[result]="result" [id]="result.objId?result.objId:result.id"
|
||||
[url]="properties.domain + properties.baseLink + url + '?' + urlParam + '=' + result.id"
|
||||
[isMobile]="isMobile">
|
||||
<span *ngIf="orcid">
|
||||
<orcid-work *ngIf="showOrcid && result.identifiers && result.identifiers.size > 0"
|
||||
[resultId]="result.relcanId" [resultTitle]="result.title"
|
||||
[type]="result.resultType" [pageType]="'search'"
|
||||
[putCodes]="result.orcidPutCodes" [givenPutCode]="true" [identifiers]="result.identifiers"
|
||||
[isMobile]="isMobile">
|
||||
</orcid-work>
|
||||
</span>
|
||||
<span *ngFor="let date of result.orcidCreationDates; let i=index">
|
||||
{{date | date: 'dd MMM yyyy'}}
|
||||
<span *ngIf="i < (result.orcidCreationDates.length - 1)">
|
||||
&
|
||||
<span *ngIf="orcid" class="uk-width-expand uk-text-right">
|
||||
<span *ngIf="result.orcidCreationDates?.length > 0" class="uk-display-inline-block">
|
||||
<span class="uk-text-meta">
|
||||
Added in ORCID:
|
||||
</span>
|
||||
<span *ngFor="let date of result.orcidCreationDates; let i=index">
|
||||
{{date | date: 'dd MMM yyyy'}}
|
||||
<span *ngIf="i < (result.orcidCreationDates.length - 1)">
|
||||
&
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</entity-actions>
|
||||
</ng-container>
|
||||
</ul>
|
||||
</div>
|
||||
</span>
|
||||
</entity-actions>
|
||||
</ng-container>
|
||||
</ul>
|
||||
</div>
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue