@@ -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/',