[plugins-functionality | DONE | Changed ] change clear cache in route to purge browser cache

This commit is contained in:
argirok 2024-07-01 16:48:10 +03:00
parent 3077b9b493
commit 94e831c548
7 changed files with 8 additions and 10 deletions

View File

@ -166,7 +166,7 @@ export class ClassContentFormComponent implements OnInit {
this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route}); this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route});
NotificationHandler.rise('Page content has been <b>successfully updated</b>'); NotificationHandler.rise('Page content has been <b>successfully updated</b>');
this.showLoading = false; 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) err => this.handleUpdateError('System error saving page content', err)
)); ));

View File

@ -155,7 +155,7 @@ export class ClassHelpContentsComponent implements OnInit {
this.deletePageHelpContentsFromArray(this.selectedPageContents); this.deletePageHelpContentsFromArray(this.selectedPageContents);
NotificationHandler.rise('Page content(s) has been <b>successfully deleted</b>'); NotificationHandler.rise('Page content(s) has been <b>successfully deleted</b>');
this.showLoading = false; 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) error => this.handleUpdateError('System error deleting the selected page content(s)', error)
)); ));
@ -198,7 +198,7 @@ export class ClassHelpContentsComponent implements OnInit {
this.countClassHelpContents(); this.countClassHelpContents();
this.applyCheck(false); this.applyCheck(false);
NotificationHandler.rise('Page content(s) has been <b>successfully updated</b>'); NotificationHandler.rise('Page content(s) has been <b>successfully updated</b>');
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) error => this.handleUpdateError('System error changing the status of the selected page content(s)', error)
)); ));

View File

@ -345,7 +345,7 @@ export class EntitiesComponent implements OnInit {
this.checkboxes[i].entity.isEnabled = this.toggleStatus; this.checkboxes[i].entity.isEnabled = this.toggleStatus;
} }
this.applyCheck(false); 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); this._clearCacheService.purgeBrowserCache("entity's status changed", this.portal);
}, },
error => this.handleUpdateError('System error changing the status of the selected entity(-ies)', error) error => this.handleUpdateError('System error changing the status of the selected entity(-ies)', error)

View File

@ -199,7 +199,7 @@ export class PageContentFormComponent implements OnInit {
NotificationHandler.rise('Page content has been <b>successfully ' + (this.pageContentId ? 'updated' : 'created') + '</b>'); NotificationHandler.rise('Page content has been <b>successfully ' + (this.pageContentId ? 'updated' : 'created') + '</b>');
this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route}); this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route});
this.showLoading = false; 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) err => this.handleUpdateError('System error saving page content', err)
)); ));

View File

@ -165,7 +165,7 @@ export class PageHelpContentsComponent implements OnInit {
this.deletePageHelpContentsFromArray(this.selectedPageContents); this.deletePageHelpContentsFromArray(this.selectedPageContents);
NotificationHandler.rise('Page content(s) has been <b>successfully deleted</b>'); NotificationHandler.rise('Page content(s) has been <b>successfully deleted</b>');
this.showLoading = false; 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) 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 <b>successfully updated</b>'); NotificationHandler.rise('Page content(s) has been <b>successfully updated</b>');
this.countPageHelpContents(); this.countPageHelpContents();
this.applyCheck(false); 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) error => this.handleUpdateError('System error changing the status of the selected page content(s)', error)
)); ));

View File

@ -415,7 +415,6 @@ export class PagesComponent implements OnInit {
this.checkboxes[i].page.isEnabled = status; this.checkboxes[i].page.isEnabled = status;
} }
this.applyCheck(false); this.applyCheck(false);
this._clearCacheService.clearCacheInRoute("Page's status changed",this.portal, "/");
this._clearCacheService.purgeBrowserCache("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) error => this.handleUpdateError('System error changing the status of the selected page(s)', error)

View File

@ -231,8 +231,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
} }
this.filterActiveBySearch(this.filterForm.value.active); this.filterActiveBySearch(this.filterForm.value.active);
this.userManagementService.updateUserInfo(); this.userManagementService.updateUserInfo();
this.clearCacheService.clearCacheInRoute(this.role + 's of ' + this.id + ' have been updated',this.id, "/"); this.clearCacheService.purgeBrowserCache(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");
NotificationHandler.rise(this.selectedUser + ' <b>is no longer</b> ' + this.role + ' of ' + this.name + ' Dashboard'); NotificationHandler.rise(this.selectedUser + ' <b>is no longer</b> ' + this.role + ' of ' + this.name + ' Dashboard');
this.loadActive = false; this.loadActive = false;
}, error => { }, error => {