From 698174e302bbd081d7d13b1fda3e07f07f341c12 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Fri, 26 May 2023 14:46:53 +0300 Subject: [PATCH 1/2] [Connect Admin | develop]: app.component.ts: Added in menu "Fields of Science" and "Sustainable Development Goals". --- src/app/app.component.ts | 5 ++++- src/app/openaireLibrary | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 74d22ca..5bb21a9 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -272,7 +272,10 @@ export class AppComponent implements OnInit { new MenuItem("", "Sources and methodology", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/content", "", false, [], ["/content"], null, null, null, null, null, "_self"), new MenuItem("", "National Bulletins", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/national-bulletins", "", false, [], ["/national-bulletins"], null, null, null, null, null, "_self"), new MenuItem("", "Subjects", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/subjects", "", false, [], ["/subjects"], null, null, null, null, null, "_self"), - new MenuItem("", "Projects and funding Opportunities", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/projects", "", false, [], ["/projects"], null, null, null, null, null, "_self") + new MenuItem("", "Projects and funding Opportunities", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/projects", "", false, [], ["/projects"], null, null, null, null, null, "_self"), + new MenuItem("", "Fields of Science", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/fields-of-science", "", false, [], ["/fields-of-science"], null, null, null, null, null, "_self"), + new MenuItem("", "Sustainable Development Goals", "https://"+(properties.environment == "beta" ? "beta." : "")+this.community.communityId+".openaire.eu/sdgs", "", false, [], ["/sdgs"], null, null, null, null, null, "_self"), + ] ) ); diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 39a7ed5..3ee89e2 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 39a7ed58be27513c05598edc18cf095eb5b044c5 +Subproject commit 3ee89e2bcae313a1ac82cfb678c4476ec1e9905f From 2c9e3e304d07e25c3c070cb02ce392ac0a667976 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Fri, 26 May 2023 15:33:29 +0300 Subject: [PATCH 2/2] [Connect Admin | develop]: connect-admin-customization.component.ts: [Bug fix] Set savingChanges to false when all css are updated and set it to true when purging caches. --- .../connect-admin-customization.component.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/app/pages/connect-admin-customization/connect-admin-customization.component.ts b/src/app/pages/connect-admin-customization/connect-admin-customization.component.ts index 6fe15b4..df51cff 100644 --- a/src/app/pages/connect-admin-customization/connect-admin-customization.component.ts +++ b/src/app/pages/connect-admin-customization/connect-admin-customization.component.ts @@ -42,6 +42,8 @@ declare var UIkit; export class ConnectAdminCustomizationComponent implements OnInit { private subscriptions: any[] = []; savingChanges = false; + cssCreated: number = 0; + totalLayouts: number = 0; community; properties = properties; @@ -66,6 +68,7 @@ export class ConnectAdminCustomizationComponent implements OnInit { let defaultCssIsSaved = false; this.subscriptions.push(this.customizationService.getLayouts(properties, ).subscribe(layouts => { + this.totalLayouts = layouts ? layouts.length : 0; for(let layout of layouts){ layout.date = date; if(layout.portalPid == 'connect'){ @@ -79,11 +82,13 @@ export class ConnectAdminCustomizationComponent implements OnInit { } } if(!connectCssIsSaved){ + this.totalLayouts++; let layout = new Layout("connect", null); layout.date = date; this.callSaveAndCreate(layout, "connect") } if(!defaultCssIsSaved){ + this.totalLayouts++; let layout = new Layout("default", null); layout.date = date; this.callSaveAndCreate(layout, "connect") @@ -100,16 +105,22 @@ export class ConnectAdminCustomizationComponent implements OnInit { pos: 'bottom-right' }); + this.cssCreated++; + if(this.cssCreated == this.totalLayouts) { + this.savingChanges = false; + } })); })); } purgeBrowserCache() { + this.savingChanges = true; this.subscriptions.push(this.communitiesService.getCommunities(this.properties, this.properties.communityAPI + 'communities').subscribe( communities => { communities.forEach(community => { this._clearCacheService.purgeBrowserCache("Layout added/ updated", community.communityId); }); + this.savingChanges = false; } )); this._clearCacheService.purgeBrowserCache("Layout added/ updated", "connect");