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 ec73a3c..dbfea03 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 @@ -237,8 +237,7 @@ export class EditCommunityComponent { this.removePhoto(); 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._clearCacheService.clearCacheInRoute("Community saved",this.community.communityId,"/"); this.communityService.getCommunity(this.community.communityId, true).subscribe(community => { NotificationHandler.rise(community.shortTitle + ' has been successfully created'); callback(community); @@ -251,8 +250,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._clearCacheService.clearCacheInRoute("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/connect-admin-customization/connect-admin-customization.component.ts b/src/app/pages/connect-admin-customization/connect-admin-customization.component.ts index df51cff..3ed1213 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 @@ -16,14 +16,28 @@ declare var UIkit;
-
-
Use only after connect deployment. And only if there are css updates!
- Press the following button to update the timestamp in the saved layouts and recreate the css files. +
+
+
Use only after connect deployment. And only if there are css updates!
+ Press the following button to update the timestamp in the saved layouts and recreate the css files. +
+ +
- - +
+
Purge ICM cache for all communities
- + +
+
+
+
Reload cache requests either per community or for all communities
+
+
+ + +
+
@@ -45,6 +59,7 @@ export class ConnectAdminCustomizationComponent implements OnInit { cssCreated: number = 0; totalLayouts: number = 0; community; + route; properties = properties; constructor( private customizationService: CustomizationService, private _clearCacheService: ClearCacheService, @@ -133,4 +148,20 @@ export class ConnectAdminCustomizationComponent implements OnInit { })); } } + + forceReloadCache() { + if (this.community) { + this._clearCacheService.clearCacheInRoute("Clear cache", this.community, this.route ? this.route : "/") + } else { + this.savingChanges = true; + this.subscriptions.push(this.communitiesService.getCommunities(this.properties, this.properties.communityAPI + 'communities').subscribe( + communities => { + communities.forEach(community => { + this._clearCacheService.clearCacheInRoute("Clear cache for "+ community.communityId, community.communityId, this.route ? this.route : "/") + }); + this.savingChanges = false; + } + )); + } + } } 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 e71b328..9fe6cae 100644 --- a/src/app/pages/content-providers/remove-content-providers.component.ts +++ b/src/app/pages/content-providers/remove-content-providers.component.ts @@ -87,6 +87,7 @@ 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 7bf8162..d2c9c54 100644 --- a/src/app/pages/projects/add-projects.component.ts +++ b/src/app/pages/projects/add-projects.component.ts @@ -123,6 +123,7 @@ 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 c930aef..b25cdea 100644 --- a/src/app/pages/projects/remove-projects.component.ts +++ b/src/app/pages/projects/remove-projects.component.ts @@ -131,7 +131,7 @@ 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 aa852a0..415d749 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,6 +344,7 @@ 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;