Skip to content

Commit 54dbfa1

Browse files
marie-jjleveugle
authored andcommitted
fix(pci.project): display kubernetes action only for EU region
1 parent 3fe7bfa commit 54dbfa1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/manager/modules/pci/src/projects/project/project.constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const ACTIONS = [
1818
{
1919
translation: 'pci_projects_project_create_cluster_kubernetes',
2020
state: 'pci.projects.project.kubernetes',
21+
regions: ['EU', 'CA'],
2122
},
2223
];
2324

packages/manager/modules/pci/src/projects/project/project.controller.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1+
import isNil from 'lodash/isNil';
2+
13
import { ACTIONS, LINKS } from './project.constants';
24

35
export default class ProjectController {
46
/* @ngInject */
5-
constructor($state, $stateParams, $transitions, OvhApiCloudProject, sidebarVisible) {
7+
constructor($state, $stateParams, $transitions, coreConfig, OvhApiCloudProject, sidebarVisible) {
68
this.$state = $state;
79
this.$stateParams = $stateParams;
810
this.OvhApiCloudProject = OvhApiCloudProject;
911
this.sidebarVisible = sidebarVisible;
1012
this.loading = false;
1113

12-
this.actions = ACTIONS;
14+
this.actions = ACTIONS.filter(
15+
({ regions }) => isNil(regions) || regions.includes(coreConfig.getRegion()),
16+
);
1317
this.links = LINKS;
1418
}
1519

0 commit comments

Comments
 (0)