[Connect Admin | Library | new-theme]: Updated call for purging browser cache - through admin tools api.

1. environment.ts & environment.beta.ts: Updated property "deleteBrowserCacheUrl" to call admin tools api.
2. clear-cache.service.ts: Used updated property "deleteBrowserCacheUrl" and in GET request added CustomOptions.registryOptions().
3. connect-admin-customization.component.ts: Deleted unnecessary code for deleting layout.
This commit is contained in:
Konstantina Galouni 2022-08-11 15:46:55 +03:00
parent 92b5d7bb33
commit d9853e1d91
3 changed files with 2 additions and 20 deletions

View File

@ -31,17 +31,6 @@ declare var UIkit;
</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> <button (click)="purgeBrowserCache()" class="uk-button uk-button-danger uk-margin-left" [class.uk-disabled]="savingChanges"> Purge Browser Cache</button>
<ng-container *ngIf="properties.domain != 'production'">
<hr>
<div class="uk-alert uk-alert-danger uk-margin-top ">
Delete after next deployment
</div>
<div class="uk-alert uk-alert-warning uk-margin-top ">
<div class="uk-text-large">Use to clean up multiple layouts of a community id.</div>
</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>
</ng-container>
</div> </div>
</div> </div>
@ -111,13 +100,6 @@ export class ConnectAdminCustomizationComponent implements OnInit {
})); }));
})); }));
} }
deleteLayout(){
if(this.community && this.community.length > 0) {
this.subscriptions.push(this.customizationService.deleteLayout(properties, this.community, "community").subscribe(data => {
}));
}
}
purgeBrowserCache() { purgeBrowserCache() {
this.subscriptions.push(this.communitiesService.getCommunities(this.properties, this.properties.communityAPI + 'communities').subscribe( this.subscriptions.push(this.communitiesService.getCommunities(this.properties, this.properties.communityAPI + 'communities').subscribe(

View File

@ -46,7 +46,7 @@ export let properties: EnvProperties = {
feedbackmailForMissingEntities: "feedback@openaire.eu", feedbackmailForMissingEntities: "feedback@openaire.eu",
cacheUrl: "https://demo.openaire.eu/cache/get?url=", cacheUrl: "https://demo.openaire.eu/cache/get?url=",
deleteCacheUrl: 'https://demo.openaire.eu/cache/clear', deleteCacheUrl: 'https://demo.openaire.eu/cache/clear',
deleteBrowserCacheUrl: 'https://beta.{pid}.openaire.eu/purge/', deleteBrowserCacheUrl: 'https://beta.services.openaire.eu/uoa-admin-tools/cache',
adminToolsAPIURL: "https://beta.services.openaire.eu/uoa-admin-tools/", adminToolsAPIURL: "https://beta.services.openaire.eu/uoa-admin-tools/",
adminToolsCommunity: "openaire", adminToolsCommunity: "openaire",
communityAPI: "https://beta.services.openaire.eu/openaire/community/", communityAPI: "https://beta.services.openaire.eu/openaire/community/",

View File

@ -51,7 +51,7 @@ export let properties: EnvProperties = {
feedbackmailForMissingEntities: 'feedback@openaire.eu', feedbackmailForMissingEntities: 'feedback@openaire.eu',
cacheUrl: 'http://scoobydoo.di.uoa.gr:3000/get?url=', cacheUrl: 'http://scoobydoo.di.uoa.gr:3000/get?url=',
deleteCacheUrl: 'http://duffy.di.uoa.gr:3000/clear', deleteCacheUrl: 'http://duffy.di.uoa.gr:3000/clear',
deleteBrowserCacheUrl: 'https://beta.{pid}.openaire.eu/purge/', deleteBrowserCacheUrl: 'http://duffy.di.uoa.gr:8080/uoa-admin-tools/cache',
adminToolsAPIURL: 'http://duffy.di.uoa.gr:8080/uoa-admin-tools/', adminToolsAPIURL: 'http://duffy.di.uoa.gr:8080/uoa-admin-tools/',
adminToolsCommunity: 'openaire', adminToolsCommunity: 'openaire',
communityAPI: 'https://dev-openaire.d4science.org/openaire/community/', communityAPI: 'https://dev-openaire.d4science.org/openaire/community/',