Skip to content

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

chore: tweak project setting layout (#16268)

boojackb719125e0088
diff --git a/frontend/src/components/GeneralSetting/DatabaseChangeModeSetting.vue b/frontend/src/components/GeneralSetting/DatabaseChangeModeSetting.vue
index 6dac330e4b..b164a0e3fc 100644
--- a/frontend/src/components/GeneralSetting/DatabaseChangeModeSetting.vue
+++ b/frontend/src/components/GeneralSetting/DatabaseChangeModeSetting.vue
@@ -1,5 +1,5 @@
<template>
- <div ref="containerRef" class="pb-6 lg:flex">
+ <div class="pb-6 lg:flex">
<div class="text-left lg:w-1/4">
<div class="flex items-center space-x-2">
<h1 class="text-2xl font-bold">
@@ -41,7 +41,7 @@
<script lang="ts" setup>
import { NButton } from "naive-ui";
-import { computed, reactive, ref } from "vue";
+import { computed, reactive } from "vue";
import { BBModal } from "@/bbkit";
import { router } from "@/router";
import { WORKSPACE_ROUTE_LANDING } from "@/router/dashboard/workspaceRoutes";
@@ -79,7 +79,6 @@ const props = defineProps<{
}>();
const settingV1Store = useSettingV1Store();
-const containerRef = ref<HTMLDivElement>();
const state = reactive<LocalState>(getInitialState());
diff --git a/frontend/src/components/Project/Settings/ProjectGeneralSettingPanel.vue b/frontend/src/components/Project/Settings/ProjectGeneralSettingPanel.vue
index e84ea190e3..ddae38582d 100644
--- a/frontend/src/components/Project/Settings/ProjectGeneralSettingPanel.vue
+++ b/frontend/src/components/Project/Settings/ProjectGeneralSettingPanel.vue
@@ -1,8 +1,5 @@
<template>
- <form class="w-full space-y-4 mx-auto">
- <p class="text-lg font-medium leading-7 text-main">
- {{ $t("common.general") }}
- </p>
+ <form class="w-full space-y-4">
<div>
<div class="font-medium">
{{ $t("common.name") }} <span class="text-red-600">*</span>
diff --git a/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue b/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue
index f4c69710dc..b1a8f0a529 100644
--- a/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue
+++ b/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue
@@ -1,7 +1,7 @@
<template>
- <div class="w-full flex flex-col justify-start items-start pt-6 space-y-4">
- <div class="space-y-2 mb-4">
- <div class="text-lg font-medium text-main">
+ <div class="w-full flex flex-col justify-start items-start space-y-4">
+ <div class="space-y-2">
+ <div class="font-medium">
{{ $t("project.settings.issue-related.labels.self") }}
<div class="textinfolabel">
{{ $t("project.settings.issue-related.labels.description") }}
@@ -20,14 +20,8 @@
@update:value="onLabelsUpdate"
/>
</div>
- <h3 class="flex flex-row items-center gap-2">
- <span class="text-lg font-medium text-main">{{
- $t("project.settings.issue-related.self")
- }}</span>
- <FeatureBadge feature="bb.feature.issue-project-setting" />
- </h3>
<div class="w-full flex flex-col justify-start items-start gap-2">
- <div>
+ <div>
<div class="flex items-center gap-x-2">
<Switch
v-model:value="state.allowModifyStatement"
@@ -35,11 +29,17 @@
:disabled="!allowUpdateIssueProjectSetting || loading"
/>
<span class="textlabel">
- {{$t('project.settings.issue-related.allow-modify-statement.self')}}
+ {{
+ $t("project.settings.issue-related.allow-modify-statement.self")
+ }}
</span>
</div>
<div class="mt-1 mb-3 text-sm text-gray-400">
- {{ $t("project.settings.issue-related.allow-modify-statement.description") }}
+ {{
+ $t(
+ "project.settings.issue-related.allow-modify-statement.description"
+ )
+ }}
</div>
</div>
<div>
@@ -50,11 +50,13 @@
:disabled="!allowUpdateIssueProjectSetting || loading"
/>
<span class="textlabel">
- {{$t('project.settings.issue-related.auto-resolve-issue.self')}}
+ {{ $t("project.settings.issue-related.auto-resolve-issue.self") }}
</span>
</div>
<div class="mt-1 mb-3 text-sm text-gray-400">
- {{ $t("project.settings.issue-related.auto-resolve-issue.description") }}
+ {{
+ $t("project.settings.issue-related.auto-resolve-issue.description")
+ }}
</div>
</div>
<div>
@@ -63,29 +65,35 @@
v-model:value="state.forceIssueLabels"
:text="true"
:disabled="
- !allowUpdateIssueProjectSetting ||
- state.issueLabels.length === 0 ||
- loading
- "
+ !allowUpdateIssueProjectSetting ||
+ state.issueLabels.length === 0 ||
+ loading
+ "
/>
<div class="textlabel flex items-center gap-x-2">
+ {{
+ $t(
+ "project.settings.issue-related.labels.force-issue-labels.self"
+ )
+ }}
+ <NTooltip v-if="allowEdit && state.issueLabels.length === 0">
+ <template #trigger>
+ <TriangleAlertIcon class="w-4 text-warning" />
+ </template>
{{
- $t("project.settings.issue-related.labels.force-issue-labels.self")
+ $t(
+ "project.settings.issue-related.labels.force-issue-labels.warning"
+ )
}}
- <NTooltip v-if="allowEdit && state.issueLabels.length === 0">
- <template #trigger>
- <TriangleAlertIcon class="w-4 text-warning" />
- </template>
- {{
- $t(
- "project.settings.issue-related.labels.force-issue-labels.warning"
- )
- }}
- </NTooltip>
- </div>
+ </NTooltip>
+ </div>
</div>
<div class="mt-1 mb-3 text-sm text-gray-400">
- {{ $t("project.settings.issue-related.labels.force-issue-labels.description") }}
+ {{
+ $t(
+ "project.settings.issue-related.labels.force-issue-labels.description"
+ )
+ }}
</div>
</div>
<div>
@@ -96,11 +104,13 @@
:disabled="!allowUpdateIssueProjectSetting || loading"
/>
<span class="textlabel">
- {{$t('project.settings.issue-related.enforce-issue-title.self')}}
+ {{ $t("project.settings.issue-related.enforce-issue-title.self") }}
</span>
</div>
<div class="mt-1 mb-3 text-sm text-gray-400">
- {{ $t("project.settings.issue-related.enforce-issue-title.description") }}
+ {{
+ $t("project.settings.issue-related.enforce-issue-title.description")
+ }}
</div>
</div>
<div>
@@ -111,11 +121,13 @@
:disabled="!allowUpdateIssueProjectSetting || loading"
/>
<span class="textlabel">
- {{$t('project.settings.issue-related.allow-self-approval.self')}}
+ {{ $t("project.settings.issue-related.allow-self-approval.self") }}
</span>
</div>
<div class="mt-1 mb-3 text-sm text-gray-400">
- {{ $t("project.settings.issue-related.allow-self-approval.description") }}
+ {{
+ $t("project.settings.issue-related.allow-self-approval.description")
+ }}
</div>
</div>
<div>
@@ -126,11 +138,13 @@
:disabled="!allowUpdateIssueProjectSetting || loading"
/>
<span class="textlabel">
- {{$t('project.settings.issue-related.auto-enable-backup.self')}}
+ {{ $t("project.settings.issue-related.auto-enable-backup.self") }}
</span>
</div>
<div class="mt-1 mb-3 text-sm text-gray-400">
- {{ $t("project.settings.issue-related.auto-enable-backup.description") }}
+ {{
+ $t("project.settings.issue-related.auto-enable-backup.description")
+ }}
</div>
</div>
<div>
@@ -141,11 +155,13 @@
:disabled="!allowUpdateIssueProjectSetting || loading"
/>
<span class="textlabel">
- {{$t('project.settings.issue-related.skip-backup-errors.self')}}
+ {{ $t("project.settings.issue-related.skip-backup-errors.self") }}
</span>
</div>
<div class="mt-1 mb-3 text-sm text-gray-400">
- {{ $t("project.settings.issue-related.skip-backup-errors.description") }}
+ {{
+ $t("project.settings.issue-related.skip-backup-errors.description")
+ }}
</div>
</div>
<div>
@@ -156,11 +172,19 @@
:disabled="!allowUpdateIssueProjectSetting || loading"
/>
<span class="textlabel">
- {{$t('project.settings.issue-related.postgres-database-tenant-mode.self')}}
+ {{
+ $t(
+ "project.settings.issue-related.postgres-database-tenant-mode.self"
+ )
+ }}
</span>
</div>
<div class="mt-1 mb-3 text-sm text-gray-400">
- {{ $t("project.settings.issue-related.postgres-database-tenant-mode.description") }}
+ {{
+ $t(
+ "project.settings.issue-related.postgres-database-tenant-mode.description"
+ )
+ }}
</div>
</div>
<div>
@@ -170,7 +194,7 @@
</span>
</p>
<p class="mt-1 mb-3 text-sm text-gray-400">
- {{ $t("project.settings.issue-related.max-retries.description") }}
+ {{ $t("project.settings.issue-related.max-retries.description") }}
</p>
<div class="mt-3 w-full flex flex-row justify-start items-center gap-4">
<NInputNumber
@@ -192,7 +216,9 @@
</span>
</p>
<p class="mt-1 mb-3 text-sm text-gray-400">
- {{ $t("project.settings.issue-related.ci-sampling-size.description") }}
+ {{
+ $t("project.settings.issue-related.ci-sampling-size.description")
+ }}
</p>
<div class="mt-3 w-full flex flex-row justify-start items-center gap-4">
<NInputNumber
@@ -209,11 +235,19 @@
<div>
<p class="">
<span class="textlabel">
- {{ $t("project.settings.issue-related.parallel_tasks_per_rollout.self") }}
+ {{
+ $t(
+ "project.settings.issue-related.parallel_tasks_per_rollout.self"
+ )
+ }}
</span>
</p>
<p class="mt-1 mb-3 text-sm text-gray-400">
- {{ $t("project.settings.issue-related.parallel_tasks_per_rollout.description") }}
+ {{
+ $t(
+ "project.settings.issue-related.parallel_tasks_per_rollout.description"
+ )
+ }}
</p>
<div class="mt-3 w-full flex flex-row justify-start items-center gap-4">
<NInputNumber
@@ -242,11 +276,13 @@ import {
NInputNumber,
} from "naive-ui";
import { computed, reactive, ref } from "vue";
-import { FeatureBadge } from "@/components/FeatureGuard";
+import { Switch } from "@/components/v2";
import { hasFeature, useProjectV1Store } from "@/store";
import type { ComposedProject } from "@/types";
-import { Label, Project_ExecutionRetryPolicy } from "@/types/proto/v1/project_service";
-import { Switch } from "@/components/v2";
+import {
+ Label,
+ Project_ExecutionRetryPolicy,
+} from "@/types/proto/v1/project_service";
interface LocalState {
issueLabels: Label[];
@@ -408,13 +444,23 @@ const updateMask = computed(() => {
) {
mask.push("postgres_database_tenant_mode");
}
- if (!isEqual(state.executionRetryPolicy?.maximumRetries ?? 0, props.project.executionRetryPolicy?.maximumRetries ?? 0)) {
+ if (
+ !isEqual(
+ state.executionRetryPolicy?.maximumRetries ?? 0,
+ props.project.executionRetryPolicy?.maximumRetries ?? 0
+ )
+ ) {
mask.push("execution_retry_policy");
}
if (!isEqual(state.ciSamplingSize, props.project.ciSamplingSize || 0)) {
mask.push("ci_sampling_size");
}
- if (!isEqual(state.parallelTasksPerRollout, props.project.parallelTasksPerRollout || 0)) {
+ if (
+ !isEqual(
+ state.parallelTasksPerRollout,
+ props.project.parallelTasksPerRollout || 0
+ )
+ ) {
mask.push("parallel_tasks_per_rollout");
}
return mask;
@@ -424,7 +470,7 @@ const handleInput = (value: number | null) => {
if (value === null) return;
if (value === undefined) return;
state.executionRetryPolicy = Project_ExecutionRetryPolicy.create({
- maximumRetries: value,
+ maximumRetries: value,
});
};
diff --git a/frontend/src/components/Project/Settings/ProjectSecuritySettingPanel.vue b/frontend/src/components/Project/Settings/ProjectSecuritySettingPanel.vue
index a2849ff505..048510e380 100644
--- a/frontend/src/components/Project/Settings/ProjectSecuritySettingPanel.vue
+++ b/frontend/src/components/Project/Settings/ProjectSecuritySettingPanel.vue
@@ -1,8 +1,5 @@
<template>
- <div class="w-full flex flex-col justify-start items-start pt-6 space-y-4">
- <h3 class="text-lg font-medium leading-7 text-main">
- {{ $t("settings.sidebar.security-and-policy") }}
- </h3>
+ <div class="w-full flex flex-col justify-start items-start space-y-4">
<SQLReviewForResource
v-if="databaseChangeMode === DatabaseChangeMode.PIPELINE"
ref="sqlReviewForResourceRef"
diff --git a/frontend/src/components/ProjectSettingPanel.vue b/frontend/src/components/ProjectSettingPanel.vue
index 9d1f3379a8..931ef46712 100644
--- a/frontend/src/components/ProjectSettingPanel.vue
+++ b/frontend/src/components/ProjectSettingPanel.vue
@@ -1,32 +1,69 @@
<template>
- <div class="w-full space-y-6">
- <div class="divide-y divide-block-border space-y-6">
- <ProjectGeneralSettingPanel
- ref="projectGeneralSettingPanelRef"
- :project="project"
- :allow-edit="allowEdit"
- />
- <ProjectSecuritySettingPanel
- ref="projectSecuritySettingPanelRef"
- :project="project"
- :allow-edit="allowEdit"
- />
- <ProjectIssueRelatedSettingPanel
+ <div class="w-full space-y-0 pt-4">
+ <div class="divide-y divide-block-border">
+ <!-- General Settings Section -->
+ <div class="pb-6 lg:flex">
+ <div class="text-left lg:w-1/4">
+ <h1 class="text-2xl font-bold">
+ {{ $t("common.general") }}
+ </h1>
+ </div>
+ <div class="flex-1 mt-4 lg:px-4 lg:mt-0">
+ <ProjectGeneralSettingPanel
+ ref="projectGeneralSettingPanelRef"
+ :project="project"
+ :allow-edit="allowEdit"
+ />
+ </div>
+ </div>
+
+ <!-- Security Settings Section -->
+ <div class="py-6 lg:flex">
+ <div class="text-left lg:w-1/4">
+ <h1 class="text-2xl font-bold">
+ {{ $t("settings.sidebar.security-and-policy") }}
+ </h1>
+ </div>
+ <div class="flex-1 mt-4 lg:px-4 lg:mt-0">
+ <ProjectSecuritySettingPanel
+ ref="projectSecuritySettingPanelRef"
+ :project="project"
+ :allow-edit="allowEdit"
+ />
+ </div>
+ </div>
+
+ <!-- Issue Related Settings Section (Pipeline mode only) -->
+ <div
v-if="databaseChangeMode === DatabaseChangeMode.PIPELINE"
- ref="projectIssueRelatedSettingPanelRef"
- :project="project"
- :allow-edit="allowEdit"
- />
+ class="py-6 lg:flex"
+ >
+ <div class="text-left lg:w-1/4">
+ <h1 class="text-2xl font-bold">
+ {{ $t("project.settings.issue-related.self") }}
+ </h1>
+ </div>
+ <div class="flex-1 mt-4 lg:px-4 lg:mt-0">
+ <ProjectIssueRelatedSettingPanel
+ ref="projectIssueRelatedSettingPanelRef"
+ :project="project"
+ :allow-edit="allowEdit"
+ />
+ </div>
+ </div>
+
+ <!-- Archive/Restore Section (Pipeline mode only) -->
<div
v-if="databaseChangeMode === DatabaseChangeMode.PIPELINE"
- class="pt-4"
+ class="py-6 lg:flex"
>
<ProjectArchiveRestoreButton :project="project" />
</div>
+ <!-- Save/Cancel buttons -->
<div v-if="allowEdit && isDirty" class="sticky bottom-0 z-10">
<div
- class="flex justify-between w-full pt-4 border-block-border bg-white"
+ class="flex justify-between w-full py-4 border-block-border bg-white"
>
<NButton @click.prevent="onRevert">
{{ $t("common.cancel") }}
diff --git a/frontend/src/views/project/ProjectSettingPanel.vue b/frontend/src/views/project/ProjectSettingPanel.vue
index aabd6cc6d7..05dd41f471 100644
--- a/frontend/src/views/project/ProjectSettingPanel.vue
+++ b/frontend/src/views/project/ProjectSettingPanel.vue
@@ -5,6 +5,7 @@
<script setup lang="ts">
import { computed, watchEffect } from "vue";
import ProjectSettingPanel from "@/components/ProjectSettingPanel.vue";
+import { useBodyLayoutContext } from "@/layouts/common";
import { usePolicyV1Store, useProjectByName } from "@/store";
import { projectNamePrefix } from "@/store/modules/v1/common";
import { PolicyResourceType } from "@/types/proto/v1/org_policy_service";
@@ -27,4 +28,8 @@ const preparePolicies = () => {
};
watchEffect(preparePolicies);
+
+const { overrideMainContainerClass } = useBodyLayoutContext();
+
+overrideMainContainerClass("!py-0");
</script>