@@ -9,10 +9,10 @@ import IconDocument from '@carbon/icons-vue/es/document/16';
9
9
import i18n from '@/i18n' ;
10
10
import stores from '@/store'
11
11
12
- import { ref , computed , onMounted } from 'vue' ;
12
+ import { computed , onMounted } from 'vue' ;
13
13
14
14
const AppNavigationData = ( ) => {
15
- const navigationData = ref ( [
15
+ const navigationData = [
16
16
{
17
17
id : 'overview' ,
18
18
label : i18n . global . t ( 'appNavigation.overview' ) ,
@@ -259,7 +259,7 @@ const AppNavigationData = () => {
259
259
route : '/notices' ,
260
260
icon : IconDocument ,
261
261
} ,
262
- ] ) ;
262
+ ] ;
263
263
264
264
const globalStore = stores . GlobalStore ( ) ;
265
265
const roleId = computed (
@@ -275,34 +275,37 @@ const AppNavigationData = () => {
275
275
hmcInfo . value === 'Enabled' ? 'HMCManaged' : 'NonHMCManaged' ,
276
276
) ;
277
277
278
- const navigationItems = computed ( ( ) => {
279
- return navigationData . value . map ( ( section ) => {
280
- const restrictedPages = [ ] ;
281
- section . children ?. forEach ( ( page ) => {
282
- if ( page . restrictTo . length > 0 ) {
283
- const isPageNeeded = page . restrictTo . some (
284
- ( requiredRole ) =>
285
- requiredRole === roleId . value ||
286
- requiredRole === model . value ||
287
- requiredRole === isHmcManged . value ,
288
- ) ;
289
- if ( ! isPageNeeded ) restrictedPages . push ( page ) ;
290
- }
291
- } ) ;
292
- if ( section ?. children && section ?. children . length > 0 ) {
293
- const finalSection = section . children . filter (
294
- ( item ) => ! restrictedPages . includes ( item ) ,
295
- ) ;
296
- section . children = finalSection ;
297
- }
298
- return section ;
299
- } ) ;
300
- } ) ;
278
+ const navigationItems = navigationData ;
279
+ // const navigationItems = computed(() => {
280
+ // console.log('navigationData', navigationData);
281
+ // return navigationData.map((section) => {
282
+ // const restrictedPages = [];
283
+ // section.children?.forEach((page) => {
284
+ // if (page.restrictTo.length > 0) {
285
+ // const isPageNeeded = page.restrictTo.some(
286
+ // (requiredRole) =>
287
+ // requiredRole === roleId.value ||
288
+ // requiredRole === model.value ||
289
+ // requiredRole === isHmcManged.value,
290
+ // );
291
+ // if (!isPageNeeded) restrictedPages.push(page);
292
+ // }
293
+ // });
294
+ // if (section?.children && section?.children.length > 0) {
295
+ // const finalSection = section.children.filter(
296
+ // (item) => !restrictedPages.includes(item),
297
+ // );
298
+ // section.children = finalSection;
299
+ // }
300
+ // console.log('section', section);
301
+ // return section;
302
+ // });
303
+ // });
301
304
302
305
onMounted ( ( ) => {
303
306
globalStore . getHmcManaged ( ) ;
304
307
} ) ;
305
-
308
+
306
309
return {
307
310
navigationItems,
308
311
roleId,
0 commit comments