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:
Diffstat (limited to 'app/assets/javascripts/ci_variable_list/store/mutations.js')
-rw-r--r--app/assets/javascripts/ci_variable_list/store/mutations.js35
1 files changed, 26 insertions, 9 deletions
diff --git a/app/assets/javascripts/ci_variable_list/store/mutations.js b/app/assets/javascripts/ci_variable_list/store/mutations.js
index 7d9cd0dd727..961cecee298 100644
--- a/app/assets/javascripts/ci_variable_list/store/mutations.js
+++ b/app/assets/javascripts/ci_variable_list/store/mutations.js
@@ -65,7 +65,8 @@ export default {
},
[types.VARIABLE_BEING_EDITED](state, variable) {
- state.variableBeingEdited = variable;
+ state.variableBeingEdited = true;
+ state.variable = variable;
},
[types.CLEAR_MODAL](state) {
@@ -73,23 +74,19 @@ export default {
variable_type: displayText.variableText,
key: '',
secret_value: '',
- protected: false,
+ protected_variable: false,
masked: false,
environment_scope: displayText.allEnvironmentsText,
};
},
[types.RESET_EDITING](state) {
- state.variableBeingEdited = null;
+ state.variableBeingEdited = false;
state.showInputValue = false;
},
[types.SET_ENVIRONMENT_SCOPE](state, environment) {
- if (state.variableBeingEdited) {
- state.variableBeingEdited.environment_scope = environment;
- } else {
- state.variable.environment_scope = environment;
- }
+ state.variable.environment_scope = environment;
},
[types.ADD_WILD_CARD_SCOPE](state, environment) {
@@ -106,6 +103,26 @@ export default {
},
[types.SET_VARIABLE_PROTECTED](state) {
- state.variable.protected = true;
+ state.variable.protected_variable = true;
+ },
+
+ [types.UPDATE_VARIABLE_KEY](state, key) {
+ state.variable.key = key;
+ },
+
+ [types.UPDATE_VARIABLE_VALUE](state, value) {
+ state.variable.secret_value = value;
+ },
+
+ [types.UPDATE_VARIABLE_TYPE](state, type) {
+ state.variable.variable_type = type;
+ },
+
+ [types.UPDATE_VARIABLE_PROTECTED](state, bool) {
+ state.variable.protected_variable = bool;
+ },
+
+ [types.UPDATE_VARIABLE_MASKED](state, bool) {
+ state.variable.masked = bool;
},
};