Merge pull request #1145 from atmire/w2p-79218_remove-menu-options-for-disabled-features

Remove menu options for disabled features
This commit is contained in:
Tim Donohue
2021-05-12 14:43:16 -05:00
committed by GitHub

View File

@@ -179,17 +179,18 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
link: '/processes/new' link: '/processes/new'
} as LinkMenuItemModel, } as LinkMenuItemModel,
}, },
{ // TODO: enable this menu item once the feature has been implemented
id: 'new_item_version', // {
parentID: 'new', // id: 'new_item_version',
active: false, // parentID: 'new',
visible: true, // active: false,
model: { // visible: true,
type: MenuItemType.LINK, // model: {
text: 'menu.section.new_item_version', // type: MenuItemType.LINK,
link: '' // text: 'menu.section.new_item_version',
} as LinkMenuItemModel, // link: ''
}, // } as LinkMenuItemModel,
// },
/* Edit */ /* Edit */
{ {
@@ -243,47 +244,35 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
} as OnClickMenuItemModel, } as OnClickMenuItemModel,
}, },
/* Curation tasks */
{
id: 'curation_tasks',
active: false,
visible: isCollectionAdmin,
model: {
type: MenuItemType.LINK,
text: 'menu.section.curation_task',
link: ''
} as LinkMenuItemModel,
icon: 'filter',
index: 7
},
/* Statistics */ /* Statistics */
{ // TODO: enable this menu item once the feature has been implemented
id: 'statistics_task', // {
active: false, // id: 'statistics_task',
visible: true, // active: false,
model: { // visible: true,
type: MenuItemType.LINK, // model: {
text: 'menu.section.statistics_task', // type: MenuItemType.LINK,
link: '' // text: 'menu.section.statistics_task',
} as LinkMenuItemModel, // link: ''
icon: 'chart-bar', // } as LinkMenuItemModel,
index: 8 // icon: 'chart-bar',
}, // index: 8
// },
/* Control Panel */ /* Control Panel */
{ // TODO: enable this menu item once the feature has been implemented
id: 'control_panel', // {
active: false, // id: 'control_panel',
visible: isSiteAdmin, // active: false,
model: { // visible: isSiteAdmin,
type: MenuItemType.LINK, // model: {
text: 'menu.section.control_panel', // type: MenuItemType.LINK,
link: '' // text: 'menu.section.control_panel',
} as LinkMenuItemModel, // link: ''
icon: 'cogs', // } as LinkMenuItemModel,
index: 9 // icon: 'cogs',
}, // index: 9
// },
/* Processes */ /* Processes */
{ {
@@ -324,42 +313,45 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
index: 3, index: 3,
shouldPersistOnRouteChange: true shouldPersistOnRouteChange: true
}, },
{ // TODO: enable this menu item once the feature has been implemented
id: 'export_community', // {
parentID: 'export', // id: 'export_community',
active: false, // parentID: 'export',
visible: true, // active: false,
model: { // visible: true,
type: MenuItemType.LINK, // model: {
text: 'menu.section.export_community', // type: MenuItemType.LINK,
link: '' // text: 'menu.section.export_community',
} as LinkMenuItemModel, // link: ''
shouldPersistOnRouteChange: true // } as LinkMenuItemModel,
}, // shouldPersistOnRouteChange: true
{ // },
id: 'export_collection', // TODO: enable this menu item once the feature has been implemented
parentID: 'export', // {
active: false, // id: 'export_collection',
visible: true, // parentID: 'export',
model: { // active: false,
type: MenuItemType.LINK, // visible: true,
text: 'menu.section.export_collection', // model: {
link: '' // type: MenuItemType.LINK,
} as LinkMenuItemModel, // text: 'menu.section.export_collection',
shouldPersistOnRouteChange: true // link: ''
}, // } as LinkMenuItemModel,
{ // shouldPersistOnRouteChange: true
id: 'export_item', // },
parentID: 'export', // TODO: enable this menu item once the feature has been implemented
active: false, // {
visible: true, // id: 'export_item',
model: { // parentID: 'export',
type: MenuItemType.LINK, // active: false,
text: 'menu.section.export_item', // visible: true,
link: '' // model: {
} as LinkMenuItemModel, // type: MenuItemType.LINK,
shouldPersistOnRouteChange: true // text: 'menu.section.export_item',
}, // link: ''
// } as LinkMenuItemModel,
// shouldPersistOnRouteChange: true
// },
]; ];
menuList.forEach((menuSection) => this.menuService.addSection(this.menuID, menuSection)); menuList.forEach((menuSection) => this.menuService.addSection(this.menuID, menuSection));
@@ -406,17 +398,18 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
icon: 'file-import', icon: 'file-import',
index: 2 index: 2
}, },
{ // TODO: enable this menu item once the feature has been implemented
id: 'import_batch', // {
parentID: 'import', // id: 'import_batch',
active: false, // parentID: 'import',
visible: true, // active: false,
model: { // visible: true,
type: MenuItemType.LINK, // model: {
text: 'menu.section.import_batch', // type: MenuItemType.LINK,
link: '' // text: 'menu.section.import_batch',
} as LinkMenuItemModel, // link: ''
} // } as LinkMenuItemModel,
// }
]; ];
menuList.forEach((menuSection) => this.menuService.addSection(this.menuID, Object.assign(menuSection, { menuList.forEach((menuSection) => this.menuService.addSection(this.menuID, Object.assign(menuSection, {
shouldPersistOnRouteChange: true shouldPersistOnRouteChange: true
@@ -563,17 +556,18 @@ export class AdminSidebarComponent extends MenuComponent implements OnInit {
link: '/access-control/groups' link: '/access-control/groups'
} as LinkMenuItemModel, } as LinkMenuItemModel,
}, },
{ // TODO: enable this menu item once the feature has been implemented
id: 'access_control_authorizations', // {
parentID: 'access_control', // id: 'access_control_authorizations',
active: false, // parentID: 'access_control',
visible: authorized, // active: false,
model: { // visible: authorized,
type: MenuItemType.LINK, // model: {
text: 'menu.section.access_control_authorizations', // type: MenuItemType.LINK,
link: '' // text: 'menu.section.access_control_authorizations',
} as LinkMenuItemModel, // link: ''
}, // } as LinkMenuItemModel,
// },
{ {
id: 'access_control', id: 'access_control',
active: false, active: false,