Skip to content

Commit 48c4584

Browse files
marie-jjleveugle
authored andcommitted
fix(pci.sidebar): add filter on menu depending on region
1 parent 0e6dda1 commit 48c4584

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/manager/modules/pci/src/projects/project/sidebar/sidebar.service.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
import includes from 'lodash/includes';
2+
import isUndefined from 'lodash/isUndefined';
13
import { MENU } from './sidebar.constant';
24

35
export default class Sidebar {
46
/* @ngInject */
5-
constructor($translate) {
7+
constructor($translate, coreConfig) {
68
this.$translate = $translate;
9+
10+
this.REGION = coreConfig.getRegion();
711
}
812

913
getSidebarLinks(stateParams) {
@@ -15,7 +19,7 @@ export default class Sidebar {
1519
title: this.$translate.instant(subitem.translation),
1620
...subitem.options,
1721
stateParams,
18-
})),
22+
})).filter(({ regions }) => includes(regions, this.REGION) || isUndefined(regions)),
1923
}));
2024
}
2125
}

0 commit comments

Comments
 (0)