Skip to content
Snippets Groups Projects

Remove Vue set for vue 3 migration from protected environments

Merged Artur Fedorov requested to merge 452467-vue3-migration-protected-environment into master
1 unresolved thread
Files
2
import Vue from 'vue';
import * as types from './mutation_types';
export const mutations = {
@@ -31,15 +30,21 @@ export const mutations = {
state.loading = false;
},
[types.RECEIVE_MEMBER_SUCCESS](state, { type, rule, users }) {
Vue.set(state.usersForRules, `${type}-${rule.id}`, users);
state.usersForRules = {
...state.usersForRules,
[`${type}-${rule.id}`]: users,
};
},
[types.REQUEST_UPDATE_PROTECTED_ENVIRONMENT](state) {
state.loading = true;
},
[types.RECEIVE_UPDATE_PROTECTED_ENVIRONMENT_SUCCESS](state, environment) {
const index = state.protectedEnvironments.findIndex((env) => env.name === environment.name);
Vue.set(state.protectedEnvironments, index, environment);
Vue.set(state.newDeployAccessLevelsForEnvironment, environment.name, []);
state.protectedEnvironments[index] = environment;
state.newDeployAccessLevelsForEnvironment = {
...state.newDeployAccessLevelsForEnvironment,
[environment.name]: [],
};
state.loading = false;
},
@@ -50,14 +55,23 @@ export const mutations = {
state.newDeployAccessLevelsForEnvironment[environment.name] = rules;
},
[types.EDIT_RULE](state, rule) {
Vue.set(state.editingRules, rule.id, { ...rule });
state.editingRules = {
...state.editingRules,
[rule.id]: { ...rule },
};
},
[types.RECEIVE_RULE_UPDATED](state, rule) {
Vue.set(state.editingRules, rule.id, null);
state.editingRules = {
...state.editingRules,
[rule.id]: null,
};
},
[types.DELETE_PROTECTED_ENVIRONMENT_SUCCESS](state, { name }) {
state.protectedEnvironments = state.protectedEnvironments.filter((env) => env.name !== name);
Vue.set(state.newDeployAccessLevelsForEnvironment, name, []);
state.newDeployAccessLevelsForEnvironment = {
...state.newDeployAccessLevelsForEnvironment,
[name]: [],
};
state.loading = false;
},
Loading