Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: extract plan and subscription data into yaml (#2617)
ecmadao6eef5c0a1234
diff --git a/frontend/src/components/PricingTable/FeatureItem.vue b/frontend/src/components/PricingTable/FeatureItem.vueindex 91acf8b279..7cf259acb0 100644--- a/frontend/src/components/PricingTable/FeatureItem.vue+++ b/frontend/src/components/PricingTable/FeatureItem.vue@@ -38,6 +38,7 @@import { PropType, computed } from "vue";import { NTooltip } from "naive-ui";import { LocalPlan } from "./types";+import { getFeatureLocalization } from "@/types";const props = defineProps({plan: {@@ -51,6 +52,11 @@ const props = defineProps({});const featureDetail = computed(() => {- return props.plan.features.find((f) => f.id === props.feature);+ const feature = props.plan.featureList.find((f) => f.type === props.feature);+ if (!feature) {+ return;+ }++ return getFeatureLocalization(feature);});</script>diff --git a/frontend/src/components/PricingTable/PricingTable.vue b/frontend/src/components/PricingTable/PricingTable.vueindex 9d0b05df7e..425674851f 100644--- a/frontend/src/components/PricingTable/PricingTable.vue+++ b/frontend/src/components/PricingTable/PricingTable.vue@@ -91,18 +91,18 @@Feature comparison</caption><tbody class="border-t border-gray-200 divide-y divide-gray-200">- <template v-for="section in sections" :key="section.id">+ <template v-for="section in sections" :key="section.type"><tr><thclass="bg-gray-50 py-3 pl-6 text-sm font-medium text-gray-900 text-left"colspan="4"scope="colgroup">- {{ $t(`subscription.feature-sections.${section.id}.title`) }}+ {{ $t(`subscription.feature-sections.${section.type}.title`) }}</th></tr><tr- v-for="feature in section.features"+ v-for="feature in section.featureList":key="feature"class="hover:bg-gray-50">@@ -112,7 +112,7 @@>{{$t(- `subscription.feature-sections.${section.id}.features.${feature}`+ `subscription.feature-sections.${section.type}.features.${feature}`)}}</th>@@ -210,17 +210,17 @@Feature comparison</caption><tbody class="border-t border-gray-200 divide-y divide-gray-200">- <template v-for="section in sections" :key="section.id">+ <template v-for="section in sections" :key="section.type"><tr><thclass="bg-gray-50 py-3 pl-6 text-sm font-medium text-gray-900 text-left"scope="colgroup">- {{ $t(`subscription.feature-sections.${section.id}.title`) }}+ {{ $t(`subscription.feature-sections.${section.type}.title`) }}</th></tr><tr- v-for="feature in section.features"+ v-for="feature in section.featureList":key="feature"class="hover:bg-gray-50">@@ -230,7 +230,7 @@>{{$t(- `subscription.feature-sections.${section.id}.features.${feature}`+ `subscription.feature-sections.${section.type}.features.${feature}`)}}</th>@@ -259,14 +259,7 @@<script lang="ts">import { reactive, computed, watch, defineComponent } from "vue";import { useI18n } from "vue-i18n";-import {- Plan,- PlanType,- FEATURE_SECTIONS,- FREE_PLAN,- TEAM_PLAN,- ENTERPRISE_PLAN,-} from "@/types";+import { Plan, PlanType, PLANS, FEATURE_SECTIONS } from "@/types";import { useSubscriptionStore } from "@/store";import { LocalPlan } from "./types";import FeatureItem from "./FeatureItem.vue";@@ -297,7 +290,7 @@ export default defineComponent({);const plans = computed((): LocalPlan[] => {- return [FREE_PLAN, TEAM_PLAN, ENTERPRISE_PLAN].map((plan) => ({+ return PLANS.map((plan) => ({...plan,image: new URL(`../../assets/plan-${plan.title.toLowerCase()}.png`,diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex 52ab6476ab..ef93c75faf 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -1306,33 +1306,7 @@},"subscription": {"description": "You can upload your Bytebase license to unlock team/enterprise features.",- "current": "Current plan",- "instance-count": "Instance count",- "expires-at": "Expires at",- "free-trial": "Your first 14 days are free - no credit card required",- "description-highlight": "Purchase a license",- "sensitive-placeholder": "Paste your license here - write only","upload-license": "Upload license",- "plan-compare": "Compare features between different plans",- "disabled-feature": "This is a premium feature in subscription plan",- "trial": "You can start a free trial - no credit card required",- "upgrade": "Upgrade subscription",- "per-month": "/ month",- "price-unit-for-enterprise": "/ month",- "start-from": "Start from",- "per-instance": "Per instance",- "free-price-intro": "Up to 5",- "team-price-intro": "5 minimum, billed annually",- "enterprise-price-intro": "Customized, billed annually",- "deploy": "Deploy",- "contact-us": "Contact us",- "start-trial": "Try free now",- "subscribe": "Subscribe now",- "current-plan": "Current plan",- "buy": "Buy {plan} plan",- "cancel": "cancel your subscription",- "announcement": "You can upgrade, downgrade, or {cancel} anytime. No hidden charges.",- "trialing": "trialing","update": {"success": {"title": "Successfully updated license",@@ -1400,87 +1374,6 @@"title": "Point-in-Time-Recovery (PITR)","desc": "Restore the database state to a point in time."}- },- "feature-sections": {- "database-management": {- "title": "Database Development",- "features": {- "instance-count": "Instance count",- "instance-upto-5": "Up to 5",- "instance-customized": "Customized",- "instance-minimum-5": "5 ~ unlimited",- "schema-change": "Schema and data change",- "schema-change-basic": "Basic",- "schema-change-basic-tooltip": "Normal migration",- "schema-change-advanced": "Advanced",- "schema-change-advanced-tooltip": "Normal migration + Online migration (gh-ost)",- "migration-history": "Migration history",- "sql-editor": "SQL Editor",- "disaster-recovery": "Disaster recovery",- "disaster-recovery-basic": "Basic",- "disaster-recovery-basic-tooltip": "Database backup / restore",- "disaster-recovery-advanced": "Advanced",- "disaster-recovery-advanced-tooltip": "Database backup / restore + Point-in-Time-Recovery (PITR)",- "archiving": "Archiving",- "sql-check": "SQL check / SQL review",- "sql-check-basic": "Basic",- "sql-check-basic-tooltip": "Syntax check, connection check",- "sql-check-advanced": "Advanced",- "sql-check-advanced-tooltip": "Basic + Customized SQL review rules",- "anomaly-detection": "Anomaly detection",- "anomaly-detection-basic": "Basic",- "anomaly-detection-basic-tooltip": "Connection failure, missing backup",- "anomaly-detection-advanced": "Advanced",- "anomaly-detection-advanced-tooltip": "Basic + Drift detection",- "schedule-change": "Scheduled change at specific time",- "review-and-backup-policy": "Review and backup policy",- "tenancy": "Multi-Region / Multi-Tenancy deployment"- }- },- "collaboration": {- "title": "Collaboration",- "features": {- "ui-based-sql-review": "UI based SQL review",- "vsc-workflow": "VCS workflow #GitOps",- "shareable-query-link": "Shareable query link",- "im-integration": "IM integration",- "inbox-notification": "Inbox notification"- }- },- "admin-and-security": {- "title": "Admin & Security",- "features": {- "activity-log": "Activity log",- "rbac": "RBAC (Owner, DBA, Developer role)",- "3rd-party-auth": "Login with GitLab account",- "sync-members-from-vcs": "Sync project membership from the linked GitLab project"- }- },- "branding": {- "title": "Branding",- "features": {- "branding-logo": "Customize the logo"- }- }- },- "plan": {- "title": "Plan",- "try": "Try Team",- "free": {- "title": "Free Plan",- "label": "",- "desc": "Personal project or small team, no DBA"- },- "team": {- "title": "Team Plan",- "label": "Beta",- "desc": "Medium size team, has dedicated DBA or TL for engineering velocity"- },- "enterprise": {- "title": "Enterprise Plan",- "label": "Early access",- "desc": "Large organization, has dedicated DBA group to manage database fleet"- }}},"sheet": {diff --git a/frontend/src/locales/subscription/en-US.json b/frontend/src/locales/subscription/en-US.jsonnew file mode 100644index 0000000000..d4e53cc1ff--- /dev/null+++ b/frontend/src/locales/subscription/en-US.json@@ -0,0 +1,109 @@+{+ "current": "Current plan",+ "instance-count": "Instance count",+ "expires-at": "Expires at",+ "free-trial": "Your first 14 days are free - no credit card required",+ "description-highlight": "Purchase a license",+ "sensitive-placeholder": "Paste your license here - write only",+ "plan-compare": "Compare features between different plans",+ "disabled-feature": "This is a premium feature in subscription plan",+ "trial": "You can start a free trial - no credit card required",+ "upgrade": "Upgrade subscription",+ "per-month": "/ month",+ "price-unit-for-enterprise": "/ month",+ "start-from": "Start from",+ "per-instance": "Per instance",+ "free-price-intro": "Up to 5",+ "team-price-intro": "5 minimum, billed annually",+ "enterprise-price-intro": "Customized, billed annually",+ "deploy": "Deploy",+ "contact-us": "Contact us",+ "start-trial": "Try free now",+ "subscribe": "Subscribe now",+ "current-plan": "Current plan",+ "buy": "Buy {plan} plan",+ "cancel": "cancel your subscription",+ "announcement": "You can upgrade, downgrade, or {cancel} anytime. No hidden charges.",+ "trialing": "trialing",+ "plan": {+ "title": "Plan",+ "try": "Try Team",+ "free": {+ "title": "Free Plan",+ "label": "",+ "desc": "Personal project or small team, no DBA"+ },+ "team": {+ "title": "Team Plan",+ "label": "Beta",+ "desc": "Medium size team, has dedicated DBA or TL for engineering velocity"+ },+ "enterprise": {+ "title": "Enterprise Plan",+ "label": "Early access",+ "desc": "Large organization, has dedicated DBA group to manage database fleet"+ }+ },+ "feature-sections": {+ "database-management": {+ "title": "Database Development",+ "features": {+ "instance-count": "Instance count",+ "instance-upto-5": "Up to 5",+ "instance-customized": "Customized",+ "instance-minimum-5": "5 ~ unlimited",+ "schema-change": "Schema and data change",+ "schema-change-basic": "Basic",+ "schema-change-basic-tooltip": "Normal migration",+ "schema-change-advanced": "Advanced",+ "schema-change-advanced-tooltip": "Normal migration + Online migration (gh-ost)",+ "migration-history": "Migration history",+ "sql-editor": "SQL Editor",+ "disaster-recovery": "Disaster recovery",+ "disaster-recovery-basic": "Basic",+ "disaster-recovery-basic-tooltip": "Database backup / restore",+ "disaster-recovery-advanced": "Advanced",+ "disaster-recovery-advanced-tooltip": "Database backup / restore + Point-in-Time-Recovery (PITR)",+ "archiving": "Archiving",+ "sql-check": "SQL check / SQL review",+ "sql-check-basic": "Basic",+ "sql-check-basic-tooltip": "Syntax check, connection check",+ "sql-check-advanced": "Advanced",+ "sql-check-advanced-tooltip": "Basic + Customized SQL review rules",+ "anomaly-detection": "Anomaly detection",+ "anomaly-detection-basic": "Basic",+ "anomaly-detection-basic-tooltip": "Connection failure, missing backup",+ "anomaly-detection-advanced": "Advanced",+ "anomaly-detection-advanced-tooltip": "Basic + Drift detection",+ "schedule-change": "Scheduled change at specific time",+ "review-and-backup-policy": "Review and backup policy",+ "tenancy": "Multi-Region / Multi-Tenancy deployment"+ }+ },+ "collaboration": {+ "title": "Collaboration",+ "features": {+ "ui-based-sql-review": "UI based SQL review",+ "vsc-workflow": "VCS workflow #GitOps",+ "shareable-query-link": "Shareable query link",+ "im-integration": "IM integration",+ "inbox-notification": "Inbox notification"+ }+ },+ "admin-and-security": {+ "title": "Admin & Security",+ "features": {+ "activity-log": "Activity log",+ "rbac": "RBAC (Owner, DBA, Developer role)",+ "3rd-party-auth": "Login with GitLab account",+ "sync-members-from-vcs": "Sync project membership from the linked GitLab project"+ }+ },+ "branding": {+ "title": "Branding",+ "features": {+ "branding-logo": "Customize the logo"+ }+ }+ }+}diff --git a/frontend/src/locales/subscription/zh-CN.json b/frontend/src/locales/subscription/zh-CN.jsonnew file mode 100644index 0000000000..e6533360a0--- /dev/null+++ b/frontend/src/locales/subscription/zh-CN.json@@ -0,0 +1,109 @@+{+ "current": "当前版本",+ "instance-count": "实例数",+ "expires-at": "过期时间",+ "free-trial": "无需信用卡即可免费试用",+ "description-highlight": "购买证书",+ "sensitive-placeholder": "粘贴您的证书 - 仅写入",+ "plan-compare": "比较不同版本的功能,寻找适合您的方案",+ "disabled-feature": "这是一个订阅版高级功能",+ "trial": "您可以免费试用 14 天",+ "upgrade": "升级订阅",+ "per-month": "/ 月",+ "price-unit-for-enterprise": "/ 月起",+ "start-from": "",+ "per-instance": "每个实例",+ "free-price-intro": "最多 5 个实例",+ "team-price-intro": "5 个起步,按年付费",+ "enterprise-price-intro": "自定义实例数,按年付费",+ "deploy": "部署",+ "contact-us": "联系我们",+ "start-trial": "免费试用",+ "subscribe": "开始订阅",+ "current-plan": "当前订阅",+ "buy": "购买{plan}",+ "cancel": "取消订阅",+ "announcement": "您可以随时升级、降级或{cancel}。没有任何隐藏费用。",+ "trialing": "试用期",+ "plan": {+ "title": "版本",+ "try": "试用团队版",+ "free": {+ "title": "免费版",+ "label": "",+ "desc": "个人或小团队,无专职 DBA"+ },+ "team": {+ "title": "团队版",+ "label": "Beta",+ "desc": "中型团队,有专职 DBA 或 TL 以提高工程速度"+ },+ "enterprise": {+ "title": "企业版",+ "label": "预览版",+ "desc": "大型组织,有专属 DBA 团队来管理数据库"+ }+ },+ "feature-sections": {+ "database-management": {+ "title": "数据库管理",+ "features": {+ "instance-count": "实例数",+ "instance-upto-5": "不多于 5 个",+ "instance-minimum-5": "5 ~ 无限制",+ "instance-customized": "自定义",+ "schema-change": "Schema 和数据变更",+ "schema-change-basic": "基础",+ "schema-change-basic-tooltip": "普通变更",+ "schema-change-advanced": "高级",+ "schema-change-advanced-tooltip": "普通变更 + 在线变更 (gh-ost)",+ "migration-history": "变更历史",+ "sql-editor": "SQL 编辑器",+ "disaster-recovery": "数据灾备",+ "disaster-recovery-basic": "基础",+ "disaster-recovery-basic-tooltip": "数据库备份和恢复",+ "disaster-recovery-advanced": "高级",+ "disaster-recovery-advanced-tooltip": "数据库备份和恢复 + 恢复到指定时间点 (PITR)",+ "archiving": "归档",+ "sql-check": "SQL 检查 / Schema 审核",+ "sql-check-basic": "基础",+ "sql-check-basic-tooltip": "语法检查、数据库连接检查",+ "sql-check-advanced": "高级",+ "sql-check-advanced-tooltip": "基础版功能 + 自定义 SQL 审核规则",+ "anomaly-detection": "异常检测",+ "anomaly-detection-basic": "基础",+ "anomaly-detection-basic-tooltip": "数据库连接异常、备份缺失",+ "anomaly-detection-advanced": "高级",+ "anomaly-detection-advanced-tooltip": "基础版功能 + Schema 偏差检测",+ "schedule-change": "设定任务执行时间",+ "review-and-backup-policy": "审核和备份策略",+ "tenancy": "多地域/多租户部署"+ }+ },+ "collaboration": {+ "title": "团队协作",+ "features": {+ "ui-based-sql-review": "基于 UI 的 SQL 审查",+ "vsc-workflow": "VCS 工作流 #GitOps",+ "shareable-query-link": "分享查询链接",+ "im-integration": "IM 集成",+ "inbox-notification": "站内信通知"+ }+ },+ "admin-and-security": {+ "title": "管理与安全",+ "features": {+ "activity-log": "活动日志",+ "rbac": "RBAC 权限管理",+ "3rd-party-auth": "通过 GitLab 登录",+ "sync-members-from-vcs": "从 GitLab 同步成员信息"+ }+ },+ "branding": {+ "title": "自定义品牌信息",+ "features": {+ "branding-logo": "自定义 Logo"+ }+ }+ }+}diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex de5cb13d82..936259cd5e 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -1306,33 +1306,7 @@},"subscription": {"description": "您可以在这里上传您购买的 Bytebase 证书来解锁团队版/企业版功能。",- "current": "当前版本",- "instance-count": "实例数",- "expires-at": "过期时间",- "free-trial": "无需信用卡即可免费试用",- "description-highlight": "购买证书",- "sensitive-placeholder": "粘贴您的证书 - 仅写入","upload-license": "上传证书",- "plan-compare": "比较不同版本的功能,寻找适合您的方案",- "disabled-feature": "这是一个订阅版高级功能",- "trial": "您可以免费试用 14 天",- "upgrade": "升级订阅",- "per-month": "/ 月",- "price-unit-for-enterprise": "/ 月起",- "start-from": "",- "per-instance": "每个实例",- "free-price-intro": "最多 5 个实例",- "team-price-intro": "5 个起步,按年付费",- "enterprise-price-intro": "自定义实例数,按年付费",- "deploy": "部署",- "contact-us": "联系我们",- "start-trial": "免费试用",- "subscribe": "开始订阅",- "current-plan": "当前订阅",- "buy": "购买{plan}",- "cancel": "取消订阅",- "announcement": "您可以随时升级、降级或{cancel}。没有任何隐藏费用。",- "trialing": "试用期","update": {"success": {"title": "证书更新成功",@@ -1400,87 +1374,6 @@"title": "恢复到指定时间点 (PITR)","desc": "将数据库的状态恢复到一个时间点。"}- },- "feature-sections": {- "database-management": {- "title": "数据库管理",- "features": {- "instance-count": "实例数",- "instance-upto-5": "不多于 5 个",- "instance-minimum-5": "5 ~ 无限制",- "instance-customized": "自定义",- "schema-change": "Schema 和数据变更",- "schema-change-basic": "基础",- "schema-change-basic-tooltip": "普通变更",- "schema-change-advanced": "高级",- "schema-change-advanced-tooltip": "普通变更 + 在线变更 (gh-ost)",- "migration-history": "变更历史",- "sql-editor": "SQL 编辑器",- "disaster-recovery": "数据灾备",- "disaster-recovery-basic": "基础",- "disaster-recovery-basic-tooltip": "数据库备份和恢复",- "disaster-recovery-advanced": "高级",- "disaster-recovery-advanced-tooltip": "数据库备份和恢复 + 恢复到指定时间点 (PITR)",- "archiving": "归档",- "sql-check": "SQL 检查 / Schema 审核",- "sql-check-basic": "基础",- "sql-check-basic-tooltip": "语法检查、数据库连接检查",- "sql-check-advanced": "高级",- "sql-check-advanced-tooltip": "基础版功能 + 自定义 SQL 审核规则",- "anomaly-detection": "异常检测",- "anomaly-detection-basic": "基础",- "anomaly-detection-basic-tooltip": "数据库连接异常、备份缺失",- "anomaly-detection-advanced": "高级",- "anomaly-detection-advanced-tooltip": "基础版功能 + Schema 偏差检测",- "schedule-change": "设定任务执行时间",- "review-and-backup-policy": "审核和备份策略",- "tenancy": "多地域/多租户部署"- }- },- "collaboration": {- "title": "团队协作",- "features": {- "ui-based-sql-review": "基于 UI 的 SQL 审查",- "vsc-workflow": "VCS 工作流 #GitOps",- "shareable-query-link": "分享查询链接",- "im-integration": "IM 集成",- "inbox-notification": "站内信通知"- }- },- "admin-and-security": {- "title": "管理与安全",- "features": {- "activity-log": "活动日志",- "rbac": "RBAC 权限管理",- "3rd-party-auth": "通过 GitLab 登录",- "sync-members-from-vcs": "从 GitLab 同步成员信息"- }- },- "branding": {- "title": "自定义品牌信息",- "features": {- "branding-logo": "自定义 Logo"- }- }- },- "plan": {- "title": "版本",- "try": "试用团队版",- "free": {- "title": "免费版",- "label": "",- "desc": "个人或小团队,无专职 DBA"- },- "team": {- "title": "团队版",- "label": "Beta",- "desc": "中型团队,有专职 DBA 或 TL 以提高工程速度"- },- "enterprise": {- "title": "企业版",- "label": "预览版",- "desc": "大型组织,有专属 DBA 团队来管理数据库"- }}},"sheet": {diff --git a/frontend/src/types/plan.ts b/frontend/src/types/plan.tsindex 28e57f27fc..c009df1c87 100644--- a/frontend/src/types/plan.ts+++ b/frontend/src/types/plan.ts@@ -1,3 +1,6 @@+import { useI18n } from "vue-i18n";+import planData from "./plan.yaml";+// Check api/plan.go to understand what each feature means.export type FeatureType =// Database management@@ -30,6 +33,12 @@ export type PlanPatch = {type: PlanType;};+interface PlanFeature {+ type: string;+ content?: string;+ tooltip?: string;+}+export interface Plan {// Plan meta datatype: PlanType;@@ -40,7 +49,7 @@ export interface Plan {pricePerInstancePerMonth: number;// Plan desc and featuretitle: string;- features: { id: string; content?: string; tooltip?: string }[];+ featureList: PlanFeature[];}// A map from the a particular feature to the respective enablement of a particular plan@@ -70,225 +79,33 @@ export const FEATURE_MATRIX: Map<FeatureType, boolean[]> = new Map([["bb.feature.branding", [false, true, true]],]);-export const FEATURE_SECTIONS = [- {- id: "database-management",- features: [- "instance-count",- "schema-change",- "migration-history",- "sql-editor",- "disaster-recovery",- "archiving",- "sql-check",- "anomaly-detection",- "schedule-change",- "review-and-backup-policy",- "tenancy",- ],- },- {- id: "collaboration",- features: [- "ui-based-sql-review",- "vsc-workflow",- "shareable-query-link",- "im-integration",- "inbox-notification",- ],- },- {- id: "admin-and-security",- features: [- "activity-log",- "rbac",- "3rd-party-auth",- "sync-members-from-vcs",- ],- },- {- id: "branding",- features: ["branding-logo"],- },-];+export const FEATURE_SECTIONS: { type: string; featureList: string[] }[] =+ planData.categoryList;-export const FREE_PLAN: Plan = {- // Plan meta data- type: PlanType.FREE,- trialDays: 0,- unitPrice: 0,- trialPrice: 0,- freeInstanceCount: 1,- pricePerInstancePerMonth: 0,- // Plan desc and feature- title: "free",- features: [- {- id: "instance-count",- content:- "subscription.feature-sections.database-management.features.instance-upto-5",- },- {- id: "schema-change",- content:- "subscription.feature-sections.database-management.features.schema-change-basic",- tooltip:- "subscription.feature-sections.database-management.features.schema-change-basic-tooltip",- },- { id: "migration-history" },- { id: "sql-editor" },- {- id: "disaster-recovery",- content:- "subscription.feature-sections.database-management.features.disaster-recovery-basic",- tooltip:- "subscription.feature-sections.database-management.features.disaster-recovery-basic-tooltip",- },- { id: "archiving" },- {- id: "sql-check",- content:- "subscription.feature-sections.database-management.features.sql-check-basic",- tooltip:- "subscription.feature-sections.database-management.features.sql-check-basic-tooltip",- },- {- id: "anomaly-detection",- content:- "subscription.feature-sections.database-management.features.anomaly-detection-basic",- tooltip:- "subscription.feature-sections.database-management.features.anomaly-detection-basic-tooltip",- },- { id: "ui-based-sql-review" },- { id: "vsc-workflow" },- { id: "shareable-query-link" },- { id: "im-integration" },- { id: "inbox-notification" },- { id: "activity-log" },- ],-};+export const PLANS: Plan[] = planData.planList;-export const TEAM_PLAN: Plan = {- // Plan meta data- type: PlanType.TEAM,- trialDays: 14,- unitPrice: 1740,- trialPrice: 0,- freeInstanceCount: 5,- pricePerInstancePerMonth: 79,- // Plan desc and feature- title: "team",- features: [- {- id: "instance-count",- content:- "subscription.feature-sections.database-management.features.instance-minimum-5",- },- {- id: "schema-change",- content:- "subscription.feature-sections.database-management.features.schema-change-advanced",- tooltip:- "subscription.feature-sections.database-management.features.schema-change-advanced-tooltip",- },- { id: "migration-history" },- { id: "sql-editor" },- {- id: "disaster-recovery",- content:- "subscription.feature-sections.database-management.features.disaster-recovery-advanced",- tooltip:- "subscription.feature-sections.database-management.features.disaster-recovery-advanced-tooltip",- },- { id: "archiving" },- {- id: "sql-check",- content:- "subscription.feature-sections.database-management.features.sql-check-advanced",- tooltip:- "subscription.feature-sections.database-management.features.sql-check-advanced-tooltip",- },- {- id: "anomaly-detection",- content:- "subscription.feature-sections.database-management.features.anomaly-detection-advanced",- tooltip:- "subscription.feature-sections.database-management.features.anomaly-detection-advanced-tooltip",- },- { id: "schedule-change" },- { id: "review-and-backup-policy" },- { id: "ui-based-sql-review" },- { id: "vsc-workflow" },- { id: "shareable-query-link" },- { id: "im-integration" },- { id: "inbox-notification" },- { id: "activity-log" },- { id: "rbac" },- { id: "3rd-party-auth" },- { id: "sync-members-from-vcs" },- { id: "branding-logo" },- ],-};+export const getFeatureLocalization = (feature: PlanFeature): PlanFeature => {+ const { t } = useI18n();+ for (const section of FEATURE_SECTIONS) {+ if (new Set(section.featureList).has(feature.type)) {+ const res: PlanFeature = {+ type: t(+ `subscription.feature-sections.${section.type}.features.${feature.type}`+ ),+ };+ if (feature.content) {+ res.content = t(+ `subscription.feature-sections.${section.type}.features.${feature.content}`+ );+ }+ if (feature.tooltip) {+ res.content = t(+ `subscription.feature-sections.${section.type}.features.${feature.tooltip}`+ );+ }+ return res;+ }+ }-export const ENTERPRISE_PLAN: Plan = {- // Plan meta data- type: PlanType.ENTERPRISE,- trialDays: 0,- unitPrice: 0,- trialPrice: 0,- freeInstanceCount: 5,- pricePerInstancePerMonth: 199,- // Plan desc and feature- title: "enterprise",- features: [- {- id: "instance-count",- content:- "subscription.feature-sections.database-management.features.instance-customized",- },- {- id: "schema-change",- content:- "subscription.feature-sections.database-management.features.schema-change-advanced",- tooltip:- "subscription.feature-sections.database-management.features.schema-change-advanced-tooltip",- },- { id: "migration-history" },- { id: "sql-editor" },- {- id: "disaster-recovery",- content:- "subscription.feature-sections.database-management.features.disaster-recovery-advanced",- tooltip:- "subscription.feature-sections.database-management.features.disaster-recovery-advanced-tooltip",- },- { id: "archiving" },- {- id: "sql-check",- content:- "subscription.feature-sections.database-management.features.sql-check-advanced",- tooltip:- "subscription.feature-sections.database-management.features.sql-check-advanced-tooltip",- },- {- id: "anomaly-detection",- content:- "subscription.feature-sections.database-management.features.anomaly-detection-advanced",- tooltip:- "subscription.feature-sections.database-management.features.anomaly-detection-advanced-tooltip",- },- { id: "schedule-change" },- { id: "review-and-backup-policy" },- { id: "tenancy" },- { id: "ui-based-sql-review" },- { id: "vsc-workflow" },- { id: "shareable-query-link" },- { id: "im-integration" },- { id: "inbox-notification" },- { id: "activity-log" },- { id: "rbac" },- { id: "3rd-party-auth" },- { id: "sync-members-from-vcs" },- { id: "branding-logo" },- ],+ return feature;};diff --git a/frontend/src/types/plan.yaml b/frontend/src/types/plan.yamlnew file mode 100644index 0000000000..c7f925f26d--- /dev/null+++ b/frontend/src/types/plan.yaml@@ -0,0 +1,137 @@+categoryList:+ - type: database-management+ featureList:+ - instance-count+ - schema-change+ - migration-history+ - sql-editor+ - disaster-recovery+ - archiving+ - sql-check+ - anomaly-detection+ - schedule-change+ - review-and-backup-policy+ - tenancy+ - type: collaboration+ featureList:+ - ui-based-sql-review+ - vsc-workflow+ - shareable-query-link+ - im-integration+ - inbox-notification+ - type: admin-and-security+ featureList:+ - activity-log+ - rbac+ - 3rd-party-auth+ - sync-members-from-vcs+ - type: branding+ featureList:+ - branding-logo+planList:+ - type: 0+ title: free+ trialDays: 0+ unitPrice: 0+ trialPrice: 0+ freeInstanceCount: 1+ pricePerInstancePerMonth: 0+ featureList:+ - type: instance-count+ content: instance-upto-5+ - type: schema-change+ content: schema-change-basic+ tooltip: schema-change-basic-tooltip+ - type: migration-history+ - type: sql-editor+ - type: disaster-recovery+ content: disaster-recovery-basic+ tooltip: disaster-recovery-basic-tooltip+ - type: archiving+ - type: sql-check+ content: sql-check-basic+ tooltip: sql-check-basic-tooltip+ - type: anomaly-detection+ content: anomaly-detection-basic+ tooltip: anomaly-detection-basic-tooltip+ - type: ui-based-sql-review+ - type: vsc-workflow+ - type: shareable-query-link+ - type: im-integration+ - type: inbox-notification+ - type: activity-log+ - type: 1+ title: team+ trialDays: 14+ unitPrice: 1740+ trialPrice: 0+ freeInstanceCount: 5+ pricePerInstancePerMonth: 79+ featureList:+ - type: instance-count+ content: instance-minimum-5+ - type: schema-change+ content: schema-change-advanced+ tooltip: schema-change-advanced-tooltip+ - type: migration-history+ - type: sql-editor+ - type: disaster-recovery+ content: disaster-recovery-advanced+ tooltip: disaster-recovery-advanced-tooltip+ - type: archiving+ - type: sql-check+ content: sql-check-advanced+ tooltip: sql-check-advanced-tooltip+ - type: anomaly-detection+ content: anomaly-detection-advanced+ tooltip: anomaly-detection-advanced-tooltip+ - type: schedule-change+ - type: review-and-backup-policy+ - type: ui-based-sql-review+ - type: vsc-workflow+ - type: shareable-query-link+ - type: im-integration+ - type: inbox-notification+ - type: activity-log+ - type: rbac+ - type: 3rd-party-auth+ - type: sync-members-from-vcs+ - type: branding-logo+ - type: 2+ title: enterprise+ trialDays: 0+ unitPrice: 0+ trialPrice: 0+ freeInstanceCount: 5+ pricePerInstancePerMonth: 199+ featureList:+ - type: instance-count+ content: instance-customized+ - type: schema-change+ content: schema-change-advanced+ tooltip: schema-change-advanced-tooltip+ - type: migration-history+ - type: sql-editor+ - type: disaster-recovery+ content: disaster-recovery-advanced+ tooltip: disaster-recovery-advanced-tooltip+ - type: archiving+ - type: sql-check+ content: sql-check-advanced+ tooltip: sql-check-advanced-tooltip+ - type: anomaly-detection+ content: anomaly-detection-advanced+ tooltip: anomaly-detection-advanced-tooltip+ - type: schedule-change+ - type: review-and-backup-policy+ - type: tenancy+ - type: ui-based-sql-review+ - type: vsc-workflow+ - type: shareable-query-link+ - type: im-integration+ - type: inbox-notification+ - type: activity-log+ - type: rbac+ - type: 3rd-party-auth+ - type: sync-members-from-vcs+ - type: branding-logo