Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

refactor: replace DataExportIssueDataTable with standard IssueTableV1 (#17333)

boojack92ca9cb46fcd
diff --git a/frontend/src/components/DatabaseInfo.vue b/frontend/src/components/DatabaseInfo.vue
index 8b180884fc..591f9d70cd 100644
--- a/frontend/src/components/DatabaseInfo.vue
+++ b/frontend/src/components/DatabaseInfo.vue
@@ -1,5 +1,5 @@
<template>
- <div class="flex items-center flex-wrap gap-1" @click.stop.prevent>
+ <div class="flex items-center flex-wrap gap-1">
<InstanceV1Name
:instance="database.instanceResource"
:plain="true"
diff --git a/frontend/src/components/IssueV1/components/DescriptionSection/DescriptionSection.vue b/frontend/src/components/IssueV1/components/DescriptionSection/DescriptionSection.vue
index 7c30769e6f..e4925bd3f8 100644
--- a/frontend/src/components/IssueV1/components/DescriptionSection/DescriptionSection.vue
+++ b/frontend/src/components/IssueV1/components/DescriptionSection/DescriptionSection.vue
@@ -1,7 +1,7 @@
<template>
- <div class="px-6 py-5 flex flex-col gap-y-4">
+ <div class="px-4 py-2 flex flex-col gap-y-2">
<div class="flex items-center justify-between">
- <span class="text-base font-semibold text-gray-900">
+ <span class="textlabel">
{{ title }}
</span>
diff --git a/frontend/src/components/Plan/components/RolloutView/context.ts b/frontend/src/components/Plan/components/RolloutView/context.ts
index 4ec8bc5a45..128b369978 100644
--- a/frontend/src/components/Plan/components/RolloutView/context.ts
+++ b/frontend/src/components/Plan/components/RolloutView/context.ts
@@ -50,6 +50,12 @@ export const provideRolloutViewContext = () => {
const fetchRolloutPreview = async () => {
try {
+ // Validate that rollout has required fields before making the request
+ if (!rollout.value?.plan || !project.value?.name) {
+ rolloutPreview.value = create(RolloutSchema, {});
+ return;
+ }
+
const rolloutPreviewNew = await rolloutServiceClientConnect.createRollout(
create(CreateRolloutRequestSchema, {
parent: project.value.name,
diff --git a/frontend/src/views/ExportCenter/DataExportIssueDataTable/DataExportIssueDataTable.vue b/frontend/src/views/ExportCenter/DataExportIssueDataTable/DataExportIssueDataTable.vue
deleted file mode 100644
index e91c9043d7..0000000000
--- a/frontend/src/views/ExportCenter/DataExportIssueDataTable/DataExportIssueDataTable.vue
+++ /dev/null
@@ -1,226 +0,0 @@
-<template>
- <div ref="tableRef">
- <NDataTable
- :columns="columnList"
- :data="issueList"
- :striped="true"
- :bordered="true"
- :loading="loading"
- :row-key="(issue: ComposedIssue) => issue.name"
- :row-props="rowProps"
- class="data-export-issue-table"
- />
- </div>
-</template>
-
-<script lang="tsx" setup>
-import { useElementSize } from "@vueuse/core";
-import { head } from "lodash-es";
-import type { DataTableColumn } from "naive-ui";
-import { NPerformantEllipsis, NDataTable } from "naive-ui";
-import { computed, watch, ref } from "vue";
-import { useI18n } from "vue-i18n";
-import { useRouter } from "vue-router";
-import DatabaseInfo from "@/components/DatabaseInfo.vue";
-import IssueLabelSelector, {
- getValidIssueLabels,
-} from "@/components/IssueV1/components/IssueLabelSelector.vue";
-import IssueStatusIconWithTaskSummary from "@/components/IssueV1/components/IssueStatusIconWithTaskSummary.vue";
-import { projectOfIssue } from "@/components/IssueV1/logic";
-import { PROJECT_V1_ROUTE_ISSUE_DETAIL } from "@/router/dashboard/projectV1";
-import { useSheetV1Store } from "@/store";
-import { getTimeForPbTimestampProtoEs, type ComposedIssue } from "@/types";
-import { databaseForTask } from "@/utils";
-import {
- extractProjectResourceName,
- humanizeTs,
- flattenTaskV1List,
- issueV1Slug,
- extractIssueUID,
-} from "@/utils";
-
-const { t } = useI18n();
-
-const props = withDefaults(
- defineProps<{
- issueList: ComposedIssue[];
- loading?: boolean;
- }>(),
- {
- loading: true,
- }
-);
-
-const router = useRouter();
-const sheetStore = useSheetV1Store();
-
-const tableRef = ref<HTMLDivElement>();
-const { width: tableWidth } = useElementSize(tableRef);
-const showExtendedColumns = computed(() => {
- return tableWidth.value > 800;
-});
-
-const columnList = computed((): DataTableColumn<ComposedIssue>[] => {
- const columns: (DataTableColumn<ComposedIssue> & { hide?: boolean })[] = [
- {
- key: "title",
- title: t("issue.table.name"),
- resizable: true,
- render: (issue) => {
- return (
- <div class="flex items-center overflow-hidden space-x-2">
- <IssueStatusIconWithTaskSummary issue={issue} />
- <div class="whitespace-nowrap text-control">
- {extractIssueUID(issue.name)}
- </div>
- <NPerformantEllipsis class="flex-1 truncate">
- {{
- default: () => <span>{issue.title}</span>,
- tooltip: () => (
- <div class="whitespace-pre-wrap break-words break-all">
- {issue.title}
- </div>
- ),
- }}
- </NPerformantEllipsis>
- </div>
- );
- },
- },
- {
- key: "labels",
- title: t("common.labels"),
- width: 144,
- resizable: true,
- render: (issue) => {
- const labels = getValidIssueLabels(
- issue.labels,
- projectOfIssue(issue).issueLabels
- );
- if (labels.length === 0) {
- return "-";
- }
- return (
- <IssueLabelSelector
- disabled={true}
- selected={labels}
- size="small"
- maxTagCount="responsive"
- project={projectOfIssue(issue)}
- />
- );
- },
- },
- {
- key: "database",
- title: t("common.database"),
- width: 300,
- resizable: true,
- hide: !showExtendedColumns.value,
- render: (issue) => {
- const database = issueRelatedDatabase(issue);
- if (!database) {
- return "-";
- }
- return <DatabaseInfo database={database} />;
- },
- },
- {
- key: "statement",
- title: t("common.statement"),
- resizable: true,
- ellipsis: true,
- hide: !showExtendedColumns.value,
- render: (issue) => {
- const statement = issueRelatedStatement(issue);
- return statement || "-";
- },
- },
- {
- key: "updateTime",
- title: t("issue.table.updated"),
- width: 150,
- resizable: true,
- hide: !showExtendedColumns.value,
- render: (issue) =>
- humanizeTs(getTimeForPbTimestampProtoEs(issue.updateTime, 0) / 1000),
- },
- ];
- return columns.filter((column) => !column.hide);
-});
-
-const rowProps = (issue: ComposedIssue) => {
- return {
- style: "cursor: pointer;",
- onClick: (e: MouseEvent) => {
- const route = router.resolve({
- name: PROJECT_V1_ROUTE_ISSUE_DETAIL,
- params: {
- projectId: extractProjectResourceName(issue.name),
- issueSlug: issueV1Slug(issue.name, issue.title),
- },
- });
- const url = route.fullPath;
- if (e.ctrlKey || e.metaKey) {
- window.open(url, "_blank");
- } else {
- router.push(url);
- }
- },
- };
-};
-
-const issueRelatedDatabase = (issue: ComposedIssue) => {
- const task = head(flattenTaskV1List(issue.rolloutEntity));
- if (!task) {
- return;
- }
- return databaseForTask(projectOfIssue(issue), task);
-};
-
-const issueRelatedStatement = (issue: ComposedIssue) => {
- const task = head(flattenTaskV1List(issue.rolloutEntity));
- const sheetName =
- task?.payload?.case === "databaseDataExport"
- ? task.payload.value.sheet
- : undefined;
- if (!task || !sheetName) {
- return;
- }
- const sheet = sheetStore.getSheetByName(sheetName);
- if (!sheet) {
- return;
- }
- const statement = new TextDecoder().decode(sheet.content);
- return statement;
-};
-
-watch(
- () => props.issueList,
- (list) => {
- // Prepare the sheet for each issue.
- for (const issue of list) {
- const task = head(flattenTaskV1List(issue.rolloutEntity));
- const sheetName =
- task?.payload?.case === "databaseDataExport"
- ? task.payload.value.sheet
- : undefined;
- if (!task || !sheetName) {
- continue;
- }
- sheetStore.getOrFetchSheetByName(sheetName);
- }
- }
-);
-</script>
-
-<style scoped lang="postcss">
-:deep(.n-base-selection-tags) {
- @apply !bg-transparent !p-0;
-}
-:deep(.n-base-suffix),
-:deep(.n-base-selection__border),
-:deep(.n-base-selection__state-border) {
- @apply !hidden;
-}
-</style>
diff --git a/frontend/src/views/ExportCenter/DataExportIssueDataTable/index.ts b/frontend/src/views/ExportCenter/DataExportIssueDataTable/index.ts
deleted file mode 100644
index 59cb0f1ca7..0000000000
--- a/frontend/src/views/ExportCenter/DataExportIssueDataTable/index.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import DataExportIssueDataTable from "./DataExportIssueDataTable.vue";
-
-export default DataExportIssueDataTable;
diff --git a/frontend/src/views/ExportCenter/index.vue b/frontend/src/views/ExportCenter/index.vue
index 3e02375bce..c64e4f45ac 100644
--- a/frontend/src/views/ExportCenter/index.vue
+++ b/frontend/src/views/ExportCenter/index.vue
@@ -37,7 +37,7 @@
:fetch-list="fetchIssueList"
>
<template #table="{ list, loading }">
- <DataExportIssueDataTable
+ <IssueTableV1
:loading="loading"
:issue-list="list"
:highlight-text="state.params.query"
@@ -66,6 +66,7 @@ import { computed, reactive, ref, watch } from "vue";
import type { ComponentExposed } from "vue-component-type-helpers";
import DataExportPrepForm from "@/components/DataExportPrepForm";
import IssueSearch from "@/components/IssueV1/components/IssueSearch/IssueSearch.vue";
+import IssueTableV1 from "@/components/IssueV1/components/IssueTableV1.vue";
import { Drawer } from "@/components/v2";
import PagedTable from "@/components/v2/Model/PagedTable.vue";
import {
@@ -85,7 +86,6 @@ import {
type SearchScope,
type SearchScopeId,
} from "@/utils";
-import DataExportIssueDataTable from "./DataExportIssueDataTable";
const props = defineProps<{
projectId: string;
@@ -179,14 +179,11 @@ const fetchIssueList = async ({
pageToken: string;
pageSize: number;
}) => {
- const { nextPageToken, issues } = await issueStore.listIssues(
- {
- find: mergedIssueFilter.value,
- pageSize,
- pageToken,
- },
- { withRollout: true }
- );
+ const { nextPageToken, issues } = await issueStore.listIssues({
+ find: mergedIssueFilter.value,
+ pageSize,
+ pageToken,
+ });
return {
nextPageToken,
list: issues,