From e56b7ca22afbe87bb4c8ace2939569f47c26c5e0 Mon Sep 17 00:00:00 2001 From: Darcy Ye Date: Fri, 23 Aug 2024 11:54:45 +0800 Subject: [PATCH] chore(console): should use SKU to filter tenant dropdown and add display of dev/admin plan --- packages/console/src/components/SkuName/index.tsx | 2 ++ .../Topbar/TenantSelector/TenantDropdownItem/index.tsx | 10 +++++----- packages/console/src/types/subscriptions.ts | 2 ++ .../de/translation/admin-console/subscription/index.ts | 4 ++++ .../en/translation/admin-console/subscription/index.ts | 2 ++ .../es/translation/admin-console/subscription/index.ts | 4 ++++ .../fr/translation/admin-console/subscription/index.ts | 4 ++++ .../it/translation/admin-console/subscription/index.ts | 4 ++++ .../ja/translation/admin-console/subscription/index.ts | 4 ++++ .../ko/translation/admin-console/subscription/index.ts | 4 ++++ .../translation/admin-console/subscription/index.ts | 4 ++++ .../translation/admin-console/subscription/index.ts | 4 ++++ .../translation/admin-console/subscription/index.ts | 4 ++++ .../ru/translation/admin-console/subscription/index.ts | 4 ++++ .../translation/admin-console/subscription/index.ts | 4 ++++ .../translation/admin-console/subscription/index.ts | 4 ++++ .../translation/admin-console/subscription/index.ts | 4 ++++ .../translation/admin-console/subscription/index.ts | 4 ++++ 18 files changed, 67 insertions(+), 5 deletions(-) diff --git a/packages/console/src/components/SkuName/index.tsx b/packages/console/src/components/SkuName/index.tsx index ee42940ceaa..b6a4532a7a8 100644 --- a/packages/console/src/components/SkuName/index.tsx +++ b/packages/console/src/components/SkuName/index.tsx @@ -10,6 +10,8 @@ const registeredSkuIdNamePhraseMap: Record< quotaKey: undefined, [ReservedSkuId.Free]: 'free_plan', [ReservedSkuId.Pro]: 'pro_plan', + [ReservedSkuId.Development]: 'dev_plan', + [ReservedSkuId.Admin]: 'admin_plan', [ReservedSkuId.Enterprise]: 'enterprise', }; diff --git a/packages/console/src/components/Topbar/TenantSelector/TenantDropdownItem/index.tsx b/packages/console/src/components/Topbar/TenantSelector/TenantDropdownItem/index.tsx index 4a638f591aa..c697bec6465 100644 --- a/packages/console/src/components/Topbar/TenantSelector/TenantDropdownItem/index.tsx +++ b/packages/console/src/components/Topbar/TenantSelector/TenantDropdownItem/index.tsx @@ -26,13 +26,13 @@ function TenantDropdownItem({ tenantData, isSelected, onClick }: Props) { subscription: { planId }, } = tenantData; - const { subscriptionPlans } = useContext(SubscriptionDataContext); - const tenantSubscriptionPlan = useMemo( - () => subscriptionPlans.find((plan) => plan.id === planId), - [subscriptionPlans, planId] + const { logtoSkus } = useContext(SubscriptionDataContext); + const tenantSubscriptionSku = useMemo( + () => logtoSkus.find(({ id }) => id === planId), + [logtoSkus, planId] ); - if (!tenantSubscriptionPlan) { + if (!tenantSubscriptionSku) { return null; } diff --git a/packages/console/src/types/subscriptions.ts b/packages/console/src/types/subscriptions.ts index cd29eb72450..2d4b370ba5d 100644 --- a/packages/console/src/types/subscriptions.ts +++ b/packages/console/src/types/subscriptions.ts @@ -14,6 +14,8 @@ export enum ReservedPlanName { export enum ReservedSkuId { Free = 'free', Pro = 'pro', + Development = 'dev', + Admin = 'admin', Enterprise = 'enterprise', } diff --git a/packages/phrases/src/locales/de/translation/admin-console/subscription/index.ts b/packages/phrases/src/locales/de/translation/admin-console/subscription/index.ts index facaa5a9842..5050e91a0be 100644 --- a/packages/phrases/src/locales/de/translation/admin-console/subscription/index.ts +++ b/packages/phrases/src/locales/de/translation/admin-console/subscription/index.ts @@ -7,6 +7,10 @@ const subscription = { pro_plan: 'Pro plan', pro_plan_description: 'Für Unternehmen, die sorgenfrei von Logto profitieren möchten.', enterprise: 'Unternehmen', + /** UNTRANSLATED */ + admin_plan: 'Admin plan', + /** UNTRANSLATED */ + dev_plan: 'Development plan', current_plan: 'Aktueller Plan', current_plan_description: 'Hier ist dein aktueller Tarif. Du kannst einfach deinen Tarifverbrauch einsehen, deine anstehende Rechnung überprüfen und bei Bedarf Änderungen an deinem Tarif vornehmen.', diff --git a/packages/phrases/src/locales/en/translation/admin-console/subscription/index.ts b/packages/phrases/src/locales/en/translation/admin-console/subscription/index.ts index ddb54473b64..84d95b94027 100644 --- a/packages/phrases/src/locales/en/translation/admin-console/subscription/index.ts +++ b/packages/phrases/src/locales/en/translation/admin-console/subscription/index.ts @@ -8,6 +8,8 @@ const subscription = { pro_plan: 'Pro plan', pro_plan_description: 'For businesses benefit worry-free with Logto.', enterprise: 'Enterprise', + admin_plan: 'Admin plan', + dev_plan: 'Development plan', current_plan: 'Current plan', current_plan_description: 'Here’s your current plan. You can easily see your plan usage, check your upcoming bill, and make changes to your plan as needed.', diff --git a/packages/phrases/src/locales/es/translation/admin-console/subscription/index.ts b/packages/phrases/src/locales/es/translation/admin-console/subscription/index.ts index 0453fbe07d2..987be9e7b0f 100644 --- a/packages/phrases/src/locales/es/translation/admin-console/subscription/index.ts +++ b/packages/phrases/src/locales/es/translation/admin-console/subscription/index.ts @@ -8,6 +8,10 @@ const subscription = { pro_plan: 'Plan Pro', pro_plan_description: 'Benefíciese sin preocupaciones con Logto para empresas.', enterprise: 'Empresa', + /** UNTRANSLATED */ + admin_plan: 'Admin plan', + /** UNTRANSLATED */ + dev_plan: 'Development plan', current_plan: 'Plan Actual', current_plan_description: 'Aquí está tu plan actual. Puedes ver fácilmente el uso de tu plan, revisar tu próxima factura y hacer cambios en tu plan según sea necesario.', diff --git a/packages/phrases/src/locales/fr/translation/admin-console/subscription/index.ts b/packages/phrases/src/locales/fr/translation/admin-console/subscription/index.ts index 20f16625b0d..79338d7a022 100644 --- a/packages/phrases/src/locales/fr/translation/admin-console/subscription/index.ts +++ b/packages/phrases/src/locales/fr/translation/admin-console/subscription/index.ts @@ -8,6 +8,10 @@ const subscription = { pro_plan: 'Plan Professionnel', pro_plan_description: 'Pour les entreprises qui bénéficient de Logto sans soucis.', enterprise: 'Entreprise', + /** UNTRANSLATED */ + admin_plan: 'Admin plan', + /** UNTRANSLATED */ + dev_plan: 'Development plan', current_plan: 'Plan Actuel', current_plan_description: "Voici votre plan actuel. Vous pouvez facilement consulter l'utilisation de votre plan, vérifier votre prochaine facture et apporter des modifications à votre plan si nécessaire.", diff --git a/packages/phrases/src/locales/it/translation/admin-console/subscription/index.ts b/packages/phrases/src/locales/it/translation/admin-console/subscription/index.ts index bf447e16d99..6d9116bad60 100644 --- a/packages/phrases/src/locales/it/translation/admin-console/subscription/index.ts +++ b/packages/phrases/src/locales/it/translation/admin-console/subscription/index.ts @@ -8,6 +8,10 @@ const subscription = { pro_plan: 'Piano Pro', pro_plan_description: 'Per aziende che beneficiano di Logto senza preoccupazioni.', enterprise: 'Azienda', + /** UNTRANSLATED */ + admin_plan: 'Admin plan', + /** UNTRANSLATED */ + dev_plan: 'Development plan', current_plan: 'Piano attuale', current_plan_description: "Ecco il tuo piano attuale. Puoi facilmente visualizzare l'utilizzo del tuo piano, controllare la tua prossima fattura e apportare modifiche al piano, se necessario.", diff --git a/packages/phrases/src/locales/ja/translation/admin-console/subscription/index.ts b/packages/phrases/src/locales/ja/translation/admin-console/subscription/index.ts index b1539193023..7821ef9f367 100644 --- a/packages/phrases/src/locales/ja/translation/admin-console/subscription/index.ts +++ b/packages/phrases/src/locales/ja/translation/admin-console/subscription/index.ts @@ -8,6 +8,10 @@ const subscription = { pro_plan: 'プロプラン', pro_plan_description: 'ビジネスが安心してLogtoを利用できるプランです。', enterprise: 'エンタープライズ', + /** UNTRANSLATED */ + admin_plan: 'Admin plan', + /** UNTRANSLATED */ + dev_plan: 'Development plan', current_plan: '現在のプラン', current_plan_description: '現在のプランはこちらです。プランの使用状況を簡単に確認したり、次回の請求を確認したり、必要に応じてプランを変更したりできます。', diff --git a/packages/phrases/src/locales/ko/translation/admin-console/subscription/index.ts b/packages/phrases/src/locales/ko/translation/admin-console/subscription/index.ts index 34eae9b41b3..2313f18e302 100644 --- a/packages/phrases/src/locales/ko/translation/admin-console/subscription/index.ts +++ b/packages/phrases/src/locales/ko/translation/admin-console/subscription/index.ts @@ -7,6 +7,10 @@ const subscription = { pro_plan: '프로 요금제', pro_plan_description: 'Logto와 함께 걱정 없이 비즈니스 혜택을 받으세요.', enterprise: '기업용', + /** UNTRANSLATED */ + admin_plan: 'Admin plan', + /** UNTRANSLATED */ + dev_plan: 'Development plan', current_plan: '현재 요금제', current_plan_description: '현재 사용중인 요금제 정보입니다. 요금제 사용 내역을 쉽게 확인하고, 다가오는 청구서를 확인하며 필요에 따라 요금제를 변경할 수 있습니다.', diff --git a/packages/phrases/src/locales/pl-pl/translation/admin-console/subscription/index.ts b/packages/phrases/src/locales/pl-pl/translation/admin-console/subscription/index.ts index dc267af3d73..00fea6ebe67 100644 --- a/packages/phrases/src/locales/pl-pl/translation/admin-console/subscription/index.ts +++ b/packages/phrases/src/locales/pl-pl/translation/admin-console/subscription/index.ts @@ -8,6 +8,10 @@ const subscription = { pro_plan: 'Plan Pro', pro_plan_description: 'Dla firm, ciesz się bezstresową obsługą Logto.', enterprise: 'Przedsiębiorstwo', + /** UNTRANSLATED */ + admin_plan: 'Admin plan', + /** UNTRANSLATED */ + dev_plan: 'Development plan', current_plan: 'Obecny plan', current_plan_description: 'Oto Twój obecny plan. Łatwo możesz sprawdzić wykorzystanie swojego planu, sprawdzić nadchodzący rachunek i dokonać zmian w planie, jeśli jest to konieczne.', diff --git a/packages/phrases/src/locales/pt-br/translation/admin-console/subscription/index.ts b/packages/phrases/src/locales/pt-br/translation/admin-console/subscription/index.ts index d6a3ce15346..9ace00cbfb6 100644 --- a/packages/phrases/src/locales/pt-br/translation/admin-console/subscription/index.ts +++ b/packages/phrases/src/locales/pt-br/translation/admin-console/subscription/index.ts @@ -8,6 +8,10 @@ const subscription = { pro_plan: 'Plano Pro', pro_plan_description: 'Para empresas se beneficiarem tranquilo com o Logto.', enterprise: 'Empresa', + /** UNTRANSLATED */ + admin_plan: 'Admin plan', + /** UNTRANSLATED */ + dev_plan: 'Development plan', current_plan: 'Plano Atual', current_plan_description: 'Aqui está o seu plano atual. Você pode facilmente ver o uso do seu plano, verificar a sua próxima fatura e fazer alterações no plano, conforme necessário.', diff --git a/packages/phrases/src/locales/pt-pt/translation/admin-console/subscription/index.ts b/packages/phrases/src/locales/pt-pt/translation/admin-console/subscription/index.ts index efd38993f01..b62f1ca388b 100644 --- a/packages/phrases/src/locales/pt-pt/translation/admin-console/subscription/index.ts +++ b/packages/phrases/src/locales/pt-pt/translation/admin-console/subscription/index.ts @@ -8,6 +8,10 @@ const subscription = { pro_plan: 'Plano Pro', pro_plan_description: 'Para empresas que desejam se beneficiar sem preocupações com o Logto.', enterprise: 'Empresa', + /** UNTRANSLATED */ + admin_plan: 'Admin plan', + /** UNTRANSLATED */ + dev_plan: 'Development plan', current_plan: 'Plano Atual', current_plan_description: 'Aqui está o seu plano atual. Pode facilmente verificar a utilização do seu plano, verificar a sua próxima fatura e efetuar alterações no seu plano, conforme necessário.', diff --git a/packages/phrases/src/locales/ru/translation/admin-console/subscription/index.ts b/packages/phrases/src/locales/ru/translation/admin-console/subscription/index.ts index 35a22cb1226..8120b0a7cb7 100644 --- a/packages/phrases/src/locales/ru/translation/admin-console/subscription/index.ts +++ b/packages/phrases/src/locales/ru/translation/admin-console/subscription/index.ts @@ -7,6 +7,10 @@ const subscription = { pro_plan: 'Про план', pro_plan_description: 'Позволяет бизнесу использовать Logto без забот.', enterprise: 'Enterprise', + /** UNTRANSLATED */ + admin_plan: 'Admin plan', + /** UNTRANSLATED */ + dev_plan: 'Development plan', current_plan: 'Текущий план', current_plan_description: 'Вот ваш текущий тарифный план. Вы можете легко просмотреть использование вашего тарифа, проверить предстоящий счет и вносить изменения в тариф по мере необходимости.', diff --git a/packages/phrases/src/locales/tr-tr/translation/admin-console/subscription/index.ts b/packages/phrases/src/locales/tr-tr/translation/admin-console/subscription/index.ts index 6c9a87ce9d6..4444a679114 100644 --- a/packages/phrases/src/locales/tr-tr/translation/admin-console/subscription/index.ts +++ b/packages/phrases/src/locales/tr-tr/translation/admin-console/subscription/index.ts @@ -8,6 +8,10 @@ const subscription = { pro_plan: 'Pro plan', pro_plan_description: "Endişesiz bir şekilde Logto'dan faydalanan işletmeler için.", enterprise: 'Kurumsal', + /** UNTRANSLATED */ + admin_plan: 'Admin plan', + /** UNTRANSLATED */ + dev_plan: 'Development plan', current_plan: 'Mevcut Plan', current_plan_description: 'İşte mevcut planınız. Plan kullanımınızı kolayca görebilir, önümüzdeki faturanızı kontrol edebilir ve ihtiyaç duydukça planınızda değişiklikler yapabilirsiniz.', diff --git a/packages/phrases/src/locales/zh-cn/translation/admin-console/subscription/index.ts b/packages/phrases/src/locales/zh-cn/translation/admin-console/subscription/index.ts index 9e75ca00fc5..a51a377236b 100644 --- a/packages/phrases/src/locales/zh-cn/translation/admin-console/subscription/index.ts +++ b/packages/phrases/src/locales/zh-cn/translation/admin-console/subscription/index.ts @@ -7,6 +7,10 @@ const subscription = { pro_plan: '专业计划', pro_plan_description: '适用于企业付费无忧。', enterprise: '企业', + /** UNTRANSLATED */ + admin_plan: 'Admin plan', + /** UNTRANSLATED */ + dev_plan: 'Development plan', current_plan: '当前计划', current_plan_description: '以下是您当前的计划。您可以轻松查看计划使用情况,检查即将到来的账单,并根据需要对计划进行更改。', diff --git a/packages/phrases/src/locales/zh-hk/translation/admin-console/subscription/index.ts b/packages/phrases/src/locales/zh-hk/translation/admin-console/subscription/index.ts index a69dfa32353..6a59c5e9ba6 100644 --- a/packages/phrases/src/locales/zh-hk/translation/admin-console/subscription/index.ts +++ b/packages/phrases/src/locales/zh-hk/translation/admin-console/subscription/index.ts @@ -7,6 +7,10 @@ const subscription = { pro_plan: '專業計劃', pro_plan_description: '供企業放心使用Logto。', enterprise: '企業', + /** UNTRANSLATED */ + admin_plan: 'Admin plan', + /** UNTRANSLATED */ + dev_plan: 'Development plan', current_plan: '當前計劃', current_plan_description: '以下是您目前的計劃。您可以輕鬆查看計劃使用情況,檢查即將到來的帳單,並根據需要進行變更。', diff --git a/packages/phrases/src/locales/zh-tw/translation/admin-console/subscription/index.ts b/packages/phrases/src/locales/zh-tw/translation/admin-console/subscription/index.ts index 8dd721f8656..d912ea3aa47 100644 --- a/packages/phrases/src/locales/zh-tw/translation/admin-console/subscription/index.ts +++ b/packages/phrases/src/locales/zh-tw/translation/admin-console/subscription/index.ts @@ -7,6 +7,10 @@ const subscription = { pro_plan: '專業方案', pro_plan_description: '企業無憂享受 Logto 服務。', enterprise: '企業版', + /** UNTRANSLATED */ + admin_plan: 'Admin plan', + /** UNTRANSLATED */ + dev_plan: 'Development plan', current_plan: '當前方案', current_plan_description: '這是您目前的方案。您可以輕鬆查看您的方案使用情況,檢查即將到來的帳單,並根據需要進行變更。',