Refactor Add CI/CD variable modal to avoid directly mutating state
The following discussion from !29124 (merged) should be addressed:
-
@sarahghp started a discussion: (+3 comments) It might seem weird that I am setting the key here directly, but since it is being used with
v-model
, it is already two-way bound. It also does not touch the state directly but is filtered through some variable logic inapp/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue
.
We should do this by not passing the store data directly to the v-model
. Instead of directly altering the store via variableData
, we should alter local data and then set/update the store when the form is submitted.
Edited by Sarah Groff Hennigh-Palermo