Skip to content

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

chore: filter drafts (#7748)

boojack87751e71002e
diff --git a/frontend/src/components/SchemaDesigner/EditSchemaDesignPanel.vue b/frontend/src/components/SchemaDesigner/EditSchemaDesignPanel.vue
index 2e105df32f..1f9455decf 100644
--- a/frontend/src/components/SchemaDesigner/EditSchemaDesignPanel.vue
+++ b/frontend/src/components/SchemaDesigner/EditSchemaDesignPanel.vue
@@ -161,7 +161,11 @@ import { computed, h, onMounted, reactive, ref, watch } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import { DatabaseV1Name, InstanceV1EngineIcon } from "@/components/v2";
-import { pushNotification, useDatabaseV1Store } from "@/store";
+import {
+ pushNotification,
+ useCurrentUserV1,
+ useDatabaseV1Store,
+} from "@/store";
import { useSchemaDesignStore } from "@/store/modules/schemaDesign";
import { DatabaseMetadata } from "@/types/proto/v1/database_service";
import {
@@ -193,6 +197,7 @@ const emit = defineEmits(["dismiss"]);
const { t } = useI18n();
const router = useRouter();
+const currentUserV1 = useCurrentUserV1();
const databaseStore = useDatabaseV1Store();
const schemaDesignStore = useSchemaDesignStore();
const dialog = useDialog();
@@ -220,7 +225,8 @@ const schemaDesignDrafts = computed(() => {
return schemaDesignStore.schemaDesignList.filter((schemaDesign) => {
return (
schemaDesign.type === SchemaDesign_Type.PERSONAL_DRAFT &&
- schemaDesign.baselineSheetName === props.schemaDesignName
+ schemaDesign.baselineSheetName === props.schemaDesignName &&
+ schemaDesign.creator === `users/${currentUserV1.value.email}`
);
});
});
diff --git a/frontend/src/components/SchemaDesigner/common/util.ts b/frontend/src/components/SchemaDesigner/common/util.ts
index d04ac60924..c47888b351 100644
--- a/frontend/src/components/SchemaDesigner/common/util.ts
+++ b/frontend/src/components/SchemaDesigner/common/util.ts
@@ -68,6 +68,7 @@ export const mergeSchemaEditToMetadata = (
(item) => item.name === columnEdit.name
);
if (!column) {
+ table.columns.push(transformColumnEditToMetadata(columnEdit));
continue;
}
column.type = columnEdit.type;
@@ -77,6 +78,16 @@ export const mergeSchemaEditToMetadata = (
column.default = columnEdit.default;
}
}
+ for (const column of table.columns) {
+ const columnEdit = tableEdit.columnList.find(
+ (item) => item.name === column.name
+ );
+ if (!columnEdit) {
+ table.columns = table.columns.filter(
+ (item) => item.name !== column.name
+ );
+ }
+ }
}
}
}