Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore(frontend): changelist improvements (#10202)
Liu Ji8cf012b5d6ab
diff --git a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangeHistoryChangeItem.vue b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangeHistoryChangeItem.vueindex 5df0e5fce4..c89f7b8f85 100644--- a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangeHistoryChangeItem.vue+++ b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangeHistoryChangeItem.vue@@ -19,6 +19,19 @@/><span>@</span><span class="text-sm">{{ changeHistory.version }}</span>+ <router-link+ :to="{+ name: 'workspace.issue.detail',+ params: {+ issueSlug: extractIssueUID(changeHistory.issue),+ },+ }"+ class="normal-link text-sm hover:!no-underline"+ target="_blank"+ @click.stop+ >+ #{{ extractIssueUID(changeHistory.issue) }}+ </router-link></div></div><div@@ -45,7 +58,7 @@ import { RichDatabaseName } from "@/components/v2";import { useChangeHistoryStore, useDatabaseV1Store } from "@/store";import { Changelist_Change as Change } from "@/types/proto/v1/changelist_service";import { ChangeHistory } from "@/types/proto/v1/database_service";-import { extractDatabaseResourceName } from "@/utils";+import { extractDatabaseResourceName, extractIssueUID } from "@/utils";import { displaySemanticType } from "./utils";const props = defineProps<{diff --git a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangeHistoryForm.vue b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangeHistoryForm.vueindex bfe5df8112..151cf34e06 100644--- a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangeHistoryForm.vue+++ b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangeHistoryForm.vue@@ -59,7 +59,7 @@</template><script setup lang="ts">-import { first, isEqual } from "lodash-es";+import { first, isEqual, orderBy } from "lodash-es";import { NCheckbox, NCheckboxGroup } from "naive-ui";import { computed, reactive, watch } from "vue";import { AffectedTableSelect } from "@/components/ChangeHistory";@@ -79,8 +79,8 @@ import {} from "@/types/proto/v1/database_service";import {extractDatabaseResourceName,+ extractIssueUID,getAffectedTablesOfChangeHistory,- keyBy,} from "@/utils";import ChangeHistoryDetailPanel from "../../ChangeHistoryDetailPanel";import { useChangelistDetailContext } from "../../context";@@ -153,27 +153,25 @@ const selectedChangeHistoryList = computed<string[]>({});},set(selected) {- const existedChangesByChangeHistoryName = keyBy(- changes.value,- (change) => change.source- );- const updatedChanges: Change[] = [];+ const changeHistories: ChangeHistory[] = [];for (let i = 0; i < selected.length; i++) {const name = selected[i];const changeHistory =useChangeHistoryStore().getChangeHistoryByName(name);if (changeHistory) {- const existedChange = existedChangesByChangeHistoryName.get(name);- if (existedChange) {- updatedChanges.push(existedChange);- } else {- updatedChanges.push({- sheet: changeHistory.statementSheet,- source: changeHistory.name,- });- }+ changeHistories.push(changeHistory);}}++ const updatedChanges = orderBy(+ changeHistories,+ [(ch) => parseInt(extractIssueUID(ch.issue), 10)],+ ["asc"]+ ).map<Change>((changeHistory) => ({+ sheet: changeHistory.statementSheet,+ source: changeHistory.name,+ version: changeHistory.version,+ }));changes.value = updatedChanges;},});diff --git a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangeHistoryTable/ChangeHistoryTable.vue b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangeHistoryTable/ChangeHistoryTable.vueindex a6fa4055f0..34552156a2 100644--- a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangeHistoryTable/ChangeHistoryTable.vue+++ b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangeHistoryTable/ChangeHistoryTable.vue@@ -28,14 +28,14 @@</div></template><template #item="{ item: changeHistory }: BBGridRow<ChangeHistory>">- <div class="bb-grid-cell" @click.stop.prevent>+ <div class="bb-grid-cell !pr-4" @click.stop.prevent="tryClickCheckbox"><NCheckbox:checked="isSelected(changeHistory)"@update:checked="toggleSelect(changeHistory, $event)"/></div>- <div class="bb-grid-cell">+ <div class="bb-grid-cell !pl-0">{{ displaySemanticType(changeHistory.type) }}</div><div class="bb-grid-cell">@@ -84,8 +84,8 @@ const { t } = useI18n();const columns = computed((): BBGridColumn[] => {return [- { title: "", width: "auto" },- { title: t("common.type"), width: "auto" },+ { title: "", width: "auto", class: "!pr-4" },+ { title: t("common.type"), width: "auto", class: "!pl-0" },{ title: t("common.version"), width: "1fr" },{ title: t("common.issue"), width: "auto" },{@@ -164,4 +164,13 @@ const renderVersion = (item: ChangeHistory) => {const handleClickRow = (item: ChangeHistory) => {emit("click-item", item);};++const tryClickCheckbox = (e: MouseEvent) => {+ console.log(e);+ const div = e.target as HTMLElement;+ const checkbox = div.querySelector(".n-checkbox");+ if (!checkbox) return;+ const e2 = new MouseEvent("click");+ checkbox.dispatchEvent(e2);+};</script>diff --git a/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/Source.vue b/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/Source.vueindex 83a89e13f3..be97df46fd 100644--- a/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/Source.vue+++ b/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/Source.vue@@ -7,6 +7,20 @@<span v-if="changeHistory" class="textinfolabel">{{ changeHistory.version }}</span>+ <router-link+ v-if="changeHistory"+ :to="{+ name: 'workspace.issue.detail',+ params: {+ issueSlug: extractIssueUID(changeHistory.issue),+ },+ }"+ class="normal-link text-sm hover:!no-underline"+ target="_blank"+ @click.stop+ >+ #{{ extractIssueUID(changeHistory.issue) }}+ </router-link></div></template><template v-if="type === 'BRANCH'">@@ -33,7 +47,7 @@ import { File, GitBranch, History } from "lucide-vue-next";import { computed } from "vue";import { useChangeHistoryStore, useBranchStore } from "@/store";import { Changelist_Change as Change } from "@/types/proto/v1/changelist_service";-import { getChangelistChangeSourceType } from "@/utils";+import { extractIssueUID, getChangelistChangeSourceType } from "@/utils";const props = defineProps<{change: Change;