Skip to content

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

feat: enforce manual title requirement on plan creation (#18605)

Danny Xu1f88b61cd915
diff --git a/frontend/src/components/Plan/logic/issue.ts b/frontend/src/components/Plan/logic/issue.ts
index 2f5b9abbc2..c231a6737d 100644
--- a/frontend/src/components/Plan/logic/issue.ts
+++ b/frontend/src/components/Plan/logic/issue.ts
@@ -7,7 +7,11 @@ import {
PROJECT_V1_ROUTE_ISSUE_DETAIL,
PROJECT_V1_ROUTE_PLAN_DETAIL_SPEC_DETAIL,
} from "@/router/dashboard/projectV1";
-import { useDatabaseV1Store, useDBGroupStore } from "@/store";
+import {
+ useDatabaseV1Store,
+ useDBGroupStore,
+ useProjectV1Store,
+} from "@/store";
import { isValidDatabaseGroupName, isValidDatabaseName } from "@/types";
import {
extractDatabaseGroupName,
@@ -41,6 +45,7 @@ export const preCreateIssue = async (project: string, targets: string[]) => {
const type = "bb.issue.database.update";
const databaseStore = useDatabaseV1Store();
const dbGroupStore = useDBGroupStore();
+ const projectStore = useProjectV1Store();
const { enabledNewLayout } = useIssueLayoutVersion();
const databaseNames: string[] = [];
@@ -69,6 +74,9 @@ export const preCreateIssue = async (project: string, targets: string[]) => {
isValidDatabaseGroupName(target)
);
+ // Fetch project to check enforce_issue_title setting
+ const projectEntity = await projectStore.getOrFetchProjectByName(project);
+
if (enabledNewLayout.value) {
// New CI/CD layout: navigate to plan detail page
const query: LocationQueryRaw = {
@@ -78,18 +86,24 @@ export const preCreateIssue = async (project: string, targets: string[]) => {
if (isDatabaseGroup) {
const databaseGroupName = targets[0];
query.databaseGroupName = databaseGroupName;
- query.name = generateIssueTitle(type, [
- extractDatabaseGroupName(databaseGroupName),
- ]);
+ // Only set title from generated if enforceIssueTitle is false.
+ if (!projectEntity.enforceIssueTitle) {
+ query.name = generateIssueTitle(type, [
+ extractDatabaseGroupName(databaseGroupName),
+ ]);
+ }
} else {
query.databaseList = targets.join(",");
- query.name = generateIssueTitle(
- type,
- targets.map((db) => {
- const { databaseName } = extractDatabaseResourceName(db);
- return databaseName;
- })
- );
+ // Only set title from generated if enforceIssueTitle is false.
+ if (!projectEntity.enforceIssueTitle) {
+ query.name = generateIssueTitle(
+ type,
+ targets.map((db) => {
+ const { databaseName } = extractDatabaseResourceName(db);
+ return databaseName;
+ })
+ );
+ }
}
router.push({
@@ -105,9 +119,12 @@ export const preCreateIssue = async (project: string, targets: string[]) => {
// Legacy layout: navigate to issue detail page
const query: LocationQueryRaw = {
template: type,
- name: generateIssueTitle(type, databaseNames),
databaseList: targets.join(","),
};
+ // Only set title from generated if enforceIssueTitle is false.
+ if (!projectEntity.enforceIssueTitle) {
+ query.name = generateIssueTitle(type, databaseNames);
+ }
router.push({
name: PROJECT_V1_ROUTE_ISSUE_DETAIL,
diff --git a/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseOperations.vue b/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseOperations.vue
index cc8d873f95..5a2ba1e958 100644
--- a/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseOperations.vue
+++ b/frontend/src/components/v2/Model/DatabaseV1Table/DatabaseOperations.vue
@@ -306,15 +306,23 @@ const generateMultiDb = async (
}
}
+ // Fetch project to check enforce_issue_title setting
+ const project = await projectStore.getOrFetchProjectByName(
+ selectedProjectName.value
+ );
+
const { enabledNewLayout } = useIssueLayoutVersion();
const query: LocationQueryRaw = {
template: type,
- name: generateIssueTitle(
- type,
- props.databases.map((db) => db.databaseName)
- ),
databaseList: props.databases.map((db) => db.name).join(","),
};
+ // Only set title from generated if enforceIssueTitle is false.
+ if (!project.enforceIssueTitle) {
+ query.name = generateIssueTitle(
+ type,
+ props.databases.map((db) => db.databaseName)
+ );
+ }
const isDataExport = type === "bb.issue.database.data.export";
if (isDataExport || enabledNewLayout.value) {
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 04d522a29d..8efeaabc7a 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1918,8 +1918,8 @@
}
},
"enforce-issue-title": {
- "self": "Enforce issue title",
- "description": "Enforce issue title to be non-empty and created by user instead of auto generated."
+ "self": "Require manual title",
+ "description": "Require titles for issues and plans to be created by user instead of auto-generated."
},
"enforce-sql-review": {
"self": "Enforce SQL review",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index ee948452ae..2d026638ef 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -1918,8 +1918,8 @@
}
},
"enforce-issue-title": {
- "self": "Hacer cumplir el título del problema",
- "description": "Exigir que el título del problema no esté vacío y que lo cree el usuario en lugar de generarse automáticamente."
+ "self": "Requerir título manual",
+ "description": "Requerir que los títulos de problemas y planes sean creados por el usuario en lugar de generarse automáticamente."
},
"enforce-sql-review": {
"self": "Aplicar revisión SQL",
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index eaaad3bfbb..ab911608e1 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -1918,8 +1918,8 @@
}
},
"enforce-issue-title": {
- "self": "問題のタイトルを強制する",
- "description": "問題のタイトルが空でないこと、および自動生成ではなくユーザーが作成することを強制します。"
+ "self": "手動タイトルを要求する",
+ "description": "イシューとプランのタイトルを自動生成ではなくユーザーが作成することを要求します。"
},
"enforce-sql-review": {
"self": "SQL レビューを強制",
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 73bc4ed983..07975f6e02 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -1918,8 +1918,8 @@
}
},
"enforce-issue-title": {
- "self": "Bắt buộc tiêu đề vấn đề",
- "description": "Bắt buộc tiêu đề vấn đề không được để trống và được tạo bởi người dùng thay vì được tạo tự động."
+ "self": "Yêu cầu tiêu đề thủ công",
+ "description": "Yêu cầu tiêu đề cho vấn đề và kế hoạch được tạo bởi người dùng thay vì tự động tạo."
},
"enforce-sql-review": {
"self": "Bắt buộc đánh giá SQL",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 40168f8fa2..6da5041b89 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1918,8 +1918,8 @@
}
},
"enforce-issue-title": {
- "self": "要求手动输入工单标题",
- "description": "工单标题必须由用户输入而不是自动生成。"
+ "self": "要求手动输入标题",
+ "description": "工单和计划的标题必须由用户输入,而不是自动生成。"
},
"enforce-sql-review": {
"self": "强制 SQL 审核",
diff --git a/frontend/src/views/project/ProjectPlanDashboard.vue b/frontend/src/views/project/ProjectPlanDashboard.vue
index ce02141e34..a809b6974b 100644
--- a/frontend/src/views/project/ProjectPlanDashboard.vue
+++ b/frontend/src/views/project/ProjectPlanDashboard.vue
@@ -325,18 +325,24 @@ const handleSpecCreated = async (spec: Plan_Spec) => {
throw new Error("No valid database group name found in targets.");
}
query.databaseGroupName = databaseGroupName;
- query.name = generateIssueTitle(template, [
- extractDatabaseGroupName(databaseGroupName),
- ]);
+ // Only set title from generated if enforceIssueTitle is false.
+ if (!project.value.enforceIssueTitle) {
+ query.name = generateIssueTitle(template, [
+ extractDatabaseGroupName(databaseGroupName),
+ ]);
+ }
} else {
query.databaseList = targets.join(",");
- query.name = generateIssueTitle(
- template,
- targets.map((db) => {
- const { databaseName } = extractDatabaseResourceName(db);
- return databaseName;
- })
- );
+ // Only set title from generated if enforceIssueTitle is false.
+ if (!project.value.enforceIssueTitle) {
+ query.name = generateIssueTitle(
+ template,
+ targets.map((db) => {
+ const { databaseName } = extractDatabaseResourceName(db);
+ return databaseName;
+ })
+ );
+ }
}
// Navigate to the spec detail page with the created spec.