From 05db37425484d08b22d1788d4c3f921d9cadf501 Mon Sep 17 00:00:00 2001 From: argirok Date: Mon, 1 Jul 2024 16:48:10 +0300 Subject: [PATCH] [plugins-functionality | DONE | Changed ] change clear cache in route to purge browser cache --- .../profile/edit-community/edit-community.component.ts | 4 ++-- .../content-providers/remove-content-providers.component.ts | 1 - src/app/pages/projects/add-projects.component.ts | 1 - src/app/pages/projects/remove-projects.component.ts | 1 - .../subjects-edit-form/subjects-edit-form.component.ts | 1 - 5 files changed, 2 insertions(+), 6 deletions(-) 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 36eb7ad..3885ab0 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 @@ -248,7 +248,7 @@ export class EditCommunityComponent { this.removePhoto(); this.subscriptions.push(this.communityService.updateCommunity( this.properties.communityAPI + this.community.communityId, this.communityFb.getRawValue()).subscribe(() => { - this._clearCacheService.clearCacheInRoute("Community saved",this.community.communityId,"/"); + 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); @@ -261,7 +261,7 @@ export class EditCommunityComponent { })); } else { this.subscriptions.push(this.communityService.updateCommunity(this.properties.communityAPI + this.community.communityId, this.communityFb.getRawValue()).subscribe(() => { - this._clearCacheService.clearCacheInRoute("Community saved",this.community.communityId,"/"); + this._clearCacheService.purgeBrowserCache("Community saved",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/content-providers/remove-content-providers.component.ts b/src/app/pages/content-providers/remove-content-providers.component.ts index 9fe6cae..e71b328 100644 --- a/src/app/pages/content-providers/remove-content-providers.component.ts +++ b/src/app/pages/content-providers/remove-content-providers.component.ts @@ -87,7 +87,6 @@ export class RemoveContentProvidersComponent implements OnInit { let index = this.communityContentProviders.indexOf(this.selectedCommunityContentProvider); this.communityContentProviders.splice(index, 1); this.applyFilters(); - this._clearCacheService.clearCacheInRoute(this.openAIREEntities.DATASOURCE+" removed", this.community.communityId) this._clearCacheService.purgeBrowserCache(this.openAIREEntities.DATASOURCE+" removed", this.community.communityId); this.handleSuccess(this.openAIREEntities.DATASOURCE + ' successfully removed!') this.communityContentProvidersChanged.emit({ diff --git a/src/app/pages/projects/add-projects.component.ts b/src/app/pages/projects/add-projects.component.ts index d2c9c54..7bf8162 100644 --- a/src/app/pages/projects/add-projects.component.ts +++ b/src/app/pages/projects/add-projects.component.ts @@ -123,7 +123,6 @@ export class AddProjectsComponent implements OnInit { this.subscriptions.push(this._manageCommunityProjectsService.addProject(this.properties, this.community.communityId, project).subscribe( data => { // this.communityProjects.push(data); - this._clearCacheService.clearCacheInRoute(this.openaireEntities.PROJECT+" added", this.community.communityId); this._clearCacheService.purgeBrowserCache(this.openaireEntities.PROJECT+" added", this.community.communityId); UIkit.notification(this.openaireEntities.PROJECT+' successfully added!', { diff --git a/src/app/pages/projects/remove-projects.component.ts b/src/app/pages/projects/remove-projects.component.ts index b25cdea..ee87311 100644 --- a/src/app/pages/projects/remove-projects.component.ts +++ b/src/app/pages/projects/remove-projects.component.ts @@ -131,7 +131,6 @@ export class RemoveProjectsComponent implements OnInit { public confirmedDeleteProject(data: any) { this.subscriptions.push(this._manageCommunityProjectsService.removeProject(this.properties, this.community.communityId, this.selectedCommunityProject.openaireId).subscribe( data => { - this._clearCacheService.clearCacheInRoute(this.openaireEntiites.PROJECT+" removed", this.community.communityId); this._clearCacheService.purgeBrowserCache(this.openaireEntiites.PROJECT+" removed", this.community.communityId); NotificationHandler.rise(OpenaireEntities.PROJECT+' successfully removed!'); this._getCommunityProjects(this.communitySearchUtils.page, this.keyword,null); 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 415d749..aa852a0 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 @@ -344,7 +344,6 @@ export class SubjectsEditFormComponent implements OnInit { } }); this._communityService.updateSubjects(this.community.subjects, this.community.fos, this.community.sdg); - this._clearCacheService.clearCacheInRoute("Subjects " + message, this.communityId); this._clearCacheService.purgeBrowserCache("Subjects " + message, this.communityId); NotificationHandler.rise('Subjects successfully ' + message + '!') this.loading = false;