Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2021-01-20 22:34:23 +0300
committerRobert Speicher <rspeicher@gmail.com>2021-01-20 22:34:23 +0300
commit6438df3a1e0fb944485cebf07976160184697d72 (patch)
tree00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /app/assets/javascripts/ci_variable_list
parent42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff)
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'app/assets/javascripts/ci_variable_list')
-rw-r--r--app/assets/javascripts/ci_variable_list/ci_variable_list.js21
-rw-r--r--app/assets/javascripts/ci_variable_list/components/ci_environments_dropdown.vue2
-rw-r--r--app/assets/javascripts/ci_variable_list/components/ci_variable_table.vue2
-rw-r--r--app/assets/javascripts/ci_variable_list/store/actions.js8
-rw-r--r--app/assets/javascripts/ci_variable_list/store/getters.js4
-rw-r--r--app/assets/javascripts/ci_variable_list/store/utils.js8
6 files changed, 21 insertions, 24 deletions
diff --git a/app/assets/javascripts/ci_variable_list/ci_variable_list.js b/app/assets/javascripts/ci_variable_list/ci_variable_list.js
index cb1935c863d..aa4d311527e 100644
--- a/app/assets/javascripts/ci_variable_list/ci_variable_list.js
+++ b/app/assets/javascripts/ci_variable_list/ci_variable_list.js
@@ -81,17 +81,17 @@ export default class VariableList {
this.initRow(rowEl);
});
- this.$container.on('click', '.js-row-remove-button', e => {
+ this.$container.on('click', '.js-row-remove-button', (e) => {
e.preventDefault();
this.removeRow($(e.currentTarget).closest('.js-row'));
});
const inputSelector = Object.keys(this.inputMap)
- .map(name => this.inputMap[name].selector)
+ .map((name) => this.inputMap[name].selector)
.join(',');
// Remove any empty rows except the last row
- this.$container.on('blur', inputSelector, e => {
+ this.$container.on('blur', inputSelector, (e) => {
const $row = $(e.currentTarget).closest('.js-row');
if ($row.is(':not(:last-child)') && !this.checkIfRowTouched($row)) {
@@ -99,7 +99,7 @@ export default class VariableList {
}
});
- this.$container.on('input trigger-change', inputSelector, e => {
+ this.$container.on('input trigger-change', inputSelector, (e) => {
// Always make sure there is an empty last row
const $lastRow = this.$container.find('.js-row').last();
@@ -149,7 +149,7 @@ export default class VariableList {
$rowClone.removeAttr('data-is-persisted');
// Reset the inputs to their defaults
- Object.keys(this.inputMap).forEach(name => {
+ Object.keys(this.inputMap).forEach((name) => {
const entry = this.inputMap[name];
$rowClone.find(entry.selector).val(entry.default);
});
@@ -184,7 +184,7 @@ export default class VariableList {
}
checkIfRowTouched($row) {
- return Object.keys(this.inputMap).some(name => {
+ return Object.keys(this.inputMap).some((name) => {
// Row should not qualify as touched if only switches have been touched
if (['protected', 'masked'].includes(name)) return false;
@@ -223,14 +223,11 @@ export default class VariableList {
getAllData() {
// Ignore the last empty row because we don't want to try persist
// a blank variable and run into validation problems.
- const validRows = this.$container
- .find('.js-row')
- .toArray()
- .slice(0, -1);
+ const validRows = this.$container.find('.js-row').toArray().slice(0, -1);
- return validRows.map(rowEl => {
+ return validRows.map((rowEl) => {
const resultant = {};
- Object.keys(this.inputMap).forEach(name => {
+ Object.keys(this.inputMap).forEach((name) => {
const entry = this.inputMap[name];
const $input = $(rowEl).find(entry.selector);
if ($input.length) {
diff --git a/app/assets/javascripts/ci_variable_list/components/ci_environments_dropdown.vue b/app/assets/javascripts/ci_variable_list/components/ci_environments_dropdown.vue
index 83e9717041f..104d6672015 100644
--- a/app/assets/javascripts/ci_variable_list/components/ci_environments_dropdown.vue
+++ b/app/assets/javascripts/ci_variable_list/components/ci_environments_dropdown.vue
@@ -33,7 +33,7 @@ export default {
},
filteredResults() {
const lowerCasedSearchTerm = this.searchTerm.toLowerCase();
- return this.joinedEnvironments.filter(resultString =>
+ return this.joinedEnvironments.filter((resultString) =>
resultString.toLowerCase().includes(lowerCasedSearchTerm),
);
},
diff --git a/app/assets/javascripts/ci_variable_list/components/ci_variable_table.vue b/app/assets/javascripts/ci_variable_list/components/ci_variable_table.vue
index 07278bb442c..47b2745af08 100644
--- a/app/assets/javascripts/ci_variable_list/components/ci_variable_table.vue
+++ b/app/assets/javascripts/ci_variable_list/components/ci_variable_table.vue
@@ -69,7 +69,7 @@ export default {
},
fields() {
if (this.isGroup) {
- return this.$options.fields.filter(field => field.key !== 'environment_scope');
+ return this.$options.fields.filter((field) => field.key !== 'environment_scope');
}
return this.$options.fields;
},
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);