Merge Angular 16 Irish Monitor to develop #33

Merged
k.triantafyllou merged 151 commits from angular-16-irish-monitor into develop 2024-02-13 09:32:41 +01:00
17 changed files with 207 additions and 159 deletions
Showing only changes of commit 83de7adc09 - Show all commits

View File

@ -865,7 +865,7 @@ export class ClaimResultSearchFormComponent {
} }
} }
filter.countAllValues = filter.values.length;
} }
return filters; return filters;
} }

View File

@ -1,3 +1,8 @@
<!-- schema.org-->
<schema2jsonld *ngIf="dataProviderInfo"
[data]=dataProviderInfo [URL]="canonicalUrl" type="datasource"
[otherURL]="(dataProviderInfo.provenance)?provenanceUrls:null"></schema2jsonld>
<!-- Desktop view --> <!-- Desktop view -->
<div class="uk-visible@m landing uk-section uk-padding-remove tm-middle"> <div class="uk-visible@m landing uk-section uk-padding-remove tm-middle">
<div *ngIf="!isMobile" class="tm-main"> <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 [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-grid uk-grid-small" uk-grid>
<div class="uk-width-expand"> <div class="uk-width-expand">
<!-- schema.org-->
<schema2jsonld [data]=dataProviderInfo
[URL]="canonicalUrl"
type="datasource"
[otherURL]="(dataProviderInfo.provenance)?provenanceUrls:null"></schema2jsonld>
<!-- Actions for mobile viewport --> <!-- Actions for mobile viewport -->
<div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s"> <div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s">
<div> <div>

View File

@ -14,6 +14,14 @@ import {RouterHelper} from "../../utils/routerHelper.class";
<div class="uk-flex uk-flex-middle" <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'" [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"> [attr.uk-grid]="!isMobile ? '' : null">
<ng-container *ngIf="inModal">
<div class="uk-text-small uk-height-max-small uk-overflow-auto">
<ng-container *ngTemplateOutlet="availableOnList"></ng-container>
</div>
</ng-container>
<ng-container *ngIf="!inModal">
<div *ngIf="properties.environment != 'production' && availableOn[0].fulltext" class="uk-flex uk-flex-middle" <div *ngIf="properties.environment != 'production' && availableOn[0].fulltext" class="uk-flex uk-flex-middle"
[ngClass]="isMobile ? 'uk-width-1-1' : 'uk-text-bolder'"> [ngClass]="isMobile ? 'uk-width-1-1' : 'uk-text-bolder'">
<a [href]="availableOn[0].fulltext" target="_blank" <a [href]="availableOn[0].fulltext" target="_blank"
@ -24,8 +32,8 @@ import {RouterHelper} from "../../utils/routerHelper.class";
<span class="uk-margin-xsmall-left">Full-Text</span> <span class="uk-margin-xsmall-left">Full-Text</span>
</a> </a>
</div> </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 *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' : '') : ''"> <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')" <span [class]="'uk-margin-xsmall-right ' + (availableOn[0].accessRightIcon == 'open_access' ? 'open-access' : 'closed-access')"
uk-tooltip [title]="getAccessLabel(availableOn[0].accessRight)"> uk-tooltip [title]="getAccessLabel(availableOn[0].accessRight)">
@ -65,17 +73,20 @@ import {RouterHelper} from "../../utils/routerHelper.class";
</ng-container> </ng-container>
</div> </div>
</div> </div>
</ng-container>
</div> </div>
</ng-container> </ng-container>
<ng-template #availableOnList> <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 <span
[class]="'uk-margin-small-right ' + (instance.accessRightIcon == 'open_access' ? 'open-access' : 'closed-access')" [class]="'uk-margin-small-right ' + (instance.accessRightIcon == 'open_access' ? 'open-access' : 'closed-access')"
uk-tooltip [title]="getAccessLabel(instance.accessRight)"> 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> </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"> <span class="uk-text-emphasis">
<a *ngIf="instance.downloadUrl" [href]="instance.downloadUrl" target="_blank" <a *ngIf="instance.downloadUrl" [href]="instance.downloadUrl" target="_blank"
class="title uk-link-text uk-text-bold custom-external uk-display-inline-block"> 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 { export class AvailableOnComponent {
@Input() isMobile: boolean = false; @Input() isMobile: boolean = false;
@Input() inModal: boolean = false;
@Input() usedBy: "search" | "landing" = "search"; @Input() usedBy: "search" | "landing" = "search";
@Input() prevPath: string = ""; @Input() prevPath: string = "";
@Input() availableOn: HostedByCollectedFrom[]; @Input() availableOn: HostedByCollectedFrom[];

View File

@ -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 --> <!-- Desktop view -->
<div id="tm-main" class="uk-visible@m landing uk-section uk-padding-remove tm-middle"> <div id="tm-main" class="uk-visible@m landing uk-section uk-padding-remove tm-middle">
<div *ngIf="!isMobile" class="tm-main"> <div *ngIf="!isMobile" class="tm-main">
@ -116,11 +122,7 @@
<ng-container *ngIf="organizationInfo"> <ng-container *ngIf="organizationInfo">
<!-- Main content --> <!-- Main content -->
<div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')"> <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 --> <!-- Actions for mobile viewport -->
<div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s"> <div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s">
<div class="uk-margin-small-right"> <div class="uk-margin-small-right">

View File

@ -1,3 +1,8 @@
<!-- schema.org-->
<schema2jsonld *ngIf="projectInfo"
[data]=projectInfo [URL]="properties.domain+properties.baseLink+properties.searchLinkToProject+projectId"
type="project"></schema2jsonld>
<!-- Desktop view --> <!-- Desktop view -->
<div class=" uk-visible@m landing uk-section uk-padding-remove tm-middle"> <div class=" uk-visible@m landing uk-section uk-padding-remove tm-middle">
<div *ngIf="!isMobile" class="tm-main"> <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 [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-grid uk-grid-small" uk-grid>
<div class="uk-width-expand"> <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 --> <!-- Actions for mobile viewport -->
<div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s"> <div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s">
<div class="uk-margin-small-right"> <div class="uk-margin-small-right">

View File

@ -1,3 +1,8 @@
<!-- schema.org-->
<schema2jsonld *ngIf="resultLandingInfo && resultLandingInfo.record"
[data]=resultLandingInfo.record [URL]="canonicalUrl"
[searchActionRoute]="properties.searchLinkToResults"></schema2jsonld>
<!-- Desktop view --> <!-- Desktop view -->
<div id="tm-main" class="uk-visible@m landing uk-section uk-padding-remove tm-middle"> <div id="tm-main" class="uk-visible@m landing uk-section uk-padding-remove tm-middle">
<div *ngIf="!isMobile" class="tm-main"> <div *ngIf="!isMobile" class="tm-main">
@ -161,10 +166,6 @@
<!-- in small screens there is no sticky #graph_and_feedback so margin-top is medium (40px) --> <!-- 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) --> <!-- 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')"> <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 --> <!-- Actions for mobile viewport -->
<div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s"> <div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s">

View File

@ -97,12 +97,12 @@ export class SearchAllComponent {
subs: Subscription[] = []; subs: Subscription[] = [];
quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = { quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = null;//{
filter: null, // filter: null,
selected: true, // selected: true,
filterId: "resultbestaccessright", // filterId: "resultbestaccessright",
value: "Open Access" // value: "Open Access"
}; // };
resultTypes = {publication: true, dataset: true, software: true, other: true}; resultTypes = {publication: true, dataset: true, software: true, other: true};
@ -290,7 +290,7 @@ export class SearchAllComponent {
this.fetchDatasets.clearSubscriptions(); this.fetchDatasets.clearSubscriptions();
this.fetchPublications.clearSubscriptions(); this.fetchPublications.clearSubscriptions();
this.fetchSoftware.clearSubscriptions(); this.fetchSoftware.clearSubscriptions();
this.fetchPublications.clearSubscriptions(); this.fetchOrps.clearSubscriptions();
this.fetchOrganizations.clearSubscriptions(); this.fetchOrganizations.clearSubscriptions();
this.fetchDataproviders.clearSubscriptions(); this.fetchDataproviders.clearSubscriptions();
this.fetchServices.clearSubscriptions(); this.fetchServices.clearSubscriptions();
@ -603,9 +603,9 @@ export class SearchAllComponent {
} }
if (entity == "result") { if (entity == "result") {
entity = "research-outcomes"; entity = "research-outcomes";
if(!!this.openAccess) { // if(!!this.openAccess) {
this.parameters["resultbestaccessright"] = '"' + encodeURIComponent("Open Access") + '"'; // this.parameters["resultbestaccessright"] = '"' + encodeURIComponent("Open Access") + '"';
} // }
} }
this.router.navigate(["/search/find", entity], {queryParams: this.parameters}); this.router.navigate(["/search/find", entity], {queryParams: this.parameters});
} }

View File

@ -99,12 +99,12 @@ export class SearchResearchResultsComponent {
public orderedFields = this.searchFields.RESULT_FIELDS_ORDERED; public orderedFields = this.searchFields.RESULT_FIELDS_ORDERED;
@ViewChild(NewSearchPageComponent, { static: true }) searchPage: NewSearchPageComponent; @ViewChild(NewSearchPageComponent, { static: true }) searchPage: NewSearchPageComponent;
@Input() simpleView: boolean = true; @Input() simpleView: boolean = true;
quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = { quickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = null;//{
filter: null, // filter: null,
selected: true, // selected: true,
filterId: "resultbestaccessright", // filterId: "resultbestaccessright",
value: "Open Access" // value: "Open Access"
}; // };
@Input() includeOnlyResultsAndFilter: boolean = false; @Input() includeOnlyResultsAndFilter: boolean = false;
@Input() showBreadcrumb: boolean = false; @Input() showBreadcrumb: boolean = false;
@Output() searchPageUpdates = new EventEmitter(); @Output() searchPageUpdates = new EventEmitter();
@ -551,6 +551,7 @@ export class SearchResearchResultsComponent {
filter.countSelectedValues = oldFilter.countSelectedValues; filter.countSelectedValues = oldFilter.countSelectedValues;
filter.radioValue = oldFilter.radioValue; filter.radioValue = oldFilter.radioValue;
this.filters[index] = filter; this.filters[index] = filter;
this.searchPage.filterFilterValues(this.filters);
this.updateOrderedFilter(filter); this.updateOrderedFilter(filter);
this.cdr.detectChanges(); this.cdr.detectChanges();

View File

@ -223,7 +223,7 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
} }
} }
if (typeof document !== 'undefined') { if (typeof document !== 'undefined') {
this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => { this.subscriptions.push(this.indexInfoService.lastIndexDate.subscribe(lastIndexUpdate => {
if (lastIndexUpdate) { if (lastIndexUpdate) {
this.indexUpdateDate = new Date(lastIndexUpdate); this.indexUpdateDate = new Date(lastIndexUpdate);
} }

View File

@ -85,9 +85,11 @@ export class SearchFilterComponent implements OnInit, OnChanges {
ngOnChanges(changes: SimpleChanges) { ngOnChanges(changes: SimpleChanges) {
if (changes.filter) { 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.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") { if (this.filter.filterType == "radio" || this.filter.filterType == "triplet") {
this.filter.radioValue = ""; this.filter.radioValue = "";

View File

@ -14,6 +14,7 @@ export class Filter{
public countAllValues?: number = -1; // -1: not yet requested, 0: request failed, >0 OK public countAllValues?: number = -1; // -1: not yet requested, 0: request failed, >0 OK
// public isOpen?: boolean = false; // public isOpen?: boolean = false;
public isViewAllOpen?: boolean = false; public isViewAllOpen?: boolean = false;
public countUnfilteredValues?: number = 0;
} }
export class Value{ export class Value{

View File

@ -11,7 +11,7 @@ export class RefineResultsUtils {
var searchFields:SearchFields = new SearchFields(); var searchFields:SearchFields = new SearchFields();
var filters:Filter[] = []; var filters:Filter[] = [];
if(data && fields){ if(data && Object.keys(data).length > 0 && fields){
for(let j=0; j<fields.length; j++) { for(let j=0; j<fields.length; j++) {
var filter:Filter = new Filter(); var filter:Filter = new Filter();
@ -27,15 +27,16 @@ export class RefineResultsUtils {
let field = data[fields[j]]; let field = data[fields[j]];
if(field){ if(field){
filter.countUnfilteredValues = field.length;
for(let i=0; i<field.length; i++) { for(let i=0; i<field.length; i++) {
var value:Value = new Value(); var value:Value = new Value();
value.name = field[i].name; value.name = field[i].name;
value.name =this.removePartAfterCharacters(value,"||"); value.name =this.removePartAfterCharacters(value,"||");
value.number = field[i].count; value.number = field[i].count;
value.id = field[i].id; value.id = field[i].id;
//if(RefineResultsUtils.includeValue(value)){ if(RefineResultsUtils.includeValue(value)){
filter.values.push(value); filter.values.push(value);
//} }
} }
@ -51,11 +52,14 @@ export class RefineResultsUtils {
return filters; return filters;
} }
private static includeValue (field):boolean { private static includeValue (field):boolean {
if( !field || !field.name || field.name == "unidentified" || field.name == "Undetermined" ){ // if( !field || !field.name || field.name == "unidentified" || field.name == "Undetermined" ){
return false; 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 { private static removePartAfterCharacters(field, characters):string {
if( field.name.indexOf(characters) !=-1){ if( field.name.indexOf(characters) !=-1){

View File

@ -87,12 +87,12 @@ export class NavigationBarComponent implements OnInit, OnDestroy, OnChanges {
public featuredAlignment: string = MenuAlignment.CENTER.valueOf(); public featuredAlignment: string = MenuAlignment.CENTER.valueOf();
public hasSearchBar: boolean = false; public hasSearchBar: boolean = false;
public resultsQuickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = { public resultsQuickFilter: { filter: Filter, selected: boolean, filterId: string, value: string } = null;//{
filter: null, // filter: null,
selected: true, // selected: true,
filterId: "resultbestaccessright", // filterId: "resultbestaccessright",
value: "Open Access" // value: "Open Access"
}; // };
@ViewChild('search_input') search_input: SearchInputComponent; @ViewChild('search_input') search_input: SearchInputComponent;
@ViewChild('canvas') canvas: ElementRef; @ViewChild('canvas') canvas: ElementRef;
public routerHelper: RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();

View File

@ -140,8 +140,8 @@ export class OpenAireJsonldConverterService {
doc["description"] = []; doc["description"] = [];
if(project.description) { if(project.description) {
let parsing = new ParsingFunctions(); let parsing = new ParsingFunctions();
let abstracts = parsing.parseDescription(project.description); let abstracts = parsing.parseDescription(project.description, true);
doc["description"] = [abstracts && abstracts[0] ?(abstracts[0].substring(0,4997)+(abstracts[0].substring(0,4997).length == 4997?'...':'')):"" ]; doc["description"] = [abstracts ?(abstracts.substring(0,4997)+(abstracts.substring(0,4997).length == 4997?'...':'')):"" ];
} else { } else {
doc["description"].push(("project" + (project.title ? "," + project.title : "") + (project.funding && project.funding.funderName ? ", funder: " + project.funding.funderName : "") + (project.acronym ? "," + project.acronym : ""))); 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"] = []; doc["description"] = [];
if(datasource.description) { if(datasource.description) {
let parsing = new ParsingFunctions(); let parsing = new ParsingFunctions();
let abstracts = parsing.parseDescription(datasource.description); let abstracts = parsing.parseDescription(datasource.description, true);
doc["description"] = [abstracts && abstracts[0] ?(abstracts[0].substring(0,4997)+(abstracts[0].substring(0,4997).length == 4997?'...':'')):"" ]; doc["description"] = [abstracts ?(abstracts.substring(0,4997)+(abstracts.substring(0,4997).length == 4997?'...':'')):"" ];
} else { } else {
doc["description"].push(datasource.title.name?datasource.title.name:datasource.officialName); 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); const item = _.get(result, "result.metadata.oaf:entity.oaf:result.description", null);
if (!item) return [ "" + this.getTitle(result)]; if (!item) return [ "" + this.getTitle(result)];
let parsing = new ParsingFunctions(); let parsing = new ParsingFunctions();
let abstracts = parsing.parseDescription(item); let abstracts = parsing.parseDescription(item, true);
return [abstracts && abstracts[0] ?(abstracts[0].substring(0,4997)+(abstracts[0].substring(0,4997).length == 4997?'...':'')):"" ]; return [abstracts ?(abstracts.substring(0,4997)+(abstracts.substring(0,4997).length == 4997?'...':'')):"" ];
} }
private getDateCreated(result: any): String[] { private getDateCreated(result: any): String[] {

View File

@ -175,6 +175,7 @@ export class FetchProjects {
} }
} }
} }
this.filters[i].countAllValues = this.filters[i].values.length;
} }
} }
if (filterquery == "") { if (filterquery == "") {
@ -186,6 +187,7 @@ export class FetchProjects {
this.funders = (this.filters[i].values); this.funders = (this.filters[i].values);
} }
this.filters[i].countAllValues = this.filters[i].values.length;
} }
//console.log(" this.funders:"+ this.funders); //console.log(" this.funders:"+ this.funders);

View File

@ -1,21 +1,34 @@
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import {EnvProperties} from './properties/env-properties'; import {EnvProperties} from './properties/env-properties';
import {Observable, of} from "rxjs"; import {BehaviorSubject, Observable, of} from "rxjs";
import {catchError, map} from "rxjs/operators"; import {catchError, map} from "rxjs/operators";
import {properties} from "../../../environments/environment";
@Injectable({ @Injectable({
providedIn: "root" providedIn: "root"
}) })
export class IndexInfoService { export class IndexInfoService {
private lastIndexDateSubject: BehaviorSubject<any> = new BehaviorSubject<any>(null);
constructor(private http: HttpClient) { constructor(private http: HttpClient) {
} }
getLastIndexDate(properties: EnvProperties): Observable<any> { get lastIndexDate(): Observable<any> {
let url = properties.indexInfoAPI; return this.lastIndexDateSubject.getValue() ? this.lastIndexDateSubject.asObservable() : this.getLastIndexDate();
return this.http.get((properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)): url).pipe(map(res => res['claim_load_date'])).pipe(catchError(err => {return of(null)})); }
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> { getStatsLastDate(properties: EnvProperties): Observable<any> {
let url = properties.indexInfoAPI; let url = properties.indexInfoAPI;

View File

@ -173,16 +173,16 @@
<!-- </div>--> <!-- </div>-->
</div> </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"> 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" <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-between]="!isDeletedByInferenceModal && (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-right]="!isDeletedByInferenceModal && !(result.measure?.bip.length || result.measure?.counts.length) && (result.hostedBy_collectedFrom?.length || hasActions)"
[class.uk-grid-divider]="!isMobile"> [class.uk-grid-divider]="!isMobile">
<div *ngIf="result.hostedBy_collectedFrom?.length" class="uk-width-auto uk-visible@m"> <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>
<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" <entity-actions [cite]="cite" [share]="share" [linking]="linking"
[deposit]="deposit" [embed]="embed" [deposit]="deposit" [embed]="embed"
[type]="result.resultType" [type]="result.resultType"
@ -211,7 +211,7 @@
</entity-actions> </entity-actions>
</div> </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" 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'"> [ngClass]="isMobile ? '' : 'uk-padding-remove-horizontal'">
<div *ngIf="result.oaRoutes" class="uk-first-column"> <div *ngIf="result.oaRoutes" class="uk-first-column">
@ -309,7 +309,13 @@
</div> </div>
</div> </div>
<div *ngIf="result.hostedBy_collectedFrom?.length || hasActions" class="uk-hidden@m"> <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"> <a class="uk-link-reset uk-flex uk-flex-middle">
<icon [flex]="true" name="more_vert"></icon> <icon [flex]="true" name="more_vert"></icon>
</a> </a>
@ -351,6 +357,7 @@
</ng-container> </ng-container>
</ul> </ul>
</div> </div>
</ng-container>
</div> </div>
</div> </div>
</div> </div>