[master | DONE | CHANGED]: admin.component.ts & sidebar-base.component.ts: Added admin menu sidebar in super admin pages for help texts | admin.module.ts: In manage profiles page set hasAdminMenu: true, hasSidebar: false & removed path: 'irish/admin-tools' - :stakeholder will be called instead.
This commit is contained in:
parent
184b8172ed
commit
43a16b1d5e
|
@ -17,11 +17,12 @@ import {Irish} from "../shared/irish";
|
|||
<div>
|
||||
<loading *ngIf="loading" class="uk-position-center"></loading>
|
||||
<div *ngIf="!loading" class="sidebar_main_swipe uk-flex uk-background-default"
|
||||
[class.sidebar_main_active]="open && (hasSidebar || hasInternalSidebar)"
|
||||
[class.sidebar_mini]="!open && (hasSidebar || hasInternalSidebar)"
|
||||
[class.sidebar_main_active]="open && (hasSidebar || hasInternalSidebar || hasAdminMenu)"
|
||||
[class.sidebar_mini]="!open && (hasSidebar || hasInternalSidebar || hasAdminMenu)"
|
||||
[class.sidebar_hover]="hover">
|
||||
<dashboard-sidebar *ngIf="hasSidebar && !hasInternalSidebar && sideBarItems.length > 0" [logoURL]="stakeholder | logoUrl"
|
||||
[items]="sideBarItems" [backItem]="backItem"></dashboard-sidebar>
|
||||
<dashboard-sidebar *ngIf="hasAdminMenu && !hasInternalSidebar" [items]="adminMenuItems" [backItem]="backItem"></dashboard-sidebar>
|
||||
<div class="uk-width-1-1">
|
||||
<router-outlet></router-outlet>
|
||||
</div>
|
||||
|
@ -65,6 +66,19 @@ export class AdminComponent extends SidebarBaseComponent implements OnInit {
|
|||
if (this.isAdmin) {
|
||||
this.sideBarItems.push(new MenuItem("admin-tools", "Pages & Entities", "", "/admin/" + this.stakeholder.alias + "/admin-tools/pages", false, [], [], {}, {name: 'description'}, null, "uk-visible@m", "/admin/" + this.stakeholder.alias + "/admin-tools"));
|
||||
}
|
||||
if (this.hasAdminMenu) {
|
||||
this.adminMenuItems = [];
|
||||
this.backItem = null;
|
||||
this.adminMenuItems.push(new MenuItem("stakeholders", "Manage profiles", "", "/admin", false, [], [], {}, {name: 'settings'}));
|
||||
if (Session.isPortalAdministrator(this.user)) {
|
||||
this.adminMenuItems.push(new MenuItem("adminOptions", "Super Admin options", "", "/admin/admin-tools/portals", false, [], [], {}, {name: 'settings'}, null, "uk-visible@m", '/admin/admin-tools'));
|
||||
}
|
||||
if (Session.isPortalAdministrator(this.user) || Session.isMonitorCurator(this.user)) {
|
||||
this.adminMenuItems.push(new MenuItem("irishOptions", "Irish options", "", "/admin/irish/admin-tools/pages", false, [], [], {}, {name: 'settings'}, null, "uk-visible@m", '/admin/irish/admin-tools'));
|
||||
}
|
||||
this.hasAdminMenu = this.hasAdminMenu && this.adminMenuItems.length > 1;
|
||||
}
|
||||
|
||||
this.backItem = new MenuItem("back", "Manage profiles", "", "/admin", false, [], null, {}, {name: 'west'});
|
||||
this.loading = false;
|
||||
}));
|
||||
|
@ -74,6 +88,18 @@ export class AdminComponent extends SidebarBaseComponent implements OnInit {
|
|||
this.layoutService.setRootClass(null);
|
||||
this.hasSidebar = false;
|
||||
this.loading = false;
|
||||
if (this.hasAdminMenu) {
|
||||
this.adminMenuItems = [];
|
||||
this.backItem = null;
|
||||
this.adminMenuItems.push(new MenuItem("stakeholders", "Manage profiles", "", "/admin", false, [], [], {}, {name: 'settings'}));
|
||||
if (Session.isPortalAdministrator(this.user)) {
|
||||
this.adminMenuItems.push(new MenuItem("adminOptions", "Super Admin options", "", "/admin/admin-tools/portals", false, [], [], {}, {name: 'settings'}, null, "uk-visible@m", '/admin/admin-tools'));
|
||||
}
|
||||
if (Session.isPortalAdministrator(this.user) || Session.isMonitorCurator(this.user)) {
|
||||
this.adminMenuItems.push(new MenuItem("irishOptions", "Irish options", "", "/admin/irish/admin-tools/pages", false, [], [], {}, {name: 'settings'}, null, "uk-visible@m", '/admin/irish/admin-tools'));
|
||||
}
|
||||
this.hasAdminMenu = this.hasAdminMenu && this.adminMenuItems.length > 1;
|
||||
}
|
||||
}
|
||||
}));
|
||||
}));
|
||||
|
|
|
@ -14,7 +14,8 @@ import {AdminLoginGuard} from "../openaireLibrary/login/adminLoginGuard.guard";
|
|||
path: '', component: AdminComponent, children: [
|
||||
{
|
||||
path: '',
|
||||
loadChildren: () => import('../openaireLibrary/monitor-admin/manageStakeholders/manageStakeholders.module').then(m => m.ManageStakeholdersModule)
|
||||
loadChildren: () => import('../openaireLibrary/monitor-admin/manageStakeholders/manageStakeholders.module').then(m => m.ManageStakeholdersModule),
|
||||
data: {hasAdminMenu: true, hasSidebar: false}
|
||||
},
|
||||
{
|
||||
path: 'admin-tools',
|
||||
|
@ -22,12 +23,6 @@ import {AdminLoginGuard} from "../openaireLibrary/login/adminLoginGuard.guard";
|
|||
canActivateChild: [AdminLoginGuard],
|
||||
data: {hasAdminMenu: true, hasSidebar: false}
|
||||
},
|
||||
{
|
||||
path: 'irish/admin-tools',
|
||||
loadChildren: () => import('../admin-tools/admin-tools-routing.module').then(m => m.AdminToolsRoutingModule),
|
||||
canActivateChild: [AdminLoginGuard],
|
||||
data: {hasAdminMenu: true, hasSidebar: false, portal: 'irish', monitorCurator: true, parentClass: 'monitor'}
|
||||
},
|
||||
{
|
||||
path: ':stakeholder', children: [
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue