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: add search box to table/column data table (#9468)
boojacka3ecad8867d1
diff --git a/frontend/src/components/ColumnDataTable/index.vue b/frontend/src/components/ColumnDataTable/index.vueindex e8d0429ddb..46a58b1e48 100644--- a/frontend/src/components/ColumnDataTable/index.vue+++ b/frontend/src/components/ColumnDataTable/index.vue@@ -1,7 +1,7 @@<template><NDataTable:columns="columns"- :data="columnList"+ :data="filteredColumnList":max-height="640":virtual-scroll="true":striped="true"@@ -59,6 +59,11 @@ const props = defineProps({DataClassificationSetting_DataClassificationConfig | undefined>,},+ search: {+ required: false,+ default: "",+ type: String,+ },});const { t } = useI18n();@@ -252,4 +257,13 @@ const columns = computed(() => {return columns.filter((column) => !column.hide);});++const filteredColumnList = computed(() => {+ if (props.search) {+ return props.columnList.filter((column) => {+ return column.name.toLowerCase().includes(props.search.toLowerCase());+ });+ }+ return props.columnList;+});</script>diff --git a/frontend/src/components/DatabaseOverviewPanel.vue b/frontend/src/components/DatabaseOverviewPanel.vueindex eb5e16e283..9f18aa91fa 100644--- a/frontend/src/components/DatabaseOverviewPanel.vue+++ b/frontend/src/components/DatabaseOverviewPanel.vue@@ -98,17 +98,27 @@</div><template v-if="databaseEngine !== Engine.REDIS">- <div class="text-lg leading-6 font-medium text-main mb-4">- <span v-if="databaseEngine === Engine.MONGODB">{{- $t("db.collections")- }}</span>- <span v-else>{{ $t("db.tables") }}</span>+ <div class="mb-4 w-full flex flex-row justify-between items-center">+ <div class="text-lg leading-6 font-medium text-main">+ <span v-if="databaseEngine === Engine.MONGODB">{{+ $t("db.collections")+ }}</span>+ <span v-else>{{ $t("db.tables") }}</span>+ </div>+ <div>+ <SearchBox+ :value="state.tableNameSearchKeyword"+ :placeholder="$t('common.filter-by-name')"+ @update:value="state.tableNameSearchKeyword = $event"+ />+ </div></div><TableDataTable:database="database":schema-name="state.selectedSchemaName":table-list="tableList"+ :search="state.tableNameSearchKeyword"/><div class="mt-6 text-lg leading-6 font-medium text-main mb-4">@@ -181,6 +191,7 @@ import TaskTable from "./TaskTable.vue";interface LocalState {selectedSchemaName: string;+ tableNameSearchKeyword: string;editingDataSource?: DataSource;}@@ -193,6 +204,7 @@ const props = defineProps({const route = useRoute();const state = reactive<LocalState>({selectedSchemaName: "",+ tableNameSearchKeyword: "",});const dbSchemaStore = useDBSchemaV1Store();diff --git a/frontend/src/components/TableDataTable.vue b/frontend/src/components/TableDataTable.vueindex 4431660f4b..9d1744af11 100644--- a/frontend/src/components/TableDataTable.vue+++ b/frontend/src/components/TableDataTable.vue@@ -51,6 +51,10 @@ const props = defineProps({required: true,type: Object as PropType<TableMetadata[]>,},+ search: {+ type: String,+ default: "",+ },});const { t } = useI18n();@@ -184,6 +188,11 @@ const reservedTableList = computed(() =>const mixedTableList = computed(() => {const tableList = [...regularTableList.value, ...reservedTableList.value];+ if (props.search) {+ return tableList.filter((table) => {+ return table.name.toLowerCase().includes(props.search.toLowerCase());+ });+ }return tableList;});</script>diff --git a/frontend/src/components/TableDetailDrawer.vue b/frontend/src/components/TableDetailDrawer.vueindex 75340cc783..f319d8d51b 100644--- a/frontend/src/components/TableDetailDrawer.vue+++ b/frontend/src/components/TableDetailDrawer.vue@@ -164,8 +164,17 @@</div><div v-if="shouldShowColumnTable" class="mt-6 px-6">- <div class="text-lg leading-6 font-medium text-main mb-4">- {{ $t("database.columns") }}+ <div class="mb-4 w-full flex flex-row justify-between items-center">+ <div class="text-lg leading-6 font-medium text-main">+ {{ $t("database.columns") }}+ </div>+ <div>+ <SearchBox+ :value="state.columnNameSearchKeyword"+ :placeholder="$t('common.filter-by-name')"+ @update:value="state.columnNameSearchKeyword = $event"+ />+ </div></div><ColumnDataTable:database="database"@@ -174,6 +183,7 @@:column-list="table.columns":mask-data-list="sensitiveDataList":classification-config="classificationConfig"+ :search="state.columnNameSearchKeyword"/></div>@@ -190,7 +200,7 @@</template><script lang="ts" setup>-import { computed, watch, ref } from "vue";+import { computed, watch, ref, reactive } from "vue";import {DatabaseV1Name,InstanceV1Name,@@ -218,6 +228,10 @@ import ColumnDataTable from "./ColumnDataTable/index.vue";import { SQLEditorButtonV1 } from "./DatabaseDetail";import IndexTable from "./IndexTable.vue";+interface LocalState {+ columnNameSearchKeyword: string;+}+const props = defineProps<{show: boolean;// Format: /databases/:databaseName@@ -232,6 +246,9 @@ defineEmits(["dismiss"]);const databaseV1Store = useDatabaseV1Store();const dbSchemaStore = useDBSchemaV1Store();const currentUserV1 = useCurrentUserV1();+const state = reactive<LocalState>({+ columnNameSearchKeyword: "",+});const table = ref<TableMetadata>();const database = computed(() => {