summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2016-11-21 12:47:17 -0500
committerAlfredo Sumaran <alfredo@gitlab.com>2016-11-21 13:57:11 -0500
commit5ccd70844655c1eb18754c67dfcf8b92b77aab9e (patch)
treec282c4eabb4cbb40bf0df8f2a9ade2e6fd0b2cbe /app
parenta7430ebc6ab7e8f3ccb804e41584bfce9ca9390e (diff)
downloadgitlab-ce-5ccd70844655c1eb18754c67dfcf8b92b77aab9e.tar.gz
Set isUserAllowed property with value coming from permissions object
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/cycle_analytics/cycle_analytics_store.js.es67
1 files changed, 3 insertions, 4 deletions
diff --git a/app/assets/javascripts/cycle_analytics/cycle_analytics_store.js.es6 b/app/assets/javascripts/cycle_analytics/cycle_analytics_store.js.es6
index b4815338622..5e28a273f9b 100644
--- a/app/assets/javascripts/cycle_analytics/cycle_analytics_store.js.es6
+++ b/app/assets/javascripts/cycle_analytics/cycle_analytics_store.js.es6
@@ -24,13 +24,12 @@
});
newData.stages.forEach((item) => {
+ const stageName = item.title.toLowerCase();
item.active = false;
- item.isUserAllowed = true; // This should come from server
- item.component = `stage-${item.title.toLowerCase()}-component`;
+ item.isUserAllowed = data.permissions[stageName];
+ item.component = `stage-${stageName}-component`;
});
-
newData.analytics = data;
-
return newData;
},
setLoadingState(state) {