Skip to content

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

feat: SDL is available on free plan with out (#5713)

Liu Ji5bc6547aff0b
diff --git a/frontend/src/components/RepositoryForm.vue b/frontend/src/components/RepositoryForm.vue
index 739a19cca2..6ee68e272f 100644
--- a/frontend/src/components/RepositoryForm.vue
+++ b/frontend/src/components/RepositoryForm.vue
@@ -173,16 +173,21 @@
class="text-accent"
/>
</div>
- <div class="mt-1 textinfolabel">
- <template v-if="isProjectSchemaChangeTypeSDL">
+ <div class="mt-1 textinfolabel space-x-1">
+ <span v-if="isProjectSchemaChangeTypeSDL">
{{ $t("project.settings.schema-path-template-sdl-description") }}
- </template>
+ </span>
<template v-else>
- {{ $t("repository.schema-writeback-description") }}
- <span class="font-medium text-main">{{
- $t("repository.schema-writeback-protected-branch")
- }}</span>
+ <span>{{ $t("repository.schema-writeback-description") }}</span>
+ <span class="font-medium text-main">
+ {{ $t("repository.schema-writeback-protected-branch") }}
+ </span>
</template>
+ <span v-if="!hasFeature('bb.feature.vcs-schema-write-back')">
+ {{
+ $t(getFeatureRequiredPlanString("bb.feature.vcs-schema-write-back"))
+ }}
+ </span>
<LearnMoreLink
url="https://www.bytebase.com/docs/vcs-integration/name-and-organize-schema-files?source=console#schema-path-template"
class="ml-1"
@@ -198,10 +203,19 @@
:disabled="!allowEdit"
/>
<input
- v-else
+ v-else-if="isProjectSchemaChangeTypeSDL"
+ id="schemapathtemplate"
+ v-model="repositoryConfig.schemaPathTemplate"
+ name="schemapathtemplate"
+ type="text"
+ class="textfield mt-2 w-full"
+ :disabled="!allowEdit"
+ />
+ <input
+ v-else-if="isProjectSchemaChangeTypeDDL"
type="text"
class="textfield mt-2 w-full"
- :value="getRquiredPlanString('bb.feature.vcs-schema-write-back')"
+ :value="getRequiredPlanString('bb.feature.vcs-schema-write-back')"
:disabled="true"
/>
<div v-if="schemaTagPlaceholder" class="mt-2 textinfolabel">
@@ -248,7 +262,7 @@
v-else
type="text"
class="textfield mt-2 w-full"
- :value="getRquiredPlanString('bb.feature.vcs-sheet-sync')"
+ :value="getRequiredPlanString('bb.feature.vcs-sheet-sync')"
:disabled="true"
/>
<div class="mt-2 textinfolabel capitalize">
@@ -520,7 +534,9 @@ export default defineComponent({
schemaTagPlaceholder,
state,
hasFeature,
- getRquiredPlanString: subscriptionStore.getRquiredPlanString,
+ getRequiredPlanString: subscriptionStore.getRquiredPlanString,
+ getFeatureRequiredPlanString:
+ subscriptionStore.getFeatureRequiredPlanString,
isProjectSchemaChangeTypeDDL,
isProjectSchemaChangeTypeSDL,
canEnableSQLReview,
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index bee2d5b876..445d15ea97 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1749,6 +1749,7 @@
"successfully-start-trial": "Successfully start free trial for {days} days",
"successfully-upgrade-trial": "Successfully upgrade free trial to {plan}",
"require-subscription": "This feature requires {requiredPlan}, please purchase Bytebase license to unlock this feature.",
+ "feature-require-subscription": "{feature} requires {requiredPlan}.",
"required-plan-with-trial": "This feature requires {requiredPlan}. {startTrial}.",
"trial-for-plan": "You can start a free trial for {plan} with {days} days - no credit card required",
"trial-for-days": "You can start a free trial for {days} days - no credit card required",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 59000f43b3..d5e4030592 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1878,7 +1878,8 @@
"title": "共享 SQL 脚本",
"desc": "将 SQL 脚本分享给项目成员,或者公开给所有人。"
}
- }
+ },
+ "feature-require-subscription": "{feature} 需要 {requiredPlan}。"
},
"sheet": {
"self": "工作表",
diff --git a/frontend/src/store/modules/subscription.ts b/frontend/src/store/modules/subscription.ts
index a303ac3994..b6faa31448 100644
--- a/frontend/src/store/modules/subscription.ts
+++ b/frontend/src/store/modules/subscription.ts
@@ -126,6 +126,21 @@ export const useSubscriptionStore = defineStore("subscription", {
);
return t("subscription.require-subscription", { requiredPlan: plan });
},
+ getFeatureRequiredPlanString(type: FeatureType): string {
+ const { t } = useI18n();
+ const minRequiredPlan = this.getMinimumRequiredPlan(type);
+
+ const requiredPlan = t(
+ `subscription.plan.${planTypeToString(minRequiredPlan)}.title`
+ );
+ const feature = t(
+ `subscription.features.${type.replace(/\./g, "-")}.title`
+ );
+ return t("subscription.feature-require-subscription", {
+ feature,
+ requiredPlan,
+ });
+ },
setSubscription(subscription: Subscription) {
this.subscription = subscription;
},