diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 13:34:23 -0600 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 13:34:23 -0600 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /app/assets/javascripts/ci_variable_list/store | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) | |
download | gitlab-ce-6438df3a1e0fb944485cebf07976160184697d72.tar.gz |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'app/assets/javascripts/ci_variable_list/store')
3 files changed, 10 insertions, 10 deletions
diff --git a/app/assets/javascripts/ci_variable_list/store/actions.js b/app/assets/javascripts/ci_variable_list/store/actions.js index e3e9dac0a79..ac595fa0045 100644 --- a/app/assets/javascripts/ci_variable_list/store/actions.js +++ b/app/assets/javascripts/ci_variable_list/store/actions.js @@ -47,7 +47,7 @@ export const addVariable = ({ state, dispatch }) => { dispatch('receiveAddVariableSuccess'); dispatch('fetchVariables'); }) - .catch(error => { + .catch((error) => { createFlash(error.response.data[0]); dispatch('receiveAddVariableError', error); }); @@ -77,7 +77,7 @@ export const updateVariable = ({ state, dispatch }) => { dispatch('receiveUpdateVariableSuccess'); dispatch('fetchVariables'); }) - .catch(error => { + .catch((error) => { createFlash(error.response.data[0]); dispatch('receiveUpdateVariableError', error); }); @@ -132,7 +132,7 @@ export const deleteVariable = ({ dispatch, state }) => { dispatch('receiveDeleteVariableSuccess'); dispatch('fetchVariables'); }) - .catch(error => { + .catch((error) => { createFlash(error.response.data[0]); dispatch('receiveDeleteVariableError', error); }); @@ -150,7 +150,7 @@ export const fetchEnvironments = ({ dispatch, state }) => { dispatch('requestEnvironments'); return Api.environments(state.projectId) - .then(res => { + .then((res) => { dispatch('receiveEnvironmentsSuccess', prepareEnvironments(res.data)); }) .catch(() => { diff --git a/app/assets/javascripts/ci_variable_list/store/getters.js b/app/assets/javascripts/ci_variable_list/store/getters.js index 619ad54cad6..6570f455541 100644 --- a/app/assets/javascripts/ci_variable_list/store/getters.js +++ b/app/assets/javascripts/ci_variable_list/store/getters.js @@ -1,6 +1,6 @@ import { uniq } from 'lodash'; -export const joinedEnvironments = state => { - const scopesFromVariables = (state.variables || []).map(variable => variable.environment_scope); +export const joinedEnvironments = (state) => { + const scopesFromVariables = (state.variables || []).map((variable) => variable.environment_scope); return uniq(state.environments.concat(scopesFromVariables)).sort(); }; diff --git a/app/assets/javascripts/ci_variable_list/store/utils.js b/app/assets/javascripts/ci_variable_list/store/utils.js index f04530359e7..d9ca460a8e1 100644 --- a/app/assets/javascripts/ci_variable_list/store/utils.js +++ b/app/assets/javascripts/ci_variable_list/store/utils.js @@ -1,12 +1,12 @@ import { cloneDeep } from 'lodash'; import { displayText, types } from '../constants'; -const variableTypeHandler = type => +const variableTypeHandler = (type) => type === displayText.variableText ? types.variableType : types.fileType; -export const prepareDataForDisplay = variables => { +export const prepareDataForDisplay = (variables) => { const variablesToDisplay = []; - variables.forEach(variable => { + variables.forEach((variable) => { const variableCopy = variable; if (variableCopy.variable_type === types.variableType) { variableCopy.variable_type = displayText.variableText; @@ -42,4 +42,4 @@ export const prepareDataForApi = (variable, destroy = false) => { return variableCopy; }; -export const prepareEnvironments = environments => environments.map(e => e.name); +export const prepareEnvironments = (environments) => environments.map((e) => e.name); |