From e535934fc2d6bd9eb2fc4c652e865f12f72f8410 Mon Sep 17 00:00:00 2001 From: argirok Date: Thu, 27 Jun 2024 12:27:37 +0300 Subject: [PATCH 01/19] [develop | DONE | FIX ] Insert claims: avoid showing multiple errors - stop status subsciption when complete or errored --- .../insertClaim/insertClaim.component.ts | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/claims/linking/insertClaim/insertClaim.component.ts b/claims/linking/insertClaim/insertClaim.component.ts index 17c920ba..a8c113b1 100644 --- a/claims/linking/insertClaim/insertClaim.component.ts +++ b/claims/linking/insertClaim/insertClaim.component.ts @@ -1,5 +1,5 @@ -import {Component, Input, Output, EventEmitter, ViewChild} from '@angular/core'; -import {Router, ActivatedRoute} from '@angular/router'; +import {Component, EventEmitter, Input, Output, ViewChild} from '@angular/core'; +import {ActivatedRoute, Router} from '@angular/router'; import {ClaimsService} from '../../claim-utils/service/claims.service'; import {ModalLoading} from '../../../utils/modal/loading.component'; import {AlertModal} from '../../../utils/modal/alert'; @@ -63,6 +63,7 @@ export class ClaimInsertComponent { private userManagementService: UserManagementService, private _logService: LogService) { } subscriptions = []; + timerSubscription; ngOnDestroy() { this.subscriptions.forEach(subscription => { if (subscription instanceof Subscriber) { @@ -88,13 +89,12 @@ export class ClaimInsertComponent { }) ).subscribe(); this.subscriptions.push(loadingTimerSubscription); - - let timerSubscription = timer(0, 10000).pipe( + this.timerSubscription = timer(0, 10000).pipe( map(() => { this.getStatus(); // load data contains the http request }) ).subscribe(); - this.subscriptions.push(timerSubscription); + this.subscriptions.push(this.timerSubscription); }else{ this.claimsJob = null; } @@ -274,12 +274,12 @@ export class ClaimInsertComponent { } } this.saveLocalStorage(); - let timerSubscription = timer(0, 10000).pipe( + this.timerSubscription = timer(0, 10000).pipe( map(() => { this.getStatus(); // load data contains the http request }) ).subscribe(); - this.subscriptions.push(timerSubscription); + this.subscriptions.push(this.timerSubscription); }, err => { err = err && err.error?err.error:err; @@ -599,11 +599,10 @@ export class ClaimInsertComponent { } getStatus(){ - if(this.feedRecordsJob && ! (this.feedRecordsJob.status == "COMPLETE" || this.feedRecordsJob.status == "ERROR") ) { - this.subscriptions.push(this.claimService.getStatus(this.feedRecordsJob.id, this.properties.claimsAPIURL).subscribe(data => { + if(this.feedRecordsJob && ! (this.feedRecordsJob.status == "COMPLETE" || this.feedRecordsJob.status == "FAILED") ) { + this.subscriptions.push(this.claimService.getStatus(this.feedRecordsJob.id, this.properties.claimsAPIURL).subscribe(data => { this.feedRecordsJob = data.data; - // console.log("feed", this.feedRecordsJob.status); - if (this.feedRecordsJob.status == "COMPLETE" || data.data.status == "ERROR") { + if (this.feedRecordsJob.status == "COMPLETE" || this.feedRecordsJob.status == "FAILED") { this.insertedRecords = this.feedRecordsJob.insertedIds; this.errorInRecords = this.feedRecordsJob.errorInClaims; } @@ -622,8 +621,8 @@ export class ClaimInsertComponent { if(this.claimsJob) { this.subscriptions.push(this.claimService.getStatus(this.claimsJob.id, this.properties.claimsAPIURL).subscribe(data => { this.claimsJob = data.data; - // console.log("claim: ", this.claimsJob.status, this.feedRecordsJob.status?this.feedRecordsJob.status:" no feed job"); - if ((this.claimsJob.status == "COMPLETE" || data.data.status == "ERROR") && ( !this.feedRecordsJob || (this.feedRecordsJob.status == "COMPLETE" || data.data.status == "ERROR")) ) { + if ((this.claimsJob.status == "COMPLETE" || this.claimsJob.status == "FAILED") && + ( !this.feedRecordsJob || (this.feedRecordsJob.status == "COMPLETE" || data.data.status == "FAILED"))) { this.insertedClaims = this.claimsJob.insertedIds; this.errorInClaims = this.claimsJob.errorInClaims; @@ -636,7 +635,7 @@ export class ClaimInsertComponent { this.errors.push(error); } this.afterclaimsInsertion(); - + this.timerSubscription.unsubscribe(); } }, err => { From 17471400639898d452155b4718fdef3ad45a09a6 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Thu, 27 Jun 2024 15:36:38 +0300 Subject: [PATCH 02/19] [develop]: Add new types in portal types. --- utils/helper/helper.service.ts | 101 +++++++++++++++-------------- utils/properties/env-properties.ts | 3 +- 2 files changed, 53 insertions(+), 51 deletions(-) diff --git a/utils/helper/helper.service.ts b/utils/helper/helper.service.ts index 65eb8159..639f913b 100644 --- a/utils/helper/helper.service.ts +++ b/utils/helper/helper.service.ts @@ -8,63 +8,64 @@ import {properties} from "../../../../environments/environment"; @Injectable() export class HelperService { - constructor(private http: HttpClient) {} + constructor(private http: HttpClient) { + } - /** - * @deprecated - */ - getHelper (router: string, position: string, before: boolean, div: string, properties:EnvProperties, communityId:string ):any { - //console.info("get router helpText for : "+router+" - position="+position+" - before="+before + " - div="+div); + /** + * @deprecated + */ + getHelper(router: string, position: string, before: boolean, div: string, properties: EnvProperties, communityId: string): any { + //console.info("get router helpText for : "+router+" - position="+position+" - before="+before + " - div="+div); - let url = properties.adminToolsAPIURL; - if(div) { - url += '/divhelpcontent?active=true&community='+communityId+'&page='+router+'&div=' + div; - } else { - url += '/pagehelpcontent?active=true&community='+communityId+'&page='+router+'&position=' + position; - if(before) { - url += '&before='+before; - } - } - - return this.http.get(/*(properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)+ (properties.forceCacheReload?'&forceReload=true':'')):*/ url); - //.map(res => res.json()); - - } - - getPageHelpContents(properties:EnvProperties, portal:string, router: string, portalType = properties.adminToolsPortalType):any { - if(!portal) { - portal = properties.adminToolsCommunity; - } - if(!portal) { - portal = 'openaire'; - } - if(typeof properties.useHelpTexts == "undefined" || properties.useHelpTexts) { - let page_route: string = router.split('?')[0].substring(0); - let url = properties.adminToolsAPIURL; - url += '/' + portalType + '/' + portal + '/pagehelpcontent/grouped?active=true&page=' + - ((page_route.indexOf("/"+portal+"/")!=-1 ) ? ("/" + page_route.split("/"+portal+"/")[1]) : page_route); - return this.http.get(/*(properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)+ (properties.forceCacheReload?'&forceReload=true':'')) :*/ url); - }else { - return of(null); + let url = properties.adminToolsAPIURL; + if (div) { + url += '/divhelpcontent?active=true&community=' + communityId + '&page=' + router + '&div=' + div; + } else { + url += '/pagehelpcontent?active=true&community=' + communityId + '&page=' + router + '&position=' + position; + if (before) { + url += '&before=' + before; } } - getDivHelpContents(properties:EnvProperties, communityId:string, router: string):any { - if(!communityId) { - communityId = properties.adminToolsCommunity; - } - if(!communityId) { - communityId = 'openaire'; - } - if(typeof properties.useHelpTexts == "undefined" || properties.useHelpTexts) { + return this.http.get(/*(properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)+ (properties.forceCacheReload?'&forceReload=true':'')):*/ url); + //.map(res => res.json()); + + } + + getPageHelpContents(properties: EnvProperties, portal: string, router: string, portalType = properties.adminToolsPortalType): any { + if (!portal) { + portal = properties.adminToolsCommunity; + } + if (!portal) { + portal = 'openaire'; + } + if (typeof properties.useHelpTexts == "undefined" || properties.useHelpTexts) { let page_route: string = router.split('?')[0].substring(0); let url = properties.adminToolsAPIURL; - url += '/'+properties.adminToolsPortalType+'/' + communityId + '/divhelpcontent/grouped?active=true&page='+ - ((page_route.indexOf("/"+communityId+"/")!=-1 ) ? ("/" + page_route.split("/"+communityId+"/")[1]) : page_route); - return this.http.get((properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)+ (properties.forceCacheReload?'&forceReload=true':'')): url); - }else { - return of(null); - } + url += '/' + portalType + '/' + portal + '/pagehelpcontent/grouped?active=true&page=' + + ((page_route.indexOf("/" + portal + "/") != -1) ? ("/" + page_route.split("/" + portal + "/")[1]) : page_route); + return this.http.get(/*(properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)+ (properties.forceCacheReload?'&forceReload=true':'')) :*/ url); + } else { + return of(null); } + } + + getDivHelpContents(properties: EnvProperties, communityId: string, router: string): any { + if (!communityId) { + communityId = properties.adminToolsCommunity; + } + if (!communityId) { + communityId = 'openaire'; + } + if (typeof properties.useHelpTexts == "undefined" || properties.useHelpTexts) { + let page_route: string = router.split('?')[0].substring(0); + let url = properties.adminToolsAPIURL; + url += '/' + properties.adminToolsPortalType + '/' + communityId + '/divhelpcontent/grouped?active=true&page=' + + ((page_route.indexOf("/" + communityId + "/") != -1) ? ("/" + page_route.split("/" + communityId + "/")[1]) : page_route); + return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url) + (properties.forceCacheReload ? '&forceReload=true' : '')) : url); + } else { + return of(null); + } + } } diff --git a/utils/properties/env-properties.ts b/utils/properties/env-properties.ts index 6f3e2864..1932596d 100644 --- a/utils/properties/env-properties.ts +++ b/utils/properties/env-properties.ts @@ -1,6 +1,7 @@ export type Environment = "development" | "test" | "beta" | "production"; export type Dashboard = "explore" | "connect" | "monitor" | "aggregator" | "eosc" | "developers" | "faircore4eosc" | "irish"; -export type PortalType = "explore" | "connect" | "community" | "monitor" | "funder" | "ri" | "project" | "organization" | "aggregator" | "eosc" | "faircore4eosc" | "country"; +export type PortalType = "explore" | "connect" | "community" | "monitor" | "funder" | "ri" | "project" | "organization" | + "aggregator" | "eosc" | "faircore4eosc" | "country" | "datasource" | "journal" | "publisher"; export interface EnvProperties { environment?: Environment; From 6b2e1c1025a1ea74a4c0f9d736b89b35f663ad29 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Fri, 28 Jun 2024 11:51:09 +0300 Subject: [PATCH 03/19] [develop]: Fix import/export indicators tab title wasn't imported bug. --- monitor-admin/topic/indicators.component.ts | 4 +++- monitor-admin/utils/indicator-utils.ts | 5 ++++- utils/properties/environments/environment.ts | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/monitor-admin/topic/indicators.component.ts b/monitor-admin/topic/indicators.component.ts index f8f16df3..5f2eab4e 100644 --- a/monitor-admin/topic/indicators.component.ts +++ b/monitor-admin/topic/indicators.component.ts @@ -1324,7 +1324,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple } if (chart.type == "chart") { - indicatorPaths = chart.indicatorPaths.map(path => this.indicatorUtils.generateIndicatorByChartUrl(this.indicatorUtils.getChartSource(path.url), path.url, chart.type, stakeholder)); + indicatorPaths = chart.indicatorPaths.map(path => this.indicatorUtils.generateIndicatorByChartUrl(this.indicatorUtils.getChartSource(path.url), path.url, chart.type, stakeholder, path.tab)); this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].charts.forEach((section: Section) => { section.indicators.forEach(indicator => { indicator.indicatorPaths.forEach(path => { @@ -1391,6 +1391,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple "indicatorPaths": indicator.indicatorPaths.map(path => { return { jsonPath: path.jsonPath, + tab: path.parameters.tab ? path.parameters.tab : path.parameters.title, url: this.indicatorUtils.getNumberUrl(path.source, this.indicatorUtils.getFullUrl(this.stakeholder, path)) } }), @@ -1411,6 +1412,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple indicators[indexIndicator] = { "indicatorPaths": indicator.indicatorPaths.map(path => { return { + tab: path.parameters.tab ? path.parameters.tab : path.parameters.title, url: this.getUrlByStakeHolder(path) } }), diff --git a/monitor-admin/utils/indicator-utils.ts b/monitor-admin/utils/indicator-utils.ts index 0103e68f..fe994f5d 100644 --- a/monitor-admin/utils/indicator-utils.ts +++ b/monitor-admin/utils/indicator-utils.ts @@ -680,7 +680,7 @@ export class IndicatorUtils { return indicatorPath; } - generateIndicatorByChartUrl(source: SourceType, url: string, type: IndicatorPathType = null, stakeholder: Stakeholder): IndicatorPath { + generateIndicatorByChartUrl(source: SourceType, url: string, type: IndicatorPathType = null, stakeholder: Stakeholder, tab: string = null): IndicatorPath { let indicatorPath = new IndicatorPath(type, source, null, null, []); try { if (source === 'stats-tool') { @@ -734,6 +734,9 @@ export class IndicatorUtils { if (indicatorPath.type == null) { indicatorPath.type = this.defaultChartType; } + if(tab) { + indicatorPath.parameters.tab = tab; + } return indicatorPath; } diff --git a/utils/properties/environments/environment.ts b/utils/properties/environments/environment.ts index 9fbc0a72..f7e88a8c 100644 --- a/utils/properties/environments/environment.ts +++ b/utils/properties/environments/environment.ts @@ -110,7 +110,7 @@ export let commonDev: EnvProperties = { orcidAPIURL: "http://duffy.di.uoa.gr:19480/uoa-orcid-service/", orcidTokenURL: "https://sandbox.orcid.org/oauth/authorize?", orcidClientId: "APP-A5M3KTX6NCN67L91", - utilsService: "http://mpagasas.di.uoa.gr:8000", + utilsService: "http://scoobydoo.di.uoa.gr:8000", vocabulariesAPI: "https://dev-openaire.d4science.org/provision/mvc/vocabularies/", loginServiceURL: "http://mpagasas.di.uoa.gr:19080/login-service/", cookieDomain: ".di.uoa.gr", From 3077b9b49302d1a79120335227e0ad8cffd1c986 Mon Sep 17 00:00:00 2001 From: argirok Date: Mon, 1 Jul 2024 16:46:55 +0300 Subject: [PATCH 04/19] [plugins-functionality | DONE | Changed ] improvements in manage menu items --- dashboard/menu/menu.component.html | 14 ++++++++++---- dashboard/menu/menu.component.ts | 23 ++++++++++++----------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/dashboard/menu/menu.component.html b/dashboard/menu/menu.component.html index ea4b77d3..bfaa2ed4 100644 --- a/dashboard/menu/menu.component.html +++ b/dashboard/menu/menu.component.html @@ -7,8 +7,13 @@
-
+ +
- +
Menu alignment
-
+
+
successfully deleted"); this.showLoading = false; - this._clearCacheService.clearCacheInRoute("Menu item deleted",this.portal, "/"); + this._clearCacheService.purgeBrowserCache("Menu item deleted",this.portal); }, error => this.handleError("Server error deleting menu item", error) @@ -313,7 +314,7 @@ export class MenuComponent implements OnInit { menuItem => { this.menuItemSavedSuccessfully(menuItem, true); NotificationHandler.rise('Menu item ' + menuItem.title + ' has been successfully created'); - this._clearCacheService.clearCacheInRoute("Menu item saved",this.portal, "/"); + this._clearCacheService.purgeBrowserCache("Menu item saved",this.portal); }, error => this.handleError("System error creating menu item", error) ) @@ -324,7 +325,7 @@ export class MenuComponent implements OnInit { menuItem => { this.menuItemSavedSuccessfully(menuItem, false); NotificationHandler.rise('Menu item ' + menuItem.title + ' has been successfully updated'); - this._clearCacheService.clearCacheInRoute("Menu item updated",this.portal, "/"); + this._clearCacheService.purgeBrowserCache("Menu item updated",this.portal); }, error => this.handleError("System error updating menu item", error) ) @@ -390,7 +391,7 @@ export class MenuComponent implements OnInit { HelperFunctions.swap(temp, index, newIndex); this._helpContentService.reorderMenuItems(temp, this.portal).subscribe(() => { HelperFunctions.swap(this.featuredMenuItems, index, newIndex); - this._clearCacheService.clearCacheInRoute("Menu items reordered",this.portal, "/"); + this._clearCacheService.purgeBrowserCache("Menu items reordered",this.portal); }, error => { this.handleError("System error reordering menu items", error); }); @@ -402,7 +403,7 @@ export class MenuComponent implements OnInit { HelperFunctions.swap(temp, index, newIndex); this._helpContentService.reorderMenuItems(temp, this.portal).subscribe(() => { HelperFunctions.swap(children && children.length ? children : this.normalMenuItems, index, newIndex); - this._clearCacheService.clearCacheInRoute("Menu items reordered",this.portal, "/"); + this._clearCacheService.purgeBrowserCache("Menu items reordered",this.portal); }, error => { this.handleError("System error reordering menu items", error); }); @@ -417,7 +418,7 @@ export class MenuComponent implements OnInit { } else { this.showNormalMenu = status; } - this._clearCacheService.clearCacheInRoute("Menu toggled",this.portal, "/"); + this._clearCacheService.purgeBrowserCache("Menu toggled",this.portal); NotificationHandler.rise("Menu has been successfully toggled to be "+(status?"visible":"hidden")+""); }, error => { this.handleError("System error toggling menu", error); @@ -429,7 +430,7 @@ export class MenuComponent implements OnInit { this.subscriptions.push( this._helpContentService.alignMenu(MenuAlignment[alignment], this.portal).subscribe(() => { this.featuredAlignment = alignment; - this._clearCacheService.clearCacheInRoute("Menu aligned",this.portal, "/"); + this._clearCacheService.purgeBrowserCache("Menu aligned",this.portal); NotificationHandler.rise("Menu has been successfully "+alignment.toLowerCase()+" aligned"); }, error => { this.handleError("System error aligning menu to the "+alignment.toLowerCase(), error); From 94e831c548eb4ac4a4a4694cfe54d19b7b15f43f Mon Sep 17 00:00:00 2001 From: argirok Date: Mon, 1 Jul 2024 16:48:10 +0300 Subject: [PATCH 05/19] [plugins-functionality | DONE | Changed ] change clear cache in route to purge browser cache --- dashboard/divhelpcontent/class-help-content-form.component.ts | 2 +- dashboard/divhelpcontent/class-help-contents.component.ts | 4 ++-- dashboard/entity/entities.component.ts | 2 +- dashboard/helpTexts/page-help-content-form.component.ts | 2 +- dashboard/helpTexts/page-help-contents.component.ts | 4 ++-- dashboard/page/pages.component.ts | 1 - dashboard/users/role-users/role-users.component.ts | 3 +-- 7 files changed, 8 insertions(+), 10 deletions(-) diff --git a/dashboard/divhelpcontent/class-help-content-form.component.ts b/dashboard/divhelpcontent/class-help-content-form.component.ts index 6ce4d961..e2ca58a1 100644 --- a/dashboard/divhelpcontent/class-help-content-form.component.ts +++ b/dashboard/divhelpcontent/class-help-content-form.component.ts @@ -166,7 +166,7 @@ export class ClassContentFormComponent implements OnInit { this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route}); NotificationHandler.rise('Page content has been successfully updated'); this.showLoading = false; - this._clearCacheService.clearCacheInRoute("Class help text saved or updated",this.portal, this.page.route); + this._clearCacheService.purgeBrowserCache("Class help text saved or updated",this.portal); }, err => this.handleUpdateError('System error saving page content', err) )); diff --git a/dashboard/divhelpcontent/class-help-contents.component.ts b/dashboard/divhelpcontent/class-help-contents.component.ts index cbf8a6ff..6ecdcbb4 100644 --- a/dashboard/divhelpcontent/class-help-contents.component.ts +++ b/dashboard/divhelpcontent/class-help-contents.component.ts @@ -155,7 +155,7 @@ export class ClassHelpContentsComponent implements OnInit { this.deletePageHelpContentsFromArray(this.selectedPageContents); NotificationHandler.rise('Page content(s) has been successfully deleted'); this.showLoading = false; - this._clearCacheService.clearCacheInRoute("Class text texts deleted",this.portal, this.page.route); + this._clearCacheService.purgeBrowserCache("Class text texts deleted",this.portal); }, error => this.handleUpdateError('System error deleting the selected page content(s)', error) )); @@ -198,7 +198,7 @@ export class ClassHelpContentsComponent implements OnInit { this.countClassHelpContents(); this.applyCheck(false); NotificationHandler.rise('Page content(s) has been successfully updated'); - this._clearCacheService.clearCacheInRoute("class help text's status changed",this.portal, this.page.route); + this._clearCacheService.purgeBrowserCache("class help text's status changed",this.portal); }, error => this.handleUpdateError('System error changing the status of the selected page content(s)', error) )); diff --git a/dashboard/entity/entities.component.ts b/dashboard/entity/entities.component.ts index 4abf71a4..6607626e 100644 --- a/dashboard/entity/entities.component.ts +++ b/dashboard/entity/entities.component.ts @@ -345,7 +345,7 @@ export class EntitiesComponent implements OnInit { this.checkboxes[i].entity.isEnabled = this.toggleStatus; } this.applyCheck(false); - this._clearCacheService.clearCacheInRoute("entity's status changed", this.portal, "/"); + this._clearCacheService.purgeBrowserCache("entity's status changed", this.portal); this._clearCacheService.purgeBrowserCache("entity's status changed", this.portal); }, error => this.handleUpdateError('System error changing the status of the selected entity(-ies)', error) diff --git a/dashboard/helpTexts/page-help-content-form.component.ts b/dashboard/helpTexts/page-help-content-form.component.ts index 60af26c9..0dd656fa 100644 --- a/dashboard/helpTexts/page-help-content-form.component.ts +++ b/dashboard/helpTexts/page-help-content-form.component.ts @@ -199,7 +199,7 @@ export class PageContentFormComponent implements OnInit { NotificationHandler.rise('Page content has been successfully ' + (this.pageContentId ? 'updated' : 'created') + ''); this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route}); this.showLoading = false; - this._clearCacheService.clearCacheInRoute("page help content saved",this.portal, this.page.route); + this._clearCacheService.purgeBrowserCache("page help content saved",this.portal); }, err => this.handleUpdateError('System error saving page content', err) )); diff --git a/dashboard/helpTexts/page-help-contents.component.ts b/dashboard/helpTexts/page-help-contents.component.ts index 0d8458d0..531dac25 100644 --- a/dashboard/helpTexts/page-help-contents.component.ts +++ b/dashboard/helpTexts/page-help-contents.component.ts @@ -165,7 +165,7 @@ export class PageHelpContentsComponent implements OnInit { this.deletePageHelpContentsFromArray(this.selectedPageContents); NotificationHandler.rise('Page content(s) has been successfully deleted'); this.showLoading = false; - this._clearCacheService.clearCacheInRoute("Help texts deleted",this.portal, this.page.route); + this._clearCacheService.purgeBrowserCache("Help texts deleted",this.portal); }, error => this.handleUpdateError('System error deleting the selected page content(s)', error) )); @@ -210,7 +210,7 @@ export class PageHelpContentsComponent implements OnInit { NotificationHandler.rise('Page content(s) has been successfully updated'); this.countPageHelpContents(); this.applyCheck(false); - this._clearCacheService.clearCacheInRoute("Help text's status changed",this.portal, this.page.route); + this._clearCacheService.purgeBrowserCache("Help text's status changed",this.portal); }, error => this.handleUpdateError('System error changing the status of the selected page content(s)', error) )); diff --git a/dashboard/page/pages.component.ts b/dashboard/page/pages.component.ts index e67e8423..9f110d9f 100644 --- a/dashboard/page/pages.component.ts +++ b/dashboard/page/pages.component.ts @@ -415,7 +415,6 @@ export class PagesComponent implements OnInit { this.checkboxes[i].page.isEnabled = status; } this.applyCheck(false); - this._clearCacheService.clearCacheInRoute("Page's status changed",this.portal, "/"); this._clearCacheService.purgeBrowserCache("Page's status changed", this.portal); }, error => this.handleUpdateError('System error changing the status of the selected page(s)', error) diff --git a/dashboard/users/role-users/role-users.component.ts b/dashboard/users/role-users/role-users.component.ts index 0b7f524a..30a4bc29 100644 --- a/dashboard/users/role-users/role-users.component.ts +++ b/dashboard/users/role-users/role-users.component.ts @@ -231,8 +231,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges { } this.filterActiveBySearch(this.filterForm.value.active); this.userManagementService.updateUserInfo(); - this.clearCacheService.clearCacheInRoute(this.role + 's of ' + this.id + ' have been updated',this.id, "/"); - this.clearCacheService.clearCacheInRoute(this.role + 's of ' + this.id + ' have been updated',this.id, "/curators"); + this.clearCacheService.purgeBrowserCache(this.role + 's of ' + this.id + ' have been updated',this.id); NotificationHandler.rise(this.selectedUser + ' is no longer ' + this.role + ' of ' + this.name + ' Dashboard'); this.loadActive = false; }, error => { From de793ab3ad0644ccc90ff387f6f154d67840016d Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 1 Jul 2024 23:35:47 +0300 Subject: [PATCH 06/19] [develop | DONE | ADDED]: Added relation between products (research product landing) and services (data sources - exclude service type). 1. result-preview.ts: Define interface RelationDatasource and added method "relationDatasourceConvert()". 2. resultLandingInfo.ts: Added fields "relatedServices" and "relatedServicesClassFilters". 3. resultLanding.service.ts: Call parsing for relations "dnet:result_datasource_relations". 4. parsingFunctions.class.ts: Added method "parseDatasources()". 5. resultLanding.component: Follow same schema for related research products (relatedResults) and related services (relatedServices), initialize relation fields and show them. --- .../landing-utils/parsingFunctions.class.ts | 57 +++++++++- .../result/resultLanding.component.html | 58 ++++++---- .../result/resultLanding.component.ts | 102 +++++++++++------- landingPages/result/resultLanding.service.ts | 13 +++ utils/entities/resultLandingInfo.ts | 5 +- utils/result-preview/result-preview.ts | 25 +++++ 6 files changed, 202 insertions(+), 58 deletions(-) diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index 961c9209..8e631278 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -1,4 +1,9 @@ -import {HostedByCollectedFrom, Project, RelationResult} from "../../utils/result-preview/result-preview"; +import { + HostedByCollectedFrom, + Project, + RelationDatasource, + RelationResult +} from "../../utils/result-preview/result-preview"; import {Context, Measure, Metric, MetricPerDatasource, Reference} from "../../utils/entities/resultLandingInfo"; import {Injectable} from '@angular/core'; import {properties} from "../../../../environments/environment"; @@ -526,6 +531,56 @@ export class ParsingFunctions { researchResults.push(researchResult); return researchResults; } + + // publication & dataset & software & orp landing : for relatedResearchResults + parseDatasources(datasources: RelationDatasource[], relation, provenanceAction: string, relationName: string): RelationDatasource[] { + let datasource: RelationDatasource = { + name: "", + id: "", + percentage: null, + percentageName: null, + class: "", + provenanceAction: provenanceAction, + relationName: relationName, + openaireCompatibility: "" + }; + + datasource['id'] = relation['to'].content; + if(relation["officialname"]) + datasource.name = relation.officialname; + else { + datasource['name'] = "[no title available]"; + } + + let percentageName: string; + if (relation.trust) { + percentageName = "trust"; + } else if (relation.similarity) { + percentageName = "similarity"; + } + if (percentageName) { + datasource['percentage'] = Math.round(relation[percentageName] * 100); + datasource['percentageName'] = percentageName; + } + + // type + if(relation.hasOwnProperty('datasourcetype') && relation['datasourcetype'].hasOwnProperty("classname")) { + datasource.class = relation['datasourcetype'].classname; + } + + // compatibility + if(relation.hasOwnProperty("openairecompatibility")) { + datasource.openaireCompatibility = relation['openairecompatibility'].classname; + } + + if(datasource.class !== "service" || properties.adminToolsPortalType == "eosc") { + if (datasources == undefined) { + datasources = []; + } + datasources.push(datasource); + } + return datasources; + } sortByPercentage(results: RelationResult[]): RelationResult[] { if (results) { diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index 03ff3145..9759a15a 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -153,6 +153,10 @@ [tabTitle]="'Related research'" [tabId]="'all_related'" [tabNumber]="resultLandingInfo.relatedResults.length"> + + @@ -179,9 +183,13 @@ +
+ +
@@ -457,6 +465,14 @@

+ +
+ {{openaireEntities.DATASOURCES}} + +
+
+
External Databases @@ -638,7 +654,15 @@
- + +
+
+ + + +
+
@@ -763,34 +787,32 @@ - -
+ +
{{header}}
-
+ [options]="props.classFilters" [(value)]="props.selectedClass" + (valueChange)="relatedClassChanged(type)">
+ [type]="((type == 'datasource') ? openaireEntities.DATASOURCES : openaireEntities.RESULTS)" + [page]="props.page" [pageSize]="pageSize" + [totalResults]="related.length">
    -
  • +
- + (pageChange)="updateRelatedPage($event, type)" + [currentPage]="props.page" [size]="pageSize" + [totalResults]="related.length">
diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts index b20fc52c..8596a08b 100644 --- a/landingPages/result/resultLanding.component.ts +++ b/landingPages/result/resultLanding.component.ts @@ -13,7 +13,7 @@ import {HelperFunctions} from '../../utils/HelperFunctions.class'; import {HelperService} from '../../utils/helper/helper.service'; import {Location} from "@angular/common"; import {MetricsService} from "../../services/metrics.service"; -import {RelationResult, ResultPreview} from "../../utils/result-preview/result-preview"; +import {RelationDatasource, RelationResult, ResultPreview} from "../../utils/result-preview/result-preview"; import {IndexInfoService} from "../../utils/indexInfo.service"; import {Identifier, StringUtils} from "../../utils/string-utils.class"; import {properties} from "../../../../environments/environment"; @@ -95,12 +95,7 @@ export class ResultLandingComponent { // Custom tab paging variables public referencesPage: number = 1; public bioentitiesPage: number = 1; - public relatedPage: number = 1; - public similarPage: number = 1; - public supplementaryPage: number = 1; - public supplementedByPage: number = 1; - public organizationsPage: number = 1; - public openCitationsPage: number = 1; + public pageSize: number = 10; // Map counting variables @@ -139,9 +134,28 @@ export class ResultLandingComponent { public pid: string; public contextsWithLink: any; - public relatedClassFilters: Option[]=[{"label": "All relations", "value": ""}]; - public relatedClassSelected: string = ""; - public filteredRelatedResults: RelationResult[]; + public relatedResults: { + classFilters: Option[], + selectedClass: string, + page: number + } = { + classFilters: [{"label": "All relations", "value": ""}], + selectedClass: "", + page: 1, + }; + filteredRelatedResults: RelationResult[]; + + public relatedServices: { + classFilters: Option[], + selectedClass: string, + page: number + } = { + classFilters: [{"label": "All relations", "value": ""}], + selectedClass: "", + page: 1 + } + filteredRelatedServices: RelationDatasource[]; + public provenanceActionVocabulary = null; public relationsVocabulary = null; @@ -168,6 +182,7 @@ export class ResultLandingComponent { @ViewChild('subjectsFsModal') subjectsFsModal: FullScreenModalComponent; @ViewChild('referencesFsModal') referencesFsModal: FullScreenModalComponent; @ViewChild('relatedResearchFsModal') relatedResearchFsModal: FullScreenModalComponent; + @ViewChild('servicesFsModal') servicesFsModal: FullScreenModalComponent; @ViewChild('bioentitiesFsModal') bioentitiesFsModal: FullScreenModalComponent; @ViewChild('compatibleEOSCFsModal') compatibleEOSCFsModal: FullScreenModalComponent; @ViewChild('fundedByFsModal') fundedByFsModal: FullScreenModalComponent; @@ -558,20 +573,34 @@ export class ResultLandingComponent { } } } - this.relatedClassFilters = [{"label": "All relations", "value": ""}]; + this.relatedResults.classFilters = [{"label": "All relations", "value": ""}]; if (this.resultLandingInfo.relatedClassFilters.size > 1) { for (let relClass of this.resultLandingInfo.relatedClassFilters) { - this.relatedClassFilters.push({ + this.relatedResults.classFilters.push({ "label": HelperFunctions.getVocabularyLabel(relClass, this.relationsVocabulary), "value": relClass }); } } else { - this.relatedClassFilters.pop(); + this.relatedResults.classFilters.pop(); } - this.relatedClassSelected = ""; + this.relatedResults.selectedClass = ""; this.filteredRelatedResults = this.resultLandingInfo.relatedResults; + this.relatedServices.classFilters = [{"label": "All relations", "value": ""}]; + if (this.resultLandingInfo.relatedServicesClassFilters.size > 1) { + for (let relClass of this.resultLandingInfo.relatedServicesClassFilters) { + this.relatedServices.classFilters.push({ + "label": HelperFunctions.getVocabularyLabel(relClass, this.relationsVocabulary), + "value": relClass + }); + } + } else { + this.relatedServices.classFilters.pop(); + } + this.relatedServices.selectedClass = ""; + this.filteredRelatedServices = this.resultLandingInfo.relatedServices + this.hasViews = false; this.hasDownloads = false; if (this.resultLandingInfo.measure && this.resultLandingInfo.measure.counts) { @@ -711,25 +740,14 @@ export class ResultLandingComponent { this.scrollToTabTop('bioentities'); } - public updateRelatedPage($event) { - this.relatedPage = $event.value; - this.scrollToTabTop('all_related'); - } - - public updateSimilarPage($event) { - this.similarPage = $event.value; - } - - public updateSupplementaryPage($event) { - this.supplementaryPage = $event.value; - } - - public updateSupplementedByPage($event) { - this.supplementedByPage = $event.value; - } - - public updateOrganizationsPage($event) { - this.organizationsPage = $event.value; + public updateRelatedPage($event, type) { + if(type == "datasource") { + this.relatedServices.page = $event.value; + this.scrollToTabTop("dataProviders"); + } else { + this.relatedResults.page = $event.value; + this.scrollToTabTop('all_related'); + } } scrollToTabTop(tabId:string){ @@ -788,8 +806,11 @@ export class ResultLandingComponent { this.alertModalDeletedByInference.open(); } - public getResultPreview(result: RelationResult): ResultPreview { - return ResultPreview.relationResultConvert(result); + public getResultPreview(result: RelationResult|RelationDatasource, type: string): ResultPreview { + if(type == "datasource") { + return ResultPreview.relationDatasourceConvert(result); + } + return ResultPreview.relationResultConvert(result); } updateUrlWithType(pid) { @@ -983,9 +1004,14 @@ export class ResultLandingComponent { this.contextsWithLink = contextsWithLink; } - public relatedClassChanged() { - this.relatedPage = 1; - this.filteredRelatedResults = this.resultLandingInfo.relatedResults.filter(result => !this.relatedClassSelected || result.relationName.toLowerCase() == this.relatedClassSelected.toLowerCase()); + public relatedClassChanged(type) { + if(type == "datasource") { + this.relatedServices.page = 1; + this.filteredRelatedServices = this.resultLandingInfo.relatedServices.filter(result => !this.relatedServices.selectedClass || result.relationName.toLowerCase() == this.relatedServices.selectedClass.toLowerCase()); + } else { + this.relatedResults.page = 1; + this.filteredRelatedResults = this.resultLandingInfo.relatedResults.filter(result => !this.relatedResults.selectedClass || result.relationName.toLowerCase() == this.relatedResults.selectedClass.toLowerCase()); + } } public viewAllOrganizationsClick() { diff --git a/landingPages/result/resultLanding.service.ts b/landingPages/result/resultLanding.service.ts index 6c9b1d1d..77c5cd1e 100644 --- a/landingPages/result/resultLanding.service.ts +++ b/landingPages/result/resultLanding.service.ts @@ -210,6 +210,19 @@ export class ResultLandingService { this.resultLandingInfo.relatedResults = this.parsingFunctions.parseResults(this.resultLandingInfo.relatedResults, relation, provenanceAction, relationName); } else if (relation['to'].class && relation['to'].class.toLowerCase() == "hasauthorinstitution") { this.resultLandingInfo.organizations = this.parseRelatedOrganizations(this.resultLandingInfo.organizations, relation); + } else if (relation['to'].scheme && relation['to'].scheme == "dnet:result_datasource_relations") { + let relationName: string = relation.to.class; + if (!this.resultLandingInfo.relatedServicesClassFilters.has(relationName)) { + this.resultLandingInfo.relatedServicesClassFilters.add(relationName); + } + + let provenanceAction: string = relation.provenanceaction; + + // this.resultLandingInfo.relatedResults = this.parsingFunctions.parseResults(this.resultLandingInfo.relatedResults, relation, provenanceAction, relationName); + if (this.resultLandingInfo.relatedServices == undefined) { + this.resultLandingInfo.relatedServices = []; + } + this.resultLandingInfo.relatedServices = this.parsingFunctions.parseDatasources(this.resultLandingInfo.relatedServices, relation, provenanceAction, relationName); } } } diff --git a/utils/entities/resultLandingInfo.ts b/utils/entities/resultLandingInfo.ts index 8cdf216b..76e98ada 100644 --- a/utils/entities/resultLandingInfo.ts +++ b/utils/entities/resultLandingInfo.ts @@ -3,7 +3,7 @@ import { HostedByCollectedFrom, Journal, OARoutes, Organization, - Project, + Project, RelationDatasource, RelationResult } from "../result-preview/result-preview"; import {isArray} from "rxjs/internal-compatibility"; @@ -194,6 +194,9 @@ export class ResultLandingInfo { organizations: Organization[]; openCitations: { "url": string, "title": string, "year": string, "doi": string, "authors": string[] }[]; + relatedServices: RelationDatasource[]; + relatedServicesClassFilters: Set = new Set(); + // DATASET subtitle: string; diff --git a/utils/result-preview/result-preview.ts b/utils/result-preview/result-preview.ts index 0362be0b..424f5bcf 100644 --- a/utils/result-preview/result-preview.ts +++ b/utils/result-preview/result-preview.ts @@ -37,6 +37,17 @@ export interface RelationResult { relationName?: string; } +export interface RelationDatasource { + name: string; + id: string; + percentage: number; + percentageName?: string; + class: string + provenanceAction?: string; + relationName?: string; + openaireCompatibility: string; +} + export interface Project { id: string; acronym: string; @@ -271,6 +282,20 @@ export class ResultPreview { return resultPreview; } + public static relationDatasourceConvert(result: RelationDatasource): ResultPreview { + let resultPreview: ResultPreview = new ResultPreview(); + resultPreview.id = result.id; + resultPreview.title = result.name; + resultPreview.resultType = "dataprovider"; + resultPreview.types = [result.class]; + resultPreview.relationName = result.relationName; + resultPreview.relation = result.percentageName; + resultPreview.percentage = result.percentage; + resultPreview.provenanceAction = result.provenanceAction; + resultPreview.compatibility = result.openaireCompatibility; + return resultPreview; + } + public static organizationConvert(result: Organization, relation: string = 'trust'): ResultPreview { let resultPreview: ResultPreview = new ResultPreview(); resultPreview.id = result.id; From 1b706003974ca33cc100ba6772084576e6148694 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 2 Jul 2024 00:03:18 +0300 Subject: [PATCH 07/19] [develop | DONE | CHANGED]: resultLanding.component.html: Hide usage counts per datasource from production | fos.component.html: Hide level 4 from keyword view too on beta and production (show only on dev). --- fos/fos.component.html | 12 +++++++----- landingPages/result/resultLanding.component.html | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/fos/fos.component.html b/fos/fos.component.html index 5bc80108..d5d67d7f 100644 --- a/fos/fos.component.html +++ b/fos/fos.component.html @@ -228,11 +228,13 @@ class="uk-link-text" [innerHTML]="highlightKeyword(searchFieldsHelper.getFosParameter() == 'foslabel' ? subSubItem.label : subSubItem.id)"> -
- - -
+ +
+ + +
+
diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index 9759a15a..a19949c5 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -1152,7 +1152,7 @@ -
+
From a8c2b2d0a315064ee557c4c7039c57228d130543 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 2 Jul 2024 00:15:21 +0300 Subject: [PATCH 08/19] [develop | DONE | CHANGED]: Parse organization versions from "children" field of the record, instead of querying explicitly. 1. organizationInfo.ts: Added field "children". 2. organization.service.ts: Set children field. 3. organization.component.html: In add parameter children. 4. organization/deletedByInference/deletedByInference.component.ts: Parse children to initialize resultsPreview: ResultPreview[] and show versions accordingly. --- .../deletedByInference.component.ts | 65 +++++++++++-------- .../organization/organization.component.html | 6 +- services/organization.service.ts | 1 + utils/entities/organizationInfo.ts | 1 + 4 files changed, 45 insertions(+), 28 deletions(-) diff --git a/landingPages/organization/deletedByInference/deletedByInference.component.ts b/landingPages/organization/deletedByInference/deletedByInference.component.ts index 9502348c..736b2ee2 100644 --- a/landingPages/organization/deletedByInference/deletedByInference.component.ts +++ b/landingPages/organization/deletedByInference/deletedByInference.component.ts @@ -19,28 +19,30 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class"; template: `
- + [totalResults]="resultsPreview.length">
    -
  • - +
- + [totalResults]="resultsPreview.length">
` }) export class OrganizationsDeletedByInferenceComponent { @Input() prevPath: string = ""; - public results: OrganizationInfo[] = []; + public resultsPreview: ResultPreview[] = []; + @Input() children = []; + @Input() id: string; @Input() ids: string[] = []; @Input() type: string; @@ -67,10 +69,10 @@ export class OrganizationsDeletedByInferenceComponent { this.properties = properties; this.subscriptions.push(this.route.queryParams.subscribe(data => { - this.errorCodes = new ErrorCodes(); - this.status = this.errorCodes.LOADING; + this.errorCodes = new ErrorCodes(); + this.status = this.errorCodes.LOADING; - this.getDeletedByInference(); + this.parseDeletedByInference(); })); } @@ -81,27 +83,38 @@ export class OrganizationsDeletedByInferenceComponent { } }); } - getDeletedByInference() { - this.results = []; - this.status = this.errorCodes.LOADING; - this.subscriptions.push(this._deletedByInferenceService.getDeletedByInferenceResults(this.id, String(this.ids.length), this.properties).subscribe( - data => { - this.results = data; - this.status = this.errorCodes.DONE; - }, - error => { - if(error.status == '404') { - this.status = this.errorCodes.NOT_FOUND; - } else if(error.status == '500') { - this.status = this.errorCodes.ERROR; + public parseDeletedByInference() { + let length = Array.isArray(this.children) ? this.children.length : 1; + for (let i = 0; i < length; i++) { + let result = Array.isArray(this.children) ? this.children[i] : this.children; + let preview = new ResultPreview(); + + if(result.hasOwnProperty("websiteurl")) { + preview.websiteURL = result.websiteurl; + } + if(result.hasOwnProperty("legalshortname")) { + preview.title = result.legalshortname; + } + if(result.hasOwnProperty("legalname")) { + if(preview.title && preview.title != result.legalname) { + preview.title += "("+result.legalname+")"; } else { - this.status = this.errorCodes.NOT_AVAILABLE; + preview.title = result.legalname; } } - )); + + if(result.hasOwnProperty("country")) { + preview.countries = [result['country'].classname]; + } + + preview.resultType = 'organization'; + + this.resultsPreview.push(preview); + } + this.status = this.errorCodes.DONE; } - + public getResultPreview(result: OrganizationInfo): ResultPreview { return ResultPreview.organizationInfoConvert(result); } diff --git a/landingPages/organization/organization.component.html b/landingPages/organization/organization.component.html index c58d75c4..a4411222 100644 --- a/landingPages/organization/organization.component.html +++ b/landingPages/organization/organization.component.html @@ -370,7 +370,8 @@ [id]="organizationInfo.objIdentifier" [ids]="organizationInfo.deletedByInferenceIds" [modal]="AlertModalDeletedByInference" - [type]="'organizations'" [prevPath]="prevPath"> + [type]="'organizations'" [prevPath]="prevPath" + [children]="organizationInfo.children">
@@ -484,7 +485,8 @@ + [type]="'organizations'" [prevPath]="prevPath" + [children]="organizationInfo.children"> diff --git a/services/organization.service.ts b/services/organization.service.ts index 44a81633..48daceca 100644 --- a/services/organization.service.ts +++ b/services/organization.service.ts @@ -93,6 +93,7 @@ export class OrganizationService { this.organizationInfo.deletedByInferenceIds.push(result.objidentifier); } } + this.organizationInfo.children = children['organization']; } if(organization['pid']) { diff --git a/utils/entities/organizationInfo.ts b/utils/entities/organizationInfo.ts index 7943db6e..fed1c128 100644 --- a/utils/entities/organizationInfo.ts +++ b/utils/entities/organizationInfo.ts @@ -28,6 +28,7 @@ export class OrganizationInfo { // organizations: {name: string; url: string}[]}[]; deletedByInferenceIds: string[]; + children; identifiers: Map; //key is the classname belongsTo: boolean = true; message: string; From 85657ceb61dd6aa424a23f45065fadcbc924b1fe Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 2 Jul 2024 00:25:35 +0300 Subject: [PATCH 09/19] [develop | DONE | CHANGED]: Parse research products versions from "children" field of the record, instead of querying explicitly. 1. resultLandingInfo.ts: Added field "children". 2. resultLanding.service.ts: Set children field. 3. resultLanding.component.html: In add parameter children. 4. result/deletedByInference/deletedByInference.component.ts: Parse children to initialize resultsPreview: ResultPreview[] and show versions accordingly. --- .../deletedByInference.component.ts | 122 ++++++++++++++---- .../result/resultLanding.component.html | 24 ++-- landingPages/result/resultLanding.service.ts | 1 + utils/entities/resultLandingInfo.ts | 1 + 4 files changed, 113 insertions(+), 35 deletions(-) diff --git a/landingPages/result/deletedByInference/deletedByInference.component.ts b/landingPages/result/deletedByInference/deletedByInference.component.ts index b986c240..2bee1215 100644 --- a/landingPages/result/deletedByInference/deletedByInference.component.ts +++ b/landingPages/result/deletedByInference/deletedByInference.component.ts @@ -8,33 +8,36 @@ import {RouterHelper} from '../../../utils/routerHelper.class'; import {ErrorCodes} from '../../../utils/properties/errorCodes'; import {DeletedByInferenceService} from './deletedByInference.service'; -import {ResultPreview} from "../../../utils/result-preview/result-preview"; +import {HostedByCollectedFrom, ResultPreview} from "../../../utils/result-preview/result-preview"; import {AlertModal} from "../../../utils/modal/alert"; import {Subscriber} from "rxjs"; import {properties} from "../../../../../environments/environment"; import {HelperFunctions} from "../../../utils/HelperFunctions.class"; +import {Dates, StringUtils} from "../../../utils/string-utils.class"; +import {ParsingFunctions} from "../../landing-utils/parsingFunctions.class"; @Component({ selector: 'deletedByInference', template: `
- + [totalResults]="resultsPreview.length">
    -
  • - +
- + [totalResults]="resultsPreview.length">
` @@ -42,7 +45,8 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class"; export class DeletedByInferenceComponent { @Input() isMobile: boolean = false; @Input() prevPath: string = ""; - public results: ResultLandingInfo[] = []; + public resultsPreview: ResultPreview[] = []; + @Input() children = []; @Input() id: string; @Input() ids: string[] = []; @Input() type: string; @@ -74,7 +78,7 @@ export class DeletedByInferenceComponent { this.errorCodes = new ErrorCodes(); this.status = this.errorCodes.LOADING; - this.getDeletedByInference(); + this.parseDeletedByInference(); })); } @@ -85,25 +89,89 @@ export class DeletedByInferenceComponent { } }); } - - getDeletedByInference() { - this.results = []; - this.status = this.errorCodes.LOADING; - this.subscriptions.push(this._deletedByInferenceService.getDeletedByInferenceResults(this.id, String(this.ids.length), this.properties).subscribe( - data => { - this.results = data; - this.status = this.errorCodes.DONE; - }, - error => { - if (error.status == '404') { - this.status = this.errorCodes.NOT_FOUND; - } else if (error.status == '500') { - this.status = this.errorCodes.ERROR; - } else { - this.status = this.errorCodes.NOT_AVAILABLE; + + public parseDeletedByInference() { + let parsingFunctions: ParsingFunctions = new ParsingFunctions(); + let length = Array.isArray(this.children) ? this.children.length : 1; + for (let i = 0; i < length; i++) { + let result = Array.isArray(this.children) ? this.children[i] : this.children; + let preview = new ResultPreview(); + if(result.hasOwnProperty("creator")) { + preview.authors = []; + let authorsLength = Array.isArray(result.creator) ? result.creator.length : 1; + for (let j = 0; j < authorsLength; j++) { + let author = {"fullName": Array.isArray(result.creator) ? result.creator[j] : result.creator, "orcid": null, "orcid_pending": null}; + preview.authors.push(author); } } - )); + if(result.hasOwnProperty("dateofacceptance")) { + preview.year = new Date(result.dateofacceptance).getFullYear().toString(); + } + if(result.hasOwnProperty("title")) { + let titleLength = Array.isArray(result.title) ? result.title.length : 1; + for (let j = 0; j < titleLength; j++) { + let title = Array.isArray(result.title) ? result.title[j] : result.title; + if (!preview.title || title.classid == "main title") { + preview.title = StringUtils.HTMLToString(String(title.content)); + } + } + } + if(result.hasOwnProperty("description")) { + preview.description = result.description; + } + preview.resultType = result?.resulttype?.classid ? result.resulttype.classid : this.resultType; + + + if (result.hasOwnProperty("instance")) { + preview.hostedBy_collectedFrom = new Array(); + + preview.types = new Array(); + let types = new Set(); + + let counter = 0; + let instance; + + let instanesLength = Array.isArray(result['instance']) ? result['instance'].length : 1; + + for (let j = 0; j < instanesLength; j++) { + instance = Array.isArray(result['instance']) ? result['instance'][j] : result['instance']; + if(result.hasOwnProperty('collectedfrom')) { + if(Array.isArray(result['collectedfrom'])) { + // not sure if this is correct mapping + instance['collectedfrom'] = result['collectedfrom'].length >= j ? result['collectedfrom'][j] : result['collectedfrom'][result['collectedfrom'].length - 1]; + } else { + instance['collectedfrom'] = result['collectedfrom']; + } + } + + parsingFunctions.parseTypes(preview.types, types, instance); + + if (instance.hasOwnProperty("webresource")) { + let url; + if (!Array.isArray(instance['webresource'])) { + url = instance['webresource'].url; + } else { + url = instance['webresource'][0].url; + } + if (url.includes('&')) { + url = url.replace(/&/gmu, '&'); + } + + /**********************************************************/ + if (instance.hasOwnProperty("hostedby")) { + parsingFunctions.parseHostedBy_collectedFrom(preview.hostedBy_collectedFrom, instance, url, null); + } + /**********************************************************/ + } + } + + // /* Order Download from via openness*/ + preview.hostedBy_collectedFrom.sort(parsingFunctions.compareHostedByCollectedFrom); + } + + this.resultsPreview.push(preview); + } + this.status = this.errorCodes.DONE; } public getResultPreview(result: ResultLandingInfo): ResultPreview { diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index a19949c5..7621c2a0 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -724,22 +724,26 @@ [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [ids]="resultLandingInfo.deletedByInferenceIds" [modal]="AlertModalDeletedByInference" - [resultType]="type" [type]="openaireEntities.PUBLICATIONS" [prevPath]="prevPath">
+ [resultType]="type" [type]="openaireEntities.PUBLICATIONS" [prevPath]="prevPath" + [children]="resultLandingInfo.children"> + [resultType]="'dataset'" [type]="openaireEntities.DATASETS" [prevPath]="prevPath" + [children]="resultLandingInfo.children"> + [resultType]="type" [type]="openaireEntities.SOFTWARE" [prevPath]="prevPath" + [children]="resultLandingInfo.children"> + [resultType]="'other'" [type]="openaireEntities.OTHER" [prevPath]="prevPath" + [children]="resultLandingInfo.children"> + [modal]="alertModalDeletedByInferenceFS" + [children]="resultLandingInfo.children"> + [modal]="alertModalDeletedByInferenceFS" + [children]="resultLandingInfo.children"> + [modal]="alertModalDeletedByInferenceFS" + [children]="resultLandingInfo.children"> + [modal]="alertModalDeletedByInferenceFS" + [children]="resultLandingInfo.children"> diff --git a/landingPages/result/resultLanding.service.ts b/landingPages/result/resultLanding.service.ts index 77c5cd1e..24913d76 100644 --- a/landingPages/result/resultLanding.service.ts +++ b/landingPages/result/resultLanding.service.ts @@ -238,6 +238,7 @@ export class ResultLandingService { let result = Array.isArray(data[3]['result']) ? data[3]['result'][i] : data[3]['result']; this.resultLandingInfo.deletedByInferenceIds.push(result.objidentifier); } + this.resultLandingInfo.children = data[3]['result']; } diff --git a/utils/entities/resultLandingInfo.ts b/utils/entities/resultLandingInfo.ts index 76e98ada..f8c03a0b 100644 --- a/utils/entities/resultLandingInfo.ts +++ b/utils/entities/resultLandingInfo.ts @@ -185,6 +185,7 @@ export class ResultLandingInfo { contexts: Context[]; deletedByInferenceIds: string[]; + children; // PUBLICATION, DATASET, ORP references: Reference[]; From 0bd8667667744f3e011979ec557cea15d3b13698 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 2 Jul 2024 00:46:57 +0300 Subject: [PATCH 10/19] [develop | DONE | CHANGED]: dataProviderInfo.ts: Renamed "EOSC Service Catalogue" to "EOSC Resource Hub" | environment.ts: Updated "eoscMarketplaceURL" property. --- utils/entities/dataProviderInfo.ts | 3 +-- utils/properties/environments/environment.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/utils/entities/dataProviderInfo.ts b/utils/entities/dataProviderInfo.ts index a532260d..7ed87639 100644 --- a/utils/entities/dataProviderInfo.ts +++ b/utils/entities/dataProviderInfo.ts @@ -11,8 +11,7 @@ export class DataproviderProvenance { this.provenance.set("fairsharing_::", {"urlPrefix": properties.fairSharingURL, "name": "FAIRsharing"}); this.provenance.set("eosc________::", { "urlPrefix": properties.eoscMarketplaceURL, - "name": "EOSC Service Catalogue" - }); + "name": "EOSC Resource Hub" }); } } diff --git a/utils/properties/environments/environment.ts b/utils/properties/environments/environment.ts index f7e88a8c..8f0b7308 100644 --- a/utils/properties/environments/environment.ts +++ b/utils/properties/environments/environment.ts @@ -25,7 +25,7 @@ export let common: EnvProperties = { wikiDataURL: "https://www.wikidata.org/wiki/", fundRefURL: "https://data.crossref.org/fundingdata/funder/", fairSharingURL: "https://fairsharing.org/", - eoscMarketplaceURL: "https://marketplace.eosc-portal.eu/services/", + eoscMarketplaceURL: "https://open-science-cloud.ec.europa.eu/resources/services/", sherpaURL: "http://sherpa.ac.uk/romeo/issn/", sherpaURLSuffix: "/", zenodo: "https://zenodo.org/", From e70625405ce455643a52d83f79ec1834687188b6 Mon Sep 17 00:00:00 2001 From: argirok Date: Tue, 2 Jul 2024 11:53:15 +0300 Subject: [PATCH 11/19] [plugins-functionality | DONE | FIXED ] fix encoding in stats titles in the form --- .../components/stats/plugin-stats.form.component.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dashboard/plugins/components/stats/plugin-stats.form.component.ts b/dashboard/plugins/components/stats/plugin-stats.form.component.ts index a3770b27..1ead1027 100644 --- a/dashboard/plugins/components/stats/plugin-stats.form.component.ts +++ b/dashboard/plugins/components/stats/plugin-stats.form.component.ts @@ -40,9 +40,9 @@ import {PluginStats} from "./plugin-stats.component"; type="checkbox" field="sdgs" (editClicked)="pluginEditEvent = $event" (changed)="indicatorsChanged(indicator._id,$event)"> - {{indicator.indicatorPaths[0].name?indicator.name:(indicator.indicatorPaths[0].parameters['title'] )}} + {{decode(indicator.indicatorPaths[0].name?indicator.name:(indicator.indicatorPaths[0].parameters['title'] ))}} - {{ indicator.indicatorPaths[0].parameters['subtitle']? ' ' + indicator.indicatorPaths[0].parameters['subtitle']:''}} + {{ decode(indicator.indicatorPaths[0].parameters['subtitle']? ' ' + indicator.indicatorPaths[0].parameters['subtitle']:'')}} @@ -78,4 +78,7 @@ export class PluginStatsFormComponent extends PluginBaseFormComponent Date: Tue, 2 Jul 2024 13:51:15 +0300 Subject: [PATCH 12/19] [develop | DONE | FIXED]: Initialize properties on field definition (files: displayClaims.component.ts & directLinking.component.ts & approved.component.ts & curators.component.ts & portals.component.ts & depositFirstPage.component.ts & searchResultsInDeposit.component.ts & statisticsTab.component.ts & citeThis.component.ts & deletedByInference.component.ts & organization.component.ts & project.component.ts & deletedByInference.component.ts & myOrcidLinks.component.ts & searchMyOrcidResults.component.ts & searchRecommendedResultsForOrcid.component.ts & searchResultsForOrcid.component.ts & searchAll.component.ts & advancedSearchForm.component.ts & searchDataProviders.component.ts & searchDataProviders.component.ts & searchOrganizations.component.ts & searchProjects.component.ts). --- claims/claim-utils/displayClaims/displayClaims.component.ts | 3 +-- claims/directLinking/directLinking.component.ts | 3 +-- connect/approvedByCommunity/approved.component.ts | 3 +-- connect/components/curators/curators.component.ts | 3 +-- dashboard/portal/portals.component.ts | 3 +-- deposit/depositFirstPage.component.ts | 3 +-- deposit/searchResultsInDeposit.component.ts | 4 +--- landingPages/dataProvider/statisticsTab.component.ts | 5 +---- landingPages/landing-utils/citeThis/citeThis.component.ts | 3 +-- .../deletedByInference/deletedByInference.component.ts | 5 +---- landingPages/organization/organization.component.ts | 3 +-- landingPages/project/project.component.ts | 3 +-- .../deletedByInference/deletedByInference.component.ts | 6 +----- orcid/my-orcid-links/myOrcidLinks.component.ts | 3 +-- orcid/my-orcid-links/searchMyOrcidResults.component.ts | 5 +---- .../searchRecommendedResultsForOrcid.component.ts | 3 +-- .../searchResultsForOrcid.component.ts | 5 +---- searchPages/find/searchAll.component.ts | 3 +-- searchPages/searchDataProviders.component.ts | 3 +-- searchPages/searchOrganizations.component.ts | 3 +-- searchPages/searchProjects.component.ts | 4 +--- searchPages/searchUtils/advancedSearchForm.component.ts | 6 ++---- searchPages/searchUtils/searchDownload.component.ts | 3 +-- 23 files changed, 24 insertions(+), 61 deletions(-) diff --git a/claims/claim-utils/displayClaims/displayClaims.component.ts b/claims/claim-utils/displayClaims/displayClaims.component.ts index 28600ec4..37d8eed7 100644 --- a/claims/claim-utils/displayClaims/displayClaims.component.ts +++ b/claims/claim-utils/displayClaims/displayClaims.component.ts @@ -28,7 +28,7 @@ import {DropdownFilterComponent} from "../../../utils/dropdown-filter/dropdown-f }) export class DisplayClaimsComponent implements OnInit, OnDestroy { @Input() pageTitle: string = ""; - properties: EnvProperties; + properties: EnvProperties = properties; public searchTermStream = new Subject(); subscriptions: any = []; public subResults: any; @@ -101,7 +101,6 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy { sort: this._fb.control(this.sortOptions[0].value) }); - this.properties = properties; this.url = properties.domain + properties.baseLink + this._router.url; if (!this.myClaims) { this.sortOptions.push({label: "User (desc) ", value: {sort: "user", descending: true}}); diff --git a/claims/directLinking/directLinking.component.ts b/claims/directLinking/directLinking.component.ts index f84b0e59..000c0900 100644 --- a/claims/directLinking/directLinking.component.ts +++ b/claims/directLinking/directLinking.component.ts @@ -34,7 +34,7 @@ export class DirectLinkingComponent { sources: ClaimEntity[] = []; inlineEntity: ClaimEntity = null; validInput: boolean = null;//'true; - properties: EnvProperties; + properties: EnvProperties = properties; @Input() communityId: string = null; localStoragePrefix: string = ""; @Input() organizationClaim: boolean = false; @@ -50,7 +50,6 @@ export class DirectLinkingComponent { }); } ngOnInit() { - this.properties = properties; /* if(!this.claimsProperties){ this.claimsProperties = new ClaimsProperties(); }*/ diff --git a/connect/approvedByCommunity/approved.component.ts b/connect/approvedByCommunity/approved.component.ts index 710a8ef2..b8b39300 100644 --- a/connect/approvedByCommunity/approved.component.ts +++ b/connect/approvedByCommunity/approved.component.ts @@ -21,13 +21,12 @@ export class ApprovedByCommunityComponent { public approved:boolean = false; private communityContentProviders = []; - properties:EnvProperties; + properties:EnvProperties = properties; public openaireEntities = OpenaireEntities; constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchCommunityDataprovidersService) {} public ngOnInit() { - this.properties =properties; this.route.queryParams.subscribe( communityId => { this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain); diff --git a/connect/components/curators/curators.component.ts b/connect/components/curators/curators.component.ts index 4423168f..3fbbb7b0 100644 --- a/connect/components/curators/curators.component.ts +++ b/connect/components/curators/curators.component.ts @@ -36,7 +36,7 @@ export class CuratorsComponent { public viewingMore: boolean = false; public curatorInModal; - public properties: EnvProperties; + public properties: EnvProperties = properties; public pageContents = null; public divContents = null; @@ -63,7 +63,6 @@ export class CuratorsComponent { ngOnInit() { this.showLoading = true; - this.properties = properties; this.downloadUrl = this.properties.utilsService + '/download/'; //if (properties.environment !== 'development') { if (!this.longView) { diff --git a/dashboard/portal/portals.component.ts b/dashboard/portal/portals.component.ts index 69b08fe9..b3b205b1 100644 --- a/dashboard/portal/portals.component.ts +++ b/dashboard/portal/portals.component.ts @@ -34,7 +34,7 @@ export class PortalsComponent implements OnInit { private searchText: RegExp = new RegExp(''); public keyword = ''; - public properties: EnvProperties = null; + public properties: EnvProperties = properties; public showLoading = true; public portalUtils: PortalUtils = new PortalUtils(); @@ -61,7 +61,6 @@ export class PortalsComponent implements OnInit { })); HelperFunctions.scroll(); - this.properties = properties; this.getPortals(); } diff --git a/deposit/depositFirstPage.component.ts b/deposit/depositFirstPage.component.ts index 43172cce..86fe0bfd 100644 --- a/deposit/depositFirstPage.component.ts +++ b/deposit/depositFirstPage.component.ts @@ -191,7 +191,7 @@ export class DepositFirstPageComponent { public keyword: string; public depositRoute: string; public searchPlaceHolder = "Search by title, country, organization, subject, type..."; - properties:EnvProperties; + properties:EnvProperties = properties; public routerHelper:RouterHelper = new RouterHelper(); @Input() showBreadcrumb:boolean = false; breadcrumbs:Breadcrumb[] = []; @@ -208,7 +208,6 @@ export class DepositFirstPageComponent { ngOnInit() { - this.properties = properties; this.url = this.properties.domain+this.properties.baseLink + this._router.url; this.seoService.createLinkForCanonicalURL(this.url, false); diff --git a/deposit/searchResultsInDeposit.component.ts b/deposit/searchResultsInDeposit.component.ts index 34e9ae46..846fc09c 100644 --- a/deposit/searchResultsInDeposit.component.ts +++ b/deposit/searchResultsInDeposit.component.ts @@ -18,7 +18,7 @@ export class SearchResultsInDepositComponent { @Input() results: SearchResult[]; @Input() status: number; @Input() type: string; - @Input() properties:EnvProperties; + @Input() properties:EnvProperties = properties; @Input() isMobile: boolean = false; @@ -60,8 +60,6 @@ export class SearchResultsInDepositComponent { this.urlParam = "datasourceId"; } - this.properties = properties; - if (!this.zenodoInformation) { this.zenodoInformation = new ZenodoInformationClass(); } diff --git a/landingPages/dataProvider/statisticsTab.component.ts b/landingPages/dataProvider/statisticsTab.component.ts index f419e7b3..857f0828 100644 --- a/landingPages/dataProvider/statisticsTab.component.ts +++ b/landingPages/dataProvider/statisticsTab.component.ts @@ -78,15 +78,12 @@ export class StatisticsTabComponent { private dataProjectsUrl:string ; private pubsProjectsUrl:string; public errorCodes:ErrorCodes = new ErrorCodes(); - properties:EnvProperties; + properties:EnvProperties = properties; public openaireEntities = OpenaireEntities; sub; constructor (private route: ActivatedRoute) {} ngOnInit() { - - this.properties = properties; - if (this.properties.useNewStatistisTool) { this.docsTimelineUrl = this.properties.statisticsFrameNewAPIURL + 'chart?json='+StringUtils.URIEncode('{"library":"HighCharts","chartDescription":{"queries":[{"name":"'+this.openaireEntities.RESULTS+'","type":"column","query":{"name":"dtsrcYear","parameters":["'+this.datasourceId+'"]}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Produced '+this.openaireEntities.RESULTS+' per year"},"subtitle":{},"yAxis":{"title":{"text":"'+this.openaireEntities.RESULTS+'"}},"xAxis":{"title":{"text":"Year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'); diff --git a/landingPages/landing-utils/citeThis/citeThis.component.ts b/landingPages/landing-utils/citeThis/citeThis.component.ts index 660a4b0d..63204797 100644 --- a/landingPages/landing-utils/citeThis/citeThis.component.ts +++ b/landingPages/landing-utils/citeThis/citeThis.component.ts @@ -41,7 +41,7 @@ export class CiteThisComponent implements OnInit, OnDestroy { public selectedStyle: string = null; public selectedFormat: string = null; public fileText: string; - properties:EnvProperties; + properties:EnvProperties = properties; public citationText: string; public citation: Citation = new Citation(); @Input() result: any; @@ -55,7 +55,6 @@ export class CiteThisComponent implements OnInit, OnDestroy { constructor( @Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2, private _piwikService: PiwikService){ } ngOnInit() { - this.properties = properties; try{ if (!this.document.getElementById('citationjs')) { const renderer = this.rendererFactory.createRenderer(this.document, { diff --git a/landingPages/organization/deletedByInference/deletedByInference.component.ts b/landingPages/organization/deletedByInference/deletedByInference.component.ts index 736b2ee2..20d399b0 100644 --- a/landingPages/organization/deletedByInference/deletedByInference.component.ts +++ b/landingPages/organization/deletedByInference/deletedByInference.component.ts @@ -57,7 +57,7 @@ export class OrganizationsDeletedByInferenceComponent { public errorCodes:ErrorCodes = new ErrorCodes(); subscriptions = []; - properties:EnvProperties; + properties:EnvProperties = properties; constructor ( private element: ElementRef, private _deletedByInferenceService: OrganizationsDeletedByInferenceService, @@ -65,9 +65,6 @@ export class OrganizationsDeletedByInferenceComponent { } ngOnInit() { - - this.properties = properties; - this.subscriptions.push(this.route.queryParams.subscribe(data => { this.errorCodes = new ErrorCodes(); this.status = this.errorCodes.LOADING; diff --git a/landingPages/organization/organization.component.ts b/landingPages/organization/organization.component.ts index d6465383..ad7f77c8 100644 --- a/landingPages/organization/organization.component.ts +++ b/landingPages/organization/organization.component.ts @@ -117,7 +117,7 @@ export class OrganizationComponent { subscriptions = []; innerReportSubscriptions = []; - properties: EnvProperties; + properties: EnvProperties = properties; public openaireEntities = OpenaireEntities; public indexUpdateDate: Date; public showFeedback: boolean = false; @@ -167,7 +167,6 @@ export class OrganizationComponent { this.isBottomIntersecting = isBottomIntersecting; this.cdr.detectChanges(); })); - this.properties = properties; if (typeof document !== 'undefined') { this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => { if (lastIndexUpdate) { diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts index b70e8b42..4ae72222 100644 --- a/landingPages/project/project.component.ts +++ b/landingPages/project/project.component.ts @@ -171,7 +171,7 @@ export class ProjectComponent { subscriptions = []; private sub: Subscription; - properties: EnvProperties; + properties: EnvProperties = properties; public openaireEntities = OpenaireEntities; public isMobile: boolean = false; @@ -214,7 +214,6 @@ export class ProjectComponent { this.isBottomIntersecting = isBottomIntersecting; this.cdr.detectChanges(); })); - this.properties = properties; if (typeof document !== 'undefined') { this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => { if (lastIndexUpdate) { diff --git a/landingPages/result/deletedByInference/deletedByInference.component.ts b/landingPages/result/deletedByInference/deletedByInference.component.ts index 2bee1215..be2402b5 100644 --- a/landingPages/result/deletedByInference/deletedByInference.component.ts +++ b/landingPages/result/deletedByInference/deletedByInference.component.ts @@ -62,7 +62,7 @@ export class DeletedByInferenceComponent { public errorCodes: ErrorCodes = new ErrorCodes(); subscriptions = []; - properties: EnvProperties; + properties: EnvProperties = properties; constructor(private element: ElementRef, private _deletedByInferenceService: DeletedByInferenceService, @@ -70,10 +70,6 @@ export class DeletedByInferenceComponent { } ngOnInit() { - - this.properties = properties; - - this.subscriptions.push(this.route.queryParams.subscribe(data => { this.errorCodes = new ErrorCodes(); this.status = this.errorCodes.LOADING; diff --git a/orcid/my-orcid-links/myOrcidLinks.component.ts b/orcid/my-orcid-links/myOrcidLinks.component.ts index ed8238d6..0e71b330 100644 --- a/orcid/my-orcid-links/myOrcidLinks.component.ts +++ b/orcid/my-orcid-links/myOrcidLinks.component.ts @@ -121,7 +121,7 @@ export class MyOrcidLinksComponent { public oldTotalResults: number = 0; pagingLimit = 0; - properties:EnvProperties; + properties:EnvProperties = properties; public openaireEntities = OpenaireEntities; public lastOrcidUpdateDate: string = ""; @@ -183,7 +183,6 @@ export class MyOrcidLinksComponent { } public ngOnInit() { - this.properties = properties; this.baseUrl = this.properties.myOrcidLinksPage; this.pagingLimit = this.properties.pagingLimit; var description = "Openaire, ORCID linking, publication, research data, software, other research product"; diff --git a/orcid/my-orcid-links/searchMyOrcidResults.component.ts b/orcid/my-orcid-links/searchMyOrcidResults.component.ts index 03847ba3..08fc9430 100644 --- a/orcid/my-orcid-links/searchMyOrcidResults.component.ts +++ b/orcid/my-orcid-links/searchMyOrcidResults.component.ts @@ -21,7 +21,7 @@ export class searcMyOrcidResultsComponent { @Input() results: SearchResult[]; @Input() status: number; @Input() type: string; - @Input() properties:EnvProperties; + @Input() properties:EnvProperties = properties; public openaireEntities = OpenaireEntities; @Input() previewResults:{"work":{},results:ResultPreview[]}[]; @@ -57,9 +57,6 @@ export class searcMyOrcidResultsComponent { this.linkToAdvancedSearchPage = this.properties.searchLinkToAdvancedOrps; this.urlParam = "orpId"; } - - this.properties = properties; - } diff --git a/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid.component.ts b/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid.component.ts index 6557c5c0..dd529463 100644 --- a/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid.component.ts +++ b/orcid/recommend-orcid-links/searchRecommendedResultsForOrcid.component.ts @@ -77,7 +77,7 @@ export class SearchRecommendedResultsForOrcidComponent { public oldTotalResults: number = 0; pagingLimit = 0; - properties:EnvProperties; + properties:EnvProperties = properties; @Input() public communityId: string = null; @@ -100,7 +100,6 @@ export class SearchRecommendedResultsForOrcidComponent { } public ngOnInit() { - this.properties = properties; this.depositLearnHowPage = this.properties.depositLearnHowPage; this.baseUrl = this.properties.depositSearchPage; this.pagingLimit = this.properties.pagingLimit; diff --git a/orcid/recommend-orcid-links/searchResultsForOrcid.component.ts b/orcid/recommend-orcid-links/searchResultsForOrcid.component.ts index 23dea6a1..25be13cc 100644 --- a/orcid/recommend-orcid-links/searchResultsForOrcid.component.ts +++ b/orcid/recommend-orcid-links/searchResultsForOrcid.component.ts @@ -17,7 +17,7 @@ export class SearchResultsForOrcidComponent { @Input() results: SearchResult[]; @Input() status: number; @Input() type: string; - @Input() properties:EnvProperties; + @Input() properties:EnvProperties = properties; public urlParam: string; @@ -56,9 +56,6 @@ export class SearchResultsForOrcidComponent { this.linkToAdvancedSearchPage = this.properties.searchLinkToAdvancedDataProviders; this.urlParam = "datasourceId"; } - - this.properties = properties; - } public quote(params: string):string { diff --git a/searchPages/find/searchAll.component.ts b/searchPages/find/searchAll.component.ts index f70ac38b..1783d61e 100644 --- a/searchPages/find/searchAll.component.ts +++ b/searchPages/find/searchAll.component.ts @@ -85,7 +85,7 @@ export class SearchAllComponent { showServices: boolean = false; showOrganizations: boolean = false; advancedSearchLink: string = properties.searchLinkToAdvancedResults; - properties: EnvProperties; + properties: EnvProperties = properties; offset: number; public openaireEntities = OpenaireEntities; @Input() logoURL; @@ -154,7 +154,6 @@ export class SearchAllComponent { var description = "Search for "+OpenaireEntities.RESULTS+" ("+OpenaireEntities.PUBLICATIONS+", "+OpenaireEntities.DATASETS+", "+OpenaireEntities.SOFTWARE+", "+OpenaireEntities.OTHER+"), "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.ORGANIZATIONS+", "+OpenaireEntities.DATASOURCES+" in the OpenAIRE Graph. "; var title = "OpenAIRE |Search for "+OpenaireEntities.RESULTS+", "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.DATASOURCES+" & "+OpenaireEntities.ORGANIZATIONS; - this.properties = properties; var url = this.properties.domain + this.properties.baseLink + this._router.url; this._title.setTitle(title); this._meta.updateTag({content: description}, "name='description'"); diff --git a/searchPages/searchDataProviders.component.ts b/searchPages/searchDataProviders.component.ts index 5a295226..9df47832 100644 --- a/searchPages/searchDataProviders.component.ts +++ b/searchPages/searchDataProviders.component.ts @@ -80,7 +80,7 @@ export class SearchDataProvidersComponent { public loadPaging: boolean = true; public oldTotalResults: number = 0; public pagingLimit: number = 0; - properties:EnvProperties; + properties:EnvProperties = properties; public openaireEntities = OpenaireEntities; @Input() type: "all" | "registries" | "journals" | "compatible" | "deposit" | "services" = "all"; @Input() entityType: "dataprovider" | "service" = "dataprovider"; @@ -130,7 +130,6 @@ export class SearchDataProvidersComponent { if(this.showSwitchSearchLink == null){ this.showSwitchSearchLink = (this.type == "all" || this.type == "services"); } - this.properties= properties; this.csvPath = this.entityType == "service" ? OpenaireEntities.SERVICES_FILE : OpenaireEntities.DATASOURCES_FILE; if (!this.simpleSearchLink) { this.simpleSearchLink = this.entityType == "service" ? this.properties.searchLinkToServices : this.properties.searchLinkToDataProviders; diff --git a/searchPages/searchOrganizations.component.ts b/searchPages/searchOrganizations.component.ts index 676dde0b..a5276ada 100644 --- a/searchPages/searchOrganizations.component.ts +++ b/searchPages/searchOrganizations.component.ts @@ -47,7 +47,7 @@ import {zip} from "rxjs"; export class SearchOrganizationsComponent { private errorCodes: ErrorCodes; private errorMessages: ErrorMessagesComponent; - properties:EnvProperties; + properties:EnvProperties = properties; public openaireEntities = OpenaireEntities; @Input() searchForm: SearchForm = {class: 'search-form', dark: true}; public results =[]; @@ -103,7 +103,6 @@ export class SearchOrganizationsComponent { } ngOnInit() { - this.properties= properties; if (!this.simpleSearchLink) { this.simpleSearchLink = this.properties.searchLinkToOrganizations; } diff --git a/searchPages/searchProjects.component.ts b/searchPages/searchProjects.component.ts index 0f9bb5ad..cb90599d 100644 --- a/searchPages/searchProjects.component.ts +++ b/searchPages/searchProjects.component.ts @@ -67,7 +67,7 @@ export class SearchProjectsComponent { public fieldIdsMap = this.searchFields.PROJECT_FIELDS; public rangeFields: string[][] = this.searchFields.PROJECT_RANGE_FIELDS; public selectedFields: AdvancedField[] = []; - properties: EnvProperties; + properties: EnvProperties = properties; public openaireEntities = OpenaireEntities; public resourcesQuery = "(oaftype exact project)"; @@ -107,8 +107,6 @@ export class SearchProjectsComponent { } ngOnInit() { - - this.properties = properties; if (!this.simpleSearchLink) { this.simpleSearchLink = this.properties.searchLinkToProjects; } diff --git a/searchPages/searchUtils/advancedSearchForm.component.ts b/searchPages/searchUtils/advancedSearchForm.component.ts index aefb089e..7b3afc6c 100644 --- a/searchPages/searchUtils/advancedSearchForm.component.ts +++ b/searchPages/searchUtils/advancedSearchForm.component.ts @@ -51,7 +51,7 @@ export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges newFieldName: string; fieldList: { [id: string]: any[] } = {}; public searchFields: SearchFields = new SearchFields(); - properties: EnvProperties; + properties: EnvProperties = properties; public openaireEntities = OpenaireEntities; public operators: string[] = this.searchFields.ADVANCED_SEARCH_OPERATORS; public isOperators: Option[] = [{label: 'is', value: true}, {label: 'is not', value: false}]; @@ -69,9 +69,7 @@ export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges ngOnInit() { this.selectedEntity = this.entityType; - - this.properties = properties; - + for (var i = 0; i < this.fieldIds.length; i++) { this.fieldList[this.fieldIds[i]] = []; } diff --git a/searchPages/searchUtils/searchDownload.component.ts b/searchPages/searchUtils/searchDownload.component.ts index 2a506fb1..5017960c 100644 --- a/searchPages/searchUtils/searchDownload.component.ts +++ b/searchPages/searchUtils/searchDownload.component.ts @@ -39,7 +39,7 @@ export class SearchDownloadComponent { @ViewChild(ModalLoading) loading: ModalLoading; // Alert box when something is wrong with CSV requests @ViewChild('AlertModalCsvError') alertCsvError; - public properties: EnvProperties; + public properties: EnvProperties = properties; public errorCodes: ErrorCodes = new ErrorCodes(); subscriptions = []; @@ -47,7 +47,6 @@ export class SearchDownloadComponent { } ngOnInit() { - this.properties = properties; this.csvLimit = this.properties.csvLimit; this.downloadURLAPI = this.properties.csvAPIURL; } From c97c54208f6cdcbdcc1f01939a6f13242b0b20c2 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 2 Jul 2024 15:55:42 +0300 Subject: [PATCH 13/19] [develop]: Change extract stakeholders by removing condition for field name. --- monitor-admin/utils/indicator-utils.ts | 148 ------------------------- 1 file changed, 148 deletions(-) diff --git a/monitor-admin/utils/indicator-utils.ts b/monitor-admin/utils/indicator-utils.ts index fe994f5d..5a17a189 100644 --- a/monitor-admin/utils/indicator-utils.ts +++ b/monitor-admin/utils/indicator-utils.ts @@ -772,45 +772,6 @@ export class IndicatorUtils { } private extractStakeHolders(obj, stakeholder: Stakeholder) { - this.extractFunder(obj, stakeholder); - this.extractRI(obj, stakeholder); - this.extractOrganization(obj, stakeholder); - this.extractDatasource(obj, stakeholder); - this.extractResearcher(obj, stakeholder); - this.extractPublisher(obj, stakeholder); - } - - private extractFunder(obj, stakeholder: Stakeholder) { - if (stakeholder.type != 'funder') { - return; - } - for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) { - if (query["query"]["profile"]) { - query["query"]["profile"] = ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix; - } - if (!query["query"]["filters"]) { - return; - } - for (let filter of query["query"]["filters"]) { - for (let gfilter of filter["groupFilters"]) { - //ignore field No Of Funders - let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder); - if (replacedValue) { // don't proceed in replacement if no replaced value matches - if ((gfilter["field"].indexOf(" funder") != -1 && gfilter["field"].indexOf(" funders") == -1) || - (gfilter["field"].indexOf(".funder") != -1) || - (gfilter["field"].indexOf(".funder.id") != -1)) { - gfilter["values"][0] = replacedValue; - } - } - } - } - } - } - - private extractRI(obj, stakeholder: Stakeholder) { - if (stakeholder.type != 'ri') { - return; - } for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) { if (query["query"]["profile"]) { query["query"]["profile"] = ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix; @@ -822,116 +783,7 @@ export class IndicatorUtils { for (let gfilter of filter["groupFilters"]) { let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder); if (replacedValue) { // don't proceed in replacement if no replaced value matches - if ((gfilter["field"].indexOf(".context.name") != -1) - || (gfilter["field"].indexOf(".context.id") != -1)) { gfilter["values"][0] = replacedValue; - } - } - } - } - } - } - - private extractOrganization(obj, stakeholder: Stakeholder) { - // works for publication.project.organization.name - // and publication.organization.name - if (stakeholder.type != 'organization') { - return; - } - for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) { - if (query["query"]["profile"]) { - query["query"]["profile"] = ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix; - } - if (!query["query"]["filters"]) { - return; - } - for (let filter of query["query"]["filters"]) { - for (let gfilter of filter["groupFilters"]) { - let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder); - if (replacedValue) { // don't proceed in replacement if no replaced value matches - if ((gfilter["field"].indexOf(".organization.name") != -1) || - (gfilter["field"].indexOf(".organization.id") != -1)) { - gfilter["values"][0] = replacedValue; - } - } - } - } - } - } - - private extractPublisher(obj, stakeholder: Stakeholder) { - // works for .publisher - if (stakeholder.type != 'publisher') { - return; - } - for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) { - if (query["query"]["profile"]) { - query["query"]["profile"] = ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix; - } - if (!query["query"]["filters"]) { - return; - } - for (let filter of query["query"]["filters"]) { - for (let gfilter of filter["groupFilters"]) { - let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder); - console.log(replacedValue) - if (replacedValue) { // don't proceed in replacement if no replaced value matches - if (gfilter["field"].indexOf(".publisher") != -1) { - console.log(gfilter["values"][0]) - gfilter["values"][0] = replacedValue; - } - } - } - } - } - } - - private extractDatasource(obj, stakeholder: Stakeholder) { - // works for .datasource.name and .HostedBy datasource - // and .datasource.id - if (stakeholder.type != 'datasource' && stakeholder.type != 'journal') { - return; - } - for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) { - if (query["query"]["profile"]) { - query["query"]["profile"] = ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix; - } - if (!query["query"]["filters"]) { - return; - } - for (let filter of query["query"]["filters"]) { - for (let gfilter of filter["groupFilters"]) { - let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder); - if (replacedValue) { // don't proceed in replacement if no replaced value matches - if ((gfilter["field"].indexOf(".datasource.name") != -1 || gfilter["field"].indexOf(".HostedBy datasource") != -1) || - (gfilter["field"].indexOf(".datasource.id") != -1) || (gfilter["field"].indexOf(".hostedby") != -1)) { - gfilter["values"][0] = replacedValue; - } - } - } - } - } - } - - private extractResearcher(obj, stakeholder: Stakeholder) { - // works for .orcid - if (stakeholder.type != "researcher") { - return; - } - for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) { - if (query["query"]["profile"]) { - query["query"]["profile"] = ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix; - } - if (!query["query"]["filters"]) { - return; - } - for (let filter of query["query"]["filters"]) { - for (let gfilter of filter["groupFilters"]) { - let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder); - if (replacedValue) { // don't proceed in replacement if no replaced value matches - if ((gfilter["field"].indexOf(".orcid") != -1)) { - gfilter["values"][0] = replacedValue; - } } } } From 853b072c62282d6641c1b80c09a1b0562eedfa93 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Fri, 5 Jul 2024 16:00:36 +0300 Subject: [PATCH 14/19] [develop | DONE | FIXED]: searchProjects.service.ts: Added parameter excludeUnidentfied: boolean = true in method "advancedSearchProjects()" to add or not the basic query :&fq=(projectcode<>"unidentified") | claimProjectSearchForm.component.ts: In calls of projectService.advancedSearchProjects, set parameter "excludeUnidentfied" to false, not to exclude unidentified projects (irish funders were missing from the funders list). --- claims/claim-utils/claimProjectSearchForm.component.ts | 4 ++-- services/searchProjects.service.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/claims/claim-utils/claimProjectSearchForm.component.ts b/claims/claim-utils/claimProjectSearchForm.component.ts index b92df231..1891b7ae 100644 --- a/claims/claim-utils/claimProjectSearchForm.component.ts +++ b/claims/claim-utils/claimProjectSearchForm.component.ts @@ -72,7 +72,7 @@ export class ClaimProjectsSearchFormComponent { this.openaireResultsStatus = this.errorCodes.LOADING; this.showResults = true; this.sub = this._projectService.advancedSearchProjects("", 1, 0, this.properties, - this.refineFieldsQuery, this.refineFields, "&type=projects&sf=funder").subscribe( + this.refineFieldsQuery, this.refineFields, "&type=projects&sf=funder", false, false).subscribe( data => { let option = {value : null, label: "No funder selected"}; this.funderOptions.push(option); @@ -110,7 +110,7 @@ export class ClaimProjectsSearchFormComponent { this.prevFilters = this.filters; //searchProjects (params: string, refineParams:string, page: number, size: number, refineFields:string[] , properties:EnvProperties ):any { - this.sub = this._projectService.advancedSearchProjects(this.createOpenaireQueryParams(), page, size, this.properties, this.createOpenaireRefineQuery(), [], null).subscribe( + this.sub = this._projectService.advancedSearchProjects(this.createOpenaireQueryParams(), page, size, this.properties, this.createOpenaireRefineQuery(), [], null, false, false).subscribe( // this.sub = this._projectService.searchProjects(this.createOpenaireQueryParams(),(page==1)? this.refineFieldsQuery:null, page, size, (page==1)?this.refineFields:[], this.properties).subscribe( data => { if (data != null) { diff --git a/services/searchProjects.service.ts b/services/searchProjects.service.ts index f3b99997..7ed5caf8 100644 --- a/services/searchProjects.service.ts +++ b/services/searchProjects.service.ts @@ -50,11 +50,11 @@ export class SearchProjectsService { //.map(res => res.json()) .pipe(map(res => [res['meta'].total, this.parseResults(res['results'])])); } - advancedSearchProjects (params: string, page: number, size: number, properties:EnvProperties, refineParams:string=null, refineFields:string[] =null, refineQuery:string = null, minRef: boolean = false):any { + advancedSearchProjects (params: string, page: number, size: number, properties:EnvProperties, refineParams:string=null, refineFields:string[] =null, refineQuery:string = null, minRef: boolean = false, excludeUnidentfied: boolean = true):any { // &type=projects let url = properties.searchAPIURLLAst+"resources2/?format=json"; // var basicQuery = "(oaftype exact project) " - var basicQuery = "&fq=(projectcode<>\"unidentified\")"; + var basicQuery = excludeUnidentfied ? "&fq=(projectcode<>\"unidentified\")" : ""; // url += "?query="; if(params!= null && params != '' ) { url +="&query=(" + params + ")"; From 1f00fae364b54dc5f3a0d36b37b7b74be59d7a3e Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 9 Jul 2024 16:26:48 +0300 Subject: [PATCH 15/19] [develop | DONE | FIXED]: orcid.component.ts: Typo fixes in message shown when granting access to OpenAIRE. --- orcid/orcid.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orcid/orcid.component.ts b/orcid/orcid.component.ts index 2ae4a8cd..20897a59 100644 --- a/orcid/orcid.component.ts +++ b/orcid/orcid.component.ts @@ -95,7 +95,7 @@ export class OrcidComponent { window.close(); } setTimeout(() => { - this.message += "
If this widnow does not close authomatically, please close it and continue!
"; + this.message += "
If this window does not close automatically, please close it and continue!
"; }, 3000); } else { this.message = "
Thank you for connecting your ORCID iD with OpenAIRE!
" + From 403fe375e7ae49bd74b46294e154fa507d3409bd Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 9 Jul 2024 17:11:55 +0300 Subject: [PATCH 16/19] [develop | DONE | ADDED]: Added compact view functionality on search pages. 1. newSearchPage.component.html: Increase left margin of download button | Added button for compact view | In added parameter "compactView". 2. newSearchPage.component.html: Added class fields "@Input() hasCompactView: boolean = false;", to show compact button or not and "public compactView: boolean = false;" to show compact or expanded view of each result. 3. searchDownload.component.ts: Changed download + + ` diff --git a/searchPages/searchUtils/searchResult.component.html b/searchPages/searchUtils/searchResult.component.html index e06fb724..ff198c7c 100644 --- a/searchPages/searchUtils/searchResult.component.html +++ b/searchPages/searchUtils/searchResult.component.html @@ -3,7 +3,7 @@
  • + [isCard]="true" [isMobile]="isMobile" [prevPath]="prevPath" [compactView]="compactView">
  • diff --git a/searchPages/searchUtils/searchResult.component.ts b/searchPages/searchUtils/searchResult.component.ts index 881578d8..cd2467d5 100644 --- a/searchPages/searchUtils/searchResult.component.ts +++ b/searchPages/searchUtils/searchResult.component.ts @@ -24,6 +24,8 @@ export class SearchResultComponent implements OnInit, OnChanges { @Input() custom_class: string = ""; @Input() properties: EnvProperties; @Input() showEnermaps: boolean; + @Input() compactView: boolean = false; // if true, show less info (e.g. hide description) on each result + public isMobile: boolean = false; private subscriptions: any[] = []; diff --git a/utils/entity-actions/entity-actions.component.ts b/utils/entity-actions/entity-actions.component.ts index bf2c628a..b4d218e0 100644 --- a/utils/entity-actions/entity-actions.component.ts +++ b/utils/entity-actions/entity-actions.component.ts @@ -10,14 +10,14 @@ import {EnvProperties} from "../properties/env-properties"; @Component({ selector: 'entity-actions', template: ` -
    +
    @@ -25,14 +25,14 @@ import {EnvProperties} from "../properties/env-properties"; [attr.uk-tooltip]="showTooltip ? 'title: Share this '+getTypeName()+' in your social networks; pos: bottom; cls: uk-active uk-text-small uk-padding-small' : 'cls: uk-invisible'" class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'"> - Share + Share
    @@ -40,7 +40,7 @@ import {EnvProperties} from "../properties/env-properties"; [attr.uk-tooltip]="showTooltip ? 'title: Find a repository to deposit or publish your research in Open Access; pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium' : 'cls: uk-invisible'" class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'"> - Deposit + Deposit
    @@ -48,7 +48,7 @@ import {EnvProperties} from "../properties/env-properties"; [attr.uk-tooltip]="showTooltip ? 'title: Embed the related '+openaireEntities.RESULTS+' of this '+getTypeName()+' in your website; pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium' : 'cls: uk-invisible'" class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'"> - Embed + Embed
    @@ -96,6 +96,7 @@ export class EntityActionsComponent implements OnInit { @Input() url: string; @Input() isMobile: boolean = false; @Input() showTooltip: boolean = true; + @Input() compactView: boolean = false; // if true, do not show label for actions public citeThisClicked: boolean; public routerHelper: RouterHelper = new RouterHelper(); @ViewChild('citeModal') citeModal; @@ -103,8 +104,8 @@ export class EntityActionsComponent implements OnInit { @ViewChild('addThisModal') addThisModal; properties: EnvProperties = properties; openaireEntities = OpenaireEntities; - - + + /* Embed */ public embed_research_results_type: string = "result"; public clipboard; diff --git a/utils/result-preview/result-preview.component.html b/utils/result-preview/result-preview.component.html index 57caefb0..01ebc125 100644 --- a/utils/result-preview/result-preview.component.html +++ b/utils/result-preview/result-preview.component.html @@ -32,7 +32,7 @@
    -
    +
    @@ -48,7 +48,7 @@
    - -
    +
    -
    +
    @@ -114,17 +114,17 @@
    -
    - - Overall Budget: - {{result.budget | number}} - {{result.currency}} - - - Funder Contribution: - {{result.contribution | number}} - {{result.currency}} - +
    + + Overall Budget: + {{result.budget | number}} + {{result.currency}} + + + Funder Contribution: + {{result.contribution | number}} + {{result.currency}} +
    @@ -132,11 +132,11 @@ [showAll]=true [showInline]="showInline">
    -
    +
    -
    Website URL: @@ -146,7 +146,7 @@
    -
    -
    +

    @@ -177,7 +177,7 @@
    + class="uk-text-small" [class.uk-margin-top]="!compactView" [class.uk-border-bottom]="!isMobile">
    + [showTooltip]="false" [compactView]="compactView"> + [putCodes]="result.orcidPutCodes" [givenPutCode]="true" [identifiers]="result.identifiers" + [compactView]="compactView"> @@ -226,7 +227,7 @@ - Access Routes + Access Routes
    diff --git a/utils/result-preview/result-preview.component.ts b/utils/result-preview/result-preview.component.ts index 539eccb9..6ab8d500 100644 --- a/utils/result-preview/result-preview.component.ts +++ b/utils/result-preview/result-preview.component.ts @@ -43,6 +43,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges { @Input() showInline: boolean = false; // do not open modal for "view more" when this is true @Input() isDeletedByInferenceModal: boolean = false; // do not show action bar in results when in "Other versions" modal section @Input() showEntityActions: boolean = true; // we can use this instead of the above as it is more generic + @Input() compactView: boolean = false; // if true, show less info (e.g. hide description) on each result /* Metadata */ public type: string; From 0896d5a3ceba923b6958cd8ec55fca308302deaa Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Tue, 9 Jul 2024 17:19:13 +0300 Subject: [PATCH 17/19] [develop | DONE | CHANGED]: searchResearchResults.component.ts & searchProjects.component.ts & searchOrganizations.component.ts & searchDataProviders.component.ts: In added parameter [hasCompactView]="true" to enable compact view button. --- searchPages/searchDataProviders.component.ts | 4 ++-- searchPages/searchOrganizations.component.ts | 3 ++- searchPages/searchProjects.component.ts | 3 ++- searchPages/searchResearchResults.component.ts | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/searchPages/searchDataProviders.component.ts b/searchPages/searchDataProviders.component.ts index 9df47832..46acfebc 100644 --- a/searchPages/searchDataProviders.component.ts +++ b/searchPages/searchDataProviders.component.ts @@ -44,8 +44,8 @@ import {zip} from "rxjs"; [showResultCount]="true" [showIndexInfo]="type!='deposit'" [tableViewLink]="tableViewLink" [sort]="false" [showBreadcrumb]="showBreadcrumb" [basicMetaDescription]="metaDescription" - (filterRequestAll)="filterRequestedAll($event)"> - + (filterRequestAll)="filterRequestedAll($event)" + [hasCompactView]="true"> ` diff --git a/searchPages/searchOrganizations.component.ts b/searchPages/searchOrganizations.component.ts index a5276ada..bfe5aab6 100644 --- a/searchPages/searchOrganizations.component.ts +++ b/searchPages/searchOrganizations.component.ts @@ -39,7 +39,8 @@ import {zip} from "rxjs"; [simpleView]="simpleView" formPlaceholderText="Search by organization name..." [showSwitchSearchLink]="showSwitchSearchLink" [showBreadcrumb]="showBreadcrumb" - (filterRequestAll)="filterRequestedAll($event)"> + (filterRequestAll)="filterRequestedAll($event)" + [hasCompactView]="true"> ` }) diff --git a/searchPages/searchProjects.component.ts b/searchPages/searchProjects.component.ts index cb90599d..764289e6 100644 --- a/searchPages/searchProjects.component.ts +++ b/searchPages/searchProjects.component.ts @@ -38,7 +38,8 @@ import {zip} from "rxjs"; [simpleView]="simpleView" formPlaceholderText="Search by title, acronym, project code..." [showSwitchSearchLink]="showSwitchSearchLink" [sort]="false" [showBreadcrumb]="showBreadcrumb" - (filterRequestAll)="filterRequestedAll($event)"> + (filterRequestAll)="filterRequestedAll($event)" + [hasCompactView]="true"> ` diff --git a/searchPages/searchResearchResults.component.ts b/searchPages/searchResearchResults.component.ts index 33ea7fcc..7c361225 100644 --- a/searchPages/searchResearchResults.component.ts +++ b/searchPages/searchResearchResults.component.ts @@ -44,6 +44,7 @@ import {zip} from "rxjs"; [includeOnlyResultsAndFilter]="includeOnlyResultsAndFilter" [showBreadcrumb]="showBreadcrumb" [showSwitchSearchLink]="showSwitchSearchLink" [stickyForm]="stickyForm" + [hasCompactView]="true" (filterRequestAll)="filterRequestedAll($event)" > From 7a18b65b40c151cabbee93998f8ced4683ed0a90 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Thu, 11 Jul 2024 16:35:19 +0300 Subject: [PATCH 18/19] [develop | DONE | CHANGED]: parsingFunctions.class.ts & showSubjects.component.ts: Removed checks for production environment - now show everything under keywords. --- .../landing-utils/parsingFunctions.class.ts | 10 ++-- .../landing-utils/showSubjects.component.ts | 53 +++++++++---------- 2 files changed, 31 insertions(+), 32 deletions(-) diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index 8e631278..240c7093 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -698,11 +698,11 @@ export class ParsingFunctions { if (!classifiedSubjects.has(subject.classname)) { classifiedSubjects.set(subject.classname, new Array()); } - if(properties.environment == "production") { - classifiedSubjects.get(subject.classname).push(content); - } else { + // if(properties.environment == "production") { + // classifiedSubjects.get(subject.classname).push(content); + // } else { classifiedSubjects.get(subject.classname).push(subject.classid + ": " + content); - } + // } // } } } else { @@ -723,7 +723,7 @@ export class ParsingFunctions { } } - if(properties.environment != "production" && classifiedSubjects != null) { + if(classifiedSubjects != null) { if (subjects == undefined) { subjects = new Array(); } diff --git a/landingPages/landing-utils/showSubjects.component.ts b/landingPages/landing-utils/showSubjects.component.ts index df8255bd..1dfaa20d 100644 --- a/landingPages/landing-utils/showSubjects.component.ts +++ b/landingPages/landing-utils/showSubjects.component.ts @@ -13,20 +13,19 @@ import {properties} from "../../../../environments/environment"; @Component({ selector: 'showSubjects', template: ` - -
    - Subjects by Vocabulary -
    - - -
    - View all -
    -
    + + + + + + + + + + -
    +
    Keywords
    @@ -35,7 +34,7 @@ import {properties} from "../../../../environments/environment";
    - +
    EOSC Subjects @@ -89,21 +88,21 @@ import {properties} from "../../../../environments/environment";
    -

    - - - - EOSC: - - - - {{subject.value}} - - - -

    + + + + + + + + + + + + + -

    +

    {{getValue(eoscSubjects).join(', ')}}

    From 92f799e63b8f2075278faf460852776e5fbe5704 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Thu, 11 Jul 2024 17:00:09 +0300 Subject: [PATCH 19/19] [develop]: Fix the redirection URL after verification of a manager for Irish and Monitor. --- role-verification/role-verification.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/role-verification/role-verification.component.ts b/role-verification/role-verification.component.ts index 5d8c7faf..89a6415c 100644 --- a/role-verification/role-verification.component.ts +++ b/role-verification/role-verification.component.ts @@ -206,7 +206,7 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit, this.error = null; if(this.service === "irish" || this.service === "monitor") { this.loading = false; - this.userManagementService.login(properties.domain + '/admin/' + this.verification.entity); + this.userManagementService.login(properties.domain + properties.baseLink + '/admin/' + this.verification.entity); } else { this.subscriptions.push(this.emailService.notifyManagers(this.id, 'manager', Composer.composeEmailToInformOldManagersForTheNewOnes(this.name, this.id)).subscribe(() => {