diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-11-21 12:47:17 -0500 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-11-21 13:57:11 -0500 |
commit | 5ccd70844655c1eb18754c67dfcf8b92b77aab9e (patch) | |
tree | c282c4eabb4cbb40bf0df8f2a9ade2e6fd0b2cbe /app | |
parent | a7430ebc6ab7e8f3ccb804e41584bfce9ca9390e (diff) | |
download | gitlab-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.es6 | 7 |
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) { |