From 92b5d7bb333f54f798cf84ade2681e1b8a0286c6 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Thu, 11 Aug 2022 12:58:20 +0300 Subject: [PATCH] [Connect Admin | Library | new-theme]: Added call to purge browser cache when updating content of community. 1. env-properties.ts & environments/: Added property "deleteBrowserCacheUrl". 2. clear-cache.service.ts: Added method "purgeBrowserCache()" to purge browser cache for a specific community. 3. entities.component.ts & menu.component.ts & pages.component.ts & affiliations.component.ts & edit-community.component.ts add-content-providers.component.ts & remove-content-providers.component.ts & add-projects.component.ts & remove-projects.component.ts & subjects-edit-form.component.ts & personal-info.component.ts & customization.component.ts: Call "_clearCacheService.purgeBrowserCache()" when adding/updating/deleting content of a specific community. 4. connect-admin-customization.module.ts: Added CommunitiesService in providers. 5. connect-admin-customization.component.ts: Added button to purge browser cache for all communities and connect. --- src/app/openaireLibrary | 2 +- .../affiliations/affiliations.component.ts | 7 ++++++- .../edit-community/edit-community.component.ts | 2 ++ .../connect-admin-customization.component.ts | 18 +++++++++++++++++- .../connect-admin-customization.module.ts | 3 ++- .../add-content-providers.component.ts | 13 +++++++------ .../remove-content-providers.component.ts | 9 +++++---- .../customization/customization.component.ts | 8 ++++---- .../pages/projects/add-projects.component.ts | 9 ++++++--- .../projects/remove-projects.component.ts | 5 ++++- .../subjects-edit-form.component.ts | 8 ++++---- .../personal-info/personal-info.component.ts | 6 +++++- src/assets/common-assets | 2 +- src/environments/environment.beta.ts | 1 + src/environments/environment.ts | 1 + 15 files changed, 66 insertions(+), 28 deletions(-) diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index f8f606a..27d7c7c 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit f8f606ada7d1db53a2ee3566ac601abf640a2187 +Subproject commit 27d7c7c118a363c2db3deb8ee13ff8801ebed3a8 diff --git a/src/app/pages/affiliations/affiliations.component.ts b/src/app/pages/affiliations/affiliations.component.ts index a7637d5..7bdf7e3 100644 --- a/src/app/pages/affiliations/affiliations.component.ts +++ b/src/app/pages/affiliations/affiliations.component.ts @@ -16,6 +16,7 @@ import {CommunityService} from "../../openaireLibrary/connect/community/communit import {CommunityInfo} from "../../openaireLibrary/connect/community/communityInfo"; import {NotificationHandler} from "../../openaireLibrary/utils/notification-handler"; import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class"; +import {ClearCacheService} from "../../openaireLibrary/services/clear-cache.service"; @Component({ selector: 'affiliations', @@ -41,7 +42,8 @@ export class AffiliationsComponent implements OnInit, OnDestroy { private fb: FormBuilder, private communityService: CommunityService, private affiliationService: AffiliationService, - private helpContentService: HelpContentService) { + private helpContentService: HelpContentService, + private _clearCacheService: ClearCacheService) { } @@ -147,6 +149,7 @@ export class AffiliationsComponent implements OnInit, OnDestroy { } else { this.affiliations[this.index] = affiliation; } + this._clearCacheService.purgeBrowserCache("Organization added/ updated", this.community.communityId); if (affiliation.id) { this.handleUpdateSuccess('Your organization has been updated successfully!'); } else { @@ -167,6 +170,7 @@ export class AffiliationsComponent implements OnInit, OnDestroy { if (this.currentPage.length === 0) { this.page = 1; } + this._clearCacheService.purgeBrowserCache("Organization deleted", this.community.communityId); this.handleUpdateSuccess('Organization has been deleted'); }, error => { @@ -193,6 +197,7 @@ export class AffiliationsComponent implements OnInit, OnDestroy { enableAffiliations() { this.helpContentService.togglePages(this.community.communityId, [this.organizationsPage._id], true, this.properties.adminToolsAPIURL).subscribe(() => { this.organizationsPage.isEnabled = true; + this._clearCacheService.purgeBrowserCache("Organizations Page enabled", this.community.communityId); NotificationHandler.rise('Organizations Page has been enabled successfully'); }, error => { this.handleUpdateError('An error has been occurred. Try again later!'); diff --git a/src/app/pages/community-info/profile/edit-community/edit-community.component.ts b/src/app/pages/community-info/profile/edit-community/edit-community.component.ts index 42253a9..d7567c9 100644 --- a/src/app/pages/community-info/profile/edit-community/edit-community.component.ts +++ b/src/app/pages/community-info/profile/edit-community/edit-community.component.ts @@ -214,6 +214,7 @@ export class EditCommunityComponent { this.subscriptions.push(this.communityService.updateCommunity( this.properties.communityAPI + this.community.communityId, this.communityFb.getRawValue()).subscribe(() => { this._clearCacheService.clearCache("Community saved"); + this._clearCacheService.purgeBrowserCache("Community saved", this.community.communityId); this.communityService.getCommunity(this.community.communityId, true).subscribe(community => { NotificationHandler.rise(community.shortTitle + ' has been successfully created'); callback(community); @@ -227,6 +228,7 @@ export class EditCommunityComponent { } else { this.subscriptions.push(this.communityService.updateCommunity(this.properties.communityAPI + this.community.communityId, this.communityFb.getRawValue()).subscribe(() => { this._clearCacheService.clearCache("Community updated"); + this._clearCacheService.purgeBrowserCache("Community updated", this.community.communityId); this.communityService.getCommunity(this.community.communityId, true).subscribe(community => { NotificationHandler.rise(community.shortTitle + ' has been successfully saved'); callback(community); 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 6cb62f8..3a82430 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 @@ -3,6 +3,9 @@ import {Subscription} from 'rxjs'; import {CustomizationService} from "../../openaireLibrary/services/customization.service"; import {properties} from "../../../environments/environment"; import {Layout} from "../../openaireLibrary/connect/community/CustomizationOptions"; +import {ClearCacheService} from "../../openaireLibrary/services/clear-cache.service"; +import {CommunitiesService} from "../../openaireLibrary/connect/communities/communities.service"; + declare var UIkit; @Component({ @@ -27,6 +30,7 @@ declare var UIkit; Press the following button to update the timestamp in the saved layouts and recreate the css files. +
@@ -49,7 +53,8 @@ export class ConnectAdminCustomizationComponent implements OnInit { community; properties = properties; - constructor( private customizationService: CustomizationService) { + constructor( private customizationService: CustomizationService, private _clearCacheService: ClearCacheService, + private communitiesService: CommunitiesService) { } ngOnInit() { @@ -113,4 +118,15 @@ export class ConnectAdminCustomizationComponent implements OnInit { })); } } + + purgeBrowserCache() { + 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._clearCacheService.purgeBrowserCache("Layout added/ updated", "connect"); + } } diff --git a/src/app/pages/connect-admin-customization/connect-admin-customization.module.ts b/src/app/pages/connect-admin-customization/connect-admin-customization.module.ts index 7d0c926..f91f7f3 100644 --- a/src/app/pages/connect-admin-customization/connect-admin-customization.module.ts +++ b/src/app/pages/connect-admin-customization/connect-admin-customization.module.ts @@ -7,12 +7,13 @@ import {ConnectAdminCustomizationRoutingModule} from "./connect-admin-customizat import {PageContentModule} from "../../openaireLibrary/dashboard/sharedComponents/page-content/page-content.module"; import {CustomizationService} from "../../openaireLibrary/services/customization.service"; import {InputModule} from "../../openaireLibrary/sharedComponents/input/input.module"; +import {CommunitiesService} from "../../openaireLibrary/connect/communities/communities.service"; @NgModule({ imports: [ CommonModule, RouterModule, AdminTabsModule, ConnectAdminCustomizationRoutingModule, PageContentModule, InputModule ], - providers: [CustomizationService], + providers: [CustomizationService, CommunitiesService], declarations: [ConnectAdminCustomizationComponent], exports: [ConnectAdminCustomizationComponent] }) diff --git a/src/app/pages/content-providers/add-content-providers.component.ts b/src/app/pages/content-providers/add-content-providers.component.ts index 9540212..08f29f8 100644 --- a/src/app/pages/content-providers/add-content-providers.component.ts +++ b/src/app/pages/content-providers/add-content-providers.component.ts @@ -1,4 +1,4 @@ -import {Component, OnInit, Input, Output, EventEmitter, ViewChild} from '@angular/core'; +import {Component, EventEmitter, Input, OnInit, Output, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from "@angular/router"; import {SearchResult} from '../../openaireLibrary/utils/entities/searchResult'; import {ErrorCodes} from '../../openaireLibrary/utils/properties/errorCodes'; @@ -8,8 +8,6 @@ import {SearchDataprovidersService} from '../../openaireLibrary/services/searchD import {RouterHelper} from '../../openaireLibrary/utils/routerHelper.class'; import {StringUtils} from '../../openaireLibrary/utils/string-utils.class'; import {ManageCommunityContentProvidersService} from '../../services/manageContentProviders.service'; -import {Session} from '../../openaireLibrary/login/utils/helper.class'; -import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; import {properties} from "../../../environments/environment"; import {FormBuilder, FormGroup} from "@angular/forms"; import {SearchInputComponent} from "../../openaireLibrary/sharedComponents/search-input/search-input.component"; @@ -20,7 +18,7 @@ import {NotificationHandler} from "../../openaireLibrary/utils/notification-hand import {CommunityInfo} from "../../openaireLibrary/connect/community/communityInfo"; import {ContentProvider} from "../../openaireLibrary/utils/entities/contentProvider"; import {OpenaireEntities} from "../../openaireLibrary/utils/properties/searchFields"; -import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class"; +import {ClearCacheService} from "../../openaireLibrary/services/clear-cache.service"; @Component({ selector: 'add-content-providers', @@ -50,6 +48,7 @@ export class AddContentProvidersComponent implements OnInit { constructor(private route: ActivatedRoute, private router: Router, private searchDataprovidersService: SearchDataprovidersService, private manageCommunityContentProvidersService: ManageCommunityContentProvidersService, + private _clearCacheService: ClearCacheService, private fb: FormBuilder) { this.errorCodes = new ErrorCodes(); this.openaireSearchUtils.status = this.errorCodes.LOADING; @@ -107,7 +106,8 @@ export class AddContentProvidersComponent implements OnInit { this.subscriptions.push(this.manageCommunityContentProvidersService.addContentProvider(this.properties, this.community.communityId, contentProvider).subscribe( data => { this.communityContentProviders.push(data); - NotificationHandler.rise('Content Provider successfully added!') + this._clearCacheService.purgeBrowserCache(this.openAIREEntities.DATASOURCE+" added", this.community.communityId); + NotificationHandler.rise(this.openAIREEntities.DATASOURCE+' successfully added!') this.communityContentProvidersChanged.emit({ value: this.communityContentProviders, }); @@ -125,7 +125,8 @@ export class AddContentProvidersComponent implements OnInit { data => { let index = this.communityContentProviders.indexOf(communityContentProvider); this.communityContentProviders.splice(index, 1); - NotificationHandler.rise('Content Provider successfully removed!') + this._clearCacheService.purgeBrowserCache(this.openAIREEntities.DATASOURCE+" removed", this.community.communityId); + NotificationHandler.rise(this.openAIREEntities.DATASOURCE+' successfully removed!') this.communityContentProvidersChanged.emit({ value: this.communityContentProviders, }); diff --git a/src/app/pages/content-providers/remove-content-providers.component.ts b/src/app/pages/content-providers/remove-content-providers.component.ts index e47b6f7..06e0811 100644 --- a/src/app/pages/content-providers/remove-content-providers.component.ts +++ b/src/app/pages/content-providers/remove-content-providers.component.ts @@ -5,9 +5,7 @@ import {Subscriber} from 'rxjs'; import {ErrorCodes} from '../../openaireLibrary/utils/properties/errorCodes'; import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; import {ManageCommunityContentProvidersService} from '../../services/manageContentProviders.service'; -import { - SearchCommunityDataprovidersService -} from '../../openaireLibrary/connect/contentProviders/searchDataproviders.service'; +import {SearchCommunityDataprovidersService} from '../../openaireLibrary/connect/contentProviders/searchDataproviders.service'; import {RouterHelper} from '../../openaireLibrary/utils/routerHelper.class'; import {ContentProvider, Criteria} from '../../openaireLibrary/utils/entities/contentProvider'; import {properties} from "../../../environments/environment"; @@ -19,6 +17,7 @@ import {NotificationHandler} from "../../openaireLibrary/utils/notification-hand import {AlertModal} from "../../openaireLibrary/utils/modal/alert"; import {OpenaireEntities} from "../../openaireLibrary/utils/properties/searchFields"; import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class"; +import {ClearCacheService} from "../../openaireLibrary/services/clear-cache.service"; @Component({ selector: 'remove-content-providers', @@ -55,7 +54,8 @@ export class RemoveContentProvidersComponent implements OnInit { constructor(private route: ActivatedRoute, private _router: Router, private _fb: FormBuilder, private _manageCommunityContentProvidersService: ManageCommunityContentProvidersService, - private _searchCommunityContentProvidersService: SearchCommunityDataprovidersService) { + private _searchCommunityContentProvidersService: SearchCommunityDataprovidersService, + private _clearCacheService: ClearCacheService) { } ngOnInit() { @@ -101,6 +101,7 @@ export class RemoveContentProvidersComponent implements OnInit { let index = this.communityContentProviders.indexOf(this.selectedCommunityContentProvider); this.communityContentProviders.splice(index, 1); this.applyFilters(); + this._clearCacheService.purgeBrowserCache(this.openAIREEntities.DATASOURCE+" removed", this.community.communityId); this.handleSuccess(this.openAIREEntities.DATASOURCE + ' successfully removed!') this.communityContentProvidersChanged.emit({ value: this.communityContentProviders, diff --git a/src/app/pages/customization/customization.component.ts b/src/app/pages/customization/customization.component.ts index 6b1dff8..bad626d 100644 --- a/src/app/pages/customization/customization.component.ts +++ b/src/app/pages/customization/customization.component.ts @@ -7,15 +7,13 @@ import {Session} from '../../openaireLibrary/login/utils/helper.class'; import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.class'; import {DomSanitizer, Title} from '@angular/platform-browser'; import {CustomizationOptions, Layout} from '../../openaireLibrary/connect/community/CustomizationOptions'; -import {StringUtils} from '../../openaireLibrary/utils/string-utils.class'; import {CustomizationService} from '../../openaireLibrary/services/customization.service'; import {properties} from '../../../environments/environment'; import {UtilitiesService} from '../../openaireLibrary/services/utilities.service'; import {Subscription} from 'rxjs'; -import {FullScreenModalComponent} from "../../openaireLibrary/utils/modal/full-screen-modal/full-screen-modal.component"; import {UserManagementService} from "../../openaireLibrary/services/user-management.service"; -import {MenuItem} from "../../openaireLibrary/sharedComponents/menu"; import {AlertModal} from "../../openaireLibrary/utils/modal/alert"; +import {ClearCacheService} from "../../openaireLibrary/services/clear-cache.service"; declare var UIkit; @@ -103,7 +101,8 @@ sidebarItems = [{name:"Identity", id : "identity", icon: "desktop_windows" }, private sanitizer: DomSanitizer, private layoutService: CustomizationService, private utilsService: UtilitiesService, - private userManagementService: UserManagementService) { + private userManagementService: UserManagementService, + private _clearCacheService: ClearCacheService) { } ngOnDestroy() { @@ -175,6 +174,7 @@ sidebarItems = [{name:"Identity", id : "identity", icon: "desktop_windows" }, this.publishedLayout.date = new Date(); this.subscriptions.push(this.layoutService.saveLayout(this.properties, this.communityId, this.publishedLayout).subscribe(layout => { this.publishedLayout._id = layout._id; + this._clearCacheService.purgeBrowserCache("Layout added/ updated", this.communityId); this.subscriptions.push(this.layoutService.createCSS(this.communityId,this.properties.connectPortalUrl, this.publishedLayout.date.valueOf(), this.publishedLayout.layoutOptions).subscribe(data => { console.log(data) diff --git a/src/app/pages/projects/add-projects.component.ts b/src/app/pages/projects/add-projects.component.ts index 5981873..0aed133 100644 --- a/src/app/pages/projects/add-projects.component.ts +++ b/src/app/pages/projects/add-projects.component.ts @@ -18,7 +18,7 @@ import {SearchInputComponent} from "../../openaireLibrary/sharedComponents/searc import {CommunityInfo} from "../../openaireLibrary/connect/community/communityInfo"; import {OpenaireEntities} from "../../openaireLibrary/utils/properties/searchFields"; import {Filter, Value} from "../../openaireLibrary/searchPages/searchUtils/searchHelperClasses.class"; -import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class"; +import {ClearCacheService} from "../../openaireLibrary/services/clear-cache.service"; declare var UIkit; @@ -58,6 +58,7 @@ export class AddProjectsComponent implements OnInit { constructor(private route: ActivatedRoute, private _router: Router, private _searchProjectsService: SearchProjectsService, private _manageCommunityProjectsService: ManageCommunityProjectsService, + private _clearCacheService: ClearCacheService, private _fb: FormBuilder) { this.errorCodes = new ErrorCodes(); this.openaireSearchUtils.status = this.errorCodes.LOADING; @@ -121,7 +122,8 @@ export class AddProjectsComponent implements OnInit { this.subscriptions.push(this._manageCommunityProjectsService.addProject(this.properties, this.community.communityId, project).subscribe( data => { this.communityProjects.push(data); - UIkit.notification('Project successfully added!', { + this._clearCacheService.purgeBrowserCache(this.openaireEntities.PROJECT+" added", this.community.communityId); + UIkit.notification(this.openaireEntities.PROJECT+' successfully added!', { status: 'success', timeout: 6000, pos: 'bottom-right' @@ -144,7 +146,8 @@ export class AddProjectsComponent implements OnInit { data => { let index = this.communityProjects.indexOf(communityProject); this.communityProjects.splice(index, 1); - UIkit.notification('Project successfully removed!', { + this._clearCacheService.purgeBrowserCache(this.openaireEntities.PROJECT+" removed", this.community.communityId); + UIkit.notification(this.openaireEntities.PROJECT+' successfully removed!', { status: 'success', timeout: 6000, pos: 'bottom-right' diff --git a/src/app/pages/projects/remove-projects.component.ts b/src/app/pages/projects/remove-projects.component.ts index ceee48f..bf48613 100644 --- a/src/app/pages/projects/remove-projects.component.ts +++ b/src/app/pages/projects/remove-projects.component.ts @@ -18,6 +18,7 @@ import {OpenaireEntities} from "../../openaireLibrary/utils/properties/searchFie import {CommunityInfo} from "../../openaireLibrary/connect/community/communityInfo"; import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class"; import {NotificationHandler} from "../../openaireLibrary/utils/notification-handler"; +import {ClearCacheService} from "../../openaireLibrary/services/clear-cache.service"; @Component({ selector: 'remove-projects', @@ -70,7 +71,8 @@ export class RemoveProjectsComponent implements OnInit { private _fb: FormBuilder, private communityService: CommunityService, private _manageCommunityProjectsService: ManageCommunityProjectsService, - private _searchCommunityProjectsService: SearchCommunityProjectsService) { + private _searchCommunityProjectsService: SearchCommunityProjectsService, + private _clearCacheService: ClearCacheService) { this.errorCodes = new ErrorCodes(); this.communitySearchUtils.status = this.errorCodes.LOADING; } @@ -136,6 +138,7 @@ export class RemoveProjectsComponent implements OnInit { let index = this.communityProjects.indexOf(this.selectedCommunityProject); this.communityProjects.splice(index, 1); this.applyFilters(); + this._clearCacheService.purgeBrowserCache(this.openaireEntiites.PROJECT+" removed", this.community.communityId); NotificationHandler.rise(OpenaireEntities.PROJECT+' successfully removed!'); this.communityProjectsChanged.emit({ value: this.communityProjects, diff --git a/src/app/pages/subjects/subjects-edit-form/subjects-edit-form.component.ts b/src/app/pages/subjects/subjects-edit-form/subjects-edit-form.component.ts index f4c00e0..787153d 100644 --- a/src/app/pages/subjects/subjects-edit-form/subjects-edit-form.component.ts +++ b/src/app/pages/subjects/subjects-edit-form/subjects-edit-form.component.ts @@ -4,18 +4,16 @@ import {ActivatedRoute, Router} from '@angular/router'; import {CommunityService} from '../../../openaireLibrary/connect/community/community.service'; import {SubjectsService} from '../subjects.service'; import {EnvProperties} from '../../../openaireLibrary/utils/properties/env-properties'; -import {Session} from '../../../openaireLibrary/login/utils/helper.class'; -import {LoginErrorCodes} from '../../../openaireLibrary/login/utils/guardHelper.class'; import {Title} from '@angular/platform-browser'; import {properties} from '../../../../environments/environment'; import {AlertModal} from '../../../openaireLibrary/utils/modal/alert'; import {SearchInputComponent} from '../../../openaireLibrary/sharedComponents/search-input/search-input.component'; -import {Subscription, zip} from 'rxjs'; +import {Subscription} from 'rxjs'; import {CommunityInfo} from '../../../openaireLibrary/connect/community/communityInfo'; -import {concat} from 'rxjs/operators'; import {FullScreenModalComponent} from 'src/app/openaireLibrary/utils/modal/full-screen-modal/full-screen-modal.component'; import {HelperFunctions} from 'src/app/openaireLibrary/utils/HelperFunctions.class'; import {NotificationHandler} from "../../../openaireLibrary/utils/notification-handler"; +import {ClearCacheService} from "../../../openaireLibrary/services/clear-cache.service"; @Component({ selector: 'subjects-edit-form', @@ -53,6 +51,7 @@ export class SubjectsEditFormComponent implements OnInit { // private _helpContentService: HelpContentService, private _communityService: CommunityService, private _subjectsService: SubjectsService, + private _clearCacheService: ClearCacheService ) { } @@ -196,6 +195,7 @@ export class SubjectsEditFormComponent implements OnInit { this.community.subjects = this.originalSubjects.filter(subject => { return !this.filterForm.value || subject.toLowerCase().indexOf(this.filterForm.value.toLowerCase()) != -1 }).sort(); + this._clearCacheService.purgeBrowserCache("Subject "+message, this.communityId); NotificationHandler.rise('Subject successfully ' + message + '!') this.showLoading = false; } diff --git a/src/app/pages/users/personal-info/personal-info.component.ts b/src/app/pages/users/personal-info/personal-info.component.ts index c5c311b..b5fd0cc 100644 --- a/src/app/pages/users/personal-info/personal-info.component.ts +++ b/src/app/pages/users/personal-info/personal-info.component.ts @@ -16,6 +16,7 @@ import {Page} from "../../../domain/page"; import {CommunityService} from "../../../openaireLibrary/connect/community/community.service"; import {StringUtils} from "../../../openaireLibrary/utils/string-utils.class"; import {CommunityInfo} from "../../../openaireLibrary/connect/community/communityInfo"; +import {ClearCacheService} from "../../../openaireLibrary/services/clear-cache.service"; declare var UIkit; @@ -207,7 +208,8 @@ export class PersonalInfoComponent implements OnInit, OnDestroy { private utilitiesService: UtilitiesService, private helpContentService: HelpContentService, private communityService: CommunityService, - private userManagementService: UserManagementService) { + private userManagementService: UserManagementService, + private _clearCacheService: ClearCacheService) { } @@ -303,6 +305,7 @@ export class PersonalInfoComponent implements OnInit, OnDestroy { saveCurator() { this.curatorService.updateCurator(this.properties, this.curatorFb.value).subscribe((curator) => { if (curator) { + this._clearCacheService.purgeBrowserCache("Curator added/ updated", this.community.communityId); UIkit.notification('Your data has been saved successfully', { status: 'success', timeout: 6000, @@ -475,6 +478,7 @@ export class PersonalInfoComponent implements OnInit, OnDestroy { enableCurators() { this.helpContentService.togglePages(this.community.communityId, [this.curatorsPage._id], true, this.properties.adminToolsAPIURL).subscribe(() => { this.curatorsPage.isEnabled = true; + this._clearCacheService.purgeBrowserCache("Curators page enabled", this.community.communityId); UIkit.notification('Curators Page has been enabled successfully', { status: 'success', timeout: 6000, diff --git a/src/assets/common-assets b/src/assets/common-assets index adf1b6d..14655ae 160000 --- a/src/assets/common-assets +++ b/src/assets/common-assets @@ -1 +1 @@ -Subproject commit adf1b6d5f5e8fb1568615b0fc596a0f39beab3e6 +Subproject commit 14655ae3aa7a50162ef218428a0ccdee35c1aa7b diff --git a/src/environments/environment.beta.ts b/src/environments/environment.beta.ts index 0c8e555..7f13177 100644 --- a/src/environments/environment.beta.ts +++ b/src/environments/environment.beta.ts @@ -46,6 +46,7 @@ export let properties: EnvProperties = { feedbackmailForMissingEntities: "feedback@openaire.eu", cacheUrl: "https://demo.openaire.eu/cache/get?url=", deleteCacheUrl: 'https://demo.openaire.eu/cache/clear', + deleteBrowserCacheUrl: 'https://beta.{pid}.openaire.eu/purge/', adminToolsAPIURL: "https://beta.services.openaire.eu/uoa-admin-tools/", adminToolsCommunity: "openaire", communityAPI: "https://beta.services.openaire.eu/openaire/community/", diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 7adcf9b..46146ed 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -51,6 +51,7 @@ export let properties: EnvProperties = { feedbackmailForMissingEntities: 'feedback@openaire.eu', cacheUrl: 'http://scoobydoo.di.uoa.gr:3000/get?url=', deleteCacheUrl: 'http://duffy.di.uoa.gr:3000/clear', + deleteBrowserCacheUrl: 'https://beta.{pid}.openaire.eu/purge/', adminToolsAPIURL: 'http://duffy.di.uoa.gr:8080/uoa-admin-tools/', adminToolsCommunity: 'openaire', communityAPI: 'https://dev-openaire.d4science.org/openaire/community/',