Compare commits

...

2 Commits

9 changed files with 50 additions and 14 deletions

View File

@ -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);

View File

@ -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;
}
));
}
}
} }

View File

@ -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({

View File

@ -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!', {

View File

@ -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);

View File

@ -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;

View File

@ -5,8 +5,8 @@ let props: EnvProperties = {
isDashboard: true, isDashboard: true,
enablePiwikTrack: false, enablePiwikTrack: false,
useCache: false, useCache: false,
domain:'https://beta.admin.connect.openaire.eu' domain:'https://beta.admin.connect.openaire.eu',
monitorStatsFrameUrl:"https://beta.services.openaire.eu/stats-tool/"
}; };
export let properties: EnvProperties = { export let properties: EnvProperties = {

View File

@ -7,6 +7,7 @@ let props: EnvProperties = {
enablePiwikTrack: false, enablePiwikTrack: false,
useCache: false, useCache: false,
domain:'https://admin.connect.openaire.eu', domain:'https://admin.connect.openaire.eu',
monitorStatsFrameUrl:"https://services.openaire.eu/stats-tool/"
}; };

View File

@ -14,7 +14,10 @@ let props: EnvProperties = {
connectPortalUrl: 'http://scoobydoo.di.uoa.gr:4200', connectPortalUrl: 'http://scoobydoo.di.uoa.gr:4200',
domain:'https://beta.admin.connect.openaire.eu', domain:'https://beta.admin.connect.openaire.eu',
adminToolsAPIURL: 'http://scoobydoo.di.uoa.gr:8880/uoa-admin-tools/', adminToolsAPIURL: 'http://scoobydoo.di.uoa.gr:8880/uoa-admin-tools/',
utilsService: "http://scoobydoo.di.uoa.gr:8000",
monitorStatsFrameUrl:"https://stats.madgik.di.uoa.gr/stats-api/",
// disableFrameLoad : true
}; };
export let properties: EnvProperties = { export let properties: EnvProperties = {