Skip to content

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

fix: popup issue in schema editor (#6653)

boojackd49ccb56ad23
diff --git a/frontend/src/components/Issue/form/DatabaseResourceView.vue b/frontend/src/components/Issue/form/DatabaseResourceView.vue
deleted file mode 100644
index 76aa264234..0000000000
--- a/frontend/src/components/Issue/form/DatabaseResourceView.vue
+++ /dev/null
@@ -1,50 +0,0 @@
-<template>
- <div
- class="flex flex-row justify-start items-center flex-nowrap whitespace-nowrap"
- >
- <Prefix class="flex-shrink-0 mr-1" />
- {{ database.databaseName }}
- <template v-if="props.databaseResource.schema">
- /
- {{ props.databaseResource.schema }}
- </template>
- <template v-if="props.databaseResource.table">
- /
- {{ props.databaseResource.table }}
- </template>
- </div>
-</template>
-
-<script lang="ts" setup>
-import { computed, h } from "vue";
-import { DatabaseResource } from "./SelectDatabaseResourceForm/common";
-import { useDatabaseV1Store } from "@/store";
-import DatabaseIcon from "~icons/heroicons-outline/circle-stack";
-import SchemaIcon from "~icons/heroicons-outline/view-columns";
-import TableIcon from "~icons/heroicons-outline/table-cells";
-
-const props = defineProps<{
- databaseResource: DatabaseResource;
-}>();
-
-const databaseStore = useDatabaseV1Store();
-
-const database = computed(() => {
- return databaseStore.getDatabaseByName(props.databaseResource.databaseName);
-});
-
-const Prefix = () => {
- if (props.databaseResource.table !== undefined) {
- return h(TableIcon, {
- class: "w-4 h-auto text-gray-400",
- });
- } else if (props.databaseResource.schema !== undefined) {
- return h(SchemaIcon, {
- class: "w-4 h-auto text-gray-400",
- });
- }
- return h(DatabaseIcon, {
- class: "w-4 h-auto text-gray-400",
- });
-};
-</script>
diff --git a/frontend/src/components/Issue/form/GrantRequestExporterForm.vue b/frontend/src/components/Issue/form/GrantRequestExporterForm.vue
index c8c41da4b7..fd3f9975cc 100644
--- a/frontend/src/components/Issue/form/GrantRequestExporterForm.vue
+++ b/frontend/src/components/Issue/form/GrantRequestExporterForm.vue
@@ -33,19 +33,15 @@
<span class="flex items-center textlabel mb-2">
{{ $t("issue.grant-request.export-rows") }}
</span>
- <input
- v-model="state.maxRowCount"
- readonly
- type="number"
- class="textfield"
- placeholder="Max row count"
- />
+ <div class="flex flex-row justify-start items-start">
+ {{ state.maxRowCount }}
+ </div>
</div>
<div class="w-full flex flex-col justify-start items-start">
<span class="flex items-center textlabel mb-2">
{{ $t("issue.grant-request.export-format") }}
</span>
- <div class="flex flex-row justify-start items-start gap-4">
+ <div class="flex flex-row justify-start items-start">
{{ state.exportFormat }}
</div>
</div>
diff --git a/frontend/src/components/Issue/table/DatabaseResourceTable.vue b/frontend/src/components/Issue/table/DatabaseResourceTable.vue
index 00d92489ed..7cb390daa6 100644
--- a/frontend/src/components/Issue/table/DatabaseResourceTable.vue
+++ b/frontend/src/components/Issue/table/DatabaseResourceTable.vue
@@ -58,14 +58,15 @@ const extractDatabaseName = (databaseResource: DatabaseResource) => {
};
const extractTableName = (databaseResource: DatabaseResource) => {
- const nameList = [];
- if (databaseResource.schema) {
- nameList.push(databaseResource.schema);
+ if (!databaseResource.schema && !databaseResource.table) {
+ return "*";
}
- if (databaseResource.table) {
- nameList.push(databaseResource.table);
+ const names = [];
+ if (databaseResource.schema) {
+ names.push(databaseResource.schema);
}
- return nameList.join(".") || "*";
+ names.push(databaseResource.table || "*");
+ return names.join(".");
};
const extractComposedDatabase = (databaseResource: DatabaseResource) => {
diff --git a/frontend/src/components/SchemaEditor/DatabaseTree.vue b/frontend/src/components/SchemaEditor/DatabaseTree.vue
index 7a5cb62f5c..2696013e25 100644
--- a/frontend/src/components/SchemaEditor/DatabaseTree.vue
+++ b/frontend/src/components/SchemaEditor/DatabaseTree.vue
@@ -11,7 +11,7 @@
</NInput>
</div>
<div ref="treeRef" class="schema-editor-database-tree pb-2 h-auto">
- <n-tree
+ <NTree
block-line
:data="treeDataRef"
:pattern="searchPattern"
@@ -25,13 +25,14 @@
:on-update:expanded-keys="handleExpandedKeysChange"
:on-update:selected-keys="handleSelectedKeysChange"
/>
- <n-dropdown
+ <NDropdown
trigger="manual"
placement="bottom-start"
:show="contextMenu.showDropdown"
:options="contextMenuOptions"
:x="contextMenu.clientX"
:y="contextMenu.clientY"
+ to="body"
@select="handleContextMenuDropdownSelect"
@clickoutside="handleDropdownClickoutside"
/>
@@ -56,7 +57,7 @@
<script lang="ts" setup>
import { escape, head, isUndefined } from "lodash-es";
-import { TreeOption, NEllipsis, NInput } from "naive-ui";
+import { TreeOption, NEllipsis, NInput, NDropdown, NTree } from "naive-ui";
import { computed, onMounted, watch, ref, h, reactive, nextTick } from "vue";
import { useI18n } from "vue-i18n";
import scrollIntoView from "scroll-into-view-if-needed";
diff --git a/frontend/src/components/SchemaEditor/Panels/DatabaseEditor.vue b/frontend/src/components/SchemaEditor/Panels/DatabaseEditor.vue
index 0a3eaf03d7..2df9841b1a 100644
--- a/frontend/src/components/SchemaEditor/Panels/DatabaseEditor.vue
+++ b/frontend/src/components/SchemaEditor/Panels/DatabaseEditor.vue
@@ -132,7 +132,7 @@
{{ table.comment }}
</div>
<div class="w-full flex justify-start items-center">
- <n-tooltip v-if="!isDroppedTable(table)" trigger="hover">
+ <NTooltip v-if="!isDroppedTable(table)" trigger="hover" to="body">
<template #trigger>
<heroicons:trash
class="w-[14px] h-auto text-gray-500 cursor-pointer hover:opacity-80"
@@ -140,8 +140,8 @@
/>
</template>
<span>{{ $t("schema-editor.actions.drop-table") }}</span>
- </n-tooltip>
- <n-tooltip v-else trigger="hover">
+ </NTooltip>
+ <NTooltip v-else trigger="hover" to="body">
<template #trigger>
<heroicons:arrow-uturn-left
class="w-[14px] h-auto text-gray-500 cursor-pointer hover:opacity-80"
@@ -149,7 +149,7 @@
/>
</template>
<span>{{ $t("schema-editor.actions.restore") }}</span>
- </n-tooltip>
+ </NTooltip>
</div>
</div>
</div>
@@ -203,7 +203,7 @@
<script lang="ts" setup>
import { head } from "lodash-es";
-import { NEllipsis } from "naive-ui";
+import { NEllipsis, NTooltip } from "naive-ui";
import scrollIntoView from "scroll-into-view-if-needed";
import { computed, nextTick, reactive, ref, watch } from "vue";
import { useI18n } from "vue-i18n";