[Library & Connect Admin | new-theme]: edit-community.component.ts & portals.component.ts & pages.component.ts & page-help-content-form.component.ts & page-help-contents.component.ts & entities.component.ts & divIds.component.ts & class-help-content-form.component.ts & class-help-contents.component.ts: On save/update/delete/toggle community/page/entity/divId/helptext/divHelptext , call clearCache() to immediately get changes in the dashboards.
This commit is contained in:
parent
6d68e753c6
commit
b1515cd395
|
@ -11,6 +11,7 @@ import {StringUtils} from "../../../../openaireLibrary/utils/string-utils.class"
|
||||||
import {Subscription} from "rxjs";
|
import {Subscription} from "rxjs";
|
||||||
import {Option} from "../../../../openaireLibrary/sharedComponents/input/input.component";
|
import {Option} from "../../../../openaireLibrary/sharedComponents/input/input.component";
|
||||||
import {NotificationHandler} from "../../../../openaireLibrary/utils/notification-handler";
|
import {NotificationHandler} from "../../../../openaireLibrary/utils/notification-handler";
|
||||||
|
import {ClearCacheService} from "../../../../openaireLibrary/services/clear-cache.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'edit-community',
|
selector: 'edit-community',
|
||||||
|
@ -111,7 +112,8 @@ export class EditCommunityComponent {
|
||||||
constructor(private fb: FormBuilder,
|
constructor(private fb: FormBuilder,
|
||||||
private communityService: CommunityService,
|
private communityService: CommunityService,
|
||||||
private utilsService: UtilitiesService,
|
private utilsService: UtilitiesService,
|
||||||
private userManagementService: UserManagementService) {
|
private userManagementService: UserManagementService,
|
||||||
|
private _clearCacheService: ClearCacheService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
|
@ -211,6 +213,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.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);
|
||||||
|
@ -223,6 +226,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.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);
|
||||||
|
|
Loading…
Reference in New Issue