Skip to content

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

chore: check statement modify setting (#16855)

boojack03bc7c0ddc12
diff --git a/frontend/package.json b/frontend/package.json
index 75058bf61f..71c275152d 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -13,7 +13,7 @@
"type-check": "export NODE_OPTIONS=--max_old_space_size=8000 && vue-tsc --build --force",
"test": "vitest run --passWithNoTests",
"coverage": "vitest --coverage",
- "i18n": "TS_NODE_PROJECT='./tsconfig.i18n.json' ts-node i18n.ts"
+ "i18n": "TS_NODE_PROJECT='./tsconfig.i18n.json' ts-node i18n.ts && eslint --cache src"
},
"dependencies": {
"@bufbuild/protobuf": "^2.5.1",
diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/panels/IssueCreationActionPanel.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/panels/IssueCreationActionPanel.vue
index d0dda351bc..b6518ceb8e 100644
--- a/frontend/src/components/Plan/components/HeaderSection/Actions/panels/IssueCreationActionPanel.vue
+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/panels/IssueCreationActionPanel.vue
@@ -82,6 +82,14 @@
@update:selected="state.labels = $event"
/>
</div>
+
+ <div v-if="tips.length > 0" class="flex flex-col gap-y-2 pl-2">
+ <ul class="list-disc list-inside space-y-1 text-sm text-gray-500">
+ <li v-for="(tip, index) in tips" :key="index">
+ {{ tip }}
+ </li>
+ </ul>
+ </div>
</div>
</template>
<template #footer>
@@ -219,6 +227,17 @@ const planCheckSummaryStatus = computed((): PlanCheckRun_Result_Status => {
return PlanCheckRun_Result_Status.STATUS_UNSPECIFIED;
});
+const tips = computed(() => {
+ const tipsList: string[] = [];
+
+ // Add tip about modifying statements
+ if (!project.value.allowModifyStatement) {
+ tipsList.push(t("issue.error.statement-cannot-be-modified"));
+ }
+
+ return tipsList;
+});
+
const confirmErrors = computed(() => {
const errors: string[] = [];
diff --git a/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue b/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue
index 482f131f2f..1a53bdc09b 100644
--- a/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue
+++ b/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue
@@ -286,7 +286,14 @@ const isSheetOversize = computed(() => {
});
const denyEditStatementReasons = computed(() => {
- return [];
+ const reasons: string[] = [];
+
+ // Check if the project allows modifying statements.
+ if (!project.value.allowModifyStatement && plan.value.issue) {
+ reasons.push(t("issue.error.statement-cannot-be-modified"));
+ }
+
+ return reasons;
});
const shouldShowEditButton = computed(() => {
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 43bdd18052..20ee5679ba 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -977,7 +977,8 @@
"error": {
"you-don-have-privilege-to-edit-this-issue": "You don't have privilege to edit this issue",
"you-are-not-allowed-to-perform-this-action": "You are not allowed to perform this action",
- "cannot-close-issue-with-running-tasks": "Cannot close issue with running tasks"
+ "cannot-close-issue-with-running-tasks": "Cannot close issue with running tasks",
+ "statement-cannot-be-modified": "Statement cannot be modified after the issue is created"
},
"unfinished-resolved-issue-tips": "This issue is marked as \"Done\" but some of its tasks are not executed successfully.",
"some-tasks-are-not-executed-successfully": "(Some tasks are not executed successfully)",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 8e0835b554..5e02dfc38f 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -977,7 +977,8 @@
"error": {
"you-don-have-privilege-to-edit-this-issue": "No tienes privilegios para editar este número.",
"you-are-not-allowed-to-perform-this-action": "No tienes permiso para realizar esta acción.",
- "cannot-close-issue-with-running-tasks": "No se puede cerrar el problema con las tareas en ejecución"
+ "cannot-close-issue-with-running-tasks": "No se puede cerrar el problema con las tareas en ejecución",
+ "statement-cannot-be-modified": "La declaración no se puede modificar una vez creado el problema"
},
"unfinished-resolved-issue-tips": "Este problema está marcado como \"Listo\", pero algunas de sus tareas no se ejecutan correctamente.",
"some-tasks-are-not-executed-successfully": "(Algunas tareas no se ejecutan correctamente)",
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 912dd92d27..07c6d85c0e 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -977,7 +977,8 @@
"error": {
"you-don-have-privilege-to-edit-this-issue": "このイシューを編集する権限がありません",
"you-are-not-allowed-to-perform-this-action": "このアクションを実行する権限がありません",
- "cannot-close-issue-with-running-tasks": "実行中のタスクに関する問題を解決できません"
+ "cannot-close-issue-with-running-tasks": "実行中のタスクに関する問題を解決できません",
+ "statement-cannot-be-modified": "問題の作成後にステートメントを変更することはできません"
},
"unfinished-resolved-issue-tips": "イシューは「完了」とマークされましたが、一部のタスクは正常に実行されませんでした。",
"some-tasks-are-not-executed-successfully": "(一部のタスクは正常に実行されませんでした)",
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index 9f67087ded..b6a587dd27 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -977,7 +977,8 @@
"error": {
"you-don-have-privilege-to-edit-this-issue": "Bạn không có quyền chỉnh sửa vấn đề này",
"you-are-not-allowed-to-perform-this-action": "Bạn không được phép thực hiện hành động này",
- "cannot-close-issue-with-running-tasks": "Không thể đóng vấn đề với các tác vụ đang chạy"
+ "cannot-close-issue-with-running-tasks": "Không thể đóng vấn đề với các tác vụ đang chạy",
+ "statement-cannot-be-modified": "Không thể sửa đổi câu lệnh sau khi vấn đề được tạo"
},
"unfinished-resolved-issue-tips": "Vấn đề này được đánh dấu là \"Hoàn tất\" nhưng một số tác vụ của nó không được thực hiện thành công.",
"some-tasks-are-not-executed-successfully": "(Một số tác vụ không được thực hiện thành công)",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 419b1fe886..79734fad10 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -977,7 +977,8 @@
"error": {
"you-don-have-privilege-to-edit-this-issue": "您没有权限编辑此工单",
"you-are-not-allowed-to-perform-this-action": "您无权执行此操作",
- "cannot-close-issue-with-running-tasks": "无法关闭还存在运行中任务的工单"
+ "cannot-close-issue-with-running-tasks": "无法关闭还存在运行中任务的工单",
+ "statement-cannot-be-modified": "工单创建后,语句将无法修改"
},
"unfinished-resolved-issue-tips": "该工单被标记为「已完成」,但其中部分任务并未成功执行。",
"some-tasks-are-not-executed-successfully": "(部分任务并未成功执行)",