diff --git a/dashboard/menu/menu.component.html b/dashboard/menu/menu.component.html index 2a1f847c..7b966ee4 100644 --- a/dashboard/menu/menu.component.html +++ b/dashboard/menu/menu.component.html @@ -159,19 +159,41 @@
-
Menu settings
+
Menu visibility
+ +
Menu alignment
+
+
+ +
+
+ +
+
+ +
+
{ + NotificationHandler.rise("Menu has been successfully toggled to be "+(status?"visible":"hidden")+""); + }, error => { this.handleError("System error toggling menu", error); }) ); } + public alignMenu(alignment: string) { + this.subscriptions.push( + this._helpContentService.alignMenu(MenuAlignment[alignment], this.portal).subscribe(() => { + this.featuredAlignment = alignment; + this._clearCacheService.clearCache("Menu aligned"); + this._clearCacheService.purgeBrowserCache("Menu aligned", this.portal); + NotificationHandler.rise("Menu has been successfully "+alignment.toLowerCase()+" aligned"); + }, error => { + this.handleError("System error aligning menu to the "+alignment.toLowerCase(), error); + }) + ); + } + // public newPageWindow() { // this.newPageWindowOpen = !this.newPageWindowOpen; // this.pageForm = this._fb.group({ @@ -465,11 +481,7 @@ export class MenuComponent implements OnInit { // this._helpContentService.savePage(this.pageForm.value, this.properties.adminToolsAPIURL).subscribe( // page => { // this.allPages.push({value: page.route, label: page.name}); - // UIkit.notification('Page ' + page.name + ' has been successfully created', { - // status: 'success', - // timeout: 6000, - // pos: 'bottom-right' - // }); + // NotificationHandler.rise('Page ' + page.name + ' has been successfully created'); // this.newPageWindowOpen = !this.newPageWindowOpen; // this.menuItemForm.get('route').setValue(page.route); // this.menuItemForm.get('route').markAsDirty(); diff --git a/services/help-content.service.ts b/services/help-content.service.ts index b952a9ec..27865e6d 100644 --- a/services/help-content.service.ts +++ b/services/help-content.service.ts @@ -349,6 +349,11 @@ export class HelpContentService { return this.http.post(properties.adminToolsAPIURL + properties.adminToolsPortalType + "/" + portalPid + "/menu/toggle?status=" + status + "&featured=" + isFeatured, {}, CustomOptions.getAuthOptionsWithBody()) .pipe(catchError(this.handleError)); } + + alignMenu(alignment: string, portalPid: string) { + return this.http.post(properties.adminToolsAPIURL + properties.adminToolsPortalType + "/" + portalPid + "/menu/align?alignment=" + alignment, {}, CustomOptions.getAuthOptionsWithBody()) + .pipe(catchError(this.handleError)); + } // unused diff --git a/sharedComponents/menu.ts b/sharedComponents/menu.ts index 000f05a5..fc186356 100644 --- a/sharedComponents/menu.ts +++ b/sharedComponents/menu.ts @@ -76,6 +76,7 @@ export class Menu { portalPid: string; isFeaturedMenuEnabled: boolean; isMenuEnabled: boolean; + featuredAlignment: MenuAlignment; featuredMenuItems: MenuItemExtended[] = []; menuItems: MenuItemExtended[] = []; } @@ -83,3 +84,5 @@ export class Menu { export class SideMenuItem extends MenuItem { ukIcon: string = ''; } + +export enum MenuAlignment {LEFT="LEFT", CENTER="CENTER", RIGHT="RIGHT"} \ No newline at end of file diff --git a/utils/entities/CuratorInfo.ts b/utils/entities/CuratorInfo.ts index bffc50db..06e8af39 100644 --- a/utils/entities/CuratorInfo.ts +++ b/utils/entities/CuratorInfo.ts @@ -6,6 +6,7 @@ export class Curator { affiliations: Affiliation[]; photo: string; bio: string; + visible: boolean = true; } export class Affiliation {