Skip to content

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

chore: remove fallback version to changes (#15127)

boojack26ae36d52950
diff --git a/frontend/src/components/Changelist/ChangelistDashboard/ChangelistDataTable.vue b/frontend/src/components/Changelist/ChangelistDashboard/ChangelistDataTable.vue
index 7308034dbe..b15272137c 100644
--- a/frontend/src/components/Changelist/ChangelistDashboard/ChangelistDataTable.vue
+++ b/frontend/src/components/Changelist/ChangelistDashboard/ChangelistDataTable.vue
@@ -18,8 +18,9 @@
import { NDataTable } from "naive-ui";
import type { DataTableColumn, PaginationProps } from "naive-ui";
import { computed } from "vue";
-import { I18nT, useI18n } from "vue-i18n";
+import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
+import { BBAvatar } from "@/bbkit";
import HumanizeDate from "@/components/misc/HumanizeDate.vue";
import { useUserStore } from "@/store";
import { getDateForPbTimestamp } from "@/types";
@@ -72,40 +73,27 @@ const columnList = computed((): ChangelistDataTableColumn[] => {
},
},
{
- key: "updated-by",
+ key: "updated-at",
title: t("common.updated-at"),
width: 256,
render: (changelist) => {
return (
- <I18nT keypath="common.updated-at-by">
- {{
- time: () => (
- <HumanizeDate
- date={getDateForPbTimestamp(changelist.createTime)}
- />
- ),
- user: () => getUser(changelist.creator)?.title,
- }}
- </I18nT>
+ <HumanizeDate date={getDateForPbTimestamp(changelist.createTime)} />
);
},
},
{
- key: "created-by",
- title: t("common.created-at"),
+ key: "creator",
+ title: t("common.creator"),
width: 256,
render: (changelist) => {
+ const creator = getUser(changelist.creator);
+ if (!creator) return null;
return (
- <I18nT keypath="common.created-at-by">
- {{
- time: () => (
- <HumanizeDate
- date={getDateForPbTimestamp(changelist.createTime)}
- />
- ),
- user: () => getUser(changelist.creator)?.title,
- }}
- </I18nT>
+ <div class="flex flex-row items-center overflow-hidden gap-x-1">
+ <BBAvatar size="SMALL" username={creator.title} />
+ <span class="truncate">{creator.title}</span>
+ </div>
);
},
},
diff --git a/frontend/src/components/Changelist/ChangelistDashboard/CreateChangelistPanel.vue b/frontend/src/components/Changelist/ChangelistDashboard/CreateChangelistPanel.vue
index b14e7cd1bf..16e551a87d 100644
--- a/frontend/src/components/Changelist/ChangelistDashboard/CreateChangelistPanel.vue
+++ b/frontend/src/components/Changelist/ChangelistDashboard/CreateChangelistPanel.vue
@@ -179,7 +179,6 @@ import {
type Encoding,
} from "@/utils";
import { getErrorCode } from "@/utils/grpcweb";
-import { fallbackVersionForChange } from "../common";
import { readUpload, type ParsedFile } from "../import";
import { useChangelistDashboardContext } from "./context";
@@ -325,7 +324,6 @@ const doCreate = async () => {
const changes = createdSheets.map((sheet) =>
Change.fromPartial({
sheet: sheet.name,
- version: fallbackVersionForChange(),
})
);
diff --git a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/AddChangePanel.vue b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/AddChangePanel.vue
index 897583050c..317f9b2f35 100644
--- a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/AddChangePanel.vue
+++ b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/AddChangePanel.vue
@@ -95,7 +95,6 @@ import {
isLocalSheet,
setSheetStatement,
} from "@/utils";
-import { fallbackVersionForChange } from "../../common";
import { useChangelistDetailContext } from "../context";
import { provideAddChangeContext } from "./context";
import { ChangelogForm, RawSQLForm } from "./form";
@@ -166,10 +165,6 @@ const doAddChange = async () => {
);
change.version = changelog?.version || "";
}
- if (change.version === "") {
- change.version = fallbackVersionForChange();
- }
-
return change;
};
try {
diff --git a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogForm.vue b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogForm.vue
index f279cb3f89..3fdea372b0 100644
--- a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogForm.vue
+++ b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogForm.vue
@@ -59,7 +59,10 @@ import {
type AffectedTable,
EmptyAffectedTable,
} from "@/types";
-import type { Changelist_Change as Change } from "@/types/proto/v1/changelist_service";
+import {
+ Changelist_Change,
+ type Changelist_Change as Change,
+} from "@/types/proto/v1/changelist_service";
import {
Changelog,
Changelog_Status,
@@ -128,11 +131,12 @@ const selectedChangelogList = computed<string[]>({
changelogs,
[(c) => parseInt(extractIssueUID(c.issue), 10)],
["asc"]
- ).map<Change>((changelog) => ({
- sheet: changelog.statementSheet,
- source: changelog.name,
- version: changelog.version,
- }));
+ ).map<Change>((changelog) =>
+ Changelist_Change.fromPartial({
+ sheet: changelog.statementSheet,
+ source: changelog.name,
+ })
+ );
changes.value = updatedChanges;
},
});
diff --git a/frontend/src/components/Changelist/ChangelistDetail/NavBar/ImportButton.vue b/frontend/src/components/Changelist/ChangelistDetail/NavBar/ImportButton.vue
index 5766d8c3ed..853cf4aa17 100644
--- a/frontend/src/components/Changelist/ChangelistDetail/NavBar/ImportButton.vue
+++ b/frontend/src/components/Changelist/ChangelistDetail/NavBar/ImportButton.vue
@@ -31,7 +31,6 @@ import {
} from "@/types/proto/v1/changelist_service";
import { Sheet } from "@/types/proto/v1/sheet_service";
import { setSheetStatement } from "@/utils";
-import { fallbackVersionForChange } from "../../common";
import { useChangelistDetailContext } from "../context";
const { t } = useI18n();
@@ -56,7 +55,6 @@ const onUploadFiles = async (
const newChanges = createdSheets.map((sheet) =>
Change.fromPartial({
sheet: sheet.name,
- version: fallbackVersionForChange(),
})
);
const changelistPatch = Changelist.fromPartial({
diff --git a/frontend/src/components/Changelist/common.ts b/frontend/src/components/Changelist/common.ts
deleted file mode 100644
index fe4c020db3..0000000000
--- a/frontend/src/components/Changelist/common.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import dayjs from "dayjs";
-
-export const fallbackVersionForChange = () => {
- // Example: 20240101061834
- return dayjs().utc().format("YYYYMMDDHHmmss");
-};