Skip to content

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

chore: update table ui (#9482)

ecmadaoaca52d2ffef5
diff --git a/frontend/src/components/SchemaTemplate/ClassificationLevelBadge.vue b/frontend/src/components/SchemaTemplate/ClassificationLevelBadge.vue
index 8e7e299cff..ff6beda2e3 100644
--- a/frontend/src/components/SchemaTemplate/ClassificationLevelBadge.vue
+++ b/frontend/src/components/SchemaTemplate/ClassificationLevelBadge.vue
@@ -1,11 +1,14 @@
<template>
- {{ showText ? columnClassification?.title ?? placeholder : "" }}
+ <NPerformantEllipsis v-if="showText" :line-clamp="1">
+ {{ columnClassification?.title ?? placeholder }}
+ </NPerformantEllipsis>
<span v-if="level" :class="['px-1 py-0.5 rounded text-xs', levelColor]">
{{ level.title }}
</span>
</template>
<script lang="ts" setup>
+import { NPerformantEllipsis } from "naive-ui";
import { computed } from "vue";
import { DataClassificationSetting_DataClassificationConfig } from "@/types/proto/v1/setting_service";
diff --git a/frontend/src/components/SchemaTemplate/FieldTemplateTable.vue b/frontend/src/components/SchemaTemplate/FieldTemplateTable.vue
index f4a20cd66e..b479e90585 100644
--- a/frontend/src/components/SchemaTemplate/FieldTemplateTable.vue
+++ b/frontend/src/components/SchemaTemplate/FieldTemplateTable.vue
@@ -87,43 +87,43 @@ const columnList = computed((): BBGridColumn[] => {
return [
{
title: t("schema-template.form.category"),
- width: "7rem",
+ width: "minmax(min-content, auto)",
class: "capitalize",
},
{
title: t("schema-template.form.column-name"),
- width: "auto",
+ width: "minmax(min-content, auto)",
class: "capitalize",
},
{
title: t("schema-template.classification.self"),
- width: "auto",
+ width: "minmax(min-content, auto)",
class: "capitalize",
hide: !classificationConfig.value,
},
{
title: t("schema-template.form.column-type"),
- width: "auto",
+ width: "minmax(min-content, auto)",
class: "capitalize",
},
{
title: t("schema-template.form.default-value"),
- width: "auto",
+ width: "minmax(min-content, auto)",
class: "capitalize",
},
{
title: t("schema-template.form.comment"),
- width: "auto",
+ width: "minmax(min-content, auto)",
class: "capitalize",
},
{
title: t("common.labels"),
- width: "auto",
+ width: "minmax(min-content, auto)",
class: "capitalize",
},
{
title: t("common.operations"),
- width: "6rem",
+ width: "minmax(min-content, auto)",
class: "capitalize",
},
].filter((col) => !col.hide);
diff --git a/frontend/src/components/SchemaTemplate/TableTemplateTable.vue b/frontend/src/components/SchemaTemplate/TableTemplateTable.vue
index cbc7b663e7..15caa7feb8 100644
--- a/frontend/src/components/SchemaTemplate/TableTemplateTable.vue
+++ b/frontend/src/components/SchemaTemplate/TableTemplateTable.vue
@@ -76,28 +76,28 @@ const columnList = computed((): BBGridColumn[] => {
return [
{
title: t("schema-template.form.category"),
- width: "minmax(auto, 15rem)",
+ width: "minmax(min-content, auto)",
class: "capitalize",
},
{
title: t("schema-template.form.table-name"),
- width: "minmax(auto, 15rem)",
+ width: "minmax(min-content, auto)",
class: "capitalize",
},
{
title: t("schema-template.classification.self"),
- width: "minmax(auto, 1fr)",
+ width: "minmax(min-content, auto)",
class: "capitalize",
hide: !classificationConfig.value,
},
{
title: t("schema-template.form.comment"),
- width: "minmax(auto, 1fr)",
+ width: "minmax(min-content, auto)",
class: "capitalize",
},
{
title: t("common.operations"),
- width: "auto",
+ width: "minmax(min-content, auto)",
class: "capitalize",
},
].filter((col) => !col.hide);
diff --git a/frontend/src/components/SensitiveData/SensitiveColumnDrawer.vue b/frontend/src/components/SensitiveData/SensitiveColumnDrawer.vue
index 9790f5c1e3..a7f53d906e 100644
--- a/frontend/src/components/SensitiveData/SensitiveColumnDrawer.vue
+++ b/frontend/src/components/SensitiveData/SensitiveColumnDrawer.vue
@@ -374,30 +374,30 @@ const gridColumnList = computed(() => {
const columns: BBGridColumn[] = [
{
title: t("common.user"),
- width: "minmax(auto, 1fr)",
+ width: "minmax(min-content, auto)",
},
{
title: t("settings.sensitive-data.action.export"),
- width: "auto",
+ width: "minmax(min-content, auto)",
},
{
title: t("settings.sensitive-data.action.query"),
- width: "auto",
+ width: "minmax(min-content, auto)",
},
{
title: t("settings.sensitive-data.masking-level.self"),
- width: "auto",
+ width: "minmax(min-content, auto)",
},
{
title: t("common.expiration"),
- width: "minmax(auto, 1fr)",
+ width: "minmax(min-content, auto)",
},
];
if (hasPermission.value) {
// operation.
columns.push({
title: "",
- width: "auto",
+ width: "minmax(min-content, auto)",
});
}
return columns;
diff --git a/frontend/src/components/SensitiveData/components/MaskingAlgorithmsTable.vue b/frontend/src/components/SensitiveData/components/MaskingAlgorithmsTable.vue
index 2b05eda130..9eaacd1c03 100644
--- a/frontend/src/components/SensitiveData/components/MaskingAlgorithmsTable.vue
+++ b/frontend/src/components/SensitiveData/components/MaskingAlgorithmsTable.vue
@@ -74,20 +74,20 @@ const columnList = computed(() => {
const columns: BBGridColumn[] = [
{
title: t("settings.sensitive-data.algorithms.table.title"),
- width: "1fr",
+ width: "minmax(min-content, auto)",
},
{
title: t("settings.sensitive-data.algorithms.table.description"),
- width: "1fr",
+ width: "minmax(min-content, auto)",
},
{
title: t("settings.sensitive-data.algorithms.table.masking-type"),
- width: "minmax(auto, 14rem)",
+ width: "minmax(min-content, auto)",
},
{
// operations
title: "",
- width: "auto",
+ width: "minmax(min-content, auto)",
},
];
return columns;
diff --git a/frontend/src/components/SensitiveData/components/SemanticTypesTable.vue b/frontend/src/components/SensitiveData/components/SemanticTypesTable.vue
index a04299132a..bdb93b50a7 100644
--- a/frontend/src/components/SensitiveData/components/SemanticTypesTable.vue
+++ b/frontend/src/components/SensitiveData/components/SemanticTypesTable.vue
@@ -165,30 +165,30 @@ const columnList = computed(() => {
const columns: BBGridColumn[] = [
{
title: t("settings.sensitive-data.semantic-types.table.semantic-type"),
- width: "1fr",
+ width: "minmax(min-content, auto)",
},
{
title: t("settings.sensitive-data.semantic-types.table.description"),
- width: "1fr",
+ width: "minmax(min-content, auto)",
},
{
title: t(
"settings.sensitive-data.semantic-types.table.full-masking-algorithm"
),
- width: "minmax(auto, 12rem)",
+ width: "minmax(min-content, auto)",
},
{
title: t(
"settings.sensitive-data.semantic-types.table.partial-masking-algorithm"
),
- width: "minmax(auto, 12rem)",
+ width: "minmax(min-content, auto)",
},
];
if (!props.readonly) {
// operation.
columns.push({
title: "",
- width: "minmax(auto, 5rem)",
+ width: "minmax(min-content, auto)",
});
}
return columns;
diff --git a/frontend/src/components/SensitiveData/components/SensitiveColumnTable.vue b/frontend/src/components/SensitiveData/components/SensitiveColumnTable.vue
index 0387a90b34..9175133e5e 100644
--- a/frontend/src/components/SensitiveData/components/SensitiveColumnTable.vue
+++ b/frontend/src/components/SensitiveData/components/SensitiveColumnTable.vue
@@ -4,7 +4,7 @@
:data-source="columnList"
:row-clickable="rowClickable"
:custom-header="true"
- class="bordered"
+ class="border compact"
@click-row="clickTableRow"
>
<template #header>
@@ -161,43 +161,43 @@ const gridColumnList = computed(() => {
const columns: BBGridColumn[] = [
{
title: t("settings.sensitive-data.masking-level.self"),
- width: "minmax(auto, 8rem)",
+ width: "minmax(min-content, auto)",
},
{
title: t("database.column"),
- width: "minmax(auto, 1fr)",
+ width: "minmax(min-content, auto)",
},
{
title: t("common.table"),
- width: "minmax(auto, 1fr)",
+ width: "minmax(min-content, auto)",
},
{
title: t("common.database"),
- width: "minmax(auto, 1fr)",
+ width: "minmax(min-content, auto)",
},
{
title: t("common.instance"),
- width: "minmax(auto, 1fr)",
+ width: "minmax(min-content, auto)",
},
{
title: t("common.environment"),
- width: "minmax(auto, 1fr)",
+ width: "minmax(min-content, auto)",
},
{
title: t("common.project"),
- width: "minmax(auto, 1fr)",
+ width: "minmax(min-content, auto)",
},
];
if (props.showOperation) {
columns.push({
title: t("common.operation"),
- width: "auto",
+ width: "minmax(min-content, auto)",
});
}
if (props.rowSelectable) {
columns.unshift({
title: "",
- width: "auto",
+ width: "minmax(auto, 3rem)",
});
}
diff --git a/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseV1Table.vue b/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseV1Table.vue
index 0ab57937f8..671e38d7b8 100644
--- a/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseV1Table.vue
+++ b/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseV1Table.vue
@@ -303,30 +303,30 @@ const preparePolicyList = () => {
const columnListMap = computed(() => {
const NAME = {
title: t("common.name"),
- width: "minmax(auto, 1.5fr)",
+ width: "minmax(min-content, auto)",
};
const SCHEMA_VERSION = props.schemaless
? undefined
: {
title: t("common.schema-version"),
- width: { lg: "minmax(auto, 1fr)" },
+ width: { lg: "minmax(min-content, auto)" },
class: "hidden lg:flex",
};
const PROJECT = {
title: t("common.project"),
- width: "minmax(auto, 1fr)",
+ width: "minmax(min-content, auto)",
};
const ENVIRONMENT = {
title: t("common.environment"),
- width: "minmax(auto, 1fr)",
+ width: "minmax(min-content, auto)",
};
const INSTANCE = {
title: t("common.instance"),
- width: "minmax(auto, 1fr)",
+ width: "minmax(min-content, auto)",
};
const LABELS = {
title: t("common.labels"),
- width: "auto",
+ width: "minmax(max-content, auto)",
class: "items-center",
};
return new Map<Mode, (BBGridColumn | undefined)[]>([
diff --git a/frontend/src/components/v2/Model/DatabaseV1Table/ProjectCol.vue b/frontend/src/components/v2/Model/DatabaseV1Table/ProjectCol.vue
index 0719dd8497..27147f81a6 100644
--- a/frontend/src/components/v2/Model/DatabaseV1Table/ProjectCol.vue
+++ b/frontend/src/components/v2/Model/DatabaseV1Table/ProjectCol.vue
@@ -1,41 +1,53 @@
<template>
<div class="flex flex-row space-x-2 items-center">
<ProjectV1Name :project="project" :link="false" tag="div" />
- <div
+
+ <NTooltip
v-if="
showTenantIcon && project.tenantMode === TenantMode.TENANT_MODE_ENABLED
"
- class="tooltip-wrapper"
>
- <span class="tooltip whitespace-nowrap">
+ <template #trigger>
+ <TenantIcon class="ml-1 text-control" />
+ </template>
+ <span class="whitespace-nowrap">
{{ $t("project.mode.batch") }}
</span>
- <TenantIcon class="text-control" />
- </div>
- <div class="tooltip-wrapper">
- <svg
- v-if="project.workflow === Workflow.UI"
- class="w-4 h-4"
- fill="none"
- stroke="currentColor"
- viewBox="0 0 24 24"
- xmlns="http://www.w3.org/2000/svg"
- ></svg>
- <template v-else-if="project.workflow === Workflow.VCS">
- <span v-if="mode === 'ALL_SHORT'" class="tooltip w-40">
- {{ $t("alter-schema.vcs-info") }}
- </span>
- <span v-else class="tooltip whitespace-nowrap">
- {{ $t("database.gitops-enabled") }}
- </span>
+ </NTooltip>
- <GitIcon class="w-4 h-4 text-control hover:text-control-hover" />
+ <NTooltip v-if="project.workflow === Workflow.VCS">
+ <template #trigger>
+ <GitIcon class="ml-1 w-4 h-4 text-control" />
</template>
- </div>
+ <span v-if="mode === 'ALL_SHORT'" class="tooltip w-40">
+ {{ $t("alter-schema.vcs-info") }}
+ </span>
+ <span v-else class="tooltip whitespace-nowrap">
+ {{ $t("database.gitops-enabled") }}
+ </span>
+ </NTooltip>
+ <svg
+ v-else-if="project.workflow === Workflow.UI"
+ class="w-4 h-4"
+ fill="none"
+ stroke="currentColor"
+ viewBox="0 0 24 24"
+ xmlns="http://www.w3.org/2000/svg"
+ ></svg>
+
+ <NTooltip v-if="project.state === State.DELETED">
+ <template #trigger>
+ <heroicons-outline:archive class="ml-1 w-4 h-4 text-control" />
+ </template>
+ <span class="whitespace-nowrap">
+ {{ $t("archive.archived") }}
+ </span>
+ </NTooltip>
</div>
</template>
<script setup lang="ts">
+import { State } from "@/types/proto/v1/common";
import {
Project,
TenantMode,
diff --git a/frontend/src/components/v2/Model/Instance/InstanceV1Table/InstanceV1Table.vue b/frontend/src/components/v2/Model/Instance/InstanceV1Table/InstanceV1Table.vue
index 714f92ad79..c3a0e2eef3 100644
--- a/frontend/src/components/v2/Model/Instance/InstanceV1Table/InstanceV1Table.vue
+++ b/frontend/src/components/v2/Model/Instance/InstanceV1Table/InstanceV1Table.vue
@@ -53,11 +53,8 @@
"
/>
</div>
- <div class="bb-grid-cell justify-center">
- <InstanceV1EngineIcon :instance="instance" />
- </div>
<div class="bb-grid-cell">
- {{ instanceV1Name(instance) }}
+ <InstanceV1Name :instance="instance" :link="false" tag="div" />
</div>
<div class="bb-grid-cell">
<EnvironmentV1Name
@@ -91,14 +88,8 @@ import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import { BBGrid, BBGridColumn, BBGridRow } from "@/bbkit";
import { ComposedInstance } from "@/types";
-import {
- urlfy,
- instanceV1Slug,
- instanceV1Name,
- hostPortOfInstanceV1,
-} from "@/utils";
+import { urlfy, instanceV1Slug, hostPortOfInstanceV1 } from "@/utils";
import EnvironmentV1Name from "../../EnvironmentV1Name.vue";
-import InstanceV1EngineIcon from "../InstanceV1EngineIcon.vue";
export type InstanceRow = BBGridRow<ComposedInstance>;
@@ -128,31 +119,26 @@ const columnList = computed((): BBGridColumn[] => {
width: "minmax(auto, 3rem)",
hide: !props.allowSelection,
},
- // engine icon
- {
- title: "",
- width: "minmax(auto, 2rem)",
- },
{
title: t("common.name"),
- width: "minmax(auto, 3fr)",
+ width: "minmax(min-content, auto)",
},
{
title: t("common.environment"),
- width: "minmax(auto, 1fr)",
+ width: "minmax(min-content, auto)",
},
{
title: t("common.Address"),
- width: "minmax(auto, 2fr)",
+ width: "minmax(min-content, auto)",
},
{
title: t("instance.external-link"),
- width: { sm: "1fr" },
+ width: { sm: "minmax(min-content, auto)" },
class: "hidden sm:flex",
},
{
title: t("subscription.instance-assignment.license"),
- width: "minmax(auto, 1fr)",
+ width: "minmax(min-content, auto)",
hide: !props.canAssignLicense,
},
];
diff --git a/frontend/src/components/v2/Model/ProjectV1Name.vue b/frontend/src/components/v2/Model/ProjectV1Name.vue
index 72eb3a3bb2..219d8826fa 100644
--- a/frontend/src/components/v2/Model/ProjectV1Name.vue
+++ b/frontend/src/components/v2/Model/ProjectV1Name.vue
@@ -5,11 +5,14 @@
class="inline-flex items-center gap-x-1"
:class="link && !plain && 'normal-link'"
>
- <span>{{ projectV1Name(project) }}</span>
+ <NPerformantEllipsis :line-clamp="1">
+ {{ projectV1Name(project) }}
+ </NPerformantEllipsis>
</component>
</template>
<script lang="ts" setup>
+import { NPerformantEllipsis } from "naive-ui";
import { computed } from "vue";
import type { Project } from "@/types/proto/v1/project_service";
import { projectV1Name, projectV1Slug } from "@/utils";
diff --git a/frontend/src/components/v2/Model/ProjectV1Table.vue b/frontend/src/components/v2/Model/ProjectV1Table.vue
index 51537e5d0c..884aeb7aa2 100644
--- a/frontend/src/components/v2/Model/ProjectV1Table.vue
+++ b/frontend/src/components/v2/Model/ProjectV1Table.vue
@@ -10,36 +10,14 @@
<div class="bb-grid-cell text-gray-500">
<span class="flex flex-row items-center space-x-1">
<span>{{ project.key }}</span>
- <NTooltip
- v-if="project.tenantMode === TenantMode.TENANT_MODE_ENABLED"
- >
- <template #trigger>
- <TenantIcon class="ml-1 text-control" />
- </template>
- <span class="whitespace-nowrap">
- {{ $t("project.mode.batch") }}
- </span>
- </NTooltip>
- <NTooltip v-if="project.state === State.DELETED">
- <template #trigger>
- <heroicons-outline:archive class="ml-1 w-4 h-4 text-control" />
- </template>
- <span class="whitespace-nowrap">
- {{ $t("archive.archived") }}
- </span>
- </NTooltip>
- <NTooltip v-if="project.workflow === Workflow.VCS">
- <template #trigger>
- <GitIcon class="ml-1 w-4 h-4 text-control" />
- </template>
- <span class="whitespace-nowrap">
- {{ $t("database.gitops-enabled") }}
- </span>
- </NTooltip>
</span>
</div>
<div class="bb-grid-cell truncate">
- {{ projectV1Name(project) }}
+ <ProjectCol
+ mode="ALL_SHORT"
+ :project="project"
+ :show-tenant-icon="true"
+ />
</div>
</template>
</BBGrid>
@@ -50,14 +28,8 @@ import { PropType, computed } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import { BBGridColumn, BBGridRow, BBGrid } from "@/bbkit";
-import TenantIcon from "@/components/TenantIcon.vue";
-import { State } from "@/types/proto/v1/common";
-import {
- Project,
- TenantMode,
- Workflow,
-} from "@/types/proto/v1/project_service";
-import { projectV1Slug, projectV1Name } from "@/utils";
+import { Project } from "@/types/proto/v1/project_service";
+import { projectV1Slug } from "@/utils";
export type ProjectGridRow = BBGridRow<Project>;
diff --git a/frontend/src/views/DatabaseDashboard.vue b/frontend/src/views/DatabaseDashboard.vue
index a188fbe33a..9bb1dec161 100644
--- a/frontend/src/views/DatabaseDashboard.vue
+++ b/frontend/src/views/DatabaseDashboard.vue
@@ -1,33 +1,39 @@
<template>
<div class="flex flex-col relative">
- <div class="px-4 py-2 flex justify-between items-center">
+ <div
+ class="px-4 py-2 flex flex-col lg:flex-row justify-between items-start lg:items-center"
+ >
<EnvironmentTabFilter
:include-all="true"
:environment="selectedEnvironment?.name"
@update:environment="changeEnvironment"
/>
- <div class="flex items-center space-x-4">
- <NTooltip v-if="canVisitUnassignedDatabases && !isStandaloneMode">
- <template #trigger>
- <router-link
- :to="{
- name: 'workspace.project.detail',
- params: {
- projectSlug: DEFAULT_PROJECT_ID,
- },
- hash: '#databases',
- }"
- class="normal-link text-sm"
- >
- {{ $t("database.view-unassigned-databases") }}
- </router-link>
- </template>
+ <div
+ class="mt-2 lg:mt-0 flex flex-col sm:flex-row items-start sm:items-center"
+ >
+ <div class="mb-2 sm:mr-4 sm:mb-0">
+ <NTooltip v-if="canVisitUnassignedDatabases && !isStandaloneMode">
+ <template #trigger>
+ <router-link
+ :to="{
+ name: 'workspace.project.detail',
+ params: {
+ projectSlug: DEFAULT_PROJECT_ID,
+ },
+ hash: '#databases',
+ }"
+ class="normal-link text-sm"
+ >
+ {{ $t("database.view-unassigned-databases") }}
+ </router-link>
+ </template>
- <div class="whitespace-pre-wrap">
- {{ $t("quick-action.unassigned-db-hint") }}
- </div>
- </NTooltip>
+ <div class="whitespace-pre-wrap">
+ {{ $t("quick-action.unassigned-db-hint") }}
+ </div>
+ </NTooltip>
+ </div>
<NInputGroup style="width: auto">
<InstanceSelect