plugins-functionality #10
|
@ -237,8 +237,7 @@ export class EditCommunityComponent {
|
||||||
this.removePhoto();
|
this.removePhoto();
|
||||||
this.subscriptions.push(this.communityService.updateCommunity(
|
this.subscriptions.push(this.communityService.updateCommunity(
|
||||||
this.properties.communityAPI + this.community.communityId, this.communityFb.getRawValue()).subscribe(() => {
|
this.properties.communityAPI + this.community.communityId, this.communityFb.getRawValue()).subscribe(() => {
|
||||||
this._clearCacheService.clearCache("Community saved");
|
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 => {
|
this.communityService.getCommunity(this.community.communityId, true).subscribe(community => {
|
||||||
NotificationHandler.rise(community.shortTitle + ' has been <b>successfully created</b>');
|
NotificationHandler.rise(community.shortTitle + ' has been <b>successfully created</b>');
|
||||||
callback(community);
|
callback(community);
|
||||||
|
@ -251,8 +250,7 @@ export class EditCommunityComponent {
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
this.subscriptions.push(this.communityService.updateCommunity(this.properties.communityAPI + this.community.communityId, this.communityFb.getRawValue()).subscribe(() => {
|
this.subscriptions.push(this.communityService.updateCommunity(this.properties.communityAPI + this.community.communityId, this.communityFb.getRawValue()).subscribe(() => {
|
||||||
this._clearCacheService.clearCache("Community updated");
|
this._clearCacheService.clearCacheInRoute("Community saved",this.community.communityId,"/");
|
||||||
this._clearCacheService.purgeBrowserCache("Community updated", this.community.communityId);
|
|
||||||
this.communityService.getCommunity(this.community.communityId, true).subscribe(community => {
|
this.communityService.getCommunity(this.community.communityId, true).subscribe(community => {
|
||||||
NotificationHandler.rise(community.shortTitle + ' has been <b>successfully saved</b>');
|
NotificationHandler.rise(community.shortTitle + ' has been <b>successfully saved</b>');
|
||||||
callback(community);
|
callback(community);
|
||||||
|
|
|
@ -16,14 +16,28 @@ declare var UIkit;
|
||||||
<admin-tabs tab="customization" portal="connect"></admin-tabs>
|
<admin-tabs tab="customization" portal="connect"></admin-tabs>
|
||||||
</div>
|
</div>
|
||||||
<div inner>
|
<div inner>
|
||||||
|
<div>
|
||||||
<div class="uk-alert uk-alert-warning uk-margin-top ">
|
<div class="uk-alert uk-alert-warning uk-margin-top ">
|
||||||
<div class="uk-text-large">Use only after connect deployment. And only if there are css updates!</div>
|
<div class="uk-text-large">Use only after connect deployment. And only if there are css updates!</div>
|
||||||
Press the following button to update the timestamp in the saved layouts and recreate the css files.
|
Press the following button to update the timestamp in the saved layouts and recreate the css files.
|
||||||
</div>
|
</div>
|
||||||
<button (click)="updateCss()" class="uk-button uk-button-danger" [class.uk-disabled]="savingChanges"> Update CSS</button>
|
<button (click)="updateCss()" class="uk-button uk-button-danger" [class.uk-disabled]="savingChanges"> Update CSS</button>
|
||||||
<button (click)="purgeBrowserCache()" class="uk-button uk-button-danger uk-margin-left" [class.uk-disabled]="savingChanges"> Purge Browser Cache</button>
|
<hr>
|
||||||
|
</div>
|
||||||
|
<div class="uk-margin-medium-top">
|
||||||
|
<div>Purge ICM cache for all communities</div>
|
||||||
|
|
||||||
<ng-container *ngIf="properties.domain != 'production'">
|
<button (click)="purgeBrowserCache()" class="uk-button uk-button-danger uk-margin-top" [class.uk-disabled]="savingChanges"> Purge Browser Cache</button>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
<div class="uk-margin-medium-top">
|
||||||
|
<div>Reload cache requests either per community or for all communities</div>
|
||||||
|
<div input [(value)]="community" [placeholder]="'e.g. galaxy'" class="uk-width-1-2 uk-margin-top"></div>
|
||||||
|
<div input [(value)]="route" [placeholder]="'Route e.g. /'" class="uk-width-1-2 uk-margin-top"></div>
|
||||||
|
|
||||||
|
<button (click)="forceReloadCache()" class="uk-button uk-button-danger uk-margin-top" [class.uk-disabled]="savingChanges"> Reload Cache</button>
|
||||||
|
</div>
|
||||||
|
<!--<ng-container *ngIf="properties.domain != 'production'">
|
||||||
<hr>
|
<hr>
|
||||||
<div class="uk-alert uk-alert-danger uk-margin-top ">
|
<div class="uk-alert uk-alert-danger uk-margin-top ">
|
||||||
Delete after next deployment
|
Delete after next deployment
|
||||||
|
@ -33,7 +47,7 @@ declare var UIkit;
|
||||||
</div>
|
</div>
|
||||||
<div input [(value)]="community" [placeholder]="'e.g. galaxy'"></div>
|
<div input [(value)]="community" [placeholder]="'e.g. galaxy'"></div>
|
||||||
<button (click)="deleteLayout()" class="uk-button uk-button-danger" [class.uk-disabled]="!community"> Delete layout</button>
|
<button (click)="deleteLayout()" class="uk-button uk-button-danger" [class.uk-disabled]="!community"> Delete layout</button>
|
||||||
</ng-container>
|
</ng-container>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -45,6 +59,7 @@ export class ConnectAdminCustomizationComponent implements OnInit {
|
||||||
cssCreated: number = 0;
|
cssCreated: number = 0;
|
||||||
totalLayouts: number = 0;
|
totalLayouts: number = 0;
|
||||||
community;
|
community;
|
||||||
|
route;
|
||||||
properties = properties;
|
properties = properties;
|
||||||
|
|
||||||
constructor( private customizationService: CustomizationService, private _clearCacheService: ClearCacheService,
|
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;
|
||||||
|
}
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,6 +87,7 @@ export class RemoveContentProvidersComponent implements OnInit {
|
||||||
let index = this.communityContentProviders.indexOf(this.selectedCommunityContentProvider);
|
let index = this.communityContentProviders.indexOf(this.selectedCommunityContentProvider);
|
||||||
this.communityContentProviders.splice(index, 1);
|
this.communityContentProviders.splice(index, 1);
|
||||||
this.applyFilters();
|
this.applyFilters();
|
||||||
|
this._clearCacheService.clearCacheInRoute(this.openAIREEntities.DATASOURCE+" removed", this.community.communityId)
|
||||||
this._clearCacheService.purgeBrowserCache(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.handleSuccess(this.openAIREEntities.DATASOURCE + ' successfully removed!')
|
||||||
this.communityContentProvidersChanged.emit({
|
this.communityContentProvidersChanged.emit({
|
||||||
|
|
|
@ -123,6 +123,7 @@ export class AddProjectsComponent implements OnInit {
|
||||||
this.subscriptions.push(this._manageCommunityProjectsService.addProject(this.properties, this.community.communityId, project).subscribe(
|
this.subscriptions.push(this._manageCommunityProjectsService.addProject(this.properties, this.community.communityId, project).subscribe(
|
||||||
data => {
|
data => {
|
||||||
// this.communityProjects.push(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);
|
this._clearCacheService.purgeBrowserCache(this.openaireEntities.PROJECT+" added", this.community.communityId);
|
||||||
|
|
||||||
UIkit.notification(this.openaireEntities.PROJECT+' successfully added!', {
|
UIkit.notification(this.openaireEntities.PROJECT+' successfully added!', {
|
||||||
|
|
|
@ -131,7 +131,7 @@ export class RemoveProjectsComponent implements OnInit {
|
||||||
public confirmedDeleteProject(data: any) {
|
public confirmedDeleteProject(data: any) {
|
||||||
this.subscriptions.push(this._manageCommunityProjectsService.removeProject(this.properties, this.community.communityId, this.selectedCommunityProject.openaireId).subscribe(
|
this.subscriptions.push(this._manageCommunityProjectsService.removeProject(this.properties, this.community.communityId, this.selectedCommunityProject.openaireId).subscribe(
|
||||||
data => {
|
data => {
|
||||||
|
this._clearCacheService.clearCacheInRoute(this.openaireEntiites.PROJECT+" removed", this.community.communityId);
|
||||||
this._clearCacheService.purgeBrowserCache(this.openaireEntiites.PROJECT+" removed", this.community.communityId);
|
this._clearCacheService.purgeBrowserCache(this.openaireEntiites.PROJECT+" removed", this.community.communityId);
|
||||||
NotificationHandler.rise(OpenaireEntities.PROJECT+' successfully removed!');
|
NotificationHandler.rise(OpenaireEntities.PROJECT+' successfully removed!');
|
||||||
this._getCommunityProjects(this.communitySearchUtils.page, this.keyword,null);
|
this._getCommunityProjects(this.communitySearchUtils.page, this.keyword,null);
|
||||||
|
|
|
@ -344,6 +344,7 @@ export class SubjectsEditFormComponent implements OnInit {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this._communityService.updateSubjects(this.community.subjects, this.community.fos, this.community.sdg);
|
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);
|
this._clearCacheService.purgeBrowserCache("Subjects " + message, this.communityId);
|
||||||
NotificationHandler.rise('Subjects successfully ' + message + '!')
|
NotificationHandler.rise('Subjects successfully ' + message + '!')
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
Loading…
Reference in New Issue