Compare commits

...

2 Commits

9 changed files with 30 additions and 25 deletions

View File

@ -166,7 +166,7 @@ export class ClassContentFormComponent implements OnInit {
this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route});
NotificationHandler.rise('Page content has been <b>successfully updated</b>');
this.showLoading = false;
this._clearCacheService.clearCacheInRoute("Class help text saved or updated",this.portal, this.page.route);
this._clearCacheService.purgeBrowserCache("Class help text saved or updated",this.portal);
},
err => this.handleUpdateError('System error saving page content', err)
));

View File

@ -155,7 +155,7 @@ export class ClassHelpContentsComponent implements OnInit {
this.deletePageHelpContentsFromArray(this.selectedPageContents);
NotificationHandler.rise('Page content(s) has been <b>successfully deleted</b>');
this.showLoading = false;
this._clearCacheService.clearCacheInRoute("Class text texts deleted",this.portal, this.page.route);
this._clearCacheService.purgeBrowserCache("Class text texts deleted",this.portal);
},
error => this.handleUpdateError('System error deleting the selected page content(s)', error)
));
@ -198,7 +198,7 @@ export class ClassHelpContentsComponent implements OnInit {
this.countClassHelpContents();
this.applyCheck(false);
NotificationHandler.rise('Page content(s) has been <b>successfully updated</b>');
this._clearCacheService.clearCacheInRoute("class help text's status changed",this.portal, this.page.route);
this._clearCacheService.purgeBrowserCache("class help text's status changed",this.portal);
},
error => this.handleUpdateError('System error changing the status of the selected page content(s)', error)
));

View File

@ -345,7 +345,7 @@ export class EntitiesComponent implements OnInit {
this.checkboxes[i].entity.isEnabled = this.toggleStatus;
}
this.applyCheck(false);
this._clearCacheService.clearCacheInRoute("entity's status changed", this.portal, "/");
this._clearCacheService.purgeBrowserCache("entity's status changed", this.portal);
this._clearCacheService.purgeBrowserCache("entity's status changed", this.portal);
},
error => this.handleUpdateError('System error changing the status of the selected entity(-ies)', error)

View File

@ -199,7 +199,7 @@ export class PageContentFormComponent implements OnInit {
NotificationHandler.rise('Page content has been <b>successfully ' + (this.pageContentId ? 'updated' : 'created') + '</b>');
this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route});
this.showLoading = false;
this._clearCacheService.clearCacheInRoute("page help content saved",this.portal, this.page.route);
this._clearCacheService.purgeBrowserCache("page help content saved",this.portal);
},
err => this.handleUpdateError('System error saving page content', err)
));

View File

@ -165,7 +165,7 @@ export class PageHelpContentsComponent implements OnInit {
this.deletePageHelpContentsFromArray(this.selectedPageContents);
NotificationHandler.rise('Page content(s) has been <b>successfully deleted</b>');
this.showLoading = false;
this._clearCacheService.clearCacheInRoute("Help texts deleted",this.portal, this.page.route);
this._clearCacheService.purgeBrowserCache("Help texts deleted",this.portal);
},
error => this.handleUpdateError('System error deleting the selected page content(s)', error)
));
@ -210,7 +210,7 @@ export class PageHelpContentsComponent implements OnInit {
NotificationHandler.rise('Page content(s) has been <b>successfully updated</b>');
this.countPageHelpContents();
this.applyCheck(false);
this._clearCacheService.clearCacheInRoute("Help text's status changed",this.portal, this.page.route);
this._clearCacheService.purgeBrowserCache("Help text's status changed",this.portal);
},
error => this.handleUpdateError('System error changing the status of the selected page content(s)', error)
));

View File

@ -7,8 +7,13 @@
<div class="uk-flex uk-flex-center uk-flex-wrap uk-flex-middle uk-grid" uk-grid
[class]="isPortalAdministrator ? 'uk-flex-between@m':'uk-flex-right@m'">
<div>
<div input inputClass="border-bottom" type="select" [options]="menuTypes" [(value)]="selectedMenuType" (valueChange)="valueChange()"
*ngIf="isPortalAdministrator"></div>
<!--<div input inputClass="border-bottom" type="select" [options]="menuTypes" [(value)]="selectedMenuType" (valueChange)="valueChange()"
*ngIf="isPortalAdministrator"></div>-->
<ul *ngIf="isPortalAdministrator" class="uk-subnav uk-subnav-pill uk-margin-medium-top">
<li *ngFor="let type of menuTypes; let i=index"
[class.uk-active]="selectedMenuType === type.value"><a
(click)="selectedMenuType = type.value"><span>{{type.label}}</span></a></li>
</ul>
</div>
<div>
<button class="uk-button uk-button-default uk-flex uk-flex-middle"
@ -163,9 +168,9 @@
<span class="uk-margin-small-left">Hidden</span>
</label>
</div>
<ng-container *ngIf="selectedMenuType == 'customMenu'">
<h6 class="uk-margin-medium-top">Menu alignment</h6>
<div *ngIf="selectedMenuType == 'customMenu'">
<div >
<div>
<label (click)="alignMenu('LEFT')">
<input class="uk-radio" type="radio" name="menuAlign" [checked]="(featuredAlignment == 'LEFT')">
@ -185,6 +190,7 @@
</label>
</div>
</div>
</ng-container>
</div>
</div>
<div *ngIf="displayMenuItems && displayMenuItems.length == 0"

View File

@ -46,8 +46,9 @@ export class MenuComponent implements OnInit {
public menuItemForm: FormGroup;
public pageForm: FormGroup;
public menuTypes = [
{label: 'Normal Menu', value: 'normalMenu'},
{label: 'Custom Menu', value: 'customMenu'}
{label: 'Custom', value: 'customMenu'},
{label: 'Main', value: 'normalMenu'}
];
public selectedMenuType = this.menuTypes[0].value;
public normalMenuItems: MenuItemExtended[] = [];
@ -126,8 +127,8 @@ export class MenuComponent implements OnInit {
} else {
this.title.setTitle('Administrator Dashboard | Menu');
}
this.isPortalAdministrator = Session.isPortalAdministrator(user);
this.selectedMenuType = this.isPortalAdministrator ? this.menuTypes[0].value : this.menuTypes[1].value;
this.isPortalAdministrator = false;//Session.isPortalAdministrator(user);
this.selectedMenuType = this.menuTypes[0].value
});
}
@ -271,7 +272,7 @@ export class MenuComponent implements OnInit {
this.deleteMenuItemFromArray(this.selectedMenuItem, this.isChild);
NotificationHandler.rise("Menu item have been <b>successfully deleted</b>");
this.showLoading = false;
this._clearCacheService.clearCacheInRoute("Menu item deleted",this.portal, "/");
this._clearCacheService.purgeBrowserCache("Menu item deleted",this.portal);
},
error => this.handleError("Server error deleting menu item", error)
@ -313,7 +314,7 @@ export class MenuComponent implements OnInit {
menuItem => {
this.menuItemSavedSuccessfully(menuItem, true);
NotificationHandler.rise('Menu item <b>' + menuItem.title + '</b> has been <b>successfully created</b>');
this._clearCacheService.clearCacheInRoute("Menu item saved",this.portal, "/");
this._clearCacheService.purgeBrowserCache("Menu item saved",this.portal);
},
error => this.handleError("System error creating menu item", error)
)
@ -324,7 +325,7 @@ export class MenuComponent implements OnInit {
menuItem => {
this.menuItemSavedSuccessfully(menuItem, false);
NotificationHandler.rise('Menu item <b>' + menuItem.title + '</b> has been <b>successfully updated</b>');
this._clearCacheService.clearCacheInRoute("Menu item updated",this.portal, "/");
this._clearCacheService.purgeBrowserCache("Menu item updated",this.portal);
},
error => this.handleError("System error updating menu item", error)
)
@ -390,7 +391,7 @@ export class MenuComponent implements OnInit {
HelperFunctions.swap(temp, index, newIndex);
this._helpContentService.reorderMenuItems(temp, this.portal).subscribe(() => {
HelperFunctions.swap(this.featuredMenuItems, index, newIndex);
this._clearCacheService.clearCacheInRoute("Menu items reordered",this.portal, "/");
this._clearCacheService.purgeBrowserCache("Menu items reordered",this.portal);
}, error => {
this.handleError("System error reordering menu items", error);
});
@ -402,7 +403,7 @@ export class MenuComponent implements OnInit {
HelperFunctions.swap(temp, index, newIndex);
this._helpContentService.reorderMenuItems(temp, this.portal).subscribe(() => {
HelperFunctions.swap(children && children.length ? children : this.normalMenuItems, index, newIndex);
this._clearCacheService.clearCacheInRoute("Menu items reordered",this.portal, "/");
this._clearCacheService.purgeBrowserCache("Menu items reordered",this.portal);
}, error => {
this.handleError("System error reordering menu items", error);
});
@ -417,7 +418,7 @@ export class MenuComponent implements OnInit {
} else {
this.showNormalMenu = status;
}
this._clearCacheService.clearCacheInRoute("Menu toggled",this.portal, "/");
this._clearCacheService.purgeBrowserCache("Menu toggled",this.portal);
NotificationHandler.rise("Menu has been <b>successfully toggled to be "+(status?"visible":"hidden")+"</b>");
}, error => {
this.handleError("System error toggling menu", error);
@ -429,7 +430,7 @@ export class MenuComponent implements OnInit {
this.subscriptions.push(
this._helpContentService.alignMenu(MenuAlignment[alignment], this.portal).subscribe(() => {
this.featuredAlignment = alignment;
this._clearCacheService.clearCacheInRoute("Menu aligned",this.portal, "/");
this._clearCacheService.purgeBrowserCache("Menu aligned",this.portal);
NotificationHandler.rise("Menu has been <b>successfully "+alignment.toLowerCase()+" aligned</b>");
}, error => {
this.handleError("System error aligning menu to the "+alignment.toLowerCase(), error);

View File

@ -415,7 +415,6 @@ export class PagesComponent implements OnInit {
this.checkboxes[i].page.isEnabled = status;
}
this.applyCheck(false);
this._clearCacheService.clearCacheInRoute("Page's status changed",this.portal, "/");
this._clearCacheService.purgeBrowserCache("Page's status changed", this.portal);
},
error => this.handleUpdateError('System error changing the status of the selected page(s)', error)

View File

@ -231,8 +231,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
}
this.filterActiveBySearch(this.filterForm.value.active);
this.userManagementService.updateUserInfo();
this.clearCacheService.clearCacheInRoute(this.role + 's of ' + this.id + ' have been updated',this.id, "/");
this.clearCacheService.clearCacheInRoute(this.role + 's of ' + this.id + ' have been updated',this.id, "/curators");
this.clearCacheService.purgeBrowserCache(this.role + 's of ' + this.id + ' have been updated',this.id);
NotificationHandler.rise(this.selectedUser + ' <b>is no longer</b> ' + this.role + ' of ' + this.name + ' Dashboard');
this.loadActive = false;
}, error => {