Skip to content

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

fix: handle schema version selector text overflow (#3398)

boojack75770e90e3e2
diff --git a/frontend/src/components/SyncDatabaseSchemaPrepForm.vue b/frontend/src/components/SyncDatabaseSchemaPrepForm.vue
index 8fd1c06fbf..e3c08c096f 100644
--- a/frontend/src/components/SyncDatabaseSchemaPrepForm.vue
+++ b/frontend/src/components/SyncDatabaseSchemaPrepForm.vue
@@ -2,13 +2,13 @@
<div class="space-y-4 overflow-x-hidden w-208 max-w-full transition-all">
<!-- Project and base, target database selectors -->
<div class="w-full flex flex-col justify-start items-start">
- <div class="w-160">
+ <div class="w-176">
<div class="w-full mb-2">
<span>{{ $t("database.sync-schema.select-project") }}</span>
</div>
<div class="w-full flex flex-row justify-start items-center px-px">
<ProjectSelect
- class="!w-48 mr-2 shrink-0"
+ class="!w-52 mr-2 shrink-0"
:disabled="!allowSelectProject"
:selected-id="state.projectId"
@select-project-id="(projectId: ProjectId)=>{
@@ -17,7 +17,7 @@
/>
</div>
</div>
- <div class="w-160">
+ <div class="w-176">
<div class="w-full mt-4 mb-2 flex flex-row justify-start items-center">
<span>{{ $t("database.sync-schema.select-schema") }}</span>
</div>
@@ -30,7 +30,7 @@
:class="isValidId(state.projectId) ? 'hidden' : ''"
></div>
<EnvironmentSelect
- class="!w-48 mr-2 shrink-0"
+ class="!w-52 mr-2 shrink-0"
name="environment"
:selected-id="state.baseSchemaInfo.environmentId"
:select-default="false"
@@ -59,7 +59,7 @@
</template>
</DatabaseSelect>
<BBSelect
- class=""
+ class="!grow"
:selected-item="state.baseSchemaInfo.migrationHistory"
:item-list="
databaseMigrationHistoryList(state.baseSchemaInfo.databaseId as DatabaseId)
@@ -69,9 +69,11 @@
@select-item="(migrationHistory: MigrationHistory) => handleSchemaVersionSelect(migrationHistory)"
>
<template #menuItem="{ item: migrationHistory }">
- <div class="flex items-center">
+ <!-- To enable the ellipsis function only when
+ overflow happens, we have to set a fixed width. -->
+ <NEllipsis style="max-width: 160px">
{{ migrationHistory.version }}
- </div>
+ </NEllipsis>
</template>
<template v-if="!hasSyncSchemaFeature" #suffixItem>
<div
@@ -85,7 +87,7 @@
</div>
</div>
<hr class="mt-4 w-full" />
- <div class="w-160">
+ <div class="w-176">
<div
class="w-full mt-4 mb-2 leading-6 flex flex-row justify-start items-center"
>
@@ -100,14 +102,14 @@
:class="isValidId(state.projectId) ? 'hidden' : ''"
></div>
<EnvironmentSelect
- class="!w-48 mr-2 shrink-0"
+ class="!w-52 mr-2 shrink-0"
name="environment"
:selected-id="state.targetDatabaseInfo.environmentId"
:select-default="false"
@select-environment-id="handleTargetEnvironmentSelect"
/>
<DatabaseSelect
- class="!grow !w-full"
+ class="!grow"
:selected-id="(state.targetDatabaseInfo.databaseId as DatabaseId)"
:mode="'USER'"
:environment-id="state.targetDatabaseInfo.environmentId"
@@ -235,6 +237,7 @@
import axios from "axios";
import dayjs from "dayjs";
import { head, isUndefined } from "lodash-es";
+import { NEllipsis } from "naive-ui";
import { computed, reactive, ref, watch } from "vue";
import { useEventListener } from "@vueuse/core";
import { useRouter } from "vue-router";