Skip to content

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

chore: refactor frontend feature guard (#16475)

Danny Xu9af0aa510619
diff --git a/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vue b/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vue
index ebe3012b37..356d74da8a 100644
--- a/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vue
+++ b/frontend/src/components/AlterSchemaPrepForm/AlterSchemaPrepForm.vue
@@ -111,8 +111,8 @@ import {
instanceNamePrefix,
environmentNamePrefix,
} from "@/store/modules/v1/common";
-import type { FeatureType } from "@/types";
import { Engine } from "@/types/proto/v1/common";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import type { SearchParams, SearchScope } from "@/utils";
import {
allowUsingSchemaEditor,
@@ -153,7 +153,7 @@ const disableSchemaEditor = useAppFeature(
);
const featureModalContext = ref<{
- feature?: FeatureType;
+ feature?: PlanLimitConfig_Feature;
}>({});
const schemaEditorContext = ref<{
diff --git a/frontend/src/components/ColumnDataTable/SemanticTypeCell.vue b/frontend/src/components/ColumnDataTable/SemanticTypeCell.vue
index 625012fa92..b200b3a1dc 100644
--- a/frontend/src/components/ColumnDataTable/SemanticTypeCell.vue
+++ b/frontend/src/components/ColumnDataTable/SemanticTypeCell.vue
@@ -24,7 +24,7 @@
</div>
<FeatureModal
- feature="bb.feature.sensitive-data"
+ :feature="PlanLimitConfig_Feature.DATA_MASKING"
:instance="database.instanceResource"
:open="state.showFeatureModal"
@cancel="state.showFeatureModal = false"
@@ -47,6 +47,7 @@ import { useSemanticType } from "@/components/SensitiveData/useSemanticType";
import { MiniActionButton } from "@/components/v2";
import { useSubscriptionV1Store } from "@/store";
import type { ComposedDatabase } from "@/types";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import FeatureModal from "../FeatureGuard/FeatureModal.vue";
import SemanticTypesDrawer from "../SensitiveData/components/SemanticTypesDrawer.vue";
@@ -75,12 +76,12 @@ const { semanticType, semanticTypeList } = useSemanticType(
);
const hasSensitiveDataFeature = computed(() => {
- return subscriptionV1Store.hasFeature("bb.feature.sensitive-data");
+ return subscriptionV1Store.hasFeature(PlanLimitConfig_Feature.DATA_MASKING);
});
const instanceMissingLicense = computed(() => {
return subscriptionV1Store.instanceMissingLicense(
- "bb.feature.sensitive-data",
+ PlanLimitConfig_Feature.DATA_MASKING,
props.database.instanceResource
);
});
diff --git a/frontend/src/components/ColumnDataTable/index.vue b/frontend/src/components/ColumnDataTable/index.vue
index 6944d38c6a..b187d744f8 100644
--- a/frontend/src/components/ColumnDataTable/index.vue
+++ b/frontend/src/components/ColumnDataTable/index.vue
@@ -24,6 +24,7 @@ import {
} from "@/store";
import type { ComposedDatabase } from "@/types";
import { Engine } from "@/types/proto/v1/common";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import type {
ColumnMetadata,
TableMetadata,
@@ -63,7 +64,7 @@ const engine = computed(() => {
const subscriptionV1Store = useSubscriptionV1Store();
const hasSensitiveDataFeature = computed(() => {
- return subscriptionV1Store.hasFeature("bb.feature.sensitive-data");
+ return subscriptionV1Store.hasFeature(PlanLimitConfig_Feature.DATA_MASKING);
});
const showSensitiveColumn = computed(() => {
diff --git a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/Toolbar.vue b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/Toolbar.vue
index 6e960c23d3..d67de73463 100644
--- a/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/Toolbar.vue
+++ b/frontend/src/components/CustomApproval/Settings/components/CustomApproval/FlowsPanel/Toolbar.vue
@@ -2,7 +2,7 @@
<div class="flex items-center gap-x-2">
<NButton type="primary" :disabled="!allowAdmin" @click="createRule">
<FeatureBadge
- feature="bb.feature.custom-approval"
+ :feature="PlanLimitConfig_Feature.APPROVAL_WORKFLOW"
class="mr-1 text-white"
/>
{{ $t("common.create") }}
@@ -13,6 +13,7 @@
<script lang="ts" setup>
import { NButton } from "naive-ui";
import { FeatureBadge } from "@/components/FeatureGuard";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { useCustomApprovalContext } from "../context";
import { emptyLocalApprovalRule } from "../logic";
diff --git a/frontend/src/components/Database/DatabaseSensitiveDataPanel.vue b/frontend/src/components/Database/DatabaseSensitiveDataPanel.vue
index 8894e5308d..ad5aef5c74 100644
--- a/frontend/src/components/Database/DatabaseSensitiveDataPanel.vue
+++ b/frontend/src/components/Database/DatabaseSensitiveDataPanel.vue
@@ -1,7 +1,7 @@
<template>
<div class="w-full space-y-4">
<FeatureAttention
- feature="bb.feature.sensitive-data"
+ :feature="PlanLimitConfig_Feature.DATA_MASKING"
:instance="database.instanceResource"
/>
<div
@@ -21,7 +21,7 @@
<template #icon>
<ShieldCheckIcon v-if="hasSensitiveDataFeature" class="w-4" />
<FeatureBadge
- feature="bb.feature.sensitive-data"
+ :feature="PlanLimitConfig_Feature.DATA_MASKING"
class="text-white"
:instance="database.instanceResource"
/>
@@ -43,7 +43,7 @@
</div>
<FeatureModal
- feature="bb.feature.sensitive-data"
+ :feature="PlanLimitConfig_Feature.DATA_MASKING"
:open="state.showFeatureModal"
:instance="database.instanceResource"
@cancel="state.showFeatureModal = false"
@@ -85,6 +85,7 @@ import { isCurrentColumnException } from "@/components/SensitiveData/utils";
import { SearchBox } from "@/components/v2";
import { featureToRef, usePolicyV1Store, useDatabaseCatalog } from "@/store";
import { type ComposedDatabase } from "@/types";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import {
ObjectSchema_Type,
type ObjectSchema,
@@ -141,7 +142,7 @@ const hasPolicyPermission = computed(() => {
const policyStore = usePolicyV1Store();
-const hasSensitiveDataFeature = featureToRef("bb.feature.sensitive-data");
+const hasSensitiveDataFeature = featureToRef(PlanLimitConfig_Feature.DATA_MASKING);
const databaseCatalog = useDatabaseCatalog(props.database.name, false);
diff --git a/frontend/src/components/DatabaseDetail/Settings/components/Secrets.vue b/frontend/src/components/DatabaseDetail/Settings/components/Secrets.vue
index 7b0a49a352..3553d88072 100644
--- a/frontend/src/components/DatabaseDetail/Settings/components/Secrets.vue
+++ b/frontend/src/components/DatabaseDetail/Settings/components/Secrets.vue
@@ -7,7 +7,7 @@
{{ $t("database.secret.self") }}
</p>
<FeatureBadge
- feature="bb.feature.encrypted-secrets"
+ :feature="PlanLimitConfig_Feature.DATABASE_SECRET_VARIABLES"
class="ml-2"
:instance="database.instanceResource"
/>
@@ -33,7 +33,7 @@
</div>
</div>
<FeatureAttention
- feature="bb.feature.encrypted-secrets"
+ :feature="PlanLimitConfig_Feature.DATABASE_SECRET_VARIABLES"
:instance="database.instanceResource"
/>
<div>
@@ -159,7 +159,7 @@
</Drawer>
</div>
<FeatureModal
- feature="bb.feature.encrypted-secrets"
+ :feature="PlanLimitConfig_Feature.DATABASE_SECRET_VARIABLES"
:open="showFeatureModal"
:instance="database.instanceResource"
@cancel="showFeatureModal = false"
@@ -186,6 +186,7 @@ import {
} from "@/store";
import { type ComposedDatabase } from "@/types";
import { Secret } from "@/types/proto/v1/database_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
export type Detail = {
secret: Secret;
@@ -260,7 +261,7 @@ const extractSecretName = (name: string) => {
const hasSecretFeature = computed(() => {
return subscriptionV1Store.hasInstanceFeature(
- "bb.feature.encrypted-secrets",
+ PlanLimitConfig_Feature.DATABASE_SECRET_VARIABLES,
props.database.instanceResource
);
});
diff --git a/frontend/src/components/EnvironmentForm/AccessControlConfigure.vue b/frontend/src/components/EnvironmentForm/AccessControlConfigure.vue
index e7a6ca8f16..e64aae5b8b 100644
--- a/frontend/src/components/EnvironmentForm/AccessControlConfigure.vue
+++ b/frontend/src/components/EnvironmentForm/AccessControlConfigure.vue
@@ -4,7 +4,8 @@
<label>
{{ $t("environment.access-control.title") }}
</label>
- <FeatureBadge feature="bb.feature.access-control" />
+ // TODO(d): fix this feature control.
+ <FeatureBadge :feature="PlanLimitConfig_Feature.QUERY_DATASOURCE_RESTRICTION" />
</div>
<div>
<div class="w-full inline-flex items-center gap-x-2">
@@ -96,18 +97,19 @@
</template>
<script setup lang="ts">
-import { isEqual, cloneDeep } from "lodash-es";
-import { NRadioGroup, NRadio } from "naive-ui";
-import { computed, watchEffect, reactive } from "vue";
import { hasFeature, usePolicyV1Store } from "@/store";
import { environmentNamePrefix } from "@/store/modules/v1/common";
import {
DataSourceQueryPolicy,
- DisableCopyDataPolicy,
DataSourceQueryPolicy_Restriction,
+ DisableCopyDataPolicy,
PolicyType,
} from "@/types/proto/v1/org_policy_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { hasWorkspacePermissionV2 } from "@/utils";
+import { cloneDeep, isEqual } from "lodash-es";
+import { NRadio, NRadioGroup } from "naive-ui";
+import { computed, reactive, watchEffect } from "vue";
import { FeatureBadge } from "../FeatureGuard";
import { Switch } from "../v2";
@@ -168,7 +170,7 @@ const adminDataSourceQueruRestrictionEnabled = computed(() => {
});
const hasAccessControlFeature = computed(() =>
- hasFeature("bb.feature.access-control")
+ hasFeature(PlanLimitConfig_Feature.QUERY_DATASOURCE_RESTRICTION)
);
const allowUpdatePolicy = computed(() => {
diff --git a/frontend/src/components/EnvironmentForm/EnvironmentForm.vue b/frontend/src/components/EnvironmentForm/EnvironmentForm.vue
index 17dbb9b1ec..92a039859e 100644
--- a/frontend/src/components/EnvironmentForm/EnvironmentForm.vue
+++ b/frontend/src/components/EnvironmentForm/EnvironmentForm.vue
@@ -18,6 +18,7 @@ import { hasFeature } from "@/store";
import { VirtualRoleType } from "@/types";
import type { Policy } from "@/types/proto/v1/org_policy_service";
import { PolicyType } from "@/types/proto/v1/org_policy_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import type { Environment } from "@/types/v1/environment";
import { FeatureModal } from "../FeatureGuard";
import { provideEnvironmentFormContext } from "./context";
@@ -82,21 +83,21 @@ onBeforeRouteLeave((to, from, next) => {
useEmitteryEventListener(events, "create", (params) => {
const { rolloutPolicy, environment } = params;
if (environment.tags?.protected === "protected") {
- if (!hasFeature("bb.feature.environment-tier-policy")) {
- missingFeature.value = "bb.feature.environment-tier-policy";
+ if (!hasFeature(PlanLimitConfig_Feature.ENVIRONMENT_TIERS)) {
+ missingFeature.value = PlanLimitConfig_Feature.ENVIRONMENT_TIERS;
return;
}
}
const rp = rolloutPolicy.rolloutPolicy;
if (rp?.automatic === false) {
if (rp.issueRoles.includes(VirtualRoleType.LAST_APPROVER)) {
- if (!hasFeature("bb.feature.custom-approval")) {
- missingFeature.value = "bb.feature.custom-approval";
+ if (!hasFeature(PlanLimitConfig_Feature.APPROVAL_WORKFLOW)) {
+ missingFeature.value = PlanLimitConfig_Feature.APPROVAL_WORKFLOW;
return;
}
}
- if (!hasFeature("bb.feature.rollout-policy")) {
- missingFeature.value = "bb.feature.rollout-policy";
+ if (!hasFeature(PlanLimitConfig_Feature.ROLLOUT_POLICY)) {
+ missingFeature.value = PlanLimitConfig_Feature.ROLLOUT_POLICY;
return;
}
}
@@ -106,9 +107,9 @@ useEmitteryEventListener(events, "create", (params) => {
useEmitteryEventListener(events, "update", (environment) => {
if (
environment.tags.protected === "protected" &&
- !hasFeature("bb.feature.environment-tier-policy")
+ !hasFeature(PlanLimitConfig_Feature.ENVIRONMENT_TIERS)
) {
- missingFeature.value = "bb.feature.environment-tier-policy";
+ missingFeature.value = PlanLimitConfig_Feature.ENVIRONMENT_TIERS;
return;
}
@@ -120,13 +121,13 @@ useEmitteryEventListener(events, "update-policy", (params) => {
const rp = policy.rolloutPolicy;
if (rp?.automatic === false) {
if (rp.issueRoles.includes(VirtualRoleType.LAST_APPROVER)) {
- if (!hasFeature("bb.feature.custom-approval")) {
- missingFeature.value = "bb.feature.custom-approval";
+ if (!hasFeature(PlanLimitConfig_Feature.APPROVAL_WORKFLOW)) {
+ missingFeature.value = PlanLimitConfig_Feature.APPROVAL_WORKFLOW;
return;
}
}
- if (!hasFeature("bb.feature.rollout-policy")) {
- missingFeature.value = "bb.feature.rollout-policy";
+ if (!hasFeature(PlanLimitConfig_Feature.ROLLOUT_POLICY)) {
+ missingFeature.value = PlanLimitConfig_Feature.ROLLOUT_POLICY;
return;
}
}
diff --git a/frontend/src/components/EnvironmentForm/Form.vue b/frontend/src/components/EnvironmentForm/Form.vue
index 99254e1a44..0e2ea4dff6 100644
--- a/frontend/src/components/EnvironmentForm/Form.vue
+++ b/frontend/src/components/EnvironmentForm/Form.vue
@@ -36,7 +36,7 @@
<div v-if="features.includes('TIER')" class="flex flex-col gap-y-2">
<label class="font-medium flex items-center">
{{ $t("policy.environment-tier.name") }}
- <FeatureBadge feature="bb.feature.environment-tier-policy" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.ENVIRONMENT_TIERS" />
</label>
<p class="text-sm text-gray-600">
<i18n-t tag="span" keypath="policy.environment-tier.description">
@@ -146,6 +146,7 @@ import {
pushNotification,
} from "@/store";
import { environmentNamePrefix } from "@/store/modules/v1/common";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { FeatureBadge } from "../FeatureGuard";
import SQLReviewForResource from "../SQLReview/components/SQLReviewForResource.vue";
import { ResourceIdField } from "../v2";
@@ -205,7 +206,7 @@ watch(
);
const hasEnvironmentPolicyFeature = computed(() =>
- hasFeature("bb.feature.environment-tier-policy")
+ hasFeature(PlanLimitConfig_Feature.ENVIRONMENT_TIERS)
);
const allowArchive = computed(() => {
@@ -241,7 +242,7 @@ const renderColorPicker = () => {
}}
onUpdateValue={(color: string) => {
if (!hasEnvironmentPolicyFeature.value) {
- missingFeature.value = "bb.feature.environment-tier-policy";
+ missingFeature.value = PlanLimitConfig_Feature.ENVIRONMENT_TIERS;
return;
}
state.value.environment.color = color;
diff --git a/frontend/src/components/EnvironmentForm/context.ts b/frontend/src/components/EnvironmentForm/context.ts
index 568346c378..32a1af9332 100644
--- a/frontend/src/components/EnvironmentForm/context.ts
+++ b/frontend/src/components/EnvironmentForm/context.ts
@@ -4,8 +4,8 @@ import { useDialog } from "naive-ui";
import type { InjectionKey, Ref } from "vue";
import { provide, inject, computed, ref, watch } from "vue";
import type { ResourceIdField } from "@/components/v2";
-import type { FeatureType } from "@/types";
import { PolicyType, type Policy } from "@/types/proto/v1/org_policy_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import type { Environment } from "@/types/v1/environment";
import { hasWorkspacePermissionV2 } from "@/utils";
@@ -49,7 +49,7 @@ export const provideEnvironmentFormContext = (baseContext: {
rolloutPolicy: cloneDeep(rolloutPolicy.value),
policyChanged: false,
});
- const missingFeature = ref<FeatureType | undefined>(undefined);
+ const missingFeature = ref<PlanLimitConfig_Feature | undefined>(undefined);
const resourceIdField = ref<InstanceType<typeof ResourceIdField>>();
const valueChanged = (
diff --git a/frontend/src/components/FeatureGuard/FeatureAttention.vue b/frontend/src/components/FeatureGuard/FeatureAttention.vue
index 65e2991368..6a1a10d2d7 100644
--- a/frontend/src/components/FeatureGuard/FeatureAttention.vue
+++ b/frontend/src/components/FeatureGuard/FeatureAttention.vue
@@ -21,20 +21,19 @@
</template>
<script lang="ts" setup>
-import { reactive, computed } from "vue";
-import { useI18n } from "vue-i18n";
-import { useRouter } from "vue-router";
import { BBAttention } from "@/bbkit";
import { useLanguage } from "@/composables/useLanguage";
-import { useSubscriptionV1Store, useActuatorV1Store } from "@/store";
-import type { FeatureType } from "@/types";
-import { planTypeToString, ENTERPRISE_INQUIRE_LINK } from "@/types";
-import { instanceLimitFeature } from "@/types";
+import { useActuatorV1Store, useSubscriptionV1Store } from "@/store";
+import { ENTERPRISE_INQUIRE_LINK, instanceLimitFeature, planTypeToString } from "@/types";
import type {
Instance,
InstanceResource,
} from "@/types/proto/v1/instance_service";
+import { PlanLimitConfig_Feature, PlanType } from "@/types/proto/v1/subscription_service";
import { autoSubscriptionRoute, hasWorkspacePermissionV2 } from "@/utils";
+import { computed, reactive } from "vue";
+import { useI18n } from "vue-i18n";
+import { useRouter } from "vue-router";
import InstanceAssignment from "../InstanceAssignment.vue";
import WeChatQRModal from "../WeChatQRModal.vue";
@@ -45,7 +44,7 @@ interface LocalState {
const props = withDefaults(
defineProps<{
- feature: FeatureType;
+ feature: PlanLimitConfig_Feature;
description?: string;
type?: "info" | "warning" | "error";
instance?: Instance | InstanceResource;
@@ -142,13 +141,12 @@ const descriptionText = computed(() => {
: t("subscription.trial-for-days", {
days: subscriptionStore.trialingDays,
});
- if (!Array.isArray(subscriptionStore.featureMatrix.get(props.feature))) {
+ // Check if feature is available in any plan
+ // TODO(d): simplify the check.
+ const requiredPlan = subscriptionStore.getMinimumRequiredPlan(props.feature);
+ if (requiredPlan === PlanType.FREE && subscriptionStore.hasFeature(props.feature)) {
return `${description}\n${startTrial}`;
}
-
- const requiredPlan = subscriptionStore.getMinimumRequiredPlan(
- props.feature
- );
const trialText = t("subscription.required-plan-with-trial", {
requiredPlan: t(
`subscription.plan.${planTypeToString(requiredPlan)}.title`
diff --git a/frontend/src/components/FeatureGuard/FeatureBadge.vue b/frontend/src/components/FeatureGuard/FeatureBadge.vue
index 988e4752d0..6bf1337867 100644
--- a/frontend/src/components/FeatureGuard/FeatureBadge.vue
+++ b/frontend/src/components/FeatureGuard/FeatureBadge.vue
@@ -60,12 +60,12 @@
import { NTooltip } from "naive-ui";
import { reactive, computed } from "vue";
import { useSubscriptionV1Store } from "@/store";
-import type { FeatureType } from "@/types";
import { planTypeToString } from "@/types";
import type {
Instance,
InstanceResource,
} from "@/types/proto/v1/instance_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { autoSubscriptionRoute, hasWorkspacePermissionV2 } from "@/utils";
import InstanceAssignment from "../InstanceAssignment.vue";
@@ -75,7 +75,7 @@ interface LocalState {
const props = withDefaults(
defineProps<{
- feature: FeatureType;
+ feature: PlanLimitConfig_Feature;
instance?: Instance | InstanceResource;
showInstanceMissingLicense?: boolean;
clickable?: boolean;
diff --git a/frontend/src/components/FeatureGuard/FeatureModal.vue b/frontend/src/components/FeatureGuard/FeatureModal.vue
index 73ee4d3923..f17c7d9ec0 100644
--- a/frontend/src/components/FeatureGuard/FeatureModal.vue
+++ b/frontend/src/components/FeatureGuard/FeatureModal.vue
@@ -115,22 +115,21 @@
</template>
<script lang="ts" setup>
-import { NButton } from "naive-ui";
-import type { PropType } from "vue";
-import { computed, reactive } from "vue";
-import { useI18n } from "vue-i18n";
-import { useRouter } from "vue-router";
import { BBModal } from "@/bbkit";
import { useLanguage } from "@/composables/useLanguage";
import { useSubscriptionV1Store } from "@/store";
-import type { FeatureType } from "@/types";
-import { planTypeToString, ENTERPRISE_INQUIRE_LINK } from "@/types";
+import { ENTERPRISE_INQUIRE_LINK, planTypeToString } from "@/types";
import type {
Instance,
InstanceResource,
} from "@/types/proto/v1/instance_service";
-import { PlanType } from "@/types/proto/v1/subscription_service";
+import { PlanLimitConfig_Feature, PlanType } from "@/types/proto/v1/subscription_service";
import { autoSubscriptionRoute, hasWorkspacePermissionV2 } from "@/utils";
+import { NButton } from "naive-ui";
+import type { PropType } from "vue";
+import { computed, reactive } from "vue";
+import { useI18n } from "vue-i18n";
+import { useRouter } from "vue-router";
import InstanceAssignment from "../InstanceAssignment.vue";
import WeChatQRModal from "../WeChatQRModal.vue";
@@ -146,8 +145,8 @@ const props = defineProps({
},
feature: {
required: true,
- type: String as PropType<FeatureType>,
- default: "",
+ type: Number as unknown as PropType<PlanLimitConfig_Feature>,
+ default: () => PlanLimitConfig_Feature.FEATURE_UNSPECIFIED,
},
instance: {
type: Object as PropType<Instance | InstanceResource>,
@@ -191,9 +190,8 @@ const ok = () => {
emit("cancel");
};
-const isRequiredInPlan = Array.isArray(
- subscriptionStore.featureMatrix.get(props.feature)
-);
+// TODO(d): fix this required plan logic.
+const isRequiredInPlan = subscriptionStore.getMinimumRequiredPlan(props.feature) !== PlanType.FREE;
const requiredPlan = subscriptionStore.getMinimumRequiredPlan(props.feature);
const featureKey = computed(() => {
diff --git a/frontend/src/components/GeneralSetting/AIAugmentationSetting.vue b/frontend/src/components/GeneralSetting/AIAugmentationSetting.vue
index c2eac0ca7c..c242ee2bdb 100644
--- a/frontend/src/components/GeneralSetting/AIAugmentationSetting.vue
+++ b/frontend/src/components/GeneralSetting/AIAugmentationSetting.vue
@@ -5,7 +5,7 @@
<h1 class="text-2xl font-bold">
{{ title }}
</h1>
- <FeatureBadge feature="bb.feature.ai-assistant" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.NATURAL_LANGUAGE_TO_SQL" />
</div>
<span v-if="!allowEdit" class="text-sm text-gray-400">
{{ $t("settings.general.workspace.only-admin-can-edit") }}
@@ -167,6 +167,7 @@ import {
AISetting_Provider,
Setting_SettingName,
} from "@/types/proto/v1/setting_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { FeatureBadge } from "../FeatureGuard";
interface LocalState {
@@ -198,7 +199,7 @@ const aiSetting = computed(
() => settingV1Store.getSettingByName(Setting_SettingName.AI)?.value?.aiSetting
);
-const hasAIFeature = computed(() => hasFeature("bb.feature.ai-assistant"));
+const hasAIFeature = computed(() => hasFeature(PlanLimitConfig_Feature.NATURAL_LANGUAGE_TO_SQL));
const getInitialState = (): LocalState => {
return {
diff --git a/frontend/src/components/GeneralSetting/AccountSetting.vue b/frontend/src/components/GeneralSetting/AccountSetting.vue
index b675e59528..6777c9e305 100644
--- a/frontend/src/components/GeneralSetting/AccountSetting.vue
+++ b/frontend/src/components/GeneralSetting/AccountSetting.vue
@@ -21,7 +21,7 @@
/>
<div class="font-medium flex items-center gap-x-2">
{{ $t("settings.general.workspace.disallow-signup.enable") }}
- <FeatureBadge feature="bb.feature.disallow-signup" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.DISALLOW_SELF_SERVICE_SIGNUP" />
</div>
</div>
<div class="mt-1 mb-3 text-sm text-gray-400">
@@ -47,7 +47,7 @@
/>
<div class="font-medium flex items-center gap-x-2">
{{ $t("settings.general.workspace.require-2fa.enable") }}
- <FeatureBadge feature="bb.feature.2fa" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.TWO_FA" />
</div>
</div>
<div class="mt-1 mb-3 text-sm text-gray-400">
@@ -86,7 +86,7 @@
)
}}
</NTooltip>
- <FeatureBadge feature="bb.feature.disallow-password-signin" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.DISALLOW_PASSWORD_SIGNIN" />
</div>
</div>
<div class="mt-1 mb-3 text-sm text-gray-400">
@@ -115,11 +115,6 @@
</template>
<script lang="ts" setup>
-import { isEqual } from "lodash-es";
-import { TriangleAlertIcon } from "lucide-vue-next";
-import { NDivider, NTooltip } from "naive-ui";
-import { storeToRefs } from "pinia";
-import { computed, reactive, ref, watchEffect } from "vue";
import { Switch } from "@/components/v2";
import {
featureToRef,
@@ -127,14 +122,19 @@ import {
useIdentityProviderStore,
} from "@/store";
import { useSettingV1Store } from "@/store/modules/v1/setting";
-import type { FeatureType } from "@/types";
import { type WorkspaceProfileSetting } from "@/types/proto/v1/setting_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
+import { isEqual } from "lodash-es";
+import { TriangleAlertIcon } from "lucide-vue-next";
+import { NDivider, NTooltip } from "naive-ui";
+import { storeToRefs } from "pinia";
+import { computed, reactive, ref, watchEffect } from "vue";
import { FeatureBadge, FeatureModal } from "../FeatureGuard";
import PasswordRestrictionSetting from "./PasswordRestrictionSetting.vue";
import SignInFrequencySetting from "./SignInFrequencySetting.vue";
interface LocalState {
- featureNameForModal?: FeatureType;
+ featureNameForModal?: PlanLimitConfig_Feature;
disallowSignup: boolean;
require2fa: boolean;
disallowPasswordSignin: boolean;
@@ -168,10 +168,10 @@ const state = reactive<LocalState>({
});
const { isSaaSMode } = storeToRefs(actuatorStore);
-const has2FAFeature = featureToRef("bb.feature.2fa");
-const hasDisallowSignupFeature = featureToRef("bb.feature.disallow-signup");
+const has2FAFeature = featureToRef(PlanLimitConfig_Feature.TWO_FA);
+const hasDisallowSignupFeature = featureToRef(PlanLimitConfig_Feature.DISALLOW_SELF_SERVICE_SIGNUP);
const hasDisallowPasswordSigninFeature = featureToRef(
- "bb.feature.disallow-password-signin"
+ PlanLimitConfig_Feature.DISALLOW_PASSWORD_SIGNIN
);
watchEffect(async () => {
diff --git a/frontend/src/components/GeneralSetting/AnnouncementSetting.vue b/frontend/src/components/GeneralSetting/AnnouncementSetting.vue
index fca2e80fda..c0b38fbf87 100644
--- a/frontend/src/components/GeneralSetting/AnnouncementSetting.vue
+++ b/frontend/src/components/GeneralSetting/AnnouncementSetting.vue
@@ -5,7 +5,7 @@
<h1 class="text-2xl font-bold">
{{ title }}
</h1>
- <FeatureBadge feature="bb.feature.announcement" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.DASHBOARD_ANNOUNCEMENT" />
</div>
<span v-if="!allowEdit" class="text-sm text-gray-400">
@@ -107,6 +107,7 @@ import { featureToRef } from "@/store";
import { useSettingV1Store } from "@/store/modules/v1/setting";
import { Announcement } from "@/types/proto/v1/setting_service";
import { Announcement_AlertLevel } from "@/types/proto/v1/setting_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { FeatureBadge } from "../FeatureGuard";
const props = defineProps<{
@@ -115,7 +116,7 @@ const props = defineProps<{
}>();
const settingV1Store = useSettingV1Store();
-const hasAnnouncementFeature = featureToRef("bb.feature.announcement");
+const hasAnnouncementFeature = featureToRef(PlanLimitConfig_Feature.DASHBOARD_ANNOUNCEMENT);
const rawAnnouncement = computed(() =>
cloneDeep(
diff --git a/frontend/src/components/GeneralSetting/BrandingSetting.vue b/frontend/src/components/GeneralSetting/BrandingSetting.vue
index 607b5b2c94..3f03d8a521 100644
--- a/frontend/src/components/GeneralSetting/BrandingSetting.vue
+++ b/frontend/src/components/GeneralSetting/BrandingSetting.vue
@@ -5,7 +5,7 @@
<h1 class="text-2xl font-bold">
{{ title }}
</h1>
- <FeatureBadge feature="bb.feature.branding" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.CUSTOM_LOGO" />
</div>
<span v-if="!allowEdit" class="text-sm text-gray-400">
{{ $t("settings.general.workspace.only-admin-can-edit") }}
@@ -55,7 +55,7 @@
</div>
<FeatureModal
- feature="bb.feature.branding"
+ :feature="PlanLimitConfig_Feature.CUSTOM_LOGO"
:open="state.showFeatureModal"
@cancel="state.showFeatureModal = false"
/>
@@ -68,6 +68,7 @@ import { featureToRef } from "@/store";
import { useActuatorV1Store } from "@/store/modules/v1/actuator";
import { useSettingV1Store } from "@/store/modules/v1/setting";
import { Setting_SettingName } from "@/types/proto/v1/setting_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { FeatureBadge, FeatureModal } from "../FeatureGuard";
import SingleFileSelector from "../SingleFileSelector.vue";
@@ -106,7 +107,7 @@ const allowSave = computed((): boolean => {
return state.logoUrl !== settingV1Store.brandingLogo;
});
-const hasBrandingFeature = featureToRef("bb.feature.branding");
+const hasBrandingFeature = featureToRef(PlanLimitConfig_Feature.CUSTOM_LOGO);
const doUpdate = async (content: string) => {
if (state.loading) {
diff --git a/frontend/src/components/GeneralSetting/DomainRestrictionSetting.vue b/frontend/src/components/GeneralSetting/DomainRestrictionSetting.vue
index 6f4baf2371..7e6fdd9ea3 100644
--- a/frontend/src/components/GeneralSetting/DomainRestrictionSetting.vue
+++ b/frontend/src/components/GeneralSetting/DomainRestrictionSetting.vue
@@ -34,7 +34,7 @@
"settings.general.workspace.domain-restriction.members-restriction.self"
)
}}
- <FeatureBadge feature="bb.feature.domain-restriction" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.USER_EMAIL_DOMAIN_RESTRICTION" />
</div>
<p class="text-sm text-gray-400 leading-tight">
{{
@@ -55,6 +55,7 @@ import { NCheckbox, NInput } from "naive-ui";
import { computed, reactive } from "vue";
import { featureToRef } from "@/store";
import { useSettingV1Store } from "@/store/modules/v1/setting";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { FeatureBadge } from "../FeatureGuard";
const initialState = computed((): LocalState => {
@@ -86,7 +87,7 @@ defineProps<{
const settingV1Store = useSettingV1Store();
const state = reactive<LocalState>(initialState.value);
-const hasFeature = featureToRef("bb.feature.domain-restriction");
+const hasFeature = featureToRef(PlanLimitConfig_Feature.USER_EMAIL_DOMAIN_RESTRICTION);
defineExpose({
isDirty: computed(() => !isEqual(state, initialState.value)),
diff --git a/frontend/src/components/GeneralSetting/PasswordRestrictionSetting.vue b/frontend/src/components/GeneralSetting/PasswordRestrictionSetting.vue
index 9615240963..f90cb2a637 100644
--- a/frontend/src/components/GeneralSetting/PasswordRestrictionSetting.vue
+++ b/frontend/src/components/GeneralSetting/PasswordRestrictionSetting.vue
@@ -4,7 +4,7 @@
class="font-medium flex flex-row justify-start items-center mb-2 gap-x-2"
>
{{ $t("settings.general.workspace.password-restriction.self") }}
- <FeatureBadge feature="bb.feature.password-restriction" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.PASSWORD_RESTRICTIONS" />
</p>
<div class="w-full flex flex-col space-y-3">
<div class="flex items-center space-x-2">
@@ -167,7 +167,7 @@
</div>
<FeatureModal
- feature="bb.feature.password-restriction"
+ :feature="PlanLimitConfig_Feature.PASSWORD_RESTRICTIONS"
:open="showFeatureModal"
@cancel="showFeatureModal = false"
/>
@@ -181,6 +181,7 @@ import { featureToRef } from "@/store";
import { useSettingV1Store } from "@/store/modules/v1/setting";
import { Duration } from "@/types/proto/google/protobuf/duration";
import { PasswordRestrictionSetting, Setting_SettingName } from "@/types/proto/v1/setting_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { FeatureBadge, FeatureModal } from "../FeatureGuard";
const DEFAULT_MIN_LENGTH = 8;
@@ -191,7 +192,7 @@ defineProps<{
const settingV1Store = useSettingV1Store();
const showFeatureModal = ref<boolean>(false);
-const hasPasswordFeature = featureToRef("bb.feature.password-restriction");
+const hasPasswordFeature = featureToRef(PlanLimitConfig_Feature.PASSWORD_RESTRICTIONS);
const passwordRestrictionSetting = computed(
() =>
diff --git a/frontend/src/components/GeneralSetting/QueryDataPolicySetting.vue b/frontend/src/components/GeneralSetting/QueryDataPolicySetting.vue
index 85053675e6..201f242db3 100644
--- a/frontend/src/components/GeneralSetting/QueryDataPolicySetting.vue
+++ b/frontend/src/components/GeneralSetting/QueryDataPolicySetting.vue
@@ -4,7 +4,7 @@
<span class="mr-2">
{{ $t("settings.general.workspace.query-data-policy.timeout.self") }}
</span>
- <FeatureBadge feature="bb.feature.access-control" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.QUERY_DATASOURCE_RESTRICTION" />
</p>
<p class="text-sm text-gray-400 mt-1">
{{
@@ -32,8 +32,6 @@
</template>
<script lang="ts" setup>
-import { NInputNumber } from "naive-ui";
-import { ref, computed } from "vue";
import {
featureToRef,
usePolicyByParentAndType,
@@ -44,11 +42,14 @@ import {
PolicyResourceType,
PolicyType,
} from "@/types/proto/v1/org_policy_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { hasWorkspacePermissionV2 } from "@/utils";
+import { NInputNumber } from "naive-ui";
+import { computed, ref } from "vue";
import { FeatureBadge } from "../FeatureGuard";
const policyV1Store = usePolicyV1Store();
-const hasAccessControlFeature = featureToRef("bb.feature.access-control");
+const hasAccessControlFeature = featureToRef(PlanLimitConfig_Feature.IAM);
const { policy: queryDataPolicy } = usePolicyByParentAndType(
computed(() => ({
diff --git a/frontend/src/components/GeneralSetting/RestrictIssueCreationConfigure.vue b/frontend/src/components/GeneralSetting/RestrictIssueCreationConfigure.vue
index cffdb0f549..3e9421140e 100644
--- a/frontend/src/components/GeneralSetting/RestrictIssueCreationConfigure.vue
+++ b/frontend/src/components/GeneralSetting/RestrictIssueCreationConfigure.vue
@@ -13,7 +13,6 @@
)
}}
</span>
- <FeatureBadge feature="bb.feature.access-control" />
</div>
<div class="mt-1 mb-3 text-sm text-gray-400">
{{
@@ -26,18 +25,18 @@
</template>
<script setup lang="ts">
-import { computed, ref, watch } from "vue";
import {
hasFeature,
- usePolicyV1Store,
usePolicyByParentAndType,
+ usePolicyV1Store,
} from "@/store";
import {
PolicyResourceType,
PolicyType,
} from "@/types/proto/v1/org_policy_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { hasWorkspacePermissionV2 } from "@/utils";
-import { FeatureBadge } from "../FeatureGuard";
+import { computed, ref, watch } from "vue";
import { Switch } from "../v2";
const props = withDefaults(
@@ -57,7 +56,7 @@ const allowEdit = computed(() => {
return (
props.allowEdit &&
hasWorkspacePermissionV2("bb.policies.update") &&
- hasFeature("bb.feature.access-control")
+ hasFeature(PlanLimitConfig_Feature.IAM)
);
});
diff --git a/frontend/src/components/GeneralSetting/SecuritySetting.vue b/frontend/src/components/GeneralSetting/SecuritySetting.vue
index 16c30eeb2e..270ac2b137 100644
--- a/frontend/src/components/GeneralSetting/SecuritySetting.vue
+++ b/frontend/src/components/GeneralSetting/SecuritySetting.vue
@@ -22,7 +22,7 @@
<span class="font-medium">
{{ $t("settings.general.workspace.watermark.enable") }}
</span>
- <FeatureBadge feature="bb.feature.watermark" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.WATERMARK" />
</div>
<div class="mt-1 mb-3 text-sm text-gray-400">
{{ $t("settings.general.workspace.watermark.description") }}
@@ -33,12 +33,12 @@
<Switch
v-model:value="state.enableDataExport"
:text="true"
- :disabled="!allowEdit || !hasAccessControlFeature"
+ :disabled="!allowEdit"
/>
<span class="font-medium">
{{ $t("settings.general.workspace.data-export.enable") }}
</span>
- <FeatureBadge feature="bb.feature.access-control" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.RESTRICT_COPYING_DATA" />
</div>
<div class="mt-1 mb-3 text-sm text-gray-400">
{{ $t("settings.general.workspace.data-export.description") }}
@@ -74,21 +74,21 @@
</template>
<script lang="ts" setup>
-import { isEqual } from "lodash-es";
-import { computed, reactive, ref } from "vue";
import { Switch } from "@/components/v2";
import {
featureToRef,
- useSettingV1Store,
- usePolicyV1Store,
usePolicyByParentAndType,
+ usePolicyV1Store,
+ useSettingV1Store,
} from "@/store";
-import type { FeatureType } from "@/types";
import {
- PolicyType,
PolicyResourceType,
+ PolicyType,
} from "@/types/proto/v1/org_policy_service";
import { Setting_SettingName } from "@/types/proto/v1/setting_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
+import { isEqual } from "lodash-es";
+import { computed, reactive, ref } from "vue";
import { FeatureBadge, FeatureModal } from "../FeatureGuard";
import DomainRestrictionSetting from "./DomainRestrictionSetting.vue";
import MaximumRoleExpirationSetting from "./MaximumRoleExpirationSetting.vue";
@@ -97,7 +97,7 @@ import QueryDataPolicySetting from "./QueryDataPolicySetting.vue";
import RestrictIssueCreationConfigure from "./RestrictIssueCreationConfigure.vue";
interface LocalState {
- featureNameForModal?: FeatureType;
+ featureNameForModal?: PlanLimitConfig_Feature;
enableWatermark: boolean;
enableDataExport: boolean;
}
@@ -109,8 +109,7 @@ const props = defineProps<{
const settingV1Store = useSettingV1Store();
const policyV1Store = usePolicyV1Store();
-const hasWatermarkFeature = featureToRef("bb.feature.branding");
-const hasAccessControlFeature = featureToRef("bb.feature.access-control");
+const hasWatermarkFeature = featureToRef(PlanLimitConfig_Feature.WATERMARK);
const domainRestrictionSettingRef =
ref<InstanceType<typeof DomainRestrictionSetting>>();
diff --git a/frontend/src/components/GeneralSetting/SignInFrequencySetting.vue b/frontend/src/components/GeneralSetting/SignInFrequencySetting.vue
index 6225906562..96aadbba2e 100644
--- a/frontend/src/components/GeneralSetting/SignInFrequencySetting.vue
+++ b/frontend/src/components/GeneralSetting/SignInFrequencySetting.vue
@@ -4,7 +4,7 @@
<span class="mr-2">{{
$t("settings.general.workspace.sign-in-frequency.self")
}}</span>
- <FeatureBadge feature="bb.feature.secure-token" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.SIGN_IN_FREQUENCY_CONTROL" />
</p>
<p class="text-sm text-gray-400 mt-1">
{{ $t("settings.general.workspace.sign-in-frequency.description") }}
@@ -42,7 +42,7 @@
</div>
<FeatureModal
- feature="bb.feature.secure-token"
+ :feature="PlanLimitConfig_Feature.SIGN_IN_FREQUENCY_CONTROL"
:open="state.showFeatureModal"
@cancel="state.showFeatureModal = false"
/>
@@ -56,6 +56,7 @@ import { featureToRef } from "@/store";
import { useSettingV1Store } from "@/store/modules/v1/setting";
import { defaultTokenDurationInHours } from "@/types";
import { Duration } from "@/types/proto/google/protobuf/duration";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { FeatureBadge, FeatureModal } from "../FeatureGuard";
const getInitialState = (): LocalState => {
@@ -91,7 +92,7 @@ const props = defineProps<{
const settingV1Store = useSettingV1Store();
const state = reactive<LocalState>(getInitialState());
-const hasSecureTokenFeature = featureToRef("bb.feature.secure-token");
+const hasSecureTokenFeature = featureToRef(PlanLimitConfig_Feature.SIGN_IN_FREQUENCY_CONTROL);
const allowChangeSetting = computed(() => {
return hasSecureTokenFeature.value && props.allowEdit;
diff --git a/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/index.vue b/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/index.vue
index 00379dd966..ecb594bf03 100644
--- a/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/index.vue
+++ b/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/index.vue
@@ -47,7 +47,8 @@ import { NRadioGroup, NRadio, NTooltip } from "naive-ui";
import { computed, onMounted, reactive, watch } from "vue";
import { FeatureBadge, FeatureModal } from "@/components/FeatureGuard";
import { useProjectByName, hasFeature } from "@/store";
-import type { DatabaseResource, FeatureType } from "@/types";
+import type { DatabaseResource } from "@/types";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import DatabaseResourceSelector from "./DatabaseResourceSelector.vue";
interface LocalState {
@@ -60,7 +61,7 @@ const props = withDefaults(
defineProps<{
disabled?: boolean;
projectName: string;
- requiredFeature: FeatureType;
+ requiredFeature: PlanLimitConfig_Feature;
includeCloumn: boolean;
allowSelectAll?: boolean;
databaseResources?: DatabaseResource[];
diff --git a/frontend/src/components/Instance/InstanceArchiveRestoreButton.vue b/frontend/src/components/Instance/InstanceArchiveRestoreButton.vue
index 4644b45dc2..ff8a432427 100644
--- a/frontend/src/components/Instance/InstanceArchiveRestoreButton.vue
+++ b/frontend/src/components/Instance/InstanceArchiveRestoreButton.vue
@@ -44,29 +44,23 @@
/>
</template>
</div>
- <FeatureModal
- feature="bb.feature.instance-count"
- :open="state.showFeatureModal"
- @cancel="state.showFeatureModal = false"
- />
</template>
<script setup lang="ts">
-import { NCheckbox } from "naive-ui";
-import { computed, ref, reactive } from "vue";
-import { useI18n } from "vue-i18n";
import { restartAppRoot } from "@/AppRootContext";
import { BBButtonConfirm } from "@/bbkit";
import {
- useInstanceV1Store,
pushNotification,
useActuatorV1Store,
+ useInstanceV1Store,
useSubscriptionV1Store,
} from "@/store";
import type { ComposedInstance } from "@/types";
import { State } from "@/types/proto/v1/common";
import { hasWorkspacePermissionV2 } from "@/utils";
-import { FeatureModal } from "../FeatureGuard";
+import { NCheckbox } from "naive-ui";
+import { computed, reactive, ref } from "vue";
+import { useI18n } from "vue-i18n";
interface LocalState {
showFeatureModal: boolean;
diff --git a/frontend/src/components/InstanceForm/Buttons.vue b/frontend/src/components/InstanceForm/Buttons.vue
index 06a633e8fc..4514c78c90 100644
--- a/frontend/src/components/InstanceForm/Buttons.vue
+++ b/frontend/src/components/InstanceForm/Buttons.vue
@@ -62,6 +62,7 @@ import {
DataSourceType,
Instance,
} from "@/types/proto/v1/instance_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { defer, isValidSpannerHost } from "@/utils";
import { cloneDeep, isEqual } from "lodash-es";
import { NButton } from "naive-ui";
@@ -197,7 +198,7 @@ const tryCreate = async () => {
};
const hasExternalSecretFeature = computed(() =>
- subscriptionStore.hasFeature("bb.feature.external-secret-manager")
+ subscriptionStore.hasFeature(PlanLimitConfig_Feature.EXTERNAL_SECRET_MANAGER)
);
const checkExternalSecretFeature = (dataSources: DataSource[]) => {
if (hasExternalSecretFeature.value) {
@@ -256,7 +257,7 @@ const doCreate = async () => {
}
if (!checkExternalSecretFeature(pendingCreateInstance.value.dataSources)) {
- missingFeature.value = "bb.feature.external-secret-manager";
+ missingFeature.value = PlanLimitConfig_Feature.EXTERNAL_SECRET_MANAGER;
return;
}
@@ -308,12 +309,12 @@ const doUpdate = async () => {
return;
}
if (!checkRODataSourceFeature(inst)) {
- missingFeature.value = "bb.feature.read-replica-connection";
+ missingFeature.value = PlanLimitConfig_Feature.INSTANCE_READ_ONLY_CONNECTION;
return;
}
if (!checkExternalSecretFeature([adminDataSource.value])) {
- missingFeature.value = "bb.feature.external-secret-manager";
+ missingFeature.value = PlanLimitConfig_Feature.EXTERNAL_SECRET_MANAGER;
return;
}
@@ -323,7 +324,7 @@ const doUpdate = async () => {
...readonlyDataSourceList.value,
])
) {
- missingFeature.value = "bb.feature.external-secret-manager";
+ missingFeature.value = PlanLimitConfig_Feature.EXTERNAL_SECRET_MANAGER;
return;
}
diff --git a/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue b/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue
index 6b4288f2ad..c23efd8f27 100644
--- a/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue
+++ b/frontend/src/components/InstanceForm/DataSourceSection/DataSourceForm.vue
@@ -276,7 +276,7 @@
<NRadio :value="DataSourceExternalSecret_SecretType.VAULT_KV_V2">
<div class="flex items-center gap-x-1">
{{ $t("instance.password-type.external-secret-vault") }}
- <FeatureBadge feature="bb.feature.external-secret-manager" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.EXTERNAL_SECRET_MANAGER" />
</div>
</NRadio>
<NRadio
@@ -284,7 +284,7 @@
>
<div class="flex items-center gap-x-1">
{{ $t("instance.password-type.external-secret-aws") }}
- <FeatureBadge feature="bb.feature.external-secret-manager" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.EXTERNAL_SECRET_MANAGER" />
</div>
</NRadio>
<NRadio
@@ -292,7 +292,7 @@
>
<div class="flex items-center gap-x-1">
{{ $t("instance.password-type.external-secret-gcp") }}
- <FeatureBadge feature="bb.feature.external-secret-manager" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.EXTERNAL_SECRET_MANAGER" />
</div>
</NRadio>
</NRadioGroup>
@@ -318,7 +318,7 @@
url="https://www.bytebase.com/docs/get-started/instance/#use-secret-manager?source=console"
class="ml-1 text-sm"
/>
- <FeatureBadge feature="bb.feature.external-secret-manager" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.EXTERNAL_SECRET_MANAGER" />
</div>
<div class="mt-2">
<NCheckbox
@@ -998,6 +998,7 @@ import {
KerberosConfig,
SASLConfig,
} from "@/types/proto/v1/instance_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { onlyAllowNumber } from "@/utils";
import {
NButton,
@@ -1247,7 +1248,7 @@ const handleHostInput = (value: string) => {
if (ds.host || ds.port) {
ds.host = adminDataSource.value.host;
ds.port = adminDataSource.value.port;
- missingFeature.value = "bb.feature.read-replica-connection";
+ missingFeature.value = PlanLimitConfig_Feature.INSTANCE_READ_ONLY_CONNECTION;
return;
}
}
@@ -1262,7 +1263,7 @@ const handlePortInput = (value: string) => {
if (ds.host || ds.port) {
ds.host = adminDataSource.value.host;
ds.port = adminDataSource.value.port;
- missingFeature.value = "bb.feature.read-replica-connection";
+ missingFeature.value = PlanLimitConfig_Feature.INSTANCE_READ_ONLY_CONNECTION;
return;
}
}
diff --git a/frontend/src/components/InstanceForm/MaximumConnectionsInput.vue b/frontend/src/components/InstanceForm/MaximumConnectionsInput.vue
index a67a81149c..b7ab35bcb2 100644
--- a/frontend/src/components/InstanceForm/MaximumConnectionsInput.vue
+++ b/frontend/src/components/InstanceForm/MaximumConnectionsInput.vue
@@ -8,7 +8,7 @@
{{ $t("instance.maximum-connections.self") }}
</label>
<FeatureBadge
- feature="bb.feature.custom-instance-synchronization"
+ :feature="PlanLimitConfig_Feature.CUSTOM_INSTANCE_CONNECTION_LIMIT"
:instance="instance"
/>
</div>
@@ -63,6 +63,7 @@
import { NInputNumber, NRadio } from "naive-ui";
import { computed, reactive, watch } from "vue";
import { useSubscriptionV1Store } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { FeatureBadge } from "../FeatureGuard";
import { useInstanceFormContext } from "./context";
@@ -89,7 +90,7 @@ const { instance, hideAdvancedFeatures } = useInstanceFormContext();
const hasFeature = computed(() => {
return subscriptionStore.hasInstanceFeature(
- "bb.feature.custom-instance-synchronization",
+ PlanLimitConfig_Feature.CUSTOM_INSTANCE_CONNECTION_LIMIT,
instance.value
);
});
diff --git a/frontend/src/components/InstanceForm/ScanIntervalInput.vue b/frontend/src/components/InstanceForm/ScanIntervalInput.vue
index ded894e3b6..440201b3b6 100644
--- a/frontend/src/components/InstanceForm/ScanIntervalInput.vue
+++ b/frontend/src/components/InstanceForm/ScanIntervalInput.vue
@@ -8,7 +8,7 @@
{{ $t("instance.scan-interval.self") }}
</label>
<FeatureBadge
- feature="bb.feature.custom-instance-synchronization"
+ :feature="PlanLimitConfig_Feature.CUSTOM_INSTANCE_SYNC_TIME"
:instance="instance"
/>
</div>
@@ -65,6 +65,7 @@ import { NInputNumber, NRadio } from "naive-ui";
import { computed, reactive, watch } from "vue";
import { useSubscriptionV1Store } from "@/store";
import { Duration } from "@/types/proto/google/protobuf/duration";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { FeatureBadge } from "../FeatureGuard";
import { useInstanceFormContext } from "./context";
@@ -92,7 +93,7 @@ const { instance, hideAdvancedFeatures } = useInstanceFormContext();
const hasFeature = computed(() => {
return subscriptionStore.hasInstanceFeature(
- "bb.feature.custom-instance-synchronization",
+ PlanLimitConfig_Feature.CUSTOM_INSTANCE_SYNC_TIME,
instance.value
);
});
diff --git a/frontend/src/components/InstanceForm/SyncDatabases.vue b/frontend/src/components/InstanceForm/SyncDatabases.vue
index 41ee3252d4..c9149f5399 100644
--- a/frontend/src/components/InstanceForm/SyncDatabases.vue
+++ b/frontend/src/components/InstanceForm/SyncDatabases.vue
@@ -7,10 +7,6 @@
<label class="textlabel">
{{ $t("instance.sync-databases.self") }}
</label>
- <FeatureBadge
- feature="bb.feature.custom-instance-synchronization"
- :instance="instance"
- />
</div>
<div class="textinfolabel">
{{ $t("instance.sync-databases.description") }}
@@ -18,7 +14,7 @@
<div class="space-y-2">
<NCheckbox
v-model:checked="state.syncAll"
- :disabled="!allowEdit || !hasFeature"
+ :disabled="!allowEdit"
>
{{ $t("instance.sync-databases.sync-all") }}
</NCheckbox>
@@ -28,7 +24,7 @@
<SearchBox
v-model:value="state.searchText"
style="max-width: 100%"
- :disabled="!hasFeature"
+ :disabled="false"
:placeholder="$t('instance.sync-databases.search-database')"
/>
<NTree
@@ -42,7 +38,7 @@
:data="treeData"
:show-irrelevant-nodes="false"
:render-label="renderLabel"
- :disabled="!allowEdit || !hasFeature"
+ :disabled="!allowEdit"
v-model:checked-keys="state.selectedDatabases"
/>
<NInput
@@ -50,7 +46,7 @@
size="small"
:placeholder="$t('instance.sync-databases.add-database')"
v-model:value="state.inputDatabase"
- :disabled="!allowEdit || !hasFeature"
+ :disabled="!allowEdit"
@keydown="handleKeyDown"
/>
</div>
@@ -60,14 +56,13 @@
</template>
<script lang="tsx" setup>
-import { NInput, NCheckbox, NTree } from "naive-ui";
-import type { TreeOption } from "naive-ui";
-import { computed, reactive, watch, h } from "vue";
import { BBSpin } from "@/bbkit";
import { SearchBox } from "@/components/v2";
-import { useInstanceV1Store, useSubscriptionV1Store } from "@/store";
+import { useInstanceV1Store } from "@/store";
import { getHighlightHTMLByKeyWords } from "@/utils";
-import { FeatureBadge } from "../FeatureGuard";
+import type { TreeOption } from "naive-ui";
+import { NCheckbox, NInput, NTree } from "naive-ui";
+import { computed, h, reactive, watch } from "vue";
import { useInstanceFormContext } from "./context";
const props = withDefaults(
@@ -95,7 +90,6 @@ interface LocalState {
inputDatabase: string;
}
-const subscriptionStore = useSubscriptionV1Store();
const { hideAdvancedFeatures, pendingCreateInstance, instance } =
useInstanceFormContext();
const instanceStore = useInstanceV1Store();
@@ -113,13 +107,6 @@ const targetInstance = computed(() => {
return props.isCreating ? pendingCreateInstance.value : instance.value;
});
-const hasFeature = computed(() => {
- return subscriptionStore.hasInstanceFeature(
- "bb.feature.custom-instance-synchronization",
- targetInstance.value
- );
-});
-
const fetchAllDatabases = async () => {
if (!targetInstance.value) {
return;
diff --git a/frontend/src/components/InstanceForm/context.ts b/frontend/src/components/InstanceForm/context.ts
index 7825b3e968..d0d4a71d7d 100644
--- a/frontend/src/components/InstanceForm/context.ts
+++ b/frontend/src/components/InstanceForm/context.ts
@@ -14,7 +14,6 @@ import {
import {
isValidEnvironmentName,
unknownEnvironment,
- type FeatureType,
} from "@/types";
import { Engine, State } from "@/types/proto/v1/common";
import type { DataSource, Instance } from "@/types/proto/v1/instance_service";
@@ -25,6 +24,7 @@ import {
DataSource_AuthenticationType,
DataSource_RedisType,
} from "@/types/proto/v1/instance_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import {
extractInstanceResourceName,
hasWorkspacePermissionV2,
@@ -101,7 +101,7 @@ export const provideInstanceFormContext = (baseContext: {
const hasReadonlyReplicaFeature = computed(() => {
return useSubscriptionV1Store().hasInstanceFeature(
- "bb.feature.read-replica-connection",
+ PlanLimitConfig_Feature.INSTANCE_READ_ONLY_CONNECTION,
instance.value
);
});
@@ -109,7 +109,7 @@ export const provideInstanceFormContext = (baseContext: {
const resetDataSource = () => {
dataSourceEditState.value = extractDataSourceEditState(instance.value);
};
- const missingFeature = ref<FeatureType | undefined>(undefined);
+ const missingFeature = ref<PlanLimitConfig_Feature | undefined>(undefined);
const resourceIdField = ref<InstanceType<typeof ResourceIdField>>();
diff --git a/frontend/src/components/IssueV1/DataExportIssueDetailPage.vue b/frontend/src/components/IssueV1/DataExportIssueDetailPage.vue
index 2322a2ae9e..859a5dd2a9 100644
--- a/frontend/src/components/IssueV1/DataExportIssueDetailPage.vue
+++ b/frontend/src/components/IssueV1/DataExportIssueDetailPage.vue
@@ -2,7 +2,7 @@
<div ref="containerRef" class="h-full flex flex-col">
<div class="border-b">
<BannerSection v-if="!isCreating" />
- <FeatureAttention feature="bb.feature.custom-approval" />
+ <FeatureAttention :feature="PlanLimitConfig_Feature.APPROVAL_WORKFLOW" />
<HeaderSection />
</div>
<div class="flex-1 flex flex-row">
@@ -65,6 +65,7 @@
import { computed, ref } from "vue";
import { FeatureAttention } from "@/components/FeatureGuard";
import { useCurrentProjectV1 } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import type { Plan, Plan_Spec } from "@/types/proto/v1/plan_service";
import type { Task } from "@/types/proto/v1/rollout_service";
import { SQLCheckSection } from "../Plan/components";
diff --git a/frontend/src/components/IssueV1/GrantRequestIssueDetailPage.vue b/frontend/src/components/IssueV1/GrantRequestIssueDetailPage.vue
index 500ee3ec7e..95d6fccd38 100644
--- a/frontend/src/components/IssueV1/GrantRequestIssueDetailPage.vue
+++ b/frontend/src/components/IssueV1/GrantRequestIssueDetailPage.vue
@@ -2,7 +2,7 @@
<div ref="containerRef" class="h-full flex flex-col">
<div class="border-b">
<BannerSection v-if="!isCreating" />
- <FeatureAttention feature="bb.feature.custom-approval" />
+ <FeatureAttention :feature="PlanLimitConfig_Feature.APPROVAL_WORKFLOW" />
<HeaderSection />
</div>
@@ -117,6 +117,7 @@ import { computedAsync } from "@vueuse/core";
import { computed, ref } from "vue";
import { FeatureAttention } from "@/components/FeatureGuard";
import { useEmitteryEventListener } from "@/composables/useEmitteryEventListener";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { displayRoleTitle } from "@/utils";
import { convertFromCELString } from "@/utils/issue/cel";
import { provideSidebarContext } from "../Plan/logic";
diff --git a/frontend/src/components/IssueV1/IssueDetailPage.vue b/frontend/src/components/IssueV1/IssueDetailPage.vue
index dc48ea365b..b075a053a1 100644
--- a/frontend/src/components/IssueV1/IssueDetailPage.vue
+++ b/frontend/src/components/IssueV1/IssueDetailPage.vue
@@ -2,7 +2,7 @@
<div ref="containerRef" class="h-full flex flex-col">
<div class="border-b">
<BannerSection v-if="!isCreating" />
- <FeatureAttention feature="bb.feature.custom-approval" />
+ <FeatureAttention :feature="PlanLimitConfig_Feature.APPROVAL_WORKFLOW" />
<HeaderSection />
</div>
@@ -68,6 +68,7 @@
import { computed, ref } from "vue";
import { FeatureAttention } from "@/components/FeatureGuard";
import { useCurrentProjectV1 } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import type { Plan, Plan_Spec } from "@/types/proto/v1/plan_service";
import { type Task } from "@/types/proto/v1/rollout_service";
import { SQLCheckSection } from "../Plan/components";
diff --git a/frontend/src/components/IssueV1/components/Sidebar/ReviewSection/ReviewSection.vue b/frontend/src/components/IssueV1/components/Sidebar/ReviewSection/ReviewSection.vue
index c434232349..df0a3aa97f 100644
--- a/frontend/src/components/IssueV1/components/Sidebar/ReviewSection/ReviewSection.vue
+++ b/frontend/src/components/IssueV1/components/Sidebar/ReviewSection/ReviewSection.vue
@@ -6,7 +6,7 @@
<div>
<div class="textlabel flex items-center gap-x-1">
{{ $t("issue.approval-flow.self") }}
- <FeatureBadge feature="bb.feature.custom-approval" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.APPROVAL_WORKFLOW" />
</div>
</div>
</template>
@@ -62,7 +62,7 @@
<div v-if="isCreating" class="flex flex-col gap-y-1">
<div class="textlabel flex items-center gap-x-1">
{{ $t("issue.approval-flow.self") }}
- <FeatureBadge feature="bb.feature.custom-approval" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.APPROVAL_WORKFLOW" />
</div>
<div class="text-control-placeholder text-xs">
{{ $t("issue.approval-flow.pre-issue-created-tips") }}
@@ -77,6 +77,7 @@ import { BBSpin } from "@/bbkit";
import FeatureBadge from "@/components/FeatureGuard/FeatureBadge.vue";
import { useIssueContext, useWrappedReviewStepsV1 } from "@/components/IssueV1";
import { useIssueV1Store } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import RiskLevelTag from "./RiskLevelTag.vue";
import Timeline from "./Timeline.vue";
diff --git a/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorView.vue b/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorView.vue
index 7c6bc9146f..5c063ad3a8 100644
--- a/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorView.vue
+++ b/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorView.vue
@@ -10,7 +10,7 @@
</span>
<span v-if="isCreating" class="text-red-600">*</span>
<NButton
- v-if="!isCreating && !hasFeature('bb.feature.sql-review')"
+ v-if="!isCreating && !hasFeature(PlanLimitConfig_Feature.PRE_DEPLOYMENT_SQL_REVIEW)"
size="tiny"
@click.prevent="state.showFeatureModal = true"
>
@@ -181,7 +181,7 @@
<FeatureModal
:open="state.showFeatureModal"
- feature="bb.feature.sql-review"
+ :feature="PlanLimitConfig_Feature.PRE_DEPLOYMENT_SQL_REVIEW"
@cancel="state.showFeatureModal = false"
/>
</template>
@@ -196,6 +196,7 @@ import { useI18n } from "vue-i18n";
import { useRoute } from "vue-router";
import { BBAttention, BBModal } from "@/bbkit";
import { FeatureModal } from "@/components/FeatureGuard";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { ErrorList } from "@/components/IssueV1/components/common";
import {
useIssueContext,
diff --git a/frontend/src/components/IssueV1/components/StatementSection/SDLView/SDLView.vue b/frontend/src/components/IssueV1/components/StatementSection/SDLView/SDLView.vue
index e4d6113d23..1014e6c1b5 100644
--- a/frontend/src/components/IssueV1/components/StatementSection/SDLView/SDLView.vue
+++ b/frontend/src/components/IssueV1/components/StatementSection/SDLView/SDLView.vue
@@ -1,6 +1,6 @@
<template>
<div class="flex flex-col gap-y-2">
- <div v-if="!hasFeature('bb.feature.sql-review')">
+ <div v-if="!hasFeature(PlanLimitConfig_Feature.PRE_DEPLOYMENT_SQL_REVIEW)">
<div class="flex space-x-4 flex-1">
<NButton size="small" @click.prevent="state.showFeatureModal = true">
🎈{{ $t("sql-review.unlock-full-feature") }}
@@ -76,7 +76,7 @@
</div>
<FeatureModal
:open="state.showFeatureModal"
- feature="bb.feature.sql-review"
+ :feature="PlanLimitConfig_Feature.PRE_DEPLOYMENT_SQL_REVIEW"
@cancel="state.showFeatureModal = false"
/>
</template>
@@ -89,6 +89,7 @@ import { FeatureModal } from "@/components/FeatureGuard";
import { useIssueContext } from "@/components/IssueV1/logic";
import { DiffEditor, MonacoEditor } from "@/components/MonacoEditor";
import { hasFeature, pushNotification } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { useSQLAdviceMarkers } from "../useSQLAdviceMarkers";
import { useSDLState } from "./useSDLState";
diff --git a/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue b/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue
index a928308c91..4bf2457637 100644
--- a/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue
+++ b/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue
@@ -11,7 +11,7 @@
</span>
<span v-if="isCreating" class="text-red-600">*</span>
<NButton
- v-if="!isCreating && !hasFeature('bb.feature.sql-review')"
+ v-if="!isCreating && !hasFeature(PlanLimitConfig_Feature.PRE_DEPLOYMENT_SQL_REVIEW)"
size="small"
@click.prevent="state.showFeatureModal = true"
>
@@ -177,7 +177,7 @@
<FeatureModal
:open="state.showFeatureModal"
- feature="bb.feature.sql-review"
+ :feature="PlanLimitConfig_Feature.PRE_DEPLOYMENT_SQL_REVIEW"
@cancel="state.showFeatureModal = false"
/>
</template>
@@ -192,6 +192,7 @@ import { computed, reactive, ref, watch } from "vue";
import { useI18n } from "vue-i18n";
import { BBAttention, BBModal } from "@/bbkit";
import { FeatureModal } from "@/components/FeatureGuard";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { MonacoEditor } from "@/components/MonacoEditor";
import { extensionNameOfLanguage } from "@/components/MonacoEditor/utils";
import { ErrorList } from "@/components/Plan/components/common";
diff --git a/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue b/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue
index b1a8f0a529..89762a8c36 100644
--- a/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue
+++ b/frontend/src/components/Project/Settings/ProjectIssueRelatedSettingPanel.vue
@@ -266,23 +266,23 @@
</template>
<script setup lang="tsx">
-import { isEqual, cloneDeep } from "lodash-es";
+import { Switch } from "@/components/v2";
+import { useProjectV1Store } from "@/store";
+import type { ComposedProject } from "@/types";
+import {
+ Label,
+ Project_ExecutionRetryPolicy,
+} from "@/types/proto/v1/project_service";
+import { cloneDeep, isEqual } from "lodash-es";
import { TriangleAlertIcon } from "lucide-vue-next";
import {
+ NColorPicker,
NDynamicTags,
+ NInputNumber,
NTag,
- NColorPicker,
NTooltip,
- NInputNumber,
} from "naive-ui";
import { computed, reactive, ref } from "vue";
-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";
interface LocalState {
issueLabels: Label[];
@@ -333,7 +333,7 @@ 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");
+ return props.allowEdit;
});
const onLabelsUpdate = (values: string[]) => {
diff --git a/frontend/src/components/ProjectMember/AddProjectMember/AddProjectMemberForm.vue b/frontend/src/components/ProjectMember/AddProjectMember/AddProjectMemberForm.vue
index 993a32884a..44a4d62b7f 100644
--- a/frontend/src/components/ProjectMember/AddProjectMember/AddProjectMemberForm.vue
+++ b/frontend/src/components/ProjectMember/AddProjectMember/AddProjectMemberForm.vue
@@ -58,7 +58,7 @@
<QuerierDatabaseResourceForm
v-model:database-resources="state.databaseResources"
:project-name="projectName"
- :required-feature="'bb.feature.access-control'"
+ :required-feature="PlanLimitConfig_Feature.IAM"
:include-cloumn="false"
/>
</div>
@@ -88,9 +88,6 @@
<script lang="ts" setup>
/* eslint-disable vue/no-mutating-props */
-import { isUndefined } from "lodash-es";
-import { NInput, NButton } from "naive-ui";
-import { computed, reactive, watch } from "vue";
import ExpirationSelector from "@/components/ExpirationSelector.vue";
import QuerierDatabaseResourceForm from "@/components/GrantRequestPanel/DatabaseResourceForm/index.vue";
import MaxRowCountSelect from "@/components/GrantRequestPanel/MaxRowCountSelect.vue";
@@ -99,8 +96,12 @@ import RequiredStar from "@/components/RequiredStar.vue";
import { RoleSelect } from "@/components/v2/Select";
import { PresetRoleType, type DatabaseResource } from "@/types";
import type { Binding } from "@/types/proto/v1/iam_policy";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { checkRoleContainsAnyPermission } from "@/utils";
import { buildConditionExpr } from "@/utils/issue/cel";
+import { isUndefined } from "lodash-es";
+import { NButton, NInput } from "naive-ui";
+import { computed, reactive, watch } from "vue";
const props = withDefaults(
defineProps<{
diff --git a/frontend/src/components/ProjectMember/ProjectMemberPanel.vue b/frontend/src/components/ProjectMember/ProjectMemberPanel.vue
index 839edd1bcb..3b907eaa42 100644
--- a/frontend/src/components/ProjectMember/ProjectMemberPanel.vue
+++ b/frontend/src/components/ProjectMember/ProjectMemberPanel.vue
@@ -12,8 +12,6 @@
</a>
</div>
- <FeatureAttention feature="bb.feature.rbac" />
-
<NTabs v-model:value="state.selectedTab" type="bar" animated>
<template #suffix>
<div class="flex justify-end gap-x-2">
@@ -92,17 +90,12 @@
</template>
<script lang="ts" setup>
-import { computedAsync } from "@vueuse/core";
-import { cloneDeep } from "lodash-es";
-import { NButton, NTabs, NTabPane, useDialog } from "naive-ui";
-import { computed, reactive } from "vue";
-import { useI18n } from "vue-i18n";
import MemberDataTable from "@/components/Member/MemberDataTable/index.vue";
import MemberDataTableByRole from "@/components/Member/MemberDataTableByRole.vue";
import type { MemberBinding } from "@/components/Member/types";
import {
- getMemberBindingsByRole,
getMemberBindings,
+ getMemberBindingsByRole,
} from "@/components/Member/utils";
import {
extractUserId,
@@ -115,7 +108,11 @@ import {
import type { ComposedProject } from "@/types";
import { PRESET_WORKSPACE_ROLES, groupBindingPrefix } from "@/types";
import { hasProjectPermissionV2 } from "@/utils";
-import { FeatureAttention } from "../FeatureGuard";
+import { computedAsync } from "@vueuse/core";
+import { cloneDeep } from "lodash-es";
+import { NButton, NTabPane, NTabs, useDialog } from "naive-ui";
+import { computed, reactive } from "vue";
+import { useI18n } from "vue-i18n";
import { SearchBox } from "../v2";
import AddProjectMembersPanel from "./AddProjectMember/AddProjectMembersPanel.vue";
import ProjectMemberRolePanel from "./ProjectMemberRolePanel/index.vue";
diff --git a/frontend/src/components/ProjectMember/ProjectMemberRolePanel/EditProjectRolePanel.vue b/frontend/src/components/ProjectMember/ProjectMemberRolePanel/EditProjectRolePanel.vue
index a09d44e3e1..626f5034f8 100644
--- a/frontend/src/components/ProjectMember/ProjectMemberRolePanel/EditProjectRolePanel.vue
+++ b/frontend/src/components/ProjectMember/ProjectMemberRolePanel/EditProjectRolePanel.vue
@@ -41,7 +41,7 @@
v-model:database-resources="state.databaseResources"
:project-name="project.name"
:include-cloumn="false"
- :required-feature="'bb.feature.access-control'"
+ :required-feature="PlanLimitConfig_Feature.IAM"
/>
</div>
@@ -141,6 +141,7 @@ import type { ComposedProject, DatabaseResource } from "@/types";
import { PresetRoleType } from "@/types";
import { State } from "@/types/proto/v1/common";
import type { Binding } from "@/types/proto/v1/iam_policy";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { displayRoleTitle, checkRoleContainsAnyPermission } from "@/utils";
import { convertFromExpr, buildConditionExpr } from "@/utils/issue/cel";
import { getBindingIdentifier } from "../utils";
diff --git a/frontend/src/components/Role/Setting/RoleSetting.vue b/frontend/src/components/Role/Setting/RoleSetting.vue
index bcf095028f..764f85f82b 100644
--- a/frontend/src/components/Role/Setting/RoleSetting.vue
+++ b/frontend/src/components/Role/Setting/RoleSetting.vue
@@ -21,7 +21,7 @@
<template #icon>
<PlusIcon class="h-4 w-4" />
<FeatureBadge
- feature="bb.feature.custom-role"
+ :feature="PlanLimitConfig_Feature.CUSTOM_ROLES"
class="mr-1 text-white"
/>
</template>
@@ -48,7 +48,7 @@
/>
<FeatureModal
- feature="bb.feature.custom-role"
+ :feature="PlanLimitConfig_Feature.CUSTOM_ROLES"
:open="showFeatureModal"
@cancel="showFeatureModal = false"
/>
@@ -65,6 +65,7 @@ import { FeatureBadge, FeatureModal } from "@/components/FeatureGuard";
import { featureToRef, useRoleStore } from "@/store";
import { PRESET_ROLES } from "@/types";
import { Role } from "@/types/proto/v1/role_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { hasWorkspacePermissionV2 } from "@/utils";
import { RoleDataTable, RolePanel } from "./components";
import { provideCustomRoleSettingContext } from "./context";
@@ -92,7 +93,7 @@ const state = reactive<LocalState>({
},
});
-const hasCustomRoleFeature = featureToRef("bb.feature.custom-role");
+const hasCustomRoleFeature = featureToRef(PlanLimitConfig_Feature.CUSTOM_ROLES);
const showFeatureModal = ref(false);
const allowCreateRole = computed(() => {
diff --git a/frontend/src/components/Role/Setting/components/RolePanel.vue b/frontend/src/components/Role/Setting/components/RolePanel.vue
index 645875aa3d..12fe37e97c 100644
--- a/frontend/src/components/Role/Setting/components/RolePanel.vue
+++ b/frontend/src/components/Role/Setting/components/RolePanel.vue
@@ -85,7 +85,7 @@
<NButton @click="$emit('close')">{{ $t("common.cancel") }}</NButton>
<NButton type="primary" :disabled="!allowSave" @click="handleSave">
<FeatureBadge
- feature="bb.feature.custom-role"
+ :feature="PlanLimitConfig_Feature.CUSTOM_ROLES"
class="mr-1 text-white"
/>
{{ mode === "ADD" ? $t("common.add") : $t("common.update") }}
@@ -116,6 +116,7 @@ import { roleNamePrefix } from "@/store/modules/v1/common";
import type { ValidatedMessage } from "@/types";
import { PERMISSIONS } from "@/types";
import { Role } from "@/types/proto/v1/role_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { extractRoleResourceName } from "@/utils";
import { displayPermissionTitle } from "@/utils/permission";
import { useCustomRoleSettingContext } from "../context";
diff --git a/frontend/src/components/SchemaEditorLite/Panels/DatabaseEditor.vue b/frontend/src/components/SchemaEditorLite/Panels/DatabaseEditor.vue
index 3efa758348..2bebf9178b 100644
--- a/frontend/src/components/SchemaEditorLite/Panels/DatabaseEditor.vue
+++ b/frontend/src/components/SchemaEditorLite/Panels/DatabaseEditor.vue
@@ -35,7 +35,7 @@
@click="state.showSchemaTemplateDrawer = true"
>
<template #icon>
- <FeatureBadge feature="bb.feature.schema-template" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.SCHEMA_TEMPLATE" />
<PlusIcon class="w-4 h-4" />
</template>
{{ $t("schema-editor.actions.add-from-template") }}
@@ -142,7 +142,7 @@
</Drawer>
<FeatureModal
- feature="bb.feature.schema-template"
+ :feature="PlanLimitConfig_Feature.SCHEMA_TEMPLATE"
:open="state.showFeatureModal"
@cancel="state.showFeatureModal = false"
/>
@@ -159,6 +159,7 @@ import { Drawer, DrawerContent } from "@/components/v2";
import { hasFeature } from "@/store";
import type { ComposedDatabase } from "@/types";
import { Engine } from "@/types/proto/v1/common";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import type {
ColumnMetadata,
DatabaseMetadata,
@@ -340,7 +341,7 @@ const tryEditColumn = async (
const handleApplyTemplate = (template: SchemaTemplateSetting_TableTemplate) => {
state.showSchemaTemplateDrawer = false;
- if (!hasFeature("bb.feature.schema-template")) {
+ if (!hasFeature(PlanLimitConfig_Feature.SCHEMA_TEMPLATE)) {
state.showFeatureModal = true;
return;
}
diff --git a/frontend/src/components/SchemaEditorLite/Panels/TableColumnEditor/TableColumnEditor.vue b/frontend/src/components/SchemaEditorLite/Panels/TableColumnEditor/TableColumnEditor.vue
index f871685366..68fa0c141a 100644
--- a/frontend/src/components/SchemaEditorLite/Panels/TableColumnEditor/TableColumnEditor.vue
+++ b/frontend/src/components/SchemaEditorLite/Panels/TableColumnEditor/TableColumnEditor.vue
@@ -67,6 +67,7 @@ import LabelEditorDrawer from "@/components/LabelEditorDrawer.vue";
import SemanticTypesDrawer from "@/components/SensitiveData/components/SemanticTypesDrawer.vue";
import { InlineInput } from "@/components/v2";
import { useSettingV1Store, hasFeature } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import type { ComposedDatabase } from "@/types";
import { Engine } from "@/types/proto/v1/common";
import { ColumnCatalog } from "@/types/proto/v1/database_catalog_service";
@@ -378,7 +379,7 @@ const columns = computed(() => {
maxWidth: 320,
hide:
!props.showDatabaseCatalogColumn ||
- !hasFeature("bb.feature.sensitive-data"),
+ !hasFeature(PlanLimitConfig_Feature.DATA_MASKING),
render: (column) => {
return h(SemanticTypeCell, {
database: props.database.name,
diff --git a/frontend/src/components/SchemaEditorLite/Panels/TableEditor.vue b/frontend/src/components/SchemaEditorLite/Panels/TableEditor.vue
index 99da66f9c8..7068cde735 100644
--- a/frontend/src/components/SchemaEditorLite/Panels/TableEditor.vue
+++ b/frontend/src/components/SchemaEditorLite/Panels/TableEditor.vue
@@ -49,7 +49,7 @@
>
<template #icon>
<PlusIcon class="w-4 h-auto mr-1 text-gray-400" />
- <FeatureBadge feature="bb.feature.schema-template" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.SCHEMA_TEMPLATE" />
</template>
{{ $t("schema-editor.actions.add-from-template") }}
</NButton>
@@ -184,7 +184,7 @@
</DrawerContent>
</Drawer>
<FeatureModal
- feature="bb.feature.schema-template"
+ :feature="PlanLimitConfig_Feature.SCHEMA_TEMPLATE"
:open="state.showFeatureModal"
@cancel="state.showFeatureModal = false"
/>
@@ -201,6 +201,7 @@ import { FeatureBadge, FeatureModal } from "@/components/FeatureGuard";
import { IndexIcon, TablePartitionIcon } from "@/components/Icon";
import { Drawer, DrawerContent } from "@/components/v2";
import { hasFeature, pushNotification } from "@/store/modules";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import type { ComposedDatabase } from "@/types";
import {
DatabaseCatalog,
@@ -412,7 +413,7 @@ const handleApplyColumnTemplate = (
template: SchemaTemplateSetting_FieldTemplate
) => {
state.showSchemaTemplateDrawer = false;
- if (!hasFeature("bb.feature.schema-template")) {
+ if (!hasFeature(PlanLimitConfig_Feature.SCHEMA_TEMPLATE)) {
state.showFeatureModal = true;
return;
}
diff --git a/frontend/src/components/SchemaEditorLite/Panels/TableList/TableList.vue b/frontend/src/components/SchemaEditorLite/Panels/TableList/TableList.vue
index bdd6a62bf4..01caf6aa48 100644
--- a/frontend/src/components/SchemaEditorLite/Panels/TableList/TableList.vue
+++ b/frontend/src/components/SchemaEditorLite/Panels/TableList/TableList.vue
@@ -40,7 +40,7 @@
</Drawer>
<FeatureModal
- feature="bb.feature.schema-template"
+ :feature="PlanLimitConfig_Feature.SCHEMA_TEMPLATE"
:open="state.showFeatureModal"
@cancel="state.showFeatureModal = false"
/>
@@ -57,6 +57,7 @@ import ClassificationCell from "@/components/ColumnDataTable/ClassificationCell.
import FeatureModal from "@/components/FeatureGuard/FeatureModal.vue";
import { Drawer, DrawerContent, InlineInput } from "@/components/v2";
import { hasFeature } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import type { ComposedDatabase } from "@/types";
import {
TableCatalog,
@@ -375,7 +376,7 @@ const handleRestoreTable = (table: TableMetadata) => {
const handleApplyTemplate = (template: SchemaTemplateSetting_TableTemplate) => {
state.showSchemaTemplateDrawer = false;
- if (!hasFeature("bb.feature.schema-template")) {
+ if (!hasFeature(PlanLimitConfig_Feature.SCHEMA_TEMPLATE)) {
state.showFeatureModal = true;
return;
}
diff --git a/frontend/src/components/SchemaTemplate/TableTemplateForm.vue b/frontend/src/components/SchemaTemplate/TableTemplateForm.vue
index 7e17509010..778445a0ef 100644
--- a/frontend/src/components/SchemaTemplate/TableTemplateForm.vue
+++ b/frontend/src/components/SchemaTemplate/TableTemplateForm.vue
@@ -105,7 +105,7 @@
@click="state.showFieldTemplateDrawer = true"
>
<template #icon>
- <FeatureBadge feature="bb.feature.schema-template" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.SCHEMA_TEMPLATE" />
<PlusIcon class="w-4 h-4 text-control-placeholder" />
</template>
{{ $t("schema-editor.actions.add-from-template") }}
@@ -210,6 +210,7 @@ import {
type SchemaTemplateSetting_FieldTemplate,
} from "@/types/proto/v1/setting_service";
import { SchemaTemplateSetting, Setting_SettingName } from "@/types/proto/v1/setting_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { arraySwap, instanceV1AllowsReorderColumns } from "@/utils";
import FieldTemplates from "@/views/SchemaTemplate/FieldTemplates.vue";
import ClassificationLevelBadge from "./ClassificationLevelBadge.vue";
diff --git a/frontend/src/components/SensitiveData/ClassificationView.vue b/frontend/src/components/SensitiveData/ClassificationView.vue
index c7ba313c5a..63f0de1198 100644
--- a/frontend/src/components/SensitiveData/ClassificationView.vue
+++ b/frontend/src/components/SensitiveData/ClassificationView.vue
@@ -99,6 +99,7 @@ import { v4 as uuidv4 } from "uuid";
import { computed, reactive, ref } from "vue";
import { useI18n } from "vue-i18n";
import { featureToRef, useSettingV1Store, pushNotification } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import {
DataClassificationSetting_DataClassificationConfig_Level as ClassificationLevel,
DataClassificationSetting_DataClassificationConfig_DataClassification as DataClassification,
@@ -212,7 +213,7 @@ const allowEdit = computed(() => {
return hasWorkspacePermissionV2("bb.settings.set");
});
-const hasSensitiveDataFeature = featureToRef("bb.feature.sensitive-data");
+const hasSensitiveDataFeature = featureToRef(PlanLimitConfig_Feature.DATA_MASKING);
const onUpload = () => {
uploader.value?.click();
diff --git a/frontend/src/components/SensitiveData/GlobalMaskingRulesView.vue b/frontend/src/components/SensitiveData/GlobalMaskingRulesView.vue
index fdce020188..fa1e1d6eab 100644
--- a/frontend/src/components/SensitiveData/GlobalMaskingRulesView.vue
+++ b/frontend/src/components/SensitiveData/GlobalMaskingRulesView.vue
@@ -143,6 +143,7 @@ import {
PolicyResourceType,
MaskingRulePolicy_MaskingRule,
} from "@/types/proto/v1/org_policy_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import {
arraySwap,
hasWorkspacePermissionV2,
@@ -182,7 +183,7 @@ const policyStore = usePolicyV1Store();
const hasPermission = computed(() => {
return hasWorkspacePermissionV2("bb.policies.update");
});
-const hasSensitiveDataFeature = featureToRef("bb.feature.sensitive-data");
+const hasSensitiveDataFeature = featureToRef(PlanLimitConfig_Feature.DATA_MASKING);
const layout = {
mainContainerRef: ref<HTMLDivElement>(),
};
diff --git a/frontend/src/components/SensitiveData/GrantAccessForm.vue b/frontend/src/components/SensitiveData/GrantAccessForm.vue
index c4b4e16779..cc4bfe4055 100644
--- a/frontend/src/components/SensitiveData/GrantAccessForm.vue
+++ b/frontend/src/components/SensitiveData/GrantAccessForm.vue
@@ -12,7 +12,7 @@
<DatabaseResourceForm
v-model:database-resources="state.databaseResources"
:project-name="projectName"
- :required-feature="'bb.feature.sensitive-data'"
+ :required-feature="PlanLimitConfig_Feature.DATA_MASKING"
:include-cloumn="true"
/>
</div>
@@ -119,6 +119,7 @@ import {
MaskingExceptionPolicy_MaskingException_Action,
maskingExceptionPolicy_MaskingException_ActionToJSON,
} from "@/types/proto/v1/org_policy_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import type { SensitiveColumn } from "./types";
import {
getExpressionsForDatabaseResource,
diff --git a/frontend/src/components/SensitiveData/SemanticTypesView.vue b/frontend/src/components/SensitiveData/SemanticTypesView.vue
index abaa46ae3e..4ed502e098 100644
--- a/frontend/src/components/SensitiveData/SemanticTypesView.vue
+++ b/frontend/src/components/SensitiveData/SemanticTypesView.vue
@@ -44,6 +44,7 @@ import { computed, reactive, onMounted } from "vue";
import { useI18n } from "vue-i18n";
import { featureToRef, pushNotification, useSettingV1Store } from "@/store";
import { SemanticTypeSetting_SemanticType, Setting_SettingName } from "@/types/proto/v1/setting_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { hasWorkspacePermissionV2 } from "@/utils";
import SemanticTemplateDrawer from "./components/SemanticTemplateDrawer.vue";
import type { SemanticItem } from "./components/SemanticTypesTable.vue";
@@ -66,7 +67,7 @@ const settingStore = useSettingV1Store();
const hasPermission = computed(() => {
return hasWorkspacePermissionV2("bb.policies.update");
});
-const hasSensitiveDataFeature = featureToRef("bb.feature.sensitive-data");
+const hasSensitiveDataFeature = featureToRef(PlanLimitConfig_Feature.DATA_MASKING);
const semanticTypeSettingValue = computed(() => {
const semanticTypeSetting = settingStore.getSettingByName(
diff --git a/frontend/src/components/SyncDatabaseSchemaV1/DatabaseSchemaSelector.vue b/frontend/src/components/SyncDatabaseSchemaV1/DatabaseSchemaSelector.vue
index aa7ec10b6b..143012a469 100644
--- a/frontend/src/components/SyncDatabaseSchemaV1/DatabaseSchemaSelector.vue
+++ b/frontend/src/components/SyncDatabaseSchemaV1/DatabaseSchemaSelector.vue
@@ -52,7 +52,7 @@
</div>
<FeatureModal
- feature="bb.feature.sync-schema-all-versions"
+ :feature="PlanLimitConfig_Feature.COMPARE_AND_SYNC_SCHEMA"
:open="state.showFeatureModal"
:instance="database?.instanceResource"
@cancel="state.showFeatureModal = false"
@@ -83,6 +83,7 @@ import {
Changelog_Type,
changelog_TypeToJSON,
} from "@/types/proto/v1/database_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import {
extractChangelogUID,
isValidChangelogName,
@@ -135,7 +136,7 @@ const isPreparingSchemaVersionOptions = ref(false);
const hasSyncSchemaFeature = computed(() => {
return useSubscriptionV1Store().hasInstanceFeature(
- "bb.feature.sync-schema-all-versions",
+ PlanLimitConfig_Feature.COMPARE_AND_SYNC_SCHEMA,
database.value?.instanceResource
);
});
@@ -211,7 +212,7 @@ const renderSchemaVersionLabel = (option: SelectOption) => {
<div class="flex flex-row justify-start items-center truncate gap-1">
{index > 0 && (
<FeatureBadge
- feature="bb.feature.sync-schema-all-versions"
+ feature={PlanLimitConfig_Feature.COMPARE_AND_SYNC_SCHEMA}
instance={database.value?.instanceResource}
/>
)}
diff --git a/frontend/src/components/TableDataTable.vue b/frontend/src/components/TableDataTable.vue
index e79a60fffb..870de9dfd6 100644
--- a/frontend/src/components/TableDataTable.vue
+++ b/frontend/src/components/TableDataTable.vue
@@ -43,6 +43,7 @@ import {
import type { ComposedDatabase } from "@/types";
import { Engine } from "@/types/proto/v1/common";
import type { TableMetadata } from "@/types/proto/v1/database_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { bytesToString, hasSchemaProperty } from "@/utils";
import TableDetailDrawer from "./TableDetailDrawer.vue";
@@ -100,7 +101,7 @@ const classificationConfig = computed(() => {
);
});
-const hasSensitiveDataFeature = featureToRef("bb.feature.sensitive-data");
+const hasSensitiveDataFeature = featureToRef(PlanLimitConfig_Feature.DATA_MASKING);
const engine = computed(() => props.database.instanceResource.engine);
diff --git a/frontend/src/components/misc/Watermark.vue b/frontend/src/components/misc/Watermark.vue
index e07e742cf1..278eb19dfb 100644
--- a/frontend/src/components/misc/Watermark.vue
+++ b/frontend/src/components/misc/Watermark.vue
@@ -39,6 +39,7 @@ import { featureToRef, useCurrentUserV1, extractUserId, useActuatorV1Store } fro
import { useSettingV1Store } from "@/store/modules/v1/setting";
import { UNKNOWN_USER_NAME } from "@/types";
import { Setting_SettingName } from "@/types/proto/v1/setting_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
const GAP = 320;
const SIZE = 16;
@@ -49,7 +50,7 @@ const version = computed(() => useActuatorV1Store().version + "-" + useActuatorV
const setting = computed(() =>
useSettingV1Store().getSettingByName(Setting_SettingName.WATERMARK)
);
-const hasWatermarkFeature = featureToRef("bb.feature.watermark");
+const hasWatermarkFeature = featureToRef(PlanLimitConfig_Feature.WATERMARK);
const lines = computed(() => {
const user = currentUserV1.value;
diff --git a/frontend/src/components/v2/Model/DatabaseView.vue b/frontend/src/components/v2/Model/DatabaseView.vue
index 9212967387..397af62817 100644
--- a/frontend/src/components/v2/Model/DatabaseView.vue
+++ b/frontend/src/components/v2/Model/DatabaseView.vue
@@ -1,7 +1,7 @@
<template>
<div class="flex flex-row justify-start items-center gap-x-1" v-bind="$attrs">
<FeatureBadge
- feature="bb.feature.database-grouping"
+ :feature="PlanLimitConfig_Feature.DATABASE_GROUPS"
class="mr-2"
:instance="database.instanceResource"
/>
@@ -26,6 +26,7 @@
import { FeatureBadge } from "@/components/FeatureGuard";
import { DatabaseV1Name, EnvironmentV1Name } from "@/components/v2";
import { useDatabaseV1ByName } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { InstanceV1EngineIcon } from "./Instance";
const props = defineProps<{
diff --git a/frontend/src/components/v2/Model/ProductionEnvironmentV1Icon.vue b/frontend/src/components/v2/Model/ProductionEnvironmentV1Icon.vue
index 7bf1ec10e2..35fba66599 100644
--- a/frontend/src/components/v2/Model/ProductionEnvironmentV1Icon.vue
+++ b/frontend/src/components/v2/Model/ProductionEnvironmentV1Icon.vue
@@ -17,6 +17,7 @@ import { NTooltip } from "naive-ui";
import { computed } from "vue";
import { featureToRef } from "@/store";
import type { Environment } from "@/types/v1/environment";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
const props = withDefaults(
defineProps<{
@@ -29,7 +30,7 @@ const props = withDefaults(
);
const hasEnvironmentTierPolicyFeature = featureToRef(
- "bb.feature.environment-tier-policy"
+ PlanLimitConfig_Feature.ENVIRONMENT_TIERS
);
const enabled = computed((): boolean => {
diff --git a/frontend/src/components/v2/Select/RoleSelect.vue b/frontend/src/components/v2/Select/RoleSelect.vue
index 3bbf847bad..286e77530c 100644
--- a/frontend/src/components/v2/Select/RoleSelect.vue
+++ b/frontend/src/components/v2/Select/RoleSelect.vue
@@ -13,7 +13,7 @@
@update:value="onValueUpdate"
/>
<FeatureModal
- feature="bb.feature.custom-role"
+ :feature="PlanLimitConfig_Feature.CUSTOM_ROLES"
:open="showFeatureModal"
@cancel="showFeatureModal = false"
/>
@@ -27,6 +27,7 @@ import FeatureBadge from "@/components/FeatureGuard/FeatureBadge.vue";
import FeatureModal from "@/components/FeatureGuard/FeatureModal.vue";
import { t } from "@/plugins/i18n";
import { useAppFeature, useRoleStore, featureToRef } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import {
PRESET_PROJECT_ROLES,
PRESET_ROLES,
@@ -66,7 +67,7 @@ const emit = defineEmits<{
const roleStore = useRoleStore();
const hideProjectRoles = useAppFeature("bb.feature.members.hide-project-roles");
const showFeatureModal = ref(false);
-const hasCustomRoleFeature = featureToRef("bb.feature.custom-role");
+const hasCustomRoleFeature = featureToRef(PlanLimitConfig_Feature.CUSTOM_ROLES);
const filterRole = (role: string) => {
if (!props.supportRoles || props.supportRoles.length === 0) {
@@ -132,7 +133,7 @@ const renderLabel = (option: SelectOption) => {
}
const icon = h(FeatureBadge, {
- feature: "bb.feature.custom-role",
+ feature: PlanLimitConfig_Feature.CUSTOM_ROLES,
clickable: false,
});
return h(
diff --git a/frontend/src/composables/useExecuteSQL.ts b/frontend/src/composables/useExecuteSQL.ts
index 63d9f3a8b2..dfc9d520df 100644
--- a/frontend/src/composables/useExecuteSQL.ts
+++ b/frontend/src/composables/useExecuteSQL.ts
@@ -28,6 +28,7 @@ import type {
QueryDataSourceType,
} from "@/types";
import { isValidDatabaseName } from "@/types";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { Engine } from "@/types/proto/v1/common";
import { DatabaseGroupView } from "@/types/proto/v1/database_group_service";
import {
@@ -216,7 +217,7 @@ const useExecuteSQL = () => {
]);
// Check if the user selects multiple databases to query.
- if (tab.batchQueryContext && hasFeature("bb.feature.batch-query")) {
+ if (tab.batchQueryContext && hasFeature(PlanLimitConfig_Feature.BATCH_QUERY)) {
const { databases = [], databaseGroups = [] } = tab.batchQueryContext;
for (const databaseResourceName of databases) {
if (!isValidDatabaseName(databaseResourceName)) {
@@ -228,7 +229,7 @@ const useExecuteSQL = () => {
batchQueryDatabaseSet.add(databaseResourceName);
}
- if (hasFeature("bb.feature.database-grouping")) {
+ if (hasFeature(PlanLimitConfig_Feature.DATABASE_GROUPS)) {
for (const databaseGroupName of databaseGroups) {
try {
const databaseGroup = await dbGroupStore.getOrFetchDBGroupByName(
diff --git a/frontend/src/layouts/ProjectV1Layout.vue b/frontend/src/layouts/ProjectV1Layout.vue
index 8e83e46f48..9587c8fa4e 100644
--- a/frontend/src/layouts/ProjectV1Layout.vue
+++ b/frontend/src/layouts/ProjectV1Layout.vue
@@ -59,12 +59,6 @@
</template>
<script lang="ts" setup>
-import { UsersIcon } from "lucide-vue-next";
-import { NButton, NEllipsis, NSpin } from "naive-ui";
-import type { ClientError } from "nice-grpc-web";
-import { computed, watchEffect, h, reactive } from "vue";
-import { useI18n } from "vue-i18n";
-import { useRoute, useRouter } from "vue-router";
import { BBAttention } from "@/bbkit";
import ArchiveBanner from "@/components/ArchiveBanner.vue";
import GrantRequestPanel from "@/components/GrantRequestPanel";
@@ -72,28 +66,33 @@ import IAMRemindModal from "@/components/IAMRemindModal.vue";
import { useRecentProjects } from "@/components/Project/useRecentProjects";
import NoPermissionPlaceholder from "@/components/misc/NoPermissionPlaceholder.vue";
import {
- PROJECT_V1_ROUTE_DETAIL,
PROJECT_V1_ROUTE_DATABASES,
+ PROJECT_V1_ROUTE_DETAIL,
PROJECT_V1_ROUTE_MEMBERS,
} from "@/router/dashboard/projectV1";
import { WORKSPACE_ROUTE_LANDING } from "@/router/dashboard/workspaceRoutes";
import { useRecentVisit } from "@/router/useRecentVisit";
import {
- hasFeature,
- useAppFeature,
- useProjectV1Store,
- useProjectByName,
pushNotification,
+ useAppFeature,
usePermissionStore,
+ useProjectByName,
+ useProjectV1Store
} from "@/store";
import { projectNamePrefix } from "@/store/modules/v1/common";
import {
- UNKNOWN_PROJECT_NAME,
DEFAULT_PROJECT_NAME,
PresetRoleType,
+ UNKNOWN_PROJECT_NAME,
} from "@/types";
import { State } from "@/types/proto/v1/common";
import { hasProjectPermissionV2 } from "@/utils";
+import { UsersIcon } from "lucide-vue-next";
+import { NButton, NEllipsis, NSpin } from "naive-ui";
+import type { ClientError } from "nice-grpc-web";
+import { computed, h, reactive, watchEffect } from "vue";
+import { useI18n } from "vue-i18n";
+import { useRoute, useRouter } from "vue-router";
import { useBodyLayoutContext } from "./common";
interface LocalState {
@@ -176,10 +175,6 @@ const hasPermission = computed(() => {
);
});
-const hasDBAWorkflowFeature = computed(() => {
- return hasFeature("bb.feature.dba-workflow");
-});
-
const allowEdit = computed(() => {
if (project.value.state === State.DELETED) {
return false;
@@ -202,8 +197,7 @@ const quickActionListForDatabase = computed(() => {
if (
!isProjectOwner.value &&
- hasProjectPermissionV2(project.value, "bb.issues.create") &&
- hasDBAWorkflowFeature.value
+ hasProjectPermissionV2(project.value, "bb.issues.create")
) {
actions.push({
title: t("issue.title.request-role"),
diff --git a/frontend/src/main.ts b/frontend/src/main.ts
index 46c69e9c5d..a315f4b920 100644
--- a/frontend/src/main.ts
+++ b/frontend/src/main.ts
@@ -20,7 +20,7 @@ import {
useAuthStore,
useSubscriptionV1Store,
} from "./store";
-import { humanizeTs, humanizeDate, isDev, isRelease } from "./utils";
+import { humanizeDate, humanizeTs, isDev, isRelease } from "./utils";
protobufjs.util.Long = Long;
protobufjs.configure();
@@ -46,7 +46,6 @@ console.debug("release:", isRelease());
await Promise.all([
useActuatorV1Store().fetchServerInfo(),
useSubscriptionV1Store().fetchSubscription(),
- useSubscriptionV1Store().fetchFeatureMatrix(),
useAuthStore().fetchCurrentUser(),
]);
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index 965cb757f7..7f6826b6a4 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -13,6 +13,7 @@ import {
useSQLEditorTabStore,
useAppFeature,
} from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import authRoutes, {
AUTH_2FA_SETUP_MODULE,
AUTH_MFA_MODULE,
@@ -162,7 +163,7 @@ router.beforeEach((to, from, next) => {
const currentUserV1 = useCurrentUserV1();
// If 2FA is required, redirect to MFA setup page if the user has not enabled 2FA.
- if (hasFeature("bb.feature.2fa") && actuatorStore.serverInfo?.require2fa) {
+ if (hasFeature(PlanLimitConfig_Feature.TWO_FA) && actuatorStore.serverInfo?.require2fa) {
const user = currentUserV1.value;
if (user && !user.mfaEnabled) {
next({
diff --git a/frontend/src/store/modules/sqlEditor/tab.ts b/frontend/src/store/modules/sqlEditor/tab.ts
index 506c2705c2..43604f1be6 100644
--- a/frontend/src/store/modules/sqlEditor/tab.ts
+++ b/frontend/src/store/modules/sqlEditor/tab.ts
@@ -28,6 +28,7 @@ import {
extractUserId,
hasFeature,
} from "../v1";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { useSQLEditorStore } from "./editor";
import {
EXTENDED_TAB_FIELDS,
@@ -205,7 +206,7 @@ export const useSQLEditorTabStore = defineStore("sqlEditorTab", () => {
if (!currentTab.value) {
return false;
}
- if (!hasFeature("bb.feature.batch-query")) {
+ if (!hasFeature(PlanLimitConfig_Feature.BATCH_QUERY)) {
return false;
}
const { batchQueryContext } = currentTab.value;
@@ -213,7 +214,7 @@ export const useSQLEditorTabStore = defineStore("sqlEditorTab", () => {
return false;
}
const { databaseGroups = [], databases = [] } = batchQueryContext;
- if (!hasFeature("bb.feature.database-grouping")) {
+ if (!hasFeature(PlanLimitConfig_Feature.DATABASE_GROUPS)) {
return databases.length > 1;
}
return databaseGroups.length > 0 || databases.length > 1;
diff --git a/frontend/src/store/modules/v1/subscription.ts b/frontend/src/store/modules/v1/subscription.ts
index 666a658743..d63d07c9d2 100644
--- a/frontend/src/store/modules/v1/subscription.ts
+++ b/frontend/src/store/modules/v1/subscription.ts
@@ -1,20 +1,27 @@
-import dayjs from "dayjs";
-import { defineStore } from "pinia";
-import type { Ref } from "vue";
-import { computed } from "vue";
import { subscriptionServiceClient } from "@/grpcweb";
-import type { FeatureType } from "@/types";
-import { PLANS, getDateForPbTimestamp, instanceLimitFeature } from "@/types";
+import {
+ PLANS,
+ hasFeature as checkFeature,
+ hasInstanceFeature as checkInstanceFeature,
+ getDateForPbTimestamp,
+ getMinimumRequiredPlan,
+ instanceLimitFeature
+} from "@/types";
import type {
Instance,
InstanceResource,
} from "@/types/proto/v1/instance_service";
import type { Subscription } from "@/types/proto/v1/subscription_service";
import {
+ PlanLimitConfig_Feature,
PlanType,
planTypeFromJSON,
planTypeToNumber,
} from "@/types/proto/v1/subscription_service";
+import dayjs from "dayjs";
+import { defineStore } from "pinia";
+import type { Ref } from "vue";
+import { computed } from "vue";
// The threshold of days before the license expiration date to show the warning.
// Default is 7 days.
@@ -23,14 +30,12 @@ export const LICENSE_EXPIRATION_THRESHOLD = 7;
interface SubscriptionState {
subscription: Subscription | undefined;
trialingDays: number;
- featureMatrix: Map<FeatureType, boolean[]>;
}
export const useSubscriptionV1Store = defineStore("subscription_v1", {
state: (): SubscriptionState => ({
subscription: undefined,
trialingDays: 14,
- featureMatrix: new Map<FeatureType, boolean[]>(),
}),
getters: {
instanceCountLimit(): number {
@@ -171,55 +176,47 @@ export const useSubscriptionV1Store = defineStore("subscription_v1", {
setSubscription(subscription: Subscription) {
this.subscription = subscription;
},
- hasFeature(type: FeatureType) {
- const matrix = this.featureMatrix.get(type);
- if (!Array.isArray(matrix)) {
+ hasFeature(feature: PlanLimitConfig_Feature) {
+ if (this.isExpired) {
return false;
}
-
- return !this.isExpired && matrix[planTypeToNumber(this.currentPlan) - 1];
+ return checkFeature(this.currentPlan, feature);
},
hasInstanceFeature(
- type: FeatureType,
+ feature: PlanLimitConfig_Feature,
instance: Instance | InstanceResource | undefined = undefined
) {
- // DONOT check instance license fo FREE plan.
+ // For FREE plan, don't check instance activation
if (this.currentPlan === PlanType.FREE) {
- return this.hasFeature(type);
+ return this.hasFeature(feature);
}
- if (!instanceLimitFeature.has(type) || !instance) {
- return this.hasFeature(type);
+
+ // If no instance provided or feature is not instance-limited
+ if (!instance || !instanceLimitFeature.has(feature)) {
+ return this.hasFeature(feature);
}
- return this.hasFeature(type) && instance.activation;
+
+ return checkInstanceFeature(this.currentPlan, feature, instance.activation);
},
instanceMissingLicense(
- type: FeatureType,
+ feature: PlanLimitConfig_Feature,
instance: Instance | InstanceResource | undefined = undefined
) {
- // TODO(ed) refresh instance before check license:
- if (!instanceLimitFeature.has(type)) {
+ // Only relevant for instance-limited features
+ if (!instanceLimitFeature.has(feature)) {
return false;
}
if (!instance) {
return false;
}
- return hasFeature(type) && !instance.activation;
+ // Feature is available in plan but instance is not activated
+ return this.hasFeature(feature) && !instance.activation;
},
currentPlanGTE(plan: PlanType): boolean {
return planTypeToNumber(this.currentPlan) >= planTypeToNumber(plan);
},
- getMinimumRequiredPlan(type: FeatureType): PlanType {
- const matrix = this.featureMatrix.get(type);
- if (!Array.isArray(matrix)) {
- return PlanType.FREE;
- }
-
- for (let i = 0; i < matrix.length; i++) {
- if (matrix[i]) {
- return planTypeFromJSON(i + 1) as PlanType;
- }
- }
- return PlanType.FREE;
+ getMinimumRequiredPlan(feature: PlanLimitConfig_Feature): PlanType {
+ return getMinimumRequiredPlan(feature);
},
async fetchSubscription() {
try {
@@ -241,42 +238,20 @@ export const useSubscriptionV1Store = defineStore("subscription_v1", {
this.setSubscription(subscription);
return subscription;
},
- async fetchFeatureMatrix() {
- try {
- const featureMatrix = await subscriptionServiceClient.getFeatureMatrix(
- {}
- );
-
- const stateMatrix = new Map<FeatureType, boolean[]>();
- for (const feature of featureMatrix.features) {
- const featureType = feature.name as FeatureType;
- stateMatrix.set(
- featureType,
- [PlanType.FREE, PlanType.TEAM, PlanType.ENTERPRISE].map((type) => {
- return feature.matrix[type] ?? false;
- })
- );
- }
-
- this.featureMatrix = stateMatrix;
- } catch (e) {
- console.error(e);
- }
- },
},
});
-export const hasFeature = (type: FeatureType) => {
+export const hasFeature = (feature: PlanLimitConfig_Feature) => {
const store = useSubscriptionV1Store();
- return store.hasFeature(type);
+ return store.hasFeature(feature);
};
export const featureToRef = (
- type: FeatureType,
+ feature: PlanLimitConfig_Feature,
instance: Instance | InstanceResource | undefined = undefined
): Ref<boolean> => {
const store = useSubscriptionV1Store();
- return computed(() => store.hasInstanceFeature(type, instance));
+ return computed(() => store.hasInstanceFeature(feature, instance));
};
export const useCurrentPlan = () => {
diff --git a/frontend/src/types/plan.ts b/frontend/src/types/plan.ts
index 64c80ef2a5..49bddd46bc 100644
--- a/frontend/src/types/plan.ts
+++ b/frontend/src/types/plan.ts
@@ -2,63 +2,18 @@ import {
PlanType,
type PlanConfig,
type PlanLimitConfig,
+ PlanLimitConfig_Feature,
} from "@/types/proto/v1/subscription_service";
import planData from "./plan.yaml";
-// Check api/plan.go to understand what each feature means.
-export type FeatureType =
- // General
- | "bb.feature.custom-role"
- // Admin & Security
- | "bb.feature.sso"
- | "bb.feature.2fa"
- | "bb.feature.secure-token"
- | "bb.feature.password-restriction"
- | "bb.feature.rbac"
- | "bb.feature.disallow-signup"
- | "bb.feature.disallow-password-signin"
- | "bb.feature.domain-restriction"
- | "bb.feature.watermark"
- | "bb.feature.audit-log"
- | "bb.feature.issue-advanced-search"
- | "bb.feature.announcement"
- | "bb.feature.external-secret-manager"
- | "bb.feature.directory-sync"
- // Branding
- | "bb.feature.branding"
- // Change Workflow
- | "bb.feature.dba-workflow"
- | "bb.feature.schema-drift"
- | "bb.feature.sql-review"
- | "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-synchronization"
- | "bb.feature.sync-schema-all-versions"
- // Policy Control
- | "bb.feature.rollout-policy"
- | "bb.feature.environment-tier-policy"
- | "bb.feature.sensitive-data"
- | "bb.feature.access-control"
- | "bb.feature.custom-approval"
- // Efficiency
- | "bb.feature.batch-query"
- // Collaboration
- | "bb.feature.shared-sql-script"
- // Plugins
- | "bb.feature.ai-assistant"
- // Instance count limit
- | "bb.feature.instance-count"
- // User count limit
- | "bb.feature.user-count";
+// Use proto Feature enum as the primary feature type
+export type Feature = PlanLimitConfig_Feature;
-export const instanceLimitFeature = new Set<FeatureType>([
- "bb.feature.encrypted-secrets",
- "bb.feature.read-replica-connection",
- "bb.feature.sensitive-data",
+// Instance-limited features that require activated instances
+export const instanceLimitFeature = new Set<PlanLimitConfig_Feature>([
+ PlanLimitConfig_Feature.DATABASE_SECRET_VARIABLES,
+ PlanLimitConfig_Feature.INSTANCE_READ_ONLY_CONNECTION,
+ PlanLimitConfig_Feature.DATA_MASKING,
]);
export const planTypeToString = (planType: PlanType): string => {
@@ -79,3 +34,52 @@ export type { PlanConfig, PlanLimitConfig };
export const PLAN_CONFIG: PlanConfig = planData;
export const PLANS: PlanLimitConfig[] = planData.plans;
+
+// Create a plan feature matrix from the YAML data
+export const PLAN_FEATURE_MATRIX = new Map<PlanType, Set<PlanLimitConfig_Feature>>();
+
+// Initialize the feature matrix from plan data
+PLANS.forEach((plan) => {
+ PLAN_FEATURE_MATRIX.set(plan.type, new Set(plan.features));
+});
+
+// Helper function to check if a plan has a feature
+export const planHasFeature = (plan: PlanType, feature: PlanLimitConfig_Feature): boolean => {
+ const planFeatures = PLAN_FEATURE_MATRIX.get(plan);
+ return planFeatures?.has(feature) ?? false;
+};
+
+// Helper function to get minimum required plan for a feature
+export const getMinimumRequiredPlan = (feature: PlanLimitConfig_Feature): PlanType => {
+ const planOrder = [PlanType.FREE, PlanType.TEAM, PlanType.ENTERPRISE];
+ for (const plan of planOrder) {
+ if (planHasFeature(plan, feature)) {
+ return plan;
+ }
+ }
+ return PlanType.ENTERPRISE;
+};
+
+// Helper function to check if a feature is available for a plan
+export const hasFeature = (plan: PlanType, feature: PlanLimitConfig_Feature): boolean => {
+ return planHasFeature(plan, feature);
+};
+
+// Helper function to check instance features
+export const hasInstanceFeature = (plan: PlanType, feature: PlanLimitConfig_Feature, instanceActivated = true): boolean => {
+ if (!hasFeature(plan, feature)) {
+ return false;
+ }
+
+ // For FREE plan, don't check instance activation
+ if (plan === PlanType.FREE) {
+ return true;
+ }
+
+ // For instance-limited features, check activation
+ if (instanceLimitFeature.has(feature)) {
+ return instanceActivated;
+ }
+
+ return true;
+};
diff --git a/frontend/src/types/proto/v1/subscription_service.ts b/frontend/src/types/proto/v1/subscription_service.ts
index 58e3115e03..188311873c 100644
--- a/frontend/src/types/proto/v1/subscription_service.ts
+++ b/frontend/src/types/proto/v1/subscription_service.ts
@@ -180,6 +180,7 @@ export enum PlanLimitConfig_Feature {
ENTERPRISE_SSO = "ENTERPRISE_SSO",
TWO_FA = "TWO_FA",
PASSWORD_RESTRICTIONS = "PASSWORD_RESTRICTIONS",
+ DISALLOW_PASSWORD_SIGNIN = "DISALLOW_PASSWORD_SIGNIN",
CUSTOM_ROLES = "CUSTOM_ROLES",
REQUEST_ROLE_WORKFLOW = "REQUEST_ROLE_WORKFLOW",
DATA_MASKING = "DATA_MASKING",
@@ -358,75 +359,78 @@ export function planLimitConfig_FeatureFromJSON(object: any): PlanLimitConfig_Fe
case "PASSWORD_RESTRICTIONS":
return PlanLimitConfig_Feature.PASSWORD_RESTRICTIONS;
case 49:
+ case "DISALLOW_PASSWORD_SIGNIN":
+ return PlanLimitConfig_Feature.DISALLOW_PASSWORD_SIGNIN;
+ case 50:
case "CUSTOM_ROLES":
return PlanLimitConfig_Feature.CUSTOM_ROLES;
- case 50:
+ case 51:
case "REQUEST_ROLE_WORKFLOW":
return PlanLimitConfig_Feature.REQUEST_ROLE_WORKFLOW;
- case 51:
+ case 52:
case "DATA_MASKING":
return PlanLimitConfig_Feature.DATA_MASKING;
- case 52:
+ case 53:
case "DATA_CLASSIFICATION":
return PlanLimitConfig_Feature.DATA_CLASSIFICATION;
- case 53:
+ case 54:
case "SCIM":
return PlanLimitConfig_Feature.SCIM;
- case 54:
+ case 55:
case "DIRECTORY_SYNC_ENTRA_ID":
return PlanLimitConfig_Feature.DIRECTORY_SYNC_ENTRA_ID;
- case 55:
+ case 56:
case "DIRECTORY_SYNC_OKTA":
return PlanLimitConfig_Feature.DIRECTORY_SYNC_OKTA;
- case 56:
+ case 57:
case "SIGN_IN_FREQUENCY_CONTROL":
return PlanLimitConfig_Feature.SIGN_IN_FREQUENCY_CONTROL;
- case 57:
+ case 58:
case "EXTERNAL_SECRET_MANAGER":
return PlanLimitConfig_Feature.EXTERNAL_SECRET_MANAGER;
- case 58:
+ case 59:
case "USER_EMAIL_DOMAIN_RESTRICTION":
return PlanLimitConfig_Feature.USER_EMAIL_DOMAIN_RESTRICTION;
- case 59:
+ case 60:
case "ENVIRONMENT_MANAGEMENT":
return PlanLimitConfig_Feature.ENVIRONMENT_MANAGEMENT;
- case 60:
+ case 61:
case "IM_NOTIFICATIONS":
return PlanLimitConfig_Feature.IM_NOTIFICATIONS;
- case 61:
+ case 62:
case "TERRAFORM_PROVIDER":
return PlanLimitConfig_Feature.TERRAFORM_PROVIDER;
- case 62:
+ case 63:
case "DATABASE_GROUPS":
return PlanLimitConfig_Feature.DATABASE_GROUPS;
- case 63:
+ case 64:
case "ENVIRONMENT_TIERS":
return PlanLimitConfig_Feature.ENVIRONMENT_TIERS;
- case 64:
+ case 65:
case "DASHBOARD_ANNOUNCEMENT":
return PlanLimitConfig_Feature.DASHBOARD_ANNOUNCEMENT;
- case 65:
+ case 66:
case "API_INTEGRATION_GUIDANCE":
return PlanLimitConfig_Feature.API_INTEGRATION_GUIDANCE;
- case 66:
+ case 67:
case "CUSTOM_LOGO":
return PlanLimitConfig_Feature.CUSTOM_LOGO;
- case 67:
+ case 68:
case "WATERMARK":
return PlanLimitConfig_Feature.WATERMARK;
- case 68:
+ case 69:
case "ROADMAP_PRIORITIZATION":
return PlanLimitConfig_Feature.ROADMAP_PRIORITIZATION;
- case 69:
+ case 70:
case "CUSTOM_MSA":
return PlanLimitConfig_Feature.CUSTOM_MSA;
- case 70:
+ case 71:
case "COMMUNITY_SUPPORT":
return PlanLimitConfig_Feature.COMMUNITY_SUPPORT;
- case 71:
+ case 72:
case "EMAIL_SUPPORT":
return PlanLimitConfig_Feature.EMAIL_SUPPORT;
- case 72:
+ case 73:
case "DEDICATED_SUPPORT_WITH_SLA":
return PlanLimitConfig_Feature.DEDICATED_SUPPORT_WITH_SLA;
case -1:
@@ -536,6 +540,8 @@ export function planLimitConfig_FeatureToJSON(object: PlanLimitConfig_Feature):
return "TWO_FA";
case PlanLimitConfig_Feature.PASSWORD_RESTRICTIONS:
return "PASSWORD_RESTRICTIONS";
+ case PlanLimitConfig_Feature.DISALLOW_PASSWORD_SIGNIN:
+ return "DISALLOW_PASSWORD_SIGNIN";
case PlanLimitConfig_Feature.CUSTOM_ROLES:
return "CUSTOM_ROLES";
case PlanLimitConfig_Feature.REQUEST_ROLE_WORKFLOW:
@@ -690,54 +696,56 @@ export function planLimitConfig_FeatureToNumber(object: PlanLimitConfig_Feature)
return 47;
case PlanLimitConfig_Feature.PASSWORD_RESTRICTIONS:
return 48;
- case PlanLimitConfig_Feature.CUSTOM_ROLES:
+ case PlanLimitConfig_Feature.DISALLOW_PASSWORD_SIGNIN:
return 49;
- case PlanLimitConfig_Feature.REQUEST_ROLE_WORKFLOW:
+ case PlanLimitConfig_Feature.CUSTOM_ROLES:
return 50;
- case PlanLimitConfig_Feature.DATA_MASKING:
+ case PlanLimitConfig_Feature.REQUEST_ROLE_WORKFLOW:
return 51;
- case PlanLimitConfig_Feature.DATA_CLASSIFICATION:
+ case PlanLimitConfig_Feature.DATA_MASKING:
return 52;
- case PlanLimitConfig_Feature.SCIM:
+ case PlanLimitConfig_Feature.DATA_CLASSIFICATION:
return 53;
- case PlanLimitConfig_Feature.DIRECTORY_SYNC_ENTRA_ID:
+ case PlanLimitConfig_Feature.SCIM:
return 54;
- case PlanLimitConfig_Feature.DIRECTORY_SYNC_OKTA:
+ case PlanLimitConfig_Feature.DIRECTORY_SYNC_ENTRA_ID:
return 55;
- case PlanLimitConfig_Feature.SIGN_IN_FREQUENCY_CONTROL:
+ case PlanLimitConfig_Feature.DIRECTORY_SYNC_OKTA:
return 56;
- case PlanLimitConfig_Feature.EXTERNAL_SECRET_MANAGER:
+ case PlanLimitConfig_Feature.SIGN_IN_FREQUENCY_CONTROL:
return 57;
- case PlanLimitConfig_Feature.USER_EMAIL_DOMAIN_RESTRICTION:
+ case PlanLimitConfig_Feature.EXTERNAL_SECRET_MANAGER:
return 58;
- case PlanLimitConfig_Feature.ENVIRONMENT_MANAGEMENT:
+ case PlanLimitConfig_Feature.USER_EMAIL_DOMAIN_RESTRICTION:
return 59;
- case PlanLimitConfig_Feature.IM_NOTIFICATIONS:
+ case PlanLimitConfig_Feature.ENVIRONMENT_MANAGEMENT:
return 60;
- case PlanLimitConfig_Feature.TERRAFORM_PROVIDER:
+ case PlanLimitConfig_Feature.IM_NOTIFICATIONS:
return 61;
- case PlanLimitConfig_Feature.DATABASE_GROUPS:
+ case PlanLimitConfig_Feature.TERRAFORM_PROVIDER:
return 62;
- case PlanLimitConfig_Feature.ENVIRONMENT_TIERS:
+ case PlanLimitConfig_Feature.DATABASE_GROUPS:
return 63;
- case PlanLimitConfig_Feature.DASHBOARD_ANNOUNCEMENT:
+ case PlanLimitConfig_Feature.ENVIRONMENT_TIERS:
return 64;
- case PlanLimitConfig_Feature.API_INTEGRATION_GUIDANCE:
+ case PlanLimitConfig_Feature.DASHBOARD_ANNOUNCEMENT:
return 65;
- case PlanLimitConfig_Feature.CUSTOM_LOGO:
+ case PlanLimitConfig_Feature.API_INTEGRATION_GUIDANCE:
return 66;
- case PlanLimitConfig_Feature.WATERMARK:
+ case PlanLimitConfig_Feature.CUSTOM_LOGO:
return 67;
- case PlanLimitConfig_Feature.ROADMAP_PRIORITIZATION:
+ case PlanLimitConfig_Feature.WATERMARK:
return 68;
- case PlanLimitConfig_Feature.CUSTOM_MSA:
+ case PlanLimitConfig_Feature.ROADMAP_PRIORITIZATION:
return 69;
- case PlanLimitConfig_Feature.COMMUNITY_SUPPORT:
+ case PlanLimitConfig_Feature.CUSTOM_MSA:
return 70;
- case PlanLimitConfig_Feature.EMAIL_SUPPORT:
+ case PlanLimitConfig_Feature.COMMUNITY_SUPPORT:
return 71;
- case PlanLimitConfig_Feature.DEDICATED_SUPPORT_WITH_SLA:
+ case PlanLimitConfig_Feature.EMAIL_SUPPORT:
return 72;
+ case PlanLimitConfig_Feature.DEDICATED_SUPPORT_WITH_SLA:
+ return 73;
case PlanLimitConfig_Feature.UNRECOGNIZED:
default:
return -1;
diff --git a/frontend/src/utils/v1/database.ts b/frontend/src/utils/v1/database.ts
index 97b1a57129..975691a86d 100644
--- a/frontend/src/utils/v1/database.ts
+++ b/frontend/src/utils/v1/database.ts
@@ -1,4 +1,5 @@
import { checkQuerierPermission, hasFeature } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import {
databaseNamePrefix,
instanceNamePrefix,
@@ -50,7 +51,7 @@ export const isArchivedDatabaseV1 = (_db: ComposedDatabase): boolean => {
// isDatabaseV1Alterable checks if database alterable for user.
export const isDatabaseV1Alterable = (database: ComposedDatabase): boolean => {
- if (!hasFeature("bb.feature.access-control")) {
+ if (!hasFeature(PlanLimitConfig_Feature.IAM)) {
// The current plan doesn't have access control feature.
// Fallback to true.
return true;
diff --git a/frontend/src/views/BannerUpgradeSubscription.vue b/frontend/src/views/BannerUpgradeSubscription.vue
index 633ac4e8cc..14acdef308 100644
--- a/frontend/src/views/BannerUpgradeSubscription.vue
+++ b/frontend/src/views/BannerUpgradeSubscription.vue
@@ -55,7 +55,7 @@
({{
$t(
`subscription.plan.${planTypeToString(
- subscriptionStore.getMinimumRequiredPlan(feature as FeatureType)
+ subscriptionStore.getMinimumRequiredPlan(feature as PlanLimitConfig_Feature)
)}.title`
)
}})
@@ -79,7 +79,7 @@ import { useRouter } from "vue-router";
import { BBModal } from "@/bbkit";
import { SETTING_ROUTE_WORKSPACE_SUBSCRIPTION } from "@/router/dashboard/workspaceSetting";
import { useSubscriptionV1Store, useActuatorV1Store } from "@/store";
-import type { FeatureType } from "@/types";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { planTypeToString } from "@/types";
import {
PlanType,
@@ -115,7 +115,7 @@ const neededPlan = computed(() => {
for (const feature of unlicensedFeatures.value) {
const requiredPlan = subscriptionStore.getMinimumRequiredPlan(
- feature as FeatureType
+ feature as PlanLimitConfig_Feature
);
if (planTypeToNumber(requiredPlan) > planTypeToNumber(plan)) {
plan = requiredPlan;
diff --git a/frontend/src/views/InstanceDashboard.vue b/frontend/src/views/InstanceDashboard.vue
index 9fdb2042c5..c2a015ddee 100644
--- a/frontend/src/views/InstanceDashboard.vue
+++ b/frontend/src/views/InstanceDashboard.vue
@@ -2,7 +2,7 @@
<div class="flex flex-col space-y-4">
<FeatureAttention
v-if="remainingInstanceCount <= 3"
- feature="bb.feature.instance-count"
+ :feature="PlanLimitConfig_Feature.IAM"
:description="instanceCountAttention"
/>
<div class="px-4 flex items-center space-x-2">
@@ -64,17 +64,12 @@
<FeatureModal
:open="state.showFeatureModal"
- :feature="'bb.feature.instance-count'"
+ :feature="PlanLimitConfig_Feature.IAM"
@cancel="state.showFeatureModal = false"
/>
</template>
<script lang="tsx" setup>
-import { PlusIcon } from "lucide-vue-next";
-import { NButton } from "naive-ui";
-import { computed, onMounted, reactive, ref } from "vue";
-import { useI18n } from "vue-i18n";
-import { useRouter } from "vue-router";
import AdvancedSearch from "@/components/AdvancedSearch";
import type { ScopeOption } from "@/components/AdvancedSearch/types";
import { useCommonSearchScopeOptions } from "@/components/AdvancedSearch/useCommonSearchScopeOptions";
@@ -84,20 +79,25 @@ import {
Form as InstanceFormBody,
Buttons as InstanceFormButtons,
} from "@/components/InstanceForm/";
-import { InstanceOperations, PagedInstanceTable } from "@/components/v2";
-import { Drawer, DrawerContent } from "@/components/v2";
+import { Drawer, DrawerContent, InstanceOperations, PagedInstanceTable } from "@/components/v2";
import {
+ useActuatorV1Store,
useAppFeature,
- useUIStateStore,
- useSubscriptionV1Store,
useInstanceV1Store,
- useActuatorV1Store,
+ useSubscriptionV1Store,
+ useUIStateStore,
} from "@/store";
import { environmentNamePrefix } from "@/store/modules/v1/common";
import { isValidInstanceName } from "@/types";
import { engineFromJSON } from "@/types/proto/v1/common";
import type { Instance } from "@/types/proto/v1/instance_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { type SearchParams, hasWorkspacePermissionV2 } from "@/utils";
+import { PlusIcon } from "lucide-vue-next";
+import { NButton } from "naive-ui";
+import { computed, onMounted, reactive, ref } from "vue";
+import { useI18n } from "vue-i18n";
+import { useRouter } from "vue-router";
interface LocalState {
params: SearchParams;
diff --git a/frontend/src/views/ProfileDashboard.vue b/frontend/src/views/ProfileDashboard.vue
index 459d339e13..8ff687b41a 100644
--- a/frontend/src/views/ProfileDashboard.vue
+++ b/frontend/src/views/ProfileDashboard.vue
@@ -154,7 +154,7 @@
class="text-lg font-medium flex flex-row justify-start items-center"
>
{{ $t("two-factor.self") }}
- <FeatureBadge :feature="'bb.feature.2fa'" class="ml-2" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.TWO_FA" class="ml-2" />
</span>
<div class="space-x-2">
<NButton v-if="user.email === currentUser.email" @click="enable2FA">
@@ -203,7 +203,7 @@
</main>
<FeatureModal
- feature="bb.feature.2fa"
+ :feature="PlanLimitConfig_Feature.TWO_FA"
:open="state.showFeatureModal"
@cancel="state.showFeatureModal = false"
/>
@@ -221,13 +221,6 @@
</template>
<script lang="ts" setup>
-import { computedAsync, useTitle } from "@vueuse/core";
-import { cloneDeep, head, isEqual } from "lodash-es";
-import type { DropdownOption } from "naive-ui";
-import { NButton, NInput, NDropdown, NTag } from "naive-ui";
-import { nextTick, computed, onMounted, onUnmounted, reactive, ref } from "vue";
-import { useI18n } from "vue-i18n";
-import { useRouter } from "vue-router";
import EmailInput from "@/components/EmailInput.vue";
import { FeatureModal } from "@/components/FeatureGuard";
import FeatureBadge from "@/components/FeatureGuard/FeatureBadge.vue";
@@ -245,23 +238,31 @@ import {
pushNotification,
useActuatorV1Store,
useCurrentUserV1,
+ usePermissionStore,
useSettingV1Store,
useUserStore,
useWorkspaceV1Store,
- usePermissionStore,
} from "@/store";
import {
- unknownUser,
- SYSTEM_BOT_USER_NAME,
ALL_USERS_USER_EMAIL,
+ SYSTEM_BOT_USER_NAME,
+ unknownUser,
} from "@/types";
import { State } from "@/types/proto/v1/common";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import {
UpdateUserRequest,
UserType,
type User,
} from "@/types/proto/v1/user_service";
import { displayRoleTitle, hasWorkspacePermissionV2, sortRoles } from "@/utils";
+import { computedAsync, useTitle } from "@vueuse/core";
+import { cloneDeep, head, isEqual } from "lodash-es";
+import type { DropdownOption } from "naive-ui";
+import { NButton, NDropdown, NInput, NTag } from "naive-ui";
+import { computed, nextTick, onMounted, onUnmounted, reactive, ref } from "vue";
+import { useI18n } from "vue-i18n";
+import { useRouter } from "vue-router";
interface LocalState {
editing: boolean;
@@ -324,8 +325,8 @@ onUnmounted(() => {
document.removeEventListener("keydown", keyboardHandler);
});
-const hasRBACFeature = featureToRef("bb.feature.rbac");
-const has2FAFeature = featureToRef("bb.feature.2fa");
+const hasRBACFeature = featureToRef(PlanLimitConfig_Feature.IAM);
+const has2FAFeature = featureToRef(PlanLimitConfig_Feature.TWO_FA);
const isMFAEnabled = computed(() => {
return user.value.mfaEnabled;
diff --git a/frontend/src/views/SettingWorkspaceAuditLog.vue b/frontend/src/views/SettingWorkspaceAuditLog.vue
index ad38c50126..98cf63ceeb 100644
--- a/frontend/src/views/SettingWorkspaceAuditLog.vue
+++ b/frontend/src/views/SettingWorkspaceAuditLog.vue
@@ -1,6 +1,6 @@
<template>
<div class="w-full space-y-4 pb-6">
- <FeatureAttention feature="bb.feature.audit-log" />
+ <FeatureAttention :feature="PlanLimitConfig_Feature.AUDIT_LOG" />
<AuditLogSearch v-model:params="state.params">
<template #searchbox-suffix>
<DataExportButton
@@ -62,6 +62,7 @@ import { projectNamePrefix } from "@/store/modules/v1/common";
import { type SearchAuditLogsParams } from "@/types";
import type { AuditLog } from "@/types/proto/v1/audit_log_service";
import { ExportFormat } from "@/types/proto/v1/common";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { type SearchParams, extractProjectResourceName } from "@/utils";
interface LocalState {
@@ -89,7 +90,7 @@ const state = reactive<LocalState>({
const { t } = useI18n();
const auditLogStore = useAuditLogStore();
const auditLogPagedTable = ref<ComponentExposed<typeof PagedTable<AuditLog>>>();
-const hasAuditLogFeature = featureToRef("bb.feature.audit-log");
+const hasAuditLogFeature = featureToRef(PlanLimitConfig_Feature.AUDIT_LOG);
const searchAuditLogs = computed((): SearchAuditLogsParams => {
return {
diff --git a/frontend/src/views/SettingWorkspaceCustomApproval.vue b/frontend/src/views/SettingWorkspaceCustomApproval.vue
index 699fa41eca..75c9e56769 100644
--- a/frontend/src/views/SettingWorkspaceCustomApproval.vue
+++ b/frontend/src/views/SettingWorkspaceCustomApproval.vue
@@ -1,6 +1,6 @@
<template>
<div class="w-full space-y-4 text-sm">
- <FeatureAttention feature="bb.feature.custom-approval" />
+ <FeatureAttention :feature="PlanLimitConfig_Feature.APPROVAL_WORKFLOW" />
<CustomApproval v-if="state.ready" />
<div v-else class="w-full py-[4rem] flex justify-center items-center">
@@ -11,7 +11,7 @@
<ApprovalRuleDialog />
<FeatureModal
- feature="bb.feature.custom-approval"
+ :feature="PlanLimitConfig_Feature.APPROVAL_WORKFLOW"
:open="state.showFeatureModal"
@cancel="state.showFeatureModal = false"
/>
@@ -33,6 +33,7 @@ import {
useWorkspaceApprovalSettingStore,
useRiskStore,
} from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
interface LocalState {
ready: boolean;
@@ -48,7 +49,7 @@ const state = reactive<LocalState>({
showFeatureModal: false,
});
const tab = useRouteHash("rules", TabValueList, "replace");
-const hasCustomApprovalFeature = featureToRef("bb.feature.custom-approval");
+const hasCustomApprovalFeature = featureToRef(PlanLimitConfig_Feature.APPROVAL_WORKFLOW);
provideCustomApprovalContext({
hasFeature: hasCustomApprovalFeature,
diff --git a/frontend/src/views/SettingWorkspaceDataClassification.vue b/frontend/src/views/SettingWorkspaceDataClassification.vue
index 36b163d8da..898569461a 100644
--- a/frontend/src/views/SettingWorkspaceDataClassification.vue
+++ b/frontend/src/views/SettingWorkspaceDataClassification.vue
@@ -2,7 +2,7 @@
<div class="w-full space-y-4">
<FeatureAttention
v-if="!hasSensitiveDataFeature"
- feature="bb.feature.sensitive-data"
+ :feature="PlanLimitConfig_Feature.DATA_CLASSIFICATION"
/>
<ClassificationView />
</div>
@@ -12,6 +12,7 @@
import { FeatureAttention } from "@/components/FeatureGuard";
import { ClassificationView } from "@/components/SensitiveData";
import { featureToRef } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
-const hasSensitiveDataFeature = featureToRef("bb.feature.sensitive-data");
+const hasSensitiveDataFeature = featureToRef(PlanLimitConfig_Feature.DATA_CLASSIFICATION);
</script>
diff --git a/frontend/src/views/SettingWorkspaceDataMasking.vue b/frontend/src/views/SettingWorkspaceDataMasking.vue
index 816abcfdcd..5a58bbead2 100644
--- a/frontend/src/views/SettingWorkspaceDataMasking.vue
+++ b/frontend/src/views/SettingWorkspaceDataMasking.vue
@@ -2,7 +2,7 @@
<div class="w-full space-y-4">
<FeatureAttention
v-if="!hasSensitiveDataFeature"
- feature="bb.feature.sensitive-data"
+ :feature="PlanLimitConfig_Feature.DATA_MASKING"
/>
<GlobalMaskingRulesView :embedded="embedded" />
</div>
@@ -12,10 +12,11 @@
import { FeatureAttention } from "@/components/FeatureGuard";
import { GlobalMaskingRulesView } from "@/components/SensitiveData";
import { featureToRef } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
defineProps<{
embedded?: boolean;
}>();
-const hasSensitiveDataFeature = featureToRef("bb.feature.sensitive-data");
+const hasSensitiveDataFeature = featureToRef(PlanLimitConfig_Feature.DATA_MASKING);
</script>
diff --git a/frontend/src/views/SettingWorkspaceMembers.vue b/frontend/src/views/SettingWorkspaceMembers.vue
index 0e410b1f05..4a0364145f 100644
--- a/frontend/src/views/SettingWorkspaceMembers.vue
+++ b/frontend/src/views/SettingWorkspaceMembers.vue
@@ -1,6 +1,6 @@
<template>
<div class="w-full mx-auto space-y-4">
- <FeatureAttention feature="bb.feature.rbac" />
+ <FeatureAttention :feature="PlanLimitConfig_Feature.IAM" />
<NoPermissionPlaceholder
v-if="permissionStore.onlyWorkspaceMember"
@@ -106,6 +106,7 @@ import {
} from "@/store";
import { userBindingPrefix } from "@/types";
import { User, UserType } from "@/types/proto/v1/user_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { hasWorkspacePermissionV2 } from "@/utils";
interface LocalState {
diff --git a/frontend/src/views/SettingWorkspaceRiskCenter.vue b/frontend/src/views/SettingWorkspaceRiskCenter.vue
index 62a36874b0..a528eafe82 100644
--- a/frontend/src/views/SettingWorkspaceRiskCenter.vue
+++ b/frontend/src/views/SettingWorkspaceRiskCenter.vue
@@ -1,5 +1,5 @@
<template>
- <FeatureAttention feature="bb.feature.custom-approval" class="mb-4" />
+ <FeatureAttention :feature="PlanLimitConfig_Feature.RISK_ASSESSMENT" class="mb-4" />
<div class="w-full space-y-4 text-sm">
<div class="textinfolabel">
@@ -22,14 +22,13 @@
<RiskDialog />
<FeatureModal
- feature="bb.feature.custom-approval"
+ :feature="PlanLimitConfig_Feature.RISK_ASSESSMENT"
:open="state.showFeatureModal"
@cancel="state.showFeatureModal = false"
/>
</template>
<script lang="ts" setup>
-import { computed, onMounted, reactive, ref, toRef } from "vue";
import { BBSpin } from "@/bbkit";
import {
RiskCenter,
@@ -39,7 +38,9 @@ import {
import { provideRiskFilter } from "@/components/CustomApproval/Settings/components/common";
import { FeatureAttention, FeatureModal } from "@/components/FeatureGuard";
import { featureToRef, useRiskStore } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { hasWorkspacePermissionV2 } from "@/utils";
+import { computed, onMounted, reactive, ref, toRef } from "vue";
interface LocalState {
ready: boolean;
@@ -50,7 +51,7 @@ const state = reactive<LocalState>({
ready: false,
showFeatureModal: false,
});
-const hasCustomApprovalFeature = featureToRef("bb.feature.custom-approval");
+const hasRiskAssessmentFeature = featureToRef(PlanLimitConfig_Feature.RISK_ASSESSMENT);
const allowAdmin = computed(() => {
return hasWorkspacePermissionV2("bb.risks.update");
@@ -58,7 +59,7 @@ const allowAdmin = computed(() => {
provideRiskFilter();
provideRiskCenterContext({
- hasFeature: hasCustomApprovalFeature,
+ hasFeature: hasRiskAssessmentFeature,
showFeatureModal: toRef(state, "showFeatureModal"),
allowAdmin,
ready: toRef(state, "ready"),
diff --git a/frontend/src/views/SettingWorkspaceSQLReviewCreate.vue b/frontend/src/views/SettingWorkspaceSQLReviewCreate.vue
index 62ec9d73af..8df762ad4f 100644
--- a/frontend/src/views/SettingWorkspaceSQLReviewCreate.vue
+++ b/frontend/src/views/SettingWorkspaceSQLReviewCreate.vue
@@ -1,6 +1,6 @@
<template>
<div class="space-y-4 h-full flex flex-col">
- <FeatureAttention feature="bb.feature.sql-review" />
+ <FeatureAttention :feature="PlanLimitConfig_Feature.PRE_DEPLOYMENT_SQL_REVIEW" />
<SQLReviewCreation
class="flex-1"
:selected-rule-list="[]"
@@ -14,6 +14,7 @@ import { computed, watchEffect } from "vue";
import { FeatureAttention } from "@/components/FeatureGuard";
import { SQLReviewCreation } from "@/components/SQLReview";
import { useSQLReviewStore } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
const attachedResources = computed(() => {
const url = new URL(window.location.href);
diff --git a/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue b/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue
index c2ad32a47b..1d5091340a 100644
--- a/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue
+++ b/frontend/src/views/SettingWorkspaceSQLReviewDetail.vue
@@ -1,5 +1,5 @@
<template>
- <FeatureAttention class="mb-4" feature="bb.feature.sql-review" />
+ <FeatureAttention class="mb-4" :feature="PlanLimitConfig_Feature.PRE_DEPLOYMENT_SQL_REVIEW" />
<SQLReviewCreation
v-if="state.editMode"
key="sql-review-creation"
@@ -165,6 +165,7 @@ import {
} from "@/bbkit";
import { FeatureAttention } from "@/components/FeatureGuard";
import { SQLReviewCreation } from "@/components/SQLReview";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import SQLReviewAttachResourcesPanel from "@/components/SQLReview/components/SQLReviewAttachResourcesPanel.vue";
import SQLReviewTabsByEngine from "@/components/SQLReview/components/SQLReviewTabsByEngine.vue";
import SQLRuleTableWithFilter from "@/components/SQLReview/components/SQLRuleTableWithFilter.vue";
diff --git a/frontend/src/views/SettingWorkspaceSSO.vue b/frontend/src/views/SettingWorkspaceSSO.vue
index b1a7779bbb..9557b403ae 100644
--- a/frontend/src/views/SettingWorkspaceSSO.vue
+++ b/frontend/src/views/SettingWorkspaceSSO.vue
@@ -20,7 +20,7 @@
<template #icon>
<PlusIcon class="h-4 w-4" />
</template>
- <FeatureBadge :feature="'bb.feature.sso'" class="mr-1 text-white" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.ENTERPRISE_SSO" class="mr-1 text-white" />
{{ $t("settings.sso.create") }}
</NButton>
</div>
@@ -36,7 +36,7 @@
</div>
<FeatureModal
- feature="bb.feature.sso"
+ :feature="PlanLimitConfig_Feature.ENTERPRISE_SSO"
:open="state.showFeatureModal"
@cancel="state.showFeatureModal = false"
/>
@@ -58,6 +58,7 @@ import { featureToRef } from "@/store";
import { useIdentityProviderStore } from "@/store/modules/idp";
import { getSSOId } from "@/store/modules/v1/common";
import type { IdentityProvider } from "@/types/proto/v1/idp_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import {
hasWorkspacePermissionV2,
identityProviderTypeToString,
@@ -84,7 +85,7 @@ const state = reactive<LocalState>({
selectedIdentityProviderName: "",
});
const identityProviderStore = useIdentityProviderStore();
-const hasSSOFeature = featureToRef("bb.feature.sso");
+const hasSSOFeature = featureToRef(PlanLimitConfig_Feature.ENTERPRISE_SSO);
const identityProviderList = computed(() => {
return identityProviderStore.identityProviderList;
diff --git a/frontend/src/views/SettingWorkspaceSSODetail.vue b/frontend/src/views/SettingWorkspaceSSODetail.vue
index 6d5988cb59..d9e6110b7c 100644
--- a/frontend/src/views/SettingWorkspaceSSODetail.vue
+++ b/frontend/src/views/SettingWorkspaceSSODetail.vue
@@ -27,7 +27,7 @@
<BBSpin v-else class="w-full h-64" />
<FeatureModal
- feature="bb.feature.sso"
+ :feature="PlanLimitConfig_Feature.ENTERPRISE_SSO"
:open="state.showFeatureModal"
@cancel="state.showFeatureModal = false"
/>
@@ -41,6 +41,7 @@ import IdentityProviderCreateForm from "@/components/SSO/IdentityProviderCreateF
import { useIdentityProviderStore } from "@/store/modules/idp";
import { ssoNamePrefix } from "@/store/modules/v1/common";
import type { IdentityProvider } from "@/types/proto/v1/idp_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
const props = defineProps<{
ssoId?: string;
diff --git a/frontend/src/views/SettingWorkspaceSchemaTemplate.vue b/frontend/src/views/SettingWorkspaceSchemaTemplate.vue
index 2ad7c92acd..a570c97dc0 100644
--- a/frontend/src/views/SettingWorkspaceSchemaTemplate.vue
+++ b/frontend/src/views/SettingWorkspaceSchemaTemplate.vue
@@ -1,6 +1,6 @@
<template>
<div class="w-full space-y-4">
- <FeatureAttention feature="bb.feature.schema-template" />
+ <FeatureAttention :feature="PlanLimitConfig_Feature.SCHEMA_TEMPLATE" />
<NTabs v-model:value="state.selectedTab" type="line">
<NTabPane
name="FIELD_TEMPLATE"
@@ -39,6 +39,7 @@ import ColumnTypes from "@/views/SchemaTemplate/ColumnTypes.vue";
import FieldTemplates from "@/views/SchemaTemplate/FieldTemplates.vue";
import TableTemplates from "@/views/SchemaTemplate/TableTemplates.vue";
import { FeatureAttention } from "@/components/FeatureGuard";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
interface LocalState {
selectedTab: "FIELD_TEMPLATE" | "COLUMN_TYPE_RESTRICTION" | "TABLE_TEMPLATE";
@@ -54,7 +55,7 @@ const state = reactive<LocalState>({
selectedTab: "FIELD_TEMPLATE",
});
-const hasFeature = featureToRef("bb.feature.schema-template");
+const hasFeature = featureToRef(PlanLimitConfig_Feature.SCHEMA_TEMPLATE);
watch(
() => route.hash,
diff --git a/frontend/src/views/SettingWorkspaceSemanticTypes.vue b/frontend/src/views/SettingWorkspaceSemanticTypes.vue
index d8f5ef0b37..138bbb625a 100644
--- a/frontend/src/views/SettingWorkspaceSemanticTypes.vue
+++ b/frontend/src/views/SettingWorkspaceSemanticTypes.vue
@@ -1,6 +1,6 @@
<template>
<div class="w-full space-y-4">
- <FeatureAttention feature="bb.feature.sensitive-data" />
+ <FeatureAttention :feature="PlanLimitConfig_Feature.DATA_MASKING" />
<SemanticTypesView />
</div>
</template>
@@ -8,4 +8,5 @@
<script lang="tsx" setup>
import { FeatureAttention } from "@/components/FeatureGuard";
import { SemanticTypesView } from "@/components/SensitiveData";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
</script>
diff --git a/frontend/src/views/SettingWorkspaceUsers.vue b/frontend/src/views/SettingWorkspaceUsers.vue
index 254d7f8284..96e855c392 100644
--- a/frontend/src/views/SettingWorkspaceUsers.vue
+++ b/frontend/src/views/SettingWorkspaceUsers.vue
@@ -2,7 +2,7 @@
<div class="w-full overflow-x-hidden space-y-4">
<FeatureAttention
v-if="remainingUserCount <= 3"
- feature="bb.feature.user-count"
+ :feature="PlanLimitConfig_Feature.IAM"
:description="userCountAttention"
/>
@@ -75,7 +75,7 @@
>
<template #icon>
<SettingsIcon class="h-5 w-5" />
- <FeatureBadge feature="bb.feature.directory-sync" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.DIRECTORY_SYNC_ENTRA_ID" />
</template>
{{ $t(`settings.members.entra-sync.self`) }}
</NButton>
@@ -178,21 +178,14 @@
/>
<FeatureModal
- feature="bb.feature.directory-sync"
+ :feature="PlanLimitConfig_Feature.DIRECTORY_SYNC_ENTRA_ID"
:open="state.showFeatureModal"
@cancel="state.showFeatureModal = false"
/>
</template>
<script setup lang="ts">
-import { PlusIcon, SettingsIcon } from "lucide-vue-next";
-import { NButton, NTabs, NTabPane, NPopover, NCheckbox } from "naive-ui";
-import { computed, onMounted, reactive, watch, ref } from "vue";
-import type { ComponentExposed } from "vue-component-type-helpers";
-import { useI18n } from "vue-i18n";
-import { useRoute, useRouter, RouterLink } from "vue-router";
-import { FeatureBadge, FeatureModal } from "@/components/FeatureGuard";
-import { FeatureAttention } from "@/components/FeatureGuard";
+import { FeatureAttention, FeatureBadge, FeatureModal } from "@/components/FeatureGuard";
import AADSyncDrawer from "@/components/User/Settings/AADSyncDrawer.vue";
import CreateGroupDrawer from "@/components/User/Settings/CreateGroupDrawer.vue";
import CreateUserDrawer from "@/components/User/Settings/CreateUserDrawer.vue";
@@ -202,20 +195,27 @@ import { SearchBox } from "@/components/v2";
import PagedTable from "@/components/v2/Model/PagedTable.vue";
import { WORKSPACE_ROUTE_USER_PROFILE } from "@/router/dashboard/workspaceRoutes";
import {
- useUserStore,
- useUIStateStore,
+ featureToRef,
+ useActuatorV1Store,
useGroupStore,
useSettingV1Store,
- featureToRef,
useSubscriptionV1Store,
- useActuatorV1Store,
+ useUIStateStore,
+ useUserStore,
} from "@/store";
import { groupNamePrefix } from "@/store/modules/v1/common";
import { State } from "@/types/proto/v1/common";
import type { Group } from "@/types/proto/v1/group_service";
import { WorkspaceProfileSetting } from "@/types/proto/v1/setting_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { type User } from "@/types/proto/v1/user_service";
import { hasWorkspacePermissionV2 } from "@/utils";
+import { PlusIcon, SettingsIcon } from "lucide-vue-next";
+import { NButton, NCheckbox, NPopover, NTabPane, NTabs } from "naive-ui";
+import { computed, onMounted, reactive, ref, watch } from "vue";
+import type { ComponentExposed } from "vue-component-type-helpers";
+import { useI18n } from "vue-i18n";
+import { RouterLink, useRoute, useRouter } from "vue-router";
const tabList = ["USERS", "GROUPS"] as const;
type MemberTab = (typeof tabList)[number];
@@ -328,7 +328,7 @@ const workspaceProfileSetting = computed(() =>
)
);
-const hasDirectorySyncFeature = featureToRef("bb.feature.directory-sync");
+const hasDirectorySyncFeature = featureToRef(PlanLimitConfig_Feature.DIRECTORY_SYNC_ENTRA_ID);
const allowGetSCIMSetting = computed(() =>
hasWorkspacePermissionV2("bb.settings.get")
diff --git a/frontend/src/views/project/ProjectAuditLogDashboard.vue b/frontend/src/views/project/ProjectAuditLogDashboard.vue
index 39795035ba..09520c09f2 100644
--- a/frontend/src/views/project/ProjectAuditLogDashboard.vue
+++ b/frontend/src/views/project/ProjectAuditLogDashboard.vue
@@ -1,6 +1,6 @@
<template>
<div class="w-full space-y-4">
- <FeatureAttention feature="bb.feature.audit-log" />
+ <FeatureAttention :feature="PlanLimitConfig_Feature.AUDIT_LOG" />
<AuditLogSearch v-model:params="state.params">
<template #searchbox-suffix>
<DataExportButton
@@ -58,6 +58,7 @@ import { featureToRef, useAuditLogStore, useUserStore } from "@/store";
import { type SearchAuditLogsParams } from "@/types";
import type { AuditLog } from "@/types/proto/v1/audit_log_service";
import { ExportFormat } from "@/types/proto/v1/common";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import type { SearchParams, SearchScope } from "@/utils";
interface LocalState {
@@ -98,7 +99,7 @@ watch(
);
const { t } = useI18n();
-const hasAuditLogFeature = featureToRef("bb.feature.audit-log");
+const hasAuditLogFeature = featureToRef(PlanLimitConfig_Feature.AUDIT_LOG);
const auditLogPagedTable = ref<ComponentExposed<typeof PagedTable<AuditLog>>>();
const auditLogStore = useAuditLogStore();
diff --git a/frontend/src/views/project/ProjectDatabaseGroupDashboard.vue b/frontend/src/views/project/ProjectDatabaseGroupDashboard.vue
index 022b7d5021..fa10a47c4f 100644
--- a/frontend/src/views/project/ProjectDatabaseGroupDashboard.vue
+++ b/frontend/src/views/project/ProjectDatabaseGroupDashboard.vue
@@ -1,6 +1,6 @@
<template>
<div class="flex flex-col gap-y-4">
- <FeatureAttention feature="bb.feature.database-grouping" />
+ <FeatureAttention :feature="PlanLimitConfig_Feature.DATABASE_GROUPS" />
<div class="flex flex-row items-center justify-end gap-x-2">
<SearchBox
@@ -26,7 +26,7 @@
<template #icon>
<PlusIcon class="w-4" />
<FeatureBadge
- feature="bb.feature.database-grouping"
+ :feature="PlanLimitConfig_Feature.DATABASE_GROUPS"
class="text-white"
/>
</template>
@@ -38,7 +38,7 @@
<FeatureModal
:open="state.showFeatureModal"
- feature="bb.feature.database-grouping"
+ :feature="PlanLimitConfig_Feature.DATABASE_GROUPS"
@cancel="state.showFeatureModal = false"
/>
</template>
@@ -57,6 +57,7 @@ import {
import { SearchBox } from "@/components/v2";
import { PROJECT_V1_ROUTE_DATABASE_GROUPS_CREATE } from "@/router/dashboard/projectV1";
import { useProjectByName, hasFeature } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { projectNamePrefix } from "@/store/modules/v1/common";
import { hasProjectPermissionV2 } from "@/utils";
@@ -83,6 +84,6 @@ const allowCreate = computed(() =>
);
const hasDBGroupFeature = computed(() =>
- hasFeature("bb.feature.database-grouping")
+ hasFeature(PlanLimitConfig_Feature.DATABASE_GROUPS)
);
</script>
diff --git a/frontend/src/views/project/ProjectDatabaseGroupDetail.vue b/frontend/src/views/project/ProjectDatabaseGroupDetail.vue
index 997f597d05..816cb7ab5b 100644
--- a/frontend/src/views/project/ProjectDatabaseGroupDetail.vue
+++ b/frontend/src/views/project/ProjectDatabaseGroupDetail.vue
@@ -4,7 +4,7 @@
v-bind="$attrs"
class="h-full flex-1 relative space-y-4"
>
- <FeatureAttention feature="bb.feature.database-grouping" class="mb-4" />
+ <FeatureAttention :feature="PlanLimitConfig_Feature.DATABASE_GROUPS" class="mb-4" />
<div
v-if="hasDatabaseGroupFeature && !state.editing"
@@ -66,6 +66,7 @@ import {
projectNamePrefix,
} from "@/store/modules/v1/common";
import { DatabaseGroupView } from "@/types/proto/v1/database_group_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { hasPermissionToCreateChangeDatabaseIssueInProject } from "@/utils";
import { generateDatabaseGroupIssueRoute } from "@/utils/databaseGroup/issue";
@@ -104,7 +105,7 @@ const hasMatchedDatabases = computed(
() => (databaseGroup.value?.matchedDatabases.length ?? 0) > 0
);
-const hasDatabaseGroupFeature = featureToRef("bb.feature.database-grouping");
+const hasDatabaseGroupFeature = featureToRef(PlanLimitConfig_Feature.DATABASE_GROUPS);
watchEffect(async () => {
await dbGroupStore.getOrFetchDBGroupByName(databaseGroupResourceName.value, {
diff --git a/frontend/src/views/project/ProjectMaskingExemption.vue b/frontend/src/views/project/ProjectMaskingExemption.vue
index 9b9d160ff0..e06137bb14 100644
--- a/frontend/src/views/project/ProjectMaskingExemption.vue
+++ b/frontend/src/views/project/ProjectMaskingExemption.vue
@@ -43,7 +43,7 @@
<template #icon>
<ShieldCheckIcon class="w-4" />
<FeatureBadge
- feature="bb.feature.sensitive-data"
+ :feature="PlanLimitConfig_Feature.DATA_MASKING"
class="text-white"
/>
</template>
@@ -62,7 +62,7 @@
<FeatureModal
:open="state.showFeatureModal"
- feature="bb.feature.sensitive-data"
+ :feature="PlanLimitConfig_Feature.DATA_MASKING"
@cancel="state.showFeatureModal = false"
/>
</template>
@@ -79,6 +79,7 @@ import { type AccessUser } from "@/components/SensitiveData/types";
import { SearchBox, DatabaseSelect } from "@/components/v2";
import { PROJECT_V1_ROUTE_MASKING_EXEMPTION_CREATE } from "@/router/dashboard/projectV1";
import { useProjectByName, hasFeature } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { projectNamePrefix } from "@/store/modules/v1/common";
import { MaskingExceptionPolicy_MaskingException_Action as Action } from "@/types/proto/v1/org_policy_service";
import { hasProjectPermissionV2 } from "@/utils";
@@ -105,7 +106,7 @@ const { project } = useProjectByName(
);
const hasSensitiveDataFeature = computed(() => {
- return hasFeature("bb.feature.sensitive-data");
+ return hasFeature(PlanLimitConfig_Feature.DATA_MASKING);
});
const allowCreate = computed(() => {
diff --git a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/BatchQueryDatabaseGroupSelector.vue b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/BatchQueryDatabaseGroupSelector.vue
index ca92262c45..9f5efb5073 100644
--- a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/BatchQueryDatabaseGroupSelector.vue
+++ b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/BatchQueryDatabaseGroupSelector.vue
@@ -45,7 +45,7 @@
</NPopover>
<FeatureModal
- feature="bb.feature.database-grouping"
+ :feature="PlanLimitConfig_Feature.DATABASE_GROUPS"
:open="state.showFeatureModal"
@cancel="state.showFeatureModal = false"
/>
@@ -58,6 +58,7 @@ import { computed, reactive, watch } from "vue";
import DatabaseGroupDataTable from "@/components/DatabaseGroup/DatabaseGroupDataTable.vue";
import { FeatureModal } from "@/components/FeatureGuard";
import { SearchBox } from "@/components/v2";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import {
featureToRef,
useAppFeature,
@@ -84,8 +85,8 @@ const state = reactive<LocalState>({
});
// Save the stringified label key-value pairs.
const currentTab = computed(() => tabStore.currentTab);
-const hasBatchQueryFeature = featureToRef("bb.feature.batch-query");
-const hasDatabaseGroupFeature = featureToRef("bb.feature.database-grouping");
+const hasBatchQueryFeature = featureToRef(PlanLimitConfig_Feature.BATCH_QUERY);
+const hasDatabaseGroupFeature = featureToRef(PlanLimitConfig_Feature.DATABASE_GROUPS);
const disallowBatchQuery = useAppFeature(
"bb.feature.sql-editor.disallow-batch-query"
);
diff --git a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/ConnectionPane.vue b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/ConnectionPane.vue
index 41a1000f93..0008f5108f 100644
--- a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/ConnectionPane.vue
+++ b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/ConnectionPane.vue
@@ -5,7 +5,7 @@
class="textinfolabel mb-2 w-full leading-4 flex flex-col 2xl:flex-row items-start 2xl:items-center gap-x-1"
>
<div class="flex items-center gap-x-1">
- <FeatureBadge feature="bb.feature.batch-query" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.BATCH_QUERY" />
{{
$t("sql-editor.batch-query.description", {
database: state.selectedDatabases.size,
@@ -158,7 +158,7 @@
</div>
<FeatureModal
- feature="bb.feature.batch-query"
+ :feature="PlanLimitConfig_Feature.BATCH_QUERY"
:open="state.showFeatureModal"
@cancel="state.showFeatureModal = false"
/>
@@ -218,6 +218,7 @@ import {
} from "@/types";
import { engineFromJSON } from "@/types/proto/v1/common";
import { DataSourceType } from "@/types/proto/v1/instance_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import {
findAncestor,
isDescendantOf,
@@ -276,8 +277,8 @@ watch(
{ deep: true }
);
-const hasBatchQueryFeature = featureToRef("bb.feature.batch-query");
-const hasDatabaseGroupFeature = featureToRef("bb.feature.database-grouping");
+const hasBatchQueryFeature = featureToRef(PlanLimitConfig_Feature.BATCH_QUERY);
+const hasDatabaseGroupFeature = featureToRef(PlanLimitConfig_Feature.DATABASE_GROUPS);
const state = reactive<LocalState>({
selectedDatabases: new Set(),
diff --git a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/TreeNode/DatabaseNode.vue b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/TreeNode/DatabaseNode.vue
index cc3be1987e..33a1f1e287 100644
--- a/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/TreeNode/DatabaseNode.vue
+++ b/frontend/src/views/sql-editor/ConnectionPanel/ConnectionPane/TreeNode/DatabaseNode.vue
@@ -41,6 +41,7 @@ import type {
SQLEditorTreeNode as TreeNode,
SQLEditorTreeFactor as Factor,
} from "@/types";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { isDatabaseV1Queryable } from "@/utils";
import RequestQueryButton from "../../../EditorCommon/ResultView/RequestQueryButton.vue";
@@ -78,7 +79,7 @@ const canQuery = computed(() => isDatabaseV1Queryable(database.value));
const showRequestQueryButton = computed(() => {
// Developer self-helped request query is guarded by "Access Control" feature
return (
- hasFeature("bb.feature.access-control") &&
+ hasFeature(PlanLimitConfig_Feature.IAM) &&
!disallowRequestQuery.value &&
!canQuery.value
);
diff --git a/frontend/src/views/sql-editor/EditorCommon/EditorAction.vue b/frontend/src/views/sql-editor/EditorCommon/EditorAction.vue
index 05963c5193..6d338201d0 100644
--- a/frontend/src/views/sql-editor/EditorCommon/EditorAction.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/EditorAction.vue
@@ -111,7 +111,7 @@
<template #default>
<div class="flex items-center gap-1">
<span>{{ $t("common.share") }}</span>
- <FeatureBadge feature="bb.feature.shared-sql-script" />
+ <FeatureBadge :feature="PlanLimitConfig_Feature.SAVED_AND_SHARED_SQL_SCRIPTS" />
</div>
</template>
</NPopover>
@@ -168,10 +168,10 @@ import {
} from "@/store";
import {
DEFAULT_SQL_EDITOR_TAB_MODE,
- type FeatureType,
type SQLEditorQueryParams,
} from "@/types";
import { Engine } from "@/types/proto/v1/common";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { keyboardShortcutStr, isWorksheetWritableV1 } from "@/utils";
import { useSQLEditorContext } from "../context";
import AdminModeButton from "./AdminModeButton.vue";
@@ -183,7 +183,7 @@ import SchemaChooser from "./SchemaChooser.vue";
import SharePopover from "./SharePopover.vue";
interface LocalState {
- requiredFeatureName?: FeatureType;
+ requiredFeatureName?: PlanLimitConfig_Feature;
}
defineOptions({
@@ -200,7 +200,7 @@ const tabStore = useSQLEditorTabStore();
const uiStateStore = useUIStateStore();
const { events } = useSQLEditorContext();
const { resultRowsLimit } = storeToRefs(useSQLEditorStore());
-const hasSharedSQLScriptFeature = featureToRef("bb.feature.shared-sql-script");
+const hasSharedSQLScriptFeature = featureToRef(PlanLimitConfig_Feature.SAVED_AND_SHARED_SQL_SCRIPTS);
const disallowShareWorksheet = useAppFeature(
"bb.feature.sql-editor.disallow-share-worksheet"
);
@@ -342,7 +342,7 @@ const handleClickSave = () => {
const handleShareButtonClick = () => {
if (!hasSharedSQLScriptFeature.value) {
- state.requiredFeatureName = "bb.feature.shared-sql-script";
+ state.requiredFeatureName = PlanLimitConfig_Feature.SAVED_AND_SHARED_SQL_SCRIPTS;
}
};
</script>
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/DataBlock.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/DataBlock.vue
index f15aecca6f..3ec42f4fd4 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/DataBlock.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/DataBlock.vue
@@ -25,7 +25,7 @@
/>
<FeatureBadge
v-else-if="isColumnMissingSensitive(header.index)"
- feature="bb.feature.sensitive-data"
+ :feature="PlanLimitConfig_Feature.DATA_MASKING"
class="ml-0.5 shrink-0"
:instance="database.instanceResource"
/>
@@ -57,6 +57,7 @@ import type { Table } from "@tanstack/vue-table";
import { computed } from "vue";
import { FeatureBadge } from "@/components/FeatureGuard";
import { useConnectionOfCurrentSQLEditorTab } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import type { QueryRow, RowValue } from "@/types/proto/v1/sql_service";
import TableCell from "./DataTable/TableCell.vue";
import SensitiveDataIcon from "./DataTable/common/SensitiveDataIcon.vue";
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/DataTable.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/DataTable.vue
index 203b294007..42e45d7fa6 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/DataTable.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/DataTable.vue
@@ -46,7 +46,7 @@
/>
<FeatureBadge
v-else-if="isColumnMissingSensitive(header.index)"
- feature="bb.feature.sensitive-data"
+ :feature="PlanLimitConfig_Feature.DATA_MASKING"
class="ml-0.5 shrink-0"
:instance="database.instanceResource"
/>
@@ -132,6 +132,7 @@ import { NEmpty } from "naive-ui";
import { computed, nextTick, onMounted, ref, watch } from "vue";
import { FeatureBadge } from "@/components/FeatureGuard";
import { useConnectionOfCurrentSQLEditorTab } from "@/store";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { type QueryRow, type RowValue } from "@/types/proto/v1/sql_service";
import { useSQLResultViewContext } from "../context";
import TableCell from "./TableCell.vue";
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/ResultViewV1.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/ResultViewV1.vue
index e18e324b33..fc46567b76 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/ResultViewV1.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/ResultViewV1.vue
@@ -144,6 +144,7 @@ import type {
DatabaseResource,
} from "@/types";
import { PolicyType } from "@/types/proto/v1/org_policy_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import { hasWorkspacePermissionV2 } from "@/utils";
import DetailPanel from "./DetailPanel";
import EmptyView from "./EmptyView.vue";
@@ -212,7 +213,7 @@ const missingResource = computed((): DatabaseResource | undefined => {
const showRequestQueryButton = computed(() => {
// Developer self-helped request query is guarded by "Access Control" feature
return (
- hasFeature("bb.feature.access-control") &&
+ hasFeature(PlanLimitConfig_Feature.IAM) &&
!disallowRequestQuery.value &&
missingResource.value
);
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
index 892d0b6ce1..43baae2ea1 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue
@@ -230,6 +230,7 @@ import { ExportFormat } from "@/types/proto/v1/common";
import { Engine } from "@/types/proto/v1/common";
import { PolicyType } from "@/types/proto/v1/org_policy_service";
import { DatabaseChangeMode } from "@/types/proto/v1/setting_service";
+import { PlanLimitConfig_Feature } from "@/types/proto/v1/subscription_service";
import type {
QueryResult,
QueryRow,
@@ -333,7 +334,7 @@ const allowToRequestExportData = computed(() => {
// The current plan doesn't have access control feature.
// Developers can not self-helped to request export.
- if (!featureToRef("bb.feature.access-control").value) {
+ if (!featureToRef(PlanLimitConfig_Feature.IAM).value) {
return false;
}
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 43682fac44..259c091795 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -4134,30 +4134,31 @@ Feature represents the available features in Bytebase
| ENTERPRISE_SSO | 46 | |
| TWO_FA | 47 | |
| PASSWORD_RESTRICTIONS | 48 | |
-| CUSTOM_ROLES | 49 | |
-| REQUEST_ROLE_WORKFLOW | 50 | |
-| DATA_MASKING | 51 | |
-| DATA_CLASSIFICATION | 52 | |
-| SCIM | 53 | |
-| DIRECTORY_SYNC_ENTRA_ID | 54 | |
-| DIRECTORY_SYNC_OKTA | 55 | |
-| SIGN_IN_FREQUENCY_CONTROL | 56 | |
-| EXTERNAL_SECRET_MANAGER | 57 | |
-| USER_EMAIL_DOMAIN_RESTRICTION | 58 | |
-| ENVIRONMENT_MANAGEMENT | 59 | Administration &amp; Support |
-| IM_NOTIFICATIONS | 60 | |
-| TERRAFORM_PROVIDER | 61 | |
-| DATABASE_GROUPS | 62 | |
-| ENVIRONMENT_TIERS | 63 | |
-| DASHBOARD_ANNOUNCEMENT | 64 | |
-| API_INTEGRATION_GUIDANCE | 65 | |
-| CUSTOM_LOGO | 66 | |
-| WATERMARK | 67 | |
-| ROADMAP_PRIORITIZATION | 68 | |
-| CUSTOM_MSA | 69 | |
-| COMMUNITY_SUPPORT | 70 | |
-| EMAIL_SUPPORT | 71 | |
-| DEDICATED_SUPPORT_WITH_SLA | 72 | |
+| DISALLOW_PASSWORD_SIGNIN | 49 | |
+| CUSTOM_ROLES | 50 | |
+| REQUEST_ROLE_WORKFLOW | 51 | |
+| DATA_MASKING | 52 | |
+| DATA_CLASSIFICATION | 53 | |
+| SCIM | 54 | |
+| DIRECTORY_SYNC_ENTRA_ID | 55 | |
+| DIRECTORY_SYNC_OKTA | 56 | |
+| SIGN_IN_FREQUENCY_CONTROL | 57 | |
+| EXTERNAL_SECRET_MANAGER | 58 | |
+| USER_EMAIL_DOMAIN_RESTRICTION | 59 | |
+| ENVIRONMENT_MANAGEMENT | 60 | Administration &amp; Support |
+| IM_NOTIFICATIONS | 61 | |
+| TERRAFORM_PROVIDER | 62 | |
+| DATABASE_GROUPS | 63 | |
+| ENVIRONMENT_TIERS | 64 | |
+| DASHBOARD_ANNOUNCEMENT | 65 | |
+| API_INTEGRATION_GUIDANCE | 66 | |
+| CUSTOM_LOGO | 67 | |
+| WATERMARK | 68 | |
+| ROADMAP_PRIORITIZATION | 69 | |
+| CUSTOM_MSA | 70 | |
+| COMMUNITY_SUPPORT | 71 | |
+| EMAIL_SUPPORT | 72 | |
+| DEDICATED_SUPPORT_WITH_SLA | 73 | |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index da229cad73..7361268e75 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -12415,146 +12415,152 @@ The access is based on approval flow.</p></td>
</tr>
<tr>
- <td>CUSTOM_ROLES</td>
+ <td>DISALLOW_PASSWORD_SIGNIN</td>
<td>49</td>
<td><p></p></td>
</tr>
<tr>
- <td>REQUEST_ROLE_WORKFLOW</td>
+ <td>CUSTOM_ROLES</td>
<td>50</td>
<td><p></p></td>
</tr>
<tr>
- <td>DATA_MASKING</td>
+ <td>REQUEST_ROLE_WORKFLOW</td>
<td>51</td>
<td><p></p></td>
</tr>
<tr>
- <td>DATA_CLASSIFICATION</td>
+ <td>DATA_MASKING</td>
<td>52</td>
<td><p></p></td>
</tr>
<tr>
- <td>SCIM</td>
+ <td>DATA_CLASSIFICATION</td>
<td>53</td>
<td><p></p></td>
</tr>
<tr>
- <td>DIRECTORY_SYNC_ENTRA_ID</td>
+ <td>SCIM</td>
<td>54</td>
<td><p></p></td>
</tr>
<tr>
- <td>DIRECTORY_SYNC_OKTA</td>
+ <td>DIRECTORY_SYNC_ENTRA_ID</td>
<td>55</td>
<td><p></p></td>
</tr>
<tr>
- <td>SIGN_IN_FREQUENCY_CONTROL</td>
+ <td>DIRECTORY_SYNC_OKTA</td>
<td>56</td>
<td><p></p></td>
</tr>
<tr>
- <td>EXTERNAL_SECRET_MANAGER</td>
+ <td>SIGN_IN_FREQUENCY_CONTROL</td>
<td>57</td>
<td><p></p></td>
</tr>
<tr>
- <td>USER_EMAIL_DOMAIN_RESTRICTION</td>
+ <td>EXTERNAL_SECRET_MANAGER</td>
<td>58</td>
<td><p></p></td>
</tr>
<tr>
- <td>ENVIRONMENT_MANAGEMENT</td>
+ <td>USER_EMAIL_DOMAIN_RESTRICTION</td>
<td>59</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>ENVIRONMENT_MANAGEMENT</td>
+ <td>60</td>
<td><p>Administration &amp; Support</p></td>
</tr>
<tr>
<td>IM_NOTIFICATIONS</td>
- <td>60</td>
+ <td>61</td>
<td><p></p></td>
</tr>
<tr>
<td>TERRAFORM_PROVIDER</td>
- <td>61</td>
+ <td>62</td>
<td><p></p></td>
</tr>
<tr>
<td>DATABASE_GROUPS</td>
- <td>62</td>
+ <td>63</td>
<td><p></p></td>
</tr>
<tr>
<td>ENVIRONMENT_TIERS</td>
- <td>63</td>
+ <td>64</td>
<td><p></p></td>
</tr>
<tr>
<td>DASHBOARD_ANNOUNCEMENT</td>
- <td>64</td>
+ <td>65</td>
<td><p></p></td>
</tr>
<tr>
<td>API_INTEGRATION_GUIDANCE</td>
- <td>65</td>
+ <td>66</td>
<td><p></p></td>
</tr>
<tr>
<td>CUSTOM_LOGO</td>
- <td>66</td>
+ <td>67</td>
<td><p></p></td>
</tr>
<tr>
<td>WATERMARK</td>
- <td>67</td>
+ <td>68</td>
<td><p></p></td>
</tr>
<tr>
<td>ROADMAP_PRIORITIZATION</td>
- <td>68</td>
+ <td>69</td>
<td><p></p></td>
</tr>
<tr>
<td>CUSTOM_MSA</td>
- <td>69</td>
+ <td>70</td>
<td><p></p></td>
</tr>
<tr>
<td>COMMUNITY_SUPPORT</td>
- <td>70</td>
+ <td>71</td>
<td><p></p></td>
</tr>
<tr>
<td>EMAIL_SUPPORT</td>
- <td>71</td>
+ <td>72</td>
<td><p></p></td>
</tr>
<tr>
<td>DEDICATED_SUPPORT_WITH_SLA</td>
- <td>72</td>
+ <td>73</td>
<td><p></p></td>
</tr>
diff --git a/proto/generated-go/v1/subscription_service.pb.go b/proto/generated-go/v1/subscription_service.pb.go
index 1a3566e193..ff3a456e0b 100644
--- a/proto/generated-go/v1/subscription_service.pb.go
+++ b/proto/generated-go/v1/subscription_service.pb.go
@@ -131,31 +131,32 @@ const (
PlanLimitConfig_ENTERPRISE_SSO PlanLimitConfig_Feature = 46
PlanLimitConfig_TWO_FA PlanLimitConfig_Feature = 47
PlanLimitConfig_PASSWORD_RESTRICTIONS PlanLimitConfig_Feature = 48
- PlanLimitConfig_CUSTOM_ROLES PlanLimitConfig_Feature = 49
- PlanLimitConfig_REQUEST_ROLE_WORKFLOW PlanLimitConfig_Feature = 50
- PlanLimitConfig_DATA_MASKING PlanLimitConfig_Feature = 51
- PlanLimitConfig_DATA_CLASSIFICATION PlanLimitConfig_Feature = 52
- PlanLimitConfig_SCIM PlanLimitConfig_Feature = 53
- PlanLimitConfig_DIRECTORY_SYNC_ENTRA_ID PlanLimitConfig_Feature = 54
- PlanLimitConfig_DIRECTORY_SYNC_OKTA PlanLimitConfig_Feature = 55
- PlanLimitConfig_SIGN_IN_FREQUENCY_CONTROL PlanLimitConfig_Feature = 56
- PlanLimitConfig_EXTERNAL_SECRET_MANAGER PlanLimitConfig_Feature = 57
- PlanLimitConfig_USER_EMAIL_DOMAIN_RESTRICTION PlanLimitConfig_Feature = 58
+ PlanLimitConfig_DISALLOW_PASSWORD_SIGNIN PlanLimitConfig_Feature = 49
+ PlanLimitConfig_CUSTOM_ROLES PlanLimitConfig_Feature = 50
+ PlanLimitConfig_REQUEST_ROLE_WORKFLOW PlanLimitConfig_Feature = 51
+ PlanLimitConfig_DATA_MASKING PlanLimitConfig_Feature = 52
+ PlanLimitConfig_DATA_CLASSIFICATION PlanLimitConfig_Feature = 53
+ PlanLimitConfig_SCIM PlanLimitConfig_Feature = 54
+ PlanLimitConfig_DIRECTORY_SYNC_ENTRA_ID PlanLimitConfig_Feature = 55
+ PlanLimitConfig_DIRECTORY_SYNC_OKTA PlanLimitConfig_Feature = 56
+ PlanLimitConfig_SIGN_IN_FREQUENCY_CONTROL PlanLimitConfig_Feature = 57
+ PlanLimitConfig_EXTERNAL_SECRET_MANAGER PlanLimitConfig_Feature = 58
+ PlanLimitConfig_USER_EMAIL_DOMAIN_RESTRICTION PlanLimitConfig_Feature = 59
// Administration & Support
- PlanLimitConfig_ENVIRONMENT_MANAGEMENT PlanLimitConfig_Feature = 59
- PlanLimitConfig_IM_NOTIFICATIONS PlanLimitConfig_Feature = 60
- PlanLimitConfig_TERRAFORM_PROVIDER PlanLimitConfig_Feature = 61
- PlanLimitConfig_DATABASE_GROUPS PlanLimitConfig_Feature = 62
- PlanLimitConfig_ENVIRONMENT_TIERS PlanLimitConfig_Feature = 63
- PlanLimitConfig_DASHBOARD_ANNOUNCEMENT PlanLimitConfig_Feature = 64
- PlanLimitConfig_API_INTEGRATION_GUIDANCE PlanLimitConfig_Feature = 65
- PlanLimitConfig_CUSTOM_LOGO PlanLimitConfig_Feature = 66
- PlanLimitConfig_WATERMARK PlanLimitConfig_Feature = 67
- PlanLimitConfig_ROADMAP_PRIORITIZATION PlanLimitConfig_Feature = 68
- PlanLimitConfig_CUSTOM_MSA PlanLimitConfig_Feature = 69
- PlanLimitConfig_COMMUNITY_SUPPORT PlanLimitConfig_Feature = 70
- PlanLimitConfig_EMAIL_SUPPORT PlanLimitConfig_Feature = 71
- PlanLimitConfig_DEDICATED_SUPPORT_WITH_SLA PlanLimitConfig_Feature = 72
+ PlanLimitConfig_ENVIRONMENT_MANAGEMENT PlanLimitConfig_Feature = 60
+ PlanLimitConfig_IM_NOTIFICATIONS PlanLimitConfig_Feature = 61
+ PlanLimitConfig_TERRAFORM_PROVIDER PlanLimitConfig_Feature = 62
+ PlanLimitConfig_DATABASE_GROUPS PlanLimitConfig_Feature = 63
+ PlanLimitConfig_ENVIRONMENT_TIERS PlanLimitConfig_Feature = 64
+ PlanLimitConfig_DASHBOARD_ANNOUNCEMENT PlanLimitConfig_Feature = 65
+ PlanLimitConfig_API_INTEGRATION_GUIDANCE PlanLimitConfig_Feature = 66
+ PlanLimitConfig_CUSTOM_LOGO PlanLimitConfig_Feature = 67
+ PlanLimitConfig_WATERMARK PlanLimitConfig_Feature = 68
+ PlanLimitConfig_ROADMAP_PRIORITIZATION PlanLimitConfig_Feature = 69
+ PlanLimitConfig_CUSTOM_MSA PlanLimitConfig_Feature = 70
+ PlanLimitConfig_COMMUNITY_SUPPORT PlanLimitConfig_Feature = 71
+ PlanLimitConfig_EMAIL_SUPPORT PlanLimitConfig_Feature = 72
+ PlanLimitConfig_DEDICATED_SUPPORT_WITH_SLA PlanLimitConfig_Feature = 73
)
// Enum value maps for PlanLimitConfig_Feature.
@@ -210,30 +211,31 @@ var (
46: "ENTERPRISE_SSO",
47: "TWO_FA",
48: "PASSWORD_RESTRICTIONS",
- 49: "CUSTOM_ROLES",
- 50: "REQUEST_ROLE_WORKFLOW",
- 51: "DATA_MASKING",
- 52: "DATA_CLASSIFICATION",
- 53: "SCIM",
- 54: "DIRECTORY_SYNC_ENTRA_ID",
- 55: "DIRECTORY_SYNC_OKTA",
- 56: "SIGN_IN_FREQUENCY_CONTROL",
- 57: "EXTERNAL_SECRET_MANAGER",
- 58: "USER_EMAIL_DOMAIN_RESTRICTION",
- 59: "ENVIRONMENT_MANAGEMENT",
- 60: "IM_NOTIFICATIONS",
- 61: "TERRAFORM_PROVIDER",
- 62: "DATABASE_GROUPS",
- 63: "ENVIRONMENT_TIERS",
- 64: "DASHBOARD_ANNOUNCEMENT",
- 65: "API_INTEGRATION_GUIDANCE",
- 66: "CUSTOM_LOGO",
- 67: "WATERMARK",
- 68: "ROADMAP_PRIORITIZATION",
- 69: "CUSTOM_MSA",
- 70: "COMMUNITY_SUPPORT",
- 71: "EMAIL_SUPPORT",
- 72: "DEDICATED_SUPPORT_WITH_SLA",
+ 49: "DISALLOW_PASSWORD_SIGNIN",
+ 50: "CUSTOM_ROLES",
+ 51: "REQUEST_ROLE_WORKFLOW",
+ 52: "DATA_MASKING",
+ 53: "DATA_CLASSIFICATION",
+ 54: "SCIM",
+ 55: "DIRECTORY_SYNC_ENTRA_ID",
+ 56: "DIRECTORY_SYNC_OKTA",
+ 57: "SIGN_IN_FREQUENCY_CONTROL",
+ 58: "EXTERNAL_SECRET_MANAGER",
+ 59: "USER_EMAIL_DOMAIN_RESTRICTION",
+ 60: "ENVIRONMENT_MANAGEMENT",
+ 61: "IM_NOTIFICATIONS",
+ 62: "TERRAFORM_PROVIDER",
+ 63: "DATABASE_GROUPS",
+ 64: "ENVIRONMENT_TIERS",
+ 65: "DASHBOARD_ANNOUNCEMENT",
+ 66: "API_INTEGRATION_GUIDANCE",
+ 67: "CUSTOM_LOGO",
+ 68: "WATERMARK",
+ 69: "ROADMAP_PRIORITIZATION",
+ 70: "CUSTOM_MSA",
+ 71: "COMMUNITY_SUPPORT",
+ 72: "EMAIL_SUPPORT",
+ 73: "DEDICATED_SUPPORT_WITH_SLA",
}
PlanLimitConfig_Feature_value = map[string]int32{
"FEATURE_UNSPECIFIED": 0,
@@ -285,30 +287,31 @@ var (
"ENTERPRISE_SSO": 46,
"TWO_FA": 47,
"PASSWORD_RESTRICTIONS": 48,
- "CUSTOM_ROLES": 49,
- "REQUEST_ROLE_WORKFLOW": 50,
- "DATA_MASKING": 51,
- "DATA_CLASSIFICATION": 52,
- "SCIM": 53,
- "DIRECTORY_SYNC_ENTRA_ID": 54,
- "DIRECTORY_SYNC_OKTA": 55,
- "SIGN_IN_FREQUENCY_CONTROL": 56,
- "EXTERNAL_SECRET_MANAGER": 57,
- "USER_EMAIL_DOMAIN_RESTRICTION": 58,
- "ENVIRONMENT_MANAGEMENT": 59,
- "IM_NOTIFICATIONS": 60,
- "TERRAFORM_PROVIDER": 61,
- "DATABASE_GROUPS": 62,
- "ENVIRONMENT_TIERS": 63,
- "DASHBOARD_ANNOUNCEMENT": 64,
- "API_INTEGRATION_GUIDANCE": 65,
- "CUSTOM_LOGO": 66,
- "WATERMARK": 67,
- "ROADMAP_PRIORITIZATION": 68,
- "CUSTOM_MSA": 69,
- "COMMUNITY_SUPPORT": 70,
- "EMAIL_SUPPORT": 71,
- "DEDICATED_SUPPORT_WITH_SLA": 72,
+ "DISALLOW_PASSWORD_SIGNIN": 49,
+ "CUSTOM_ROLES": 50,
+ "REQUEST_ROLE_WORKFLOW": 51,
+ "DATA_MASKING": 52,
+ "DATA_CLASSIFICATION": 53,
+ "SCIM": 54,
+ "DIRECTORY_SYNC_ENTRA_ID": 55,
+ "DIRECTORY_SYNC_OKTA": 56,
+ "SIGN_IN_FREQUENCY_CONTROL": 57,
+ "EXTERNAL_SECRET_MANAGER": 58,
+ "USER_EMAIL_DOMAIN_RESTRICTION": 59,
+ "ENVIRONMENT_MANAGEMENT": 60,
+ "IM_NOTIFICATIONS": 61,
+ "TERRAFORM_PROVIDER": 62,
+ "DATABASE_GROUPS": 63,
+ "ENVIRONMENT_TIERS": 64,
+ "DASHBOARD_ANNOUNCEMENT": 65,
+ "API_INTEGRATION_GUIDANCE": 66,
+ "CUSTOM_LOGO": 67,
+ "WATERMARK": 68,
+ "ROADMAP_PRIORITIZATION": 69,
+ "CUSTOM_MSA": 70,
+ "COMMUNITY_SUPPORT": 71,
+ "EMAIL_SUPPORT": 72,
+ "DEDICATED_SUPPORT_WITH_SLA": 73,
}
)
@@ -842,12 +845,12 @@ const file_v1_subscription_service_proto_rawDesc = "" +
"\x05value\x18\x02 \x01(\bR\x05value:\x028\x01\"@\n" +
"\n" +
"PlanConfig\x122\n" +
- "\x05plans\x18\x01 \x03(\v2\x1c.bytebase.v1.PlanLimitConfigR\x05plans\"\xcf\x10\n" +
+ "\x05plans\x18\x01 \x03(\v2\x1c.bytebase.v1.PlanLimitConfigR\x05plans\"\xed\x10\n" +
"\x0fPlanLimitConfig\x12)\n" +
"\x04type\x18\x01 \x01(\x0e2\x15.bytebase.v1.PlanTypeR\x04type\x124\n" +
"\x16maximum_instance_count\x18\x02 \x01(\x05R\x14maximumInstanceCount\x12,\n" +
"\x12maximum_seat_count\x18\x03 \x01(\x05R\x10maximumSeatCount\x12@\n" +
- "\bfeatures\x18\x04 \x03(\x0e2$.bytebase.v1.PlanLimitConfig.FeatureR\bfeatures\"\xea\x0e\n" +
+ "\bfeatures\x18\x04 \x03(\x0e2$.bytebase.v1.PlanLimitConfig.FeatureR\bfeatures\"\x88\x0f\n" +
"\aFeature\x12\x17\n" +
"\x13FEATURE_UNSPECIFIED\x10\x00\x12\x13\n" +
"\x0fDATABASE_CHANGE\x10\x01\x12$\n" +
@@ -900,32 +903,33 @@ const file_v1_subscription_service_proto_rawDesc = "" +
"\x0eENTERPRISE_SSO\x10.\x12\n" +
"\n" +
"\x06TWO_FA\x10/\x12\x19\n" +
- "\x15PASSWORD_RESTRICTIONS\x100\x12\x10\n" +
- "\fCUSTOM_ROLES\x101\x12\x19\n" +
- "\x15REQUEST_ROLE_WORKFLOW\x102\x12\x10\n" +
- "\fDATA_MASKING\x103\x12\x17\n" +
- "\x13DATA_CLASSIFICATION\x104\x12\b\n" +
- "\x04SCIM\x105\x12\x1b\n" +
- "\x17DIRECTORY_SYNC_ENTRA_ID\x106\x12\x17\n" +
- "\x13DIRECTORY_SYNC_OKTA\x107\x12\x1d\n" +
- "\x19SIGN_IN_FREQUENCY_CONTROL\x108\x12\x1b\n" +
- "\x17EXTERNAL_SECRET_MANAGER\x109\x12!\n" +
- "\x1dUSER_EMAIL_DOMAIN_RESTRICTION\x10:\x12\x1a\n" +
- "\x16ENVIRONMENT_MANAGEMENT\x10;\x12\x14\n" +
- "\x10IM_NOTIFICATIONS\x10<\x12\x16\n" +
- "\x12TERRAFORM_PROVIDER\x10=\x12\x13\n" +
- "\x0fDATABASE_GROUPS\x10>\x12\x15\n" +
- "\x11ENVIRONMENT_TIERS\x10?\x12\x1a\n" +
- "\x16DASHBOARD_ANNOUNCEMENT\x10@\x12\x1c\n" +
- "\x18API_INTEGRATION_GUIDANCE\x10A\x12\x0f\n" +
- "\vCUSTOM_LOGO\x10B\x12\r\n" +
- "\tWATERMARK\x10C\x12\x1a\n" +
- "\x16ROADMAP_PRIORITIZATION\x10D\x12\x0e\n" +
+ "\x15PASSWORD_RESTRICTIONS\x100\x12\x1c\n" +
+ "\x18DISALLOW_PASSWORD_SIGNIN\x101\x12\x10\n" +
+ "\fCUSTOM_ROLES\x102\x12\x19\n" +
+ "\x15REQUEST_ROLE_WORKFLOW\x103\x12\x10\n" +
+ "\fDATA_MASKING\x104\x12\x17\n" +
+ "\x13DATA_CLASSIFICATION\x105\x12\b\n" +
+ "\x04SCIM\x106\x12\x1b\n" +
+ "\x17DIRECTORY_SYNC_ENTRA_ID\x107\x12\x17\n" +
+ "\x13DIRECTORY_SYNC_OKTA\x108\x12\x1d\n" +
+ "\x19SIGN_IN_FREQUENCY_CONTROL\x109\x12\x1b\n" +
+ "\x17EXTERNAL_SECRET_MANAGER\x10:\x12!\n" +
+ "\x1dUSER_EMAIL_DOMAIN_RESTRICTION\x10;\x12\x1a\n" +
+ "\x16ENVIRONMENT_MANAGEMENT\x10<\x12\x14\n" +
+ "\x10IM_NOTIFICATIONS\x10=\x12\x16\n" +
+ "\x12TERRAFORM_PROVIDER\x10>\x12\x13\n" +
+ "\x0fDATABASE_GROUPS\x10?\x12\x15\n" +
+ "\x11ENVIRONMENT_TIERS\x10@\x12\x1a\n" +
+ "\x16DASHBOARD_ANNOUNCEMENT\x10A\x12\x1c\n" +
+ "\x18API_INTEGRATION_GUIDANCE\x10B\x12\x0f\n" +
+ "\vCUSTOM_LOGO\x10C\x12\r\n" +
+ "\tWATERMARK\x10D\x12\x1a\n" +
+ "\x16ROADMAP_PRIORITIZATION\x10E\x12\x0e\n" +
"\n" +
- "CUSTOM_MSA\x10E\x12\x15\n" +
- "\x11COMMUNITY_SUPPORT\x10F\x12\x11\n" +
- "\rEMAIL_SUPPORT\x10G\x12\x1e\n" +
- "\x1aDEDICATED_SUPPORT_WITH_SLA\x10H*I\n" +
+ "CUSTOM_MSA\x10F\x12\x15\n" +
+ "\x11COMMUNITY_SUPPORT\x10G\x12\x11\n" +
+ "\rEMAIL_SUPPORT\x10H\x12\x1e\n" +
+ "\x1aDEDICATED_SUPPORT_WITH_SLA\x10I*I\n" +
"\bPlanType\x12\x19\n" +
"\x15PLAN_TYPE_UNSPECIFIED\x10\x00\x12\b\n" +
"\x04FREE\x10\x01\x12\b\n" +
diff --git a/proto/v1/v1/subscription_service.proto b/proto/v1/v1/subscription_service.proto
index 1d63cfaf49..cdb59ab696 100644
--- a/proto/v1/v1/subscription_service.proto
+++ b/proto/v1/v1/subscription_service.proto
@@ -150,32 +150,33 @@ message PlanLimitConfig {
ENTERPRISE_SSO = 46;
TWO_FA = 47;
PASSWORD_RESTRICTIONS = 48;
- CUSTOM_ROLES = 49;
- REQUEST_ROLE_WORKFLOW = 50;
- DATA_MASKING = 51;
- DATA_CLASSIFICATION = 52;
- SCIM = 53;
- DIRECTORY_SYNC_ENTRA_ID = 54;
- DIRECTORY_SYNC_OKTA = 55;
- SIGN_IN_FREQUENCY_CONTROL = 56;
- EXTERNAL_SECRET_MANAGER = 57;
- USER_EMAIL_DOMAIN_RESTRICTION = 58;
+ DISALLOW_PASSWORD_SIGNIN = 49;
+ CUSTOM_ROLES = 50;
+ REQUEST_ROLE_WORKFLOW = 51;
+ DATA_MASKING = 52;
+ DATA_CLASSIFICATION = 53;
+ SCIM = 54;
+ DIRECTORY_SYNC_ENTRA_ID = 55;
+ DIRECTORY_SYNC_OKTA = 56;
+ SIGN_IN_FREQUENCY_CONTROL = 57;
+ EXTERNAL_SECRET_MANAGER = 58;
+ USER_EMAIL_DOMAIN_RESTRICTION = 59;
// Administration & Support
- ENVIRONMENT_MANAGEMENT = 59;
- IM_NOTIFICATIONS = 60;
- TERRAFORM_PROVIDER = 61;
- DATABASE_GROUPS = 62;
- ENVIRONMENT_TIERS = 63;
- DASHBOARD_ANNOUNCEMENT = 64;
- API_INTEGRATION_GUIDANCE = 65;
- CUSTOM_LOGO = 66;
- WATERMARK = 67;
- ROADMAP_PRIORITIZATION = 68;
- CUSTOM_MSA = 69;
- COMMUNITY_SUPPORT = 70;
- EMAIL_SUPPORT = 71;
- DEDICATED_SUPPORT_WITH_SLA = 72;
+ ENVIRONMENT_MANAGEMENT = 60;
+ IM_NOTIFICATIONS = 61;
+ TERRAFORM_PROVIDER = 62;
+ DATABASE_GROUPS = 63;
+ ENVIRONMENT_TIERS = 64;
+ DASHBOARD_ANNOUNCEMENT = 65;
+ API_INTEGRATION_GUIDANCE = 66;
+ CUSTOM_LOGO = 67;
+ WATERMARK = 68;
+ ROADMAP_PRIORITIZATION = 69;
+ CUSTOM_MSA = 70;
+ COMMUNITY_SUPPORT = 71;
+ EMAIL_SUPPORT = 72;
+ DEDICATED_SUPPORT_WITH_SLA = 73;
}
PlanType type = 1;