Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
Use cloneDeep to avoid accidentally changing the underlying environment order
Tianzhou Chena66a8a454227
diff --git a/frontend/src/components/EnvironmentSelect.vue b/frontend/src/components/EnvironmentSelect.vueindex 4af6104e5c..797250920f 100644--- a/frontend/src/components/EnvironmentSelect.vue+++ b/frontend/src/components/EnvironmentSelect.vue@@ -20,6 +20,7 @@<script lang="ts">import { watchEffect, reactive } from "vue";+import cloneDeep from "lodash-es/cloneDeep";import { useStore } from "vuex";import { Environment } from "../types";@@ -50,7 +51,7 @@ export default {.then((list: Environment[]) => {// Usually env is ordered by ascending importantance, thus we rervese the order to put// more important ones first.- state.environmentList = list.reverse();+ state.environmentList = cloneDeep(list).reverse();if (!state.selectedId && state.environmentList.length > 0) {state.selectedId = state.environmentList[0].id;emit("select-environment-id", state.selectedId);diff --git a/frontend/src/components/EnvironmentTabFilter.vue b/frontend/src/components/EnvironmentTabFilter.vueindex 45ec09a9d5..4a7389b867 100644--- a/frontend/src/components/EnvironmentTabFilter.vue+++ b/frontend/src/components/EnvironmentTabFilter.vue@@ -17,6 +17,7 @@<script lang="ts">import { watchEffect, reactive } from "vue";import { useStore } from "vuex";+import cloneDeep from "lodash-es/cloneDeep";import { Environment } from "../types";interface LocalState {@@ -44,7 +45,7 @@ export default {.then((list: Environment[]) => {// Usually env is ordered by ascending importantance, thus we rervese the order to put// more important ones first.- state.environmentList = list.reverse();+ state.environmentList = cloneDeep(list).reverse();state.tabList = ["All",...list.map((environment) => {