Skip to content

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

chore: update feature guard for issue project setting (#13783)

boojack3a5753d001e7
diff --git a/backend/api/v1/project_service.go b/backend/api/v1/project_service.go
index bcbad03071..3d99394419 100644
--- a/backend/api/v1/project_service.go
+++ b/backend/api/v1/project_service.go
@@ -174,7 +174,22 @@ func (s *ProjectService) UpdateProject(ctx context.Context, request *v1pb.Update
ResourceID: project.ResourceID,
}
+ issueProjectSettingFeatureRelatedPaths := []string{
+ "force_issue_labels",
+ "allow_modify_statement",
+ "auto_resolve_issue",
+ "enforce_issue_title",
+ "auto_enable_backup",
+ "skip_backup_errors",
+ }
for _, path := range request.UpdateMask.Paths {
+ if slices.Contains(issueProjectSettingFeatureRelatedPaths, path) {
+ // Check if the issue project setting feature is enabled.
+ if err := s.licenseService.IsFeatureEnabled(api.FeatureIssueProjectSetting); err != nil {
+ return nil, status.Error(codes.PermissionDenied, err.Error())
+ }
+ }
+
switch path {
case "title":
patch.Title = &request.Project.Title
diff --git a/backend/legacyapi/plan.go b/backend/legacyapi/plan.go
index 8dce4cd876..a7a576d94c 100644
--- a/backend/legacyapi/plan.go
+++ b/backend/legacyapi/plan.go
@@ -126,6 +126,8 @@ const (
FeatureDatabaseGrouping FeatureType = "bb.feature.database-grouping"
// FeatureSchemaTemplate allows user to create and use the schema template.
FeatureSchemaTemplate FeatureType = "bb.feature.schema-template"
+ // FeatureIssueProjectSetting supports some advanced project settings for issue.
+ FeatureIssueProjectSetting FeatureType = "bb.feature.issue-project-setting"
// Database management.
@@ -232,6 +234,8 @@ func (e FeatureType) Name() string {
return "Database grouping"
case FeatureSchemaTemplate:
return "Schema template"
+ case FeatureIssueProjectSetting:
+ return "Issue project setting"
// Database management
case FeatureReadReplicaConnection:
return "Read replica connection"
@@ -304,15 +308,16 @@ var FeatureMatrix = map[FeatureType][3]bool{
// Branding
FeatureBranding: {false, false, true},
// Change Workflow
- FeatureDBAWorkflow: {false, false, true},
- FeatureMultiTenancy: {false, false, true},
- FeatureOnlineMigration: {false, true, true},
- FeatureSchemaDrift: {false, false, true},
- FeatureSQLReview: {true, true, true},
- FeatureTaskScheduleTime: {false, true, true},
- FeatureEncryptedSecrets: {false, true, true},
- FeatureDatabaseGrouping: {false, false, true},
- FeatureSchemaTemplate: {false, false, true},
+ FeatureDBAWorkflow: {false, false, true},
+ FeatureMultiTenancy: {false, false, true},
+ FeatureOnlineMigration: {false, true, true},
+ FeatureSchemaDrift: {false, false, true},
+ FeatureSQLReview: {true, true, true},
+ FeatureTaskScheduleTime: {false, true, true},
+ FeatureEncryptedSecrets: {false, true, true},
+ FeatureDatabaseGrouping: {false, false, true},
+ FeatureSchemaTemplate: {false, false, true},
+ FeatureIssueProjectSetting: {false, true, true},
// Database management
FeatureReadReplicaConnection: {false, false, true},
FeatureInstanceSSHConnection: {false, false, true},
diff --git a/frontend/src/components/EnvironmentForm/AccessControlConfigure.vue b/frontend/src/components/EnvironmentForm/AccessControlConfigure.vue
index 25415d5035..aa9cc8bb47 100644
--- a/frontend/src/components/EnvironmentForm/AccessControlConfigure.vue
+++ b/frontend/src/components/EnvironmentForm/AccessControlConfigure.vue
@@ -1,6 +1,6 @@
<template>
<div class="flex flex-col gap-y-2">
- <div class="textlabel flex items-center space-x-1">
+ <div class="textlabel flex items-center space-x-2">
<label>
{{ $t("environment.access-control.title") }}
</label>
diff --git a/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue b/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue
index 0d55eb04fe..59b27c1b09 100644
--- a/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue
+++ b/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue
@@ -1,78 +1,83 @@
<template>
<div class="w-full flex flex-col justify-start items-start pt-6 space-y-4">
- <h3 class="text-lg font-medium text-main">
- {{ $t("project.settings.issue-related.self") }}
+ <div class="space-y-2 mb-4">
+ <span class="text-lg font-medium text-main">
+ {{ $t("project.settings.issue-related.labels.self") }}
+ </span>
+ <NDynamicTags
+ :size="'large'"
+ :disabled="!allowEdit"
+ :value="labelValues"
+ :render-tag="renderLabel"
+ @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 class="space-y-2 mb-4">
- <span class="textlabel">
- {{ $t("project.settings.issue-related.labels.self") }}
- </span>
- <NDynamicTags
- :size="'large'"
- :disabled="!allowEdit"
- :value="labelValues"
- :render-tag="renderLabel"
- @update:value="onLabelsUpdate"
- />
- </div>
<div>
<NCheckbox
- v-model:checked="state.forceIssueLabels"
+ v-model:checked="state.allowModifyStatement"
size="large"
- :disabled="!allowEdit || state.issueLabels.length === 0"
+ :disabled="!allowUpdateIssueProjectSetting"
:label="
- $t('project.settings.issue-related.labels.force-issue-labels.self')
+ $t('project.settings.issue-related.allow-modify-statement.self')
"
/>
<p class="text-sm text-gray-400 pl-6 ml-0.5">
{{
$t(
- "project.settings.issue-related.labels.force-issue-labels.description"
+ "project.settings.issue-related.allow-modify-statement.description"
)
}}
</p>
</div>
<div>
<NCheckbox
- v-model:checked="state.enforceIssueTitle"
+ v-model:checked="state.autoResolveIssue"
size="large"
- :disabled="!allowEdit"
- :label="$t('project.settings.issue-related.enforce-issue-title.self')"
+ :disabled="!allowUpdateIssueProjectSetting"
+ :label="$t('project.settings.issue-related.auto-resolve-issue.self')"
/>
<p class="text-sm text-gray-400 pl-6 ml-0.5">
{{
- $t("project.settings.issue-related.enforce-issue-title.description")
+ $t("project.settings.issue-related.auto-resolve-issue.description")
}}
</p>
</div>
<div>
<NCheckbox
- v-model:checked="state.allowModifyStatement"
+ v-model:checked="state.forceIssueLabels"
size="large"
- :disabled="!allowEdit"
+ :disabled="
+ !allowUpdateIssueProjectSetting || state.issueLabels.length === 0
+ "
:label="
- $t('project.settings.issue-related.allow-modify-statement.self')
+ $t('project.settings.issue-related.labels.force-issue-labels.self')
"
/>
<p class="text-sm text-gray-400 pl-6 ml-0.5">
{{
$t(
- "project.settings.issue-related.allow-modify-statement.description"
+ "project.settings.issue-related.labels.force-issue-labels.description"
)
}}
</p>
</div>
<div>
<NCheckbox
- v-model:checked="state.autoResolveIssue"
+ v-model:checked="state.enforceIssueTitle"
size="large"
- :disabled="!allowEdit"
- :label="$t('project.settings.issue-related.auto-resolve-issue.self')"
+ :disabled="!allowUpdateIssueProjectSetting"
+ :label="$t('project.settings.issue-related.enforce-issue-title.self')"
/>
<p class="text-sm text-gray-400 pl-6 ml-0.5">
{{
- $t("project.settings.issue-related.auto-resolve-issue.description")
+ $t("project.settings.issue-related.enforce-issue-title.description")
}}
</p>
</div>
@@ -80,7 +85,7 @@
<NCheckbox
v-model:checked="state.autoEnableBackup"
size="large"
- :disabled="!allowEdit"
+ :disabled="!allowUpdateIssueProjectSetting"
:label="$t('project.settings.issue-related.auto-enable-backup.self')"
/>
<p class="text-sm text-gray-400 pl-6 ml-0.5">
@@ -93,7 +98,7 @@
<NCheckbox
v-model:checked="state.skipBackupErrors"
size="large"
- :disabled="!allowEdit"
+ :disabled="!allowUpdateIssueProjectSetting"
:label="$t('project.settings.issue-related.skip-backup-errors.self')"
/>
<p class="text-sm text-gray-400 pl-6 ml-0.5">
@@ -120,15 +125,16 @@ import { isEqual, cloneDeep } from "lodash-es";
import { NButton, NDynamicTags, NTag, NColorPicker, NCheckbox } from "naive-ui";
import { computed, reactive } from "vue";
import { useI18n } from "vue-i18n";
-import { pushNotification, useProjectV1Store } from "@/store";
+import { FeatureBadge } from "@/components/FeatureGuard";
+import { hasFeature, pushNotification, useProjectV1Store } from "@/store";
import type { ComposedProject } from "@/types";
import { Label } from "@/types/proto/v1/project_service";
interface LocalState {
issueLabels: Label[];
- forceIssueLabels: boolean;
allowModifyStatement: boolean;
autoResolveIssue: boolean;
+ forceIssueLabels: boolean;
enforceIssueTitle: boolean;
autoEnableBackup: boolean;
skipBackupErrors: boolean;
@@ -138,9 +144,9 @@ const getInitialLocalState = (): LocalState => {
const project = props.project;
return {
issueLabels: [...cloneDeep(project.issueLabels)],
- forceIssueLabels: project.forceIssueLabels,
allowModifyStatement: project.allowModifyStatement,
autoResolveIssue: project.autoResolveIssue,
+ forceIssueLabels: project.forceIssueLabels,
enforceIssueTitle: project.enforceIssueTitle,
autoEnableBackup: project.autoEnableBackup,
skipBackupErrors: project.skipBackupErrors,
@@ -162,6 +168,10 @@ const labelValues = computed(() => state.issueLabels.map((l) => l.value));
const valueChanged = computed(() => !isEqual(state, getInitialLocalState()));
+const allowUpdateIssueProjectSetting = computed(() => {
+ return props.allowEdit && hasFeature("bb.feature.issue-project-setting");
+});
+
const onLabelsUpdate = (values: string[]) => {
if (state.issueLabels.length + 1 !== values.length) {
return;
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index d857bfd042..33fe1b5969 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -2891,6 +2891,10 @@
"title": "Advanced issue search",
"desc": "Access unlimited issue history with advanced issue search."
},
+ "bb-feature-issue-project-setting": {
+ "title": "Issue project setting",
+ "desc": "Customize advanced issue project settings. Including creating issue restrictions and default backup settings."
+ },
"bb-feature-password-restriction": {
"title": "Password restriction",
"desc": "Allow to configure the restriction for users' password"
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index db5b74e2d2..31bfd066f1 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -2891,6 +2891,10 @@
"title": "Búsqueda avanzada de problemas",
"desc": "Acceda a un historial de problemas ilimitado con búsqueda avanzada de problemas."
},
+ "bb-feature-issue-project-setting": {
+ "title": "Configuración avanzada de proyectos de problemas",
+ "desc": "Personalice la configuración avanzada del proyecto de problemas, incluida la creación de restricciones de problemas y configuraciones de copia de seguridad predeterminadas."
+ },
"bb-feature-password-restriction": {
"title": "Restricción de contraseña",
"desc": "Permitir configurar la restricción de contraseña de los usuarios"
@@ -3756,4 +3760,4 @@
},
"self": "Configuración"
}
-}
+}
\ No newline at end of file
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 64a9c7674a..bc08e95373 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -2891,6 +2891,10 @@
"title": "チケットの詳細検索",
"desc": "高度な検索機能を使用して、無制限の過去のチケットにアクセスできます。"
},
+ "bb-feature-issue-project-setting": {
+ "title": "高度な問題プロジェクト設定",
+ "desc": "高度な問題プロジェクト設定をカスタマイズします。問題制限の作成やデフォルトのバックアップ設定などが含まれます。"
+ },
"bb-feature-password-restriction": {
"title": "パスワード制限",
"desc": "ユーザーのパスワードの制限を設定できるようにする"
@@ -3756,4 +3760,4 @@
},
"self": "設定"
}
-}
+}
\ No newline at end of file
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 7f3ec9152f..037bc95760 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -2891,6 +2891,10 @@
"title": "工单高级搜索",
"desc": "通过高级搜索来访问无限制的历史工单。"
},
+ "bb-feature-issue-project-setting": {
+ "title": "工单项目设置",
+ "desc": "自定义高级工单项目设置。包括创建工单限制以及默认备份设置等。"
+ },
"bb-feature-password-restriction": {
"title": "密码限制",
"desc": "允许配置用户密码的规则"
diff --git a/frontend/src/types/plan.ts b/frontend/src/types/plan.ts
index 91a258c925..92d3fb5ce1 100644
--- a/frontend/src/types/plan.ts
+++ b/frontend/src/types/plan.ts
@@ -34,6 +34,7 @@ export type FeatureType =
| "bb.feature.encrypted-secrets"
| "bb.feature.database-grouping"
| "bb.feature.schema-template"
+ | "bb.feature.issue-project-setting"
// Database management
| "bb.feature.read-replica-connection"
| "bb.feature.custom-instance-scan-interval"