Skip to content

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

chore(schema-design): fix styles (#7234)

boojack151e3480a9e7
diff --git a/frontend/src/components/SchemaDesigner/CreateSchemaDesignPanel.vue b/frontend/src/components/SchemaDesigner/CreateSchemaDesignPanel.vue
index d725d9b45a..5d1b1f885b 100644
--- a/frontend/src/components/SchemaDesigner/CreateSchemaDesignPanel.vue
+++ b/frontend/src/components/SchemaDesigner/CreateSchemaDesignPanel.vue
@@ -3,6 +3,7 @@
:show="true"
width="auto"
:auto-focus="false"
+ :close-on-esc="true"
@update:show="(show: boolean) => !show && emit('dismiss')"
>
<NDrawerContent
diff --git a/frontend/src/components/SchemaDesigner/DatabaseTree.vue b/frontend/src/components/SchemaDesigner/DatabaseTree.vue
index 283cfadbc1..a6826aeb55 100644
--- a/frontend/src/components/SchemaDesigner/DatabaseTree.vue
+++ b/frontend/src/components/SchemaDesigner/DatabaseTree.vue
@@ -4,7 +4,7 @@
<p class="w-full flex flex-row justify-between items-center h-8 px-1">
<span class="text-sm">{{ $t("schema-designer.tables") }}</span>
<button
- class="text-gray-400 hover:text-gray-500"
+ class="text-gray-400 hover:text-gray-500 disabled:cursor-not-allowed"
:disabled="readonly"
@click="handleCreateTable"
>
diff --git a/frontend/src/components/SchemaDesigner/PrepForm/index.vue b/frontend/src/components/SchemaDesigner/PrepForm/index.vue
index a723f0e243..3136f04270 100644
--- a/frontend/src/components/SchemaDesigner/PrepForm/index.vue
+++ b/frontend/src/components/SchemaDesigner/PrepForm/index.vue
@@ -13,10 +13,7 @@
class="w-full border-b pb-2 mb-2 flex flex-row justify-between items-center"
>
<div class="flex flex-row justify-start items-center space-x-2">
- <span v-if="!isViewing && !isEditing">
- {{ $t("schema-designer.schema-design-list") }}
- </span>
- <template v-else>
+ <template v-if="isViewing || isEditing">
<NButton
class="w-full flex flex-row justify-start items-center"
@click="state.selectedSchemaDesign = undefined"
@@ -37,8 +34,10 @@
v-if="!isViewing && !isEditing"
type="primary"
@click="state.showCreatePanel = true"
- >{{ $t("common.create") }}</NButton
>
+ <heroicons-solid:plus class="w-4 h-auto mr-0.5" />
+ <span>{{ $t("schema-designer.new-design") }}</span>
+ </NButton>
<div v-else class="w-full flex flex-row justify-between items-center">
<div class="flex flex-row justify-end items-center space-x-2">
<template v-if="isViewing">
@@ -153,10 +152,15 @@ import {
import SchemaDesignTable from "./SchemaDesignTable.vue";
import SchemaDesigner from "../index.vue";
import { mergeSchemaEditToMetadata } from "../common/util";
-import { DatabaseV1Name, InstanceV1EngineIcon } from "@/components/v2";
+import {
+ DatabaseV1Name,
+ DrawerContent,
+ InstanceV1EngineIcon,
+} from "@/components/v2";
import CreateSchemaDesignPanel from "../CreateSchemaDesignPanel.vue";
import { useRouter } from "vue-router";
import { projectV1Slug } from "@/utils";
+import { useEventListener } from "@vueuse/core";
interface BaselineSchema {
// The uid of project.
@@ -180,7 +184,13 @@ defineProps({
default: undefined,
},
});
-defineEmits(["dismiss"]);
+const emit = defineEmits(["dismiss"]);
+
+useEventListener("keydown", (e) => {
+ if (e.code == "Escape") {
+ emit("dismiss");
+ }
+});
const { t } = useI18n();
const router = useRouter();
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index fa3ebf2b82..0fd3e82fe0 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -2696,6 +2696,7 @@
},
"schema-designer": {
"self": "Schema Designer",
+ "new-design": "New Design",
"quick-action": "Design Schema",
"schema-design": "Schema Design",
"schema-design-list": "Schema Design List",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index a4526fdbb7..8eb6e1be63 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -2695,6 +2695,7 @@
},
"schema-designer": {
"self": "Diseñador de esquemas",
+ "new-design": "Nuevo Diseño",
"quick-action": "Diseñar esquema",
"schema-design": "Esquema diseñar",
"schema-design-list": "Lista de Diseñar esquema",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index a6e1397abb..a56e24457f 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -2687,6 +2687,7 @@
},
"schema-designer": {
"self": "Schema 设计器",
+ "new-design": "创建设计",
"quick-action": "设计 Schema",
"schema-design": "Schema 设计",
"schema-design-list": "Schema 设计列表",
diff --git a/frontend/src/views/SyncDatabaseSchema/DatabaseSchemaSelector.vue b/frontend/src/views/SyncDatabaseSchema/DatabaseSchemaSelector.vue
index 1e17b5e824..9bc1427f16 100644
--- a/frontend/src/views/SyncDatabaseSchema/DatabaseSchemaSelector.vue
+++ b/frontend/src/views/SyncDatabaseSchema/DatabaseSchemaSelector.vue
@@ -46,7 +46,7 @@
</DatabaseSelect>
</div>
<div class="w-full flex flex-row justify-start items-center">
- <span class="flex w-40 items-center shrink-0">
+ <span class="flex w-40 items-center shrink-0 text-sm">
{{ $t("database.sync-schema.schema-version.self") }}
</span>
<div
diff --git a/frontend/src/views/SyncDatabaseSchema/SchemaDesignSelector.vue b/frontend/src/views/SyncDatabaseSchema/SchemaDesignSelector.vue
index 10687b0916..db957e3363 100644
--- a/frontend/src/views/SyncDatabaseSchema/SchemaDesignSelector.vue
+++ b/frontend/src/views/SyncDatabaseSchema/SchemaDesignSelector.vue
@@ -7,9 +7,10 @@
{{ $t("schema-designer.schema-design-list") }}
</span>
<div>
- <NButton type="primary" @click="state.showCreatePanel = true">{{
- $t("common.create")
- }}</NButton>
+ <NButton @click="state.showCreatePanel = true">
+ <heroicons-solid:plus class="w-4 h-auto mr-0.5" />
+ <span>{{ $t("schema-designer.new-design") }}</span>
+ </NButton>
</div>
</div>
<BBGrid
@@ -107,9 +108,9 @@ const COLUMN_LIST = computed(() => {
title: t("database.engine"),
width: "1fr",
},
- { title: t("common.creator"), width: "minmax(auto, 10rem)" },
- { title: t("common.updater"), width: "minmax(auto, 10rem)" },
- { title: t("common.updated-at"), width: "minmax(auto, 10rem)" },
+ { title: t("common.creator"), width: "1fr" },
+ { title: t("common.updater"), width: "1fr" },
+ { title: t("common.updated-at"), width: "1fr" },
];
return columns;