diff --git a/dashboard/divId/divIds.component.ts b/dashboard/divId/divIds.component.ts index 28908c8b..2c3d964c 100644 --- a/dashboard/divId/divIds.component.ts +++ b/dashboard/divId/divIds.component.ts @@ -143,7 +143,7 @@ export class DivIdsComponent implements OnInit { this.deleteDivIdsFromArray(this.selectedDivIds); NotificationHandler.rise('Classes have been successfully deleted'); this.showLoading = false; - this._clearCacheService.clearCache("Class ids deleted"); + //this._clearCacheService.clearCache("Class ids deleted"); }, error => this.handleUpdateError('System error deleting the selected classes', error) )); @@ -195,7 +195,7 @@ export class DivIdsComponent implements OnInit { divId => { this.divIdSavedSuccessfully(divId); NotificationHandler.rise('Class ' + divId.name + ' has been successfully created'); - this._clearCacheService.clearCache("Class id saved"); + //this._clearCacheService.clearCache("Class id saved"); }, error => this.handleUpdateError("System error creating class", error) )); @@ -204,7 +204,7 @@ export class DivIdsComponent implements OnInit { divId => { this.divIdUpdatedSuccessfully(divId); NotificationHandler.rise('Class ' + divId.name + ' has been successfully updated'); - this._clearCacheService.clearCache("Class id updated"); + //this._clearCacheService.clearCache("Class id updated"); }, error => this.handleUpdateError("System error updating class", error) )); diff --git a/dashboard/divhelpcontent/class-help-content-form.component.ts b/dashboard/divhelpcontent/class-help-content-form.component.ts index e24c876e..6ce4d961 100644 --- a/dashboard/divhelpcontent/class-help-content-form.component.ts +++ b/dashboard/divhelpcontent/class-help-content-form.component.ts @@ -166,7 +166,7 @@ export class ClassContentFormComponent implements OnInit { this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route}); NotificationHandler.rise('Page content has been successfully updated'); this.showLoading = false; - this._clearCacheService.clearCache("Class help text saved or updated"); + this._clearCacheService.clearCacheInRoute("Class help text saved or updated",this.portal, this.page.route); }, err => this.handleUpdateError('System error saving page content', err) )); diff --git a/dashboard/divhelpcontent/class-help-contents.component.ts b/dashboard/divhelpcontent/class-help-contents.component.ts index d59cd7d9..cbf8a6ff 100644 --- a/dashboard/divhelpcontent/class-help-contents.component.ts +++ b/dashboard/divhelpcontent/class-help-contents.component.ts @@ -155,7 +155,7 @@ export class ClassHelpContentsComponent implements OnInit { this.deletePageHelpContentsFromArray(this.selectedPageContents); NotificationHandler.rise('Page content(s) has been successfully deleted'); this.showLoading = false; - this._clearCacheService.clearCache("Class text texts deleted"); + this._clearCacheService.clearCacheInRoute("Class text texts deleted",this.portal, this.page.route); }, error => this.handleUpdateError('System error deleting the selected page content(s)', error) )); @@ -198,7 +198,7 @@ export class ClassHelpContentsComponent implements OnInit { this.countClassHelpContents(); this.applyCheck(false); NotificationHandler.rise('Page content(s) has been successfully updated'); - this._clearCacheService.clearCache("class help text's status changed"); + this._clearCacheService.clearCacheInRoute("class help text's status changed",this.portal, this.page.route); }, error => this.handleUpdateError('System error changing the status of the selected page content(s)', error) )); diff --git a/dashboard/entity/entities.component.ts b/dashboard/entity/entities.component.ts index 38fa4c6d..4abf71a4 100644 --- a/dashboard/entity/entities.component.ts +++ b/dashboard/entity/entities.component.ts @@ -202,8 +202,8 @@ export class EntitiesComponent implements OnInit { this.deleteEntitiesFromArray(this.selectedEntities); NotificationHandler.rise('Entities have been successfully deleted'); this.showLoading = false; - this._clearCacheService.clearCache("entities deleted"); - this._clearCacheService.purgeBrowserCache("entities deleted", this.portal); + // this._clearCacheService.clearCache("entities deleted"); + // this._clearCacheService.purgeBrowserCache("entities deleted", this.portal); }, error => this.handleUpdateError('System error deleting the selected entities', error) ); @@ -244,8 +244,8 @@ export class EntitiesComponent implements OnInit { entity => { this.entityUpdatedSuccessfully(entity); NotificationHandler.rise('Entity ' + entity.name + ' has been successfully updated'); - this._clearCacheService.clearCache("entity updated"); - this._clearCacheService.purgeBrowserCache("entity updated", this.portal); + // this._clearCacheService.clearCache("entity updated"); + // this._clearCacheService.purgeBrowserCache("entity updated", this.portal); }, error => this.handleUpdateError('System error updating entity', error) ); @@ -254,8 +254,8 @@ export class EntitiesComponent implements OnInit { entity => { this.entitySavedSuccessfully(entity); NotificationHandler.rise('Entity ' + entity.name + ' has been successfully created'); - this._clearCacheService.clearCache("entity saved"); - this._clearCacheService.purgeBrowserCache("entity saved", this.portal) + // this._clearCacheService.clearCache("entity saved"); + // this._clearCacheService.purgeBrowserCache("entity saved", this.portal) }, error => this.handleUpdateError('System error creating entity', error) ); @@ -345,7 +345,7 @@ export class EntitiesComponent implements OnInit { this.checkboxes[i].entity.isEnabled = this.toggleStatus; } this.applyCheck(false); - this._clearCacheService.clearCache("entity's status changed"); + this._clearCacheService.clearCacheInRoute("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) diff --git a/dashboard/helpTexts/page-help-content-form.component.ts b/dashboard/helpTexts/page-help-content-form.component.ts index 5cba1d54..60af26c9 100644 --- a/dashboard/helpTexts/page-help-content-form.component.ts +++ b/dashboard/helpTexts/page-help-content-form.component.ts @@ -199,7 +199,7 @@ export class PageContentFormComponent implements OnInit { NotificationHandler.rise('Page content has been successfully ' + (this.pageContentId ? 'updated' : 'created') + ''); this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route}); this.showLoading = false; - this._clearCacheService.clearCache("page help content saved"); + this._clearCacheService.clearCacheInRoute("page help content saved",this.portal, this.page.route); }, err => this.handleUpdateError('System error saving page content', err) )); diff --git a/dashboard/helpTexts/page-help-contents.component.ts b/dashboard/helpTexts/page-help-contents.component.ts index deba6ebd..0d8458d0 100644 --- a/dashboard/helpTexts/page-help-contents.component.ts +++ b/dashboard/helpTexts/page-help-contents.component.ts @@ -165,7 +165,7 @@ export class PageHelpContentsComponent implements OnInit { this.deletePageHelpContentsFromArray(this.selectedPageContents); NotificationHandler.rise('Page content(s) has been successfully deleted'); this.showLoading = false; - this._clearCacheService.clearCache("Help texts deleted"); + this._clearCacheService.clearCacheInRoute("Help texts deleted",this.portal, this.page.route); }, 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 successfully updated'); this.countPageHelpContents(); this.applyCheck(false); - this._clearCacheService.clearCache("Help text's status changed"); + this._clearCacheService.clearCacheInRoute("Help text's status changed",this.portal, this.page.route); }, error => this.handleUpdateError('System error changing the status of the selected page content(s)', error) )); diff --git a/dashboard/menu/menu.component.ts b/dashboard/menu/menu.component.ts index d756a77f..11914b6c 100644 --- a/dashboard/menu/menu.component.ts +++ b/dashboard/menu/menu.component.ts @@ -271,8 +271,8 @@ export class MenuComponent implements OnInit { this.deleteMenuItemFromArray(this.selectedMenuItem, this.isChild); NotificationHandler.rise("Menu item have been successfully deleted"); this.showLoading = false; - this._clearCacheService.clearCache("Menu item deleted"); - this._clearCacheService.purgeBrowserCache("Menu item deleted", this.portal); + this._clearCacheService.clearCacheInRoute("Menu item deleted",this.portal, "/"); + }, error => this.handleError("Server error deleting menu item", error) ) @@ -313,8 +313,7 @@ export class MenuComponent implements OnInit { menuItem => { this.menuItemSavedSuccessfully(menuItem, true); NotificationHandler.rise('Menu item ' + menuItem.title + ' has been successfully created'); - this._clearCacheService.clearCache("Menu item saved"); - this._clearCacheService.purgeBrowserCache("Menu item saved", this.portal); + this._clearCacheService.clearCacheInRoute("Menu item saved",this.portal, "/"); }, error => this.handleError("System error creating menu item", error) ) @@ -325,8 +324,7 @@ export class MenuComponent implements OnInit { menuItem => { this.menuItemSavedSuccessfully(menuItem, false); NotificationHandler.rise('Menu item ' + menuItem.title + ' has been successfully updated'); - this._clearCacheService.clearCache("Menu item updated"); - this._clearCacheService.purgeBrowserCache("Menu item updated", this.portal); + this._clearCacheService.clearCacheInRoute("Menu item updated",this.portal, "/"); }, error => this.handleError("System error updating menu item", error) ) @@ -392,8 +390,7 @@ export class MenuComponent implements OnInit { HelperFunctions.swap(temp, index, newIndex); this._helpContentService.reorderMenuItems(temp, this.portal).subscribe(() => { HelperFunctions.swap(this.featuredMenuItems, index, newIndex); - this._clearCacheService.clearCache("Menu items reordered"); - this._clearCacheService.purgeBrowserCache("Menu items reordered", this.portal); + this._clearCacheService.clearCacheInRoute("Menu items reordered",this.portal, "/"); }, error => { this.handleError("System error reordering menu items", error); }); @@ -405,8 +402,7 @@ export class MenuComponent implements OnInit { HelperFunctions.swap(temp, index, newIndex); this._helpContentService.reorderMenuItems(temp, this.portal).subscribe(() => { HelperFunctions.swap(children && children.length ? children : this.normalMenuItems, index, newIndex); - this._clearCacheService.clearCache("Menu items reordered"); - this._clearCacheService.purgeBrowserCache("Menu items reordered", this.portal); + this._clearCacheService.clearCacheInRoute("Menu items reordered",this.portal, "/"); }, error => { this.handleError("System error reordering menu items", error); }); @@ -421,8 +417,7 @@ export class MenuComponent implements OnInit { } else { this.showNormalMenu = status; } - this._clearCacheService.clearCache("Menu toggled"); - this._clearCacheService.purgeBrowserCache("Menu toggled", this.portal); + this._clearCacheService.clearCacheInRoute("Menu toggled",this.portal, "/"); NotificationHandler.rise("Menu has been successfully toggled to be "+(status?"visible":"hidden")+""); }, error => { this.handleError("System error toggling menu", error); @@ -434,8 +429,7 @@ export class MenuComponent implements OnInit { this.subscriptions.push( this._helpContentService.alignMenu(MenuAlignment[alignment], this.portal).subscribe(() => { this.featuredAlignment = alignment; - this._clearCacheService.clearCache("Menu aligned"); - this._clearCacheService.purgeBrowserCache("Menu aligned", this.portal); + this._clearCacheService.clearCacheInRoute("Menu aligned",this.portal, "/"); NotificationHandler.rise("Menu has been successfully "+alignment.toLowerCase()+" aligned"); }, error => { this.handleError("System error aligning menu to the "+alignment.toLowerCase(), error); diff --git a/dashboard/page/pages.component.ts b/dashboard/page/pages.component.ts index 70382ed7..e67e8423 100644 --- a/dashboard/page/pages.component.ts +++ b/dashboard/page/pages.component.ts @@ -252,8 +252,8 @@ export class PagesComponent implements OnInit { this.deletePagesFromArray(this.selectedPages); NotificationHandler.rise('Pages have been successfully deleted'); this.showLoading = false; - this._clearCacheService.clearCache("Pages deleted"); - this._clearCacheService.purgeBrowserCache("Pages deleted", this.portal); + // this._clearCacheService.clearCache("Pages deleted"); + // this._clearCacheService.purgeBrowserCache("Pages deleted", this.portal); }, error => this.handleUpdateError('System error deleting the selected pages', error) )); @@ -320,8 +320,8 @@ export class PagesComponent implements OnInit { page => { this.pageSavedSuccessfully(page, true); NotificationHandler.rise('Page ' + page.name + ' has been successfully created'); - this._clearCacheService.clearCache("Page saved"); - this._clearCacheService.purgeBrowserCache("Page saved", this.portal); + // this._clearCacheService.clearCache("Page saved"); + // this._clearCacheService.purgeBrowserCache("Page saved", this.portal); }, error => this.handleUpdateError('System error creating page', error) )); @@ -330,8 +330,8 @@ export class PagesComponent implements OnInit { page => { this.pageSavedSuccessfully(page, false); NotificationHandler.rise('Page ' + page.name + ' has been successfully updated'); - this._clearCacheService.clearCache("Page updated"); - this._clearCacheService.purgeBrowserCache("Page updated", this.portal); + // this._clearCacheService.clearCache("Page updated"); + // this._clearCacheService.purgeBrowserCache("Page updated", this.portal); }, error => this.handleUpdateError('System error updating page', error) )); @@ -415,7 +415,7 @@ export class PagesComponent implements OnInit { this.checkboxes[i].page.isEnabled = status; } this.applyCheck(false); - this._clearCacheService.clearCache("Page's status changed"); + this._clearCacheService.clearCacheInRoute("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) diff --git a/dashboard/plugins/plugins-form/pluginsForm.component.ts b/dashboard/plugins/plugins-form/pluginsForm.component.ts index 376e1aa7..8c67c742 100644 --- a/dashboard/plugins/plugins-form/pluginsForm.component.ts +++ b/dashboard/plugins/plugins-form/pluginsForm.component.ts @@ -36,7 +36,7 @@ import {PluginEditEvent} from "../utils/base-plugin.form.component"; }) export class PluginsFormComponent implements OnInit { private selectedId: string; - public pluginsByPlacement: Map = new Map(); + public pluginsByPlacement: Map = new Map(); public plugins: Plugin[] = []; public pluginTemplates: PluginTemplate[] = []; public selectedTemplate: PluginTemplate = null; @@ -65,6 +65,7 @@ export class PluginsFormComponent implements OnInit { public templateCode:string = null; public template; public selectedPlacementView = "all"; + public sinlgePlacementAvailable = false; communityInfo:CommunityInfo = null; editSubmenuOpen = false; constructor(private element: ElementRef, private route: ActivatedRoute, private _router: Router, @@ -158,13 +159,21 @@ export class PluginsFormComponent implements OnInit { this.plugins.push(plugin); } plugin.object = PluginUtils.initializeObjectAndCompare(_.code,plugin.object) - this.pluginsByPlacement.get(plugin.placement).push({plugin: plugin, template: _ }); + this.pluginsByPlacement.get(plugin.placement).push({plugin: plugin, template: _ , openPreview:false}); }); + let availablePlacements = []; for(let placement of this.pluginUtils.placementsOptions){ + if(this.pluginsByPlacement.get(placement.value).length > 0){ + availablePlacements.push(placement.value); + } this.pluginsByPlacement.get(placement.value).sort(function (a, b) { return a.plugin.order - b.plugin.order; }) } + if(availablePlacements.length == 1){ + this.selectedPlacementView == availablePlacements[0]; + this.sinlgePlacementAvailable = true + } this.showLoading = false; }, error => this.handleError('System error retrieving plugins', error))); @@ -250,7 +259,7 @@ export class PluginsFormComponent implements OnInit { this.savePlugin(plugin,update, this.index) } public savePlugin(plugin, update, index){ - this.subscriptions.push(this._pluginsService.savePlugin(plugin, this.properties.adminToolsAPIURL, this.selectedCommunityPid).subscribe( + this.subscriptions.push(this._pluginsService.savePlugin(plugin, this.properties.adminToolsAPIURL,this.selectedCommunityPid ).subscribe( saved => { this.savedSuccessfully(saved, update, index); this.editView = false; @@ -408,7 +417,7 @@ export class PluginsFormComponent implements OnInit { if(plugin._id) { this.subscriptions.push(this._pluginsService.updatePluginOrder(plugin, this.properties.adminToolsAPIURL, up ? -1 : 1, this.selectedCommunityPid).subscribe( saved => { - this.pluginsByPlacement.get(placement)[index].plugin = saved; + this.pluginsByPlacement.get(placement)[index].plugin = saved; }, error => this.handleUpdateError("System error creating template", error) )); diff --git a/dashboard/plugins/plugins.component.ts b/dashboard/plugins/plugins.component.ts index f7a6200f..73f39ca4 100644 --- a/dashboard/plugins/plugins.component.ts +++ b/dashboard/plugins/plugins.component.ts @@ -266,6 +266,7 @@ export class PluginsComponent implements OnInit { this.selectTemplateView = false; this.selectedTemplate = null; this.selectedPlugin = null; + this.clearCache(); }, error => this.handleUpdateError("System error creating template", error) )); @@ -378,8 +379,7 @@ export class PluginsComponent implements OnInit { () => { this.pluginsByPlacement.get(placement)[i].plugin.active = status; - this._clearCacheService.clearCache("Plugin's status changed"); - this._clearCacheService.purgeBrowserCache("Plugin's status changed", this.portal); + this.clearCache(); }, error => this.handleUpdateError('System error changing the status of Plugin', error) )); @@ -418,6 +418,7 @@ export class PluginsComponent implements OnInit { this.subscriptions.push(this._pluginsService.updatePluginOrder(plugin, this.properties.adminToolsAPIURL, up ? -1 : 1, this.selectedCommunityPid).subscribe( saved => { this.pluginsByPlacement.get(placement)[index].plugin = saved; + this.clearCache(); }, error => this.handleUpdateError("System error creating template", error) )); @@ -426,5 +427,10 @@ export class PluginsComponent implements OnInit { plugin.order = plugin.order + (up ? -1 : 1) this.savePlugin(plugin, true, index); } + + + } + clearCache(){ + this._clearCacheService.clearCacheInRoute(null, this.selectedCommunityPid, this.getPageById(this.selectedPageId).route) } } diff --git a/dashboard/plugins/templates/pluginTemplates.component.ts b/dashboard/plugins/templates/pluginTemplates.component.ts index 0e0ae51c..c9d5a081 100644 --- a/dashboard/plugins/templates/pluginTemplates.component.ts +++ b/dashboard/plugins/templates/pluginTemplates.component.ts @@ -150,7 +150,7 @@ export class PluginTemplatesComponent implements OnInit { this.deleteFromArray(this.selectedTemplate); NotificationHandler.rise('Template have been successfully deleted'); this.showLoading = false; - this._clearCacheService.clearCache("Template id deleted"); + // this._clearCacheService.clearCache("Template id deleted"); }, error => this.handleUpdateError('System error deleting the selected Template', error) )); @@ -231,7 +231,7 @@ export class PluginTemplatesComponent implements OnInit { saved => { this.savedSuccessfully(saved, true); - this._clearCacheService.clearCache("Template updates"); + // this._clearCacheService.clearCache("Template updates"); }, error => this.handleUpdateError("System error creating template", error) )); @@ -257,7 +257,7 @@ export class PluginTemplatesComponent implements OnInit { this.selectedTemplate = saved; this.savedSuccessfully(saved, update); NotificationHandler.rise('Template ' + saved.name + ' has been successfully' + (update ? ' updated ' : ' created ') + ''); - this._clearCacheService.clearCache("Template id saved"); + // this._clearCacheService.clearCache("Template id saved"); }, error => this.handleUpdateError("System error creating template", error) )); diff --git a/dashboard/portal/portals.component.ts b/dashboard/portal/portals.component.ts index d9dec3ec..69b08fe9 100644 --- a/dashboard/portal/portals.component.ts +++ b/dashboard/portal/portals.component.ts @@ -137,7 +137,7 @@ export class PortalsComponent implements OnInit { this.deletePortalsFromArray(this.selectedPortals); NotificationHandler.rise('Portals have been successfully deleted'); this.showLoading = false; - this._clearCacheService.clearCache("Portals deleted"); + // this._clearCacheService.clearCache("Portals deleted"); }, error => this.handleUpdateError('System error deleting the selected communities', error) )); @@ -188,7 +188,7 @@ export class PortalsComponent implements OnInit { portal => { this.portalUpdatedSuccessfully(portal); NotificationHandler.rise('Portal ' + portal.name + ' has been successfully updated'); - this._clearCacheService.clearCache("Portal updated"); + //this._clearCacheService.clearCache("Portal updated"); }, error => this.handleUpdateError('System error updating portal', error) )); @@ -198,7 +198,7 @@ export class PortalsComponent implements OnInit { portal => { this.portalSavedSuccessfully(portal); NotificationHandler.rise('Portal ' + portal.name + ' has been successfully created'); - this._clearCacheService.clearCache("Portal saved"); + //this._clearCacheService.clearCache("Portal saved"); }, error => this.handleUpdateError('System error creating portal', error) )); diff --git a/dashboard/users/role-users/role-users.component.ts b/dashboard/users/role-users/role-users.component.ts index cb53ed14..69dd8f28 100644 --- a/dashboard/users/role-users/role-users.component.ts +++ b/dashboard/users/role-users/role-users.component.ts @@ -224,7 +224,8 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges { } this.filterActiveBySearch(this.filterForm.value.active); this.userManagementService.updateUserInfo(); - this.clearCacheService.clearCache(this.role + 's of ' + this.id + ' have been updated'); + this.clearCacheService.clearCacheInRoute(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 + ' is no longer ' + this.role + ' of ' + this.name + ' Dashboard'); this.loadActive = false; }, error => { diff --git a/role-verification/role-verification.component.ts b/role-verification/role-verification.component.ts index 1b54fe75..f6112fbc 100644 --- a/role-verification/role-verification.component.ts +++ b/role-verification/role-verification.component.ts @@ -211,7 +211,7 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit, public verifyManager() { this.loading = true; this.subscriptions.push(this.userRegistryService.verify(this.verification.id, this.code.value).subscribe(() => { - this.clearCacheService.clearCache('Managers updated'); + // this.clearCacheService.clearCache('Managers updated'); this.managerModal.cancel(); this.error = null; this.userManagementService.updateUserInfo(() => { @@ -255,7 +255,7 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit, this.loading = true; if (!this.isMember) { this.subscriptions.push(this.userRegistryService.verify(this.verification.id, this.code.value, "member").subscribe(() => { - this.clearCacheService.clearCache('Members updated'); + // this.clearCacheService.clearCache('Members updated'); this.loading = false; this.error = null; this.isMember = true; diff --git a/services/clear-cache.service.ts b/services/clear-cache.service.ts index d925d5a7..f86ca083 100644 --- a/services/clear-cache.service.ts +++ b/services/clear-cache.service.ts @@ -1,5 +1,5 @@ import {Injectable} from "@angular/core"; -import {HttpClient} from "@angular/common/http"; +import {HttpClient, HttpHeaders} from "@angular/common/http"; import {properties} from "../../../environments/environment"; import {CustomOptions} from "./servicesUtils/customOptions.class"; @@ -10,14 +10,34 @@ export class ClearCacheService { constructor(private http: HttpClient) {} - clearCache(message: string = null) { + + clearCache(message: string = null, url:string = null) { if(properties.deleteCacheUrl) { - this.http.get(properties.deleteCacheUrl).subscribe( + this.http.get(properties.deleteCacheUrl + (url?'?url='+url:'')).subscribe( res => console.log((message ? message + ": " : "") + "Cache cleared!"), err => console.log((message ? message + ": " : "") + "Cache could not be cleared ", err) ); } } + clearCacheInRoute(message: string = null, pid:string, route:string = "/") { + let domain = ""; + if(properties.environment == 'production' || properties.environment == 'beta') { + domain = 'https://' + (properties.environment == 'production' ? '' : 'beta.') + pid + '.openaire.eu'; + } + domain = properties.connectPortalUrl; + this.http.get(domain + route + '?forceCacheReload=true', + { + headers: new HttpHeaders({ + 'Cache-Control': 'no-cache, no-store, must-revalidate', + 'Pragma': 'no-cache', + 'Expires': '0', + }) + }).subscribe( + res => console.log((message ? message + ": " : "") + "Cache cleared!"), + err => console.log((message ? message + ": " : "") + "Cache could not be cleared ", err) + ); + + } purgeBrowserCache(message: string = null, pid: string) { if(properties.deleteBrowserCacheUrl) {