From b21a417560ae1f6cd49b26b2fe03ff923c664dbd Mon Sep 17 00:00:00 2001 From: Charles Zhao Date: Mon, 22 Jul 2024 11:09:12 +0800 Subject: [PATCH] feat(console,phrases): add bring your ui quota item to pricing table (#6274) --- .../connector-logto-email/package.json | 2 +- packages/console/package.json | 2 +- .../console/src/consts/quota-item-phrases.ts | 8 ++++++++ packages/console/src/consts/tenants.ts | 2 ++ .../PlanComparisonTable/index.tsx | 2 ++ .../admin-console/subscription/quota-item.ts | 12 ++++++++++++ .../admin-console/subscription/quota-table.ts | 1 + pnpm-lock.yaml | 19 ++++--------------- 8 files changed, 31 insertions(+), 17 deletions(-) diff --git a/packages/connectors/connector-logto-email/package.json b/packages/connectors/connector-logto-email/package.json index a3f2033fd..0238bb59a 100644 --- a/packages/connectors/connector-logto-email/package.json +++ b/packages/connectors/connector-logto-email/package.json @@ -52,7 +52,7 @@ "access": "public" }, "devDependencies": { - "@logto/cloud": "0.2.5-a7eedce", + "@logto/cloud": "0.2.5-3b703da", "@rollup/plugin-commonjs": "^26.0.0", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^15.2.3", diff --git a/packages/console/package.json b/packages/console/package.json index 11932c3a7..e5075e138 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -27,7 +27,7 @@ "devDependencies": { "@fontsource/roboto-mono": "^5.0.0", "@jest/types": "^29.5.0", - "@logto/cloud": "0.2.5-a7eedce", + "@logto/cloud": "0.2.5-3b703da", "@logto/connector-kit": "workspace:^4.0.0", "@logto/core-kit": "workspace:^2.5.0", "@logto/elements": "workspace:^0.0.0", diff --git a/packages/console/src/consts/quota-item-phrases.ts b/packages/console/src/consts/quota-item-phrases.ts index fb26ee591..3a6dec712 100644 --- a/packages/console/src/consts/quota-item-phrases.ts +++ b/packages/console/src/consts/quota-item-phrases.ts @@ -28,6 +28,8 @@ export const quotaItemPhrasesMap: Record< ssoEnabled: 'sso_enabled.name', tenantMembersLimit: 'tenant_members_limit.name', customJwtEnabled: 'custom_jwt_enabled.name', + subjectTokenEnabled: 'impersonation_enabled.name', + bringYourUiEnabled: 'bring_your_ui_enabled.name', }; export const quotaItemUnlimitedPhrasesMap: Record< @@ -56,6 +58,8 @@ export const quotaItemUnlimitedPhrasesMap: Record< ssoEnabled: 'sso_enabled.unlimited', tenantMembersLimit: 'tenant_members_limit.unlimited', customJwtEnabled: 'custom_jwt_enabled.unlimited', + subjectTokenEnabled: 'impersonation_enabled.unlimited', + bringYourUiEnabled: 'bring_your_ui_enabled.unlimited', }; export const quotaItemLimitedPhrasesMap: Record< @@ -84,6 +88,8 @@ export const quotaItemLimitedPhrasesMap: Record< ssoEnabled: 'sso_enabled.limited', tenantMembersLimit: 'tenant_members_limit.limited', customJwtEnabled: 'custom_jwt_enabled.limited', + subjectTokenEnabled: 'impersonation_enabled.limited', + bringYourUiEnabled: 'bring_your_ui_enabled.limited', }; export const quotaItemNotEligiblePhrasesMap: Record< @@ -112,4 +118,6 @@ export const quotaItemNotEligiblePhrasesMap: Record< ssoEnabled: 'sso_enabled.not_eligible', tenantMembersLimit: 'tenant_members_limit.not_eligible', customJwtEnabled: 'custom_jwt_enabled.not_eligible', + subjectTokenEnabled: 'impersonation_enabled.not_eligible', + bringYourUiEnabled: 'bring_your_ui_enabled.not_eligible', }; diff --git a/packages/console/src/consts/tenants.ts b/packages/console/src/consts/tenants.ts index e3bfe16c8..05bc17173 100644 --- a/packages/console/src/consts/tenants.ts +++ b/packages/console/src/consts/tenants.ts @@ -71,6 +71,8 @@ export const defaultSubscriptionPlan: SubscriptionPlan = { thirdPartyApplicationsLimit: null, tenantMembersLimit: null, customJwtEnabled: true, + subjectTokenEnabled: true, + bringYourUiEnabled: true, }, }; diff --git a/packages/console/src/pages/TenantSettings/Subscription/PlanComparisonTable/index.tsx b/packages/console/src/pages/TenantSettings/Subscription/PlanComparisonTable/index.tsx index ab670ef5e..be8dfb770 100644 --- a/packages/console/src/pages/TenantSettings/Subscription/PlanComparisonTable/index.tsx +++ b/packages/console/src/pages/TenantSettings/Subscription/PlanComparisonTable/index.tsx @@ -85,6 +85,7 @@ function PlanComparisonTable() { // UI and branding const customDomain = t('branding.custom_domain'); const customCss = t('branding.custom_css'); + const bringYourUi = t('branding.bring_your_ui'); const appLogoAndFavicon = t('branding.logo_and_favicon'); const darkMode = t('branding.dark_mode'); const i18n = t('branding.i18n'); @@ -187,6 +188,7 @@ function PlanComparisonTable() { { name: appLogoAndFavicon, data: ['✓', '✓', '✓'] }, { name: darkMode, data: ['✓', '✓', '✓'] }, { name: i18n, data: ['✓', '✓', '✓'] }, + { name: bringYourUi, data: ['-', '✓', '✓'] }, ], }, { diff --git a/packages/phrases/src/locales/en/translation/admin-console/subscription/quota-item.ts b/packages/phrases/src/locales/en/translation/admin-console/subscription/quota-item.ts index d7d49de8d..340d31e14 100644 --- a/packages/phrases/src/locales/en/translation/admin-console/subscription/quota-item.ts +++ b/packages/phrases/src/locales/en/translation/admin-console/subscription/quota-item.ts @@ -159,6 +159,18 @@ const quota_item = { unlimited: 'Custom JWT', not_eligible: 'Remove your JWT claims customizer', }, + impersonation_enabled: { + name: 'Impersonation', + limited: 'Impersonation', + unlimited: 'Impersonation', + not_eligible: 'No impersonation allowed', + }, + bring_your_ui_enabled: { + name: 'Bring your UI', + limited: 'Bring your UI', + unlimited: 'Bring your UI', + not_eligible: 'Remove your custom UI assets', + }, }; export default Object.freeze(quota_item); diff --git a/packages/phrases/src/locales/en/translation/admin-console/subscription/quota-table.ts b/packages/phrases/src/locales/en/translation/admin-console/subscription/quota-table.ts index 0813277d1..b58127688 100644 --- a/packages/phrases/src/locales/en/translation/admin-console/subscription/quota-table.ts +++ b/packages/phrases/src/locales/en/translation/admin-console/subscription/quota-table.ts @@ -21,6 +21,7 @@ const quota_table = { custom_domain: 'Custom domain', custom_css: 'Custom CSS', logo_and_favicon: 'Logo and favicon', + bring_your_ui: 'Bring your UI', dark_mode: 'Dark mode', i18n: 'Internationalization', }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7e3f8cd94..5624de8d4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1372,8 +1372,8 @@ importers: version: 3.23.8 devDependencies: '@logto/cloud': - specifier: 0.2.5-a7eedce - version: 0.2.5-a7eedce(zod@3.23.8) + specifier: 0.2.5-3b703da + version: 0.2.5-3b703da(zod@3.23.8) '@rollup/plugin-commonjs': specifier: ^26.0.0 version: 26.0.1(rollup@4.12.0) @@ -2858,8 +2858,8 @@ importers: specifier: ^29.5.0 version: 29.5.0 '@logto/cloud': - specifier: 0.2.5-a7eedce - version: 0.2.5-a7eedce(zod@3.23.8) + specifier: 0.2.5-3b703da + version: 0.2.5-3b703da(zod@3.23.8) '@logto/connector-kit': specifier: workspace:^4.0.0 version: link:../toolkit/connector-kit @@ -5433,10 +5433,6 @@ packages: resolution: {integrity: sha512-VCevQnxP5910s/cDYAxoJRim9iH1yN/La0HAlOP6FhVGtZofYwTTfT9AQXC+dZScgydpcFWo4k/6MYOFRtZCLg==} engines: {node: ^20.9.0} - '@logto/cloud@0.2.5-a7eedce': - resolution: {integrity: sha512-FFjkGjqUgn9PCZnSuCODm2FcjqBm4JfPxfHCiXlOkUjeUhTJLrj7C0gjKzSQ/B6IaWri4EXN/meuqi5z/AMIPg==} - engines: {node: ^20.9.0} - '@logto/js@4.1.4': resolution: {integrity: sha512-6twud1nFBQmj89/aflzej6yD1QwXfPiYmRtyYuN4a7O9OaaW3X/kJBVwjKUn5NC9IUt+rd+jXsI3QJXENfaLAw==} @@ -15479,13 +15475,6 @@ snapshots: transitivePeerDependencies: - zod - '@logto/cloud@0.2.5-a7eedce(zod@3.23.8)': - dependencies: - '@silverhand/essentials': 2.9.1 - '@withtyped/server': 0.13.6(zod@3.23.8) - transitivePeerDependencies: - - zod - '@logto/js@4.1.4': dependencies: '@silverhand/essentials': 2.9.1