Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(console): should use SKU to filter tenant dropdown and add display of dev/admin plan #6509

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/console/src/components/SkuName/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions packages/console/src/types/subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
Enterprise = 'Enterprise',
}

// TODO: use `ReservedPlanId` in the future.

Check warning on line 13 in packages/console/src/types/subscriptions.ts

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/console/src/types/subscriptions.ts#L13

[no-warning-comments] Unexpected 'todo' comment: 'TODO: use `ReservedPlanId` in the...'.
export enum ReservedSkuId {
Free = 'free',
Pro = 'pro',
Development = 'dev',
Admin = 'admin',
Enterprise = 'enterprise',
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
'現在のプランはこちらです。プランの使用状況を簡単に確認したり、次回の請求を確認したり、必要に応じてプランを変更したりできます。',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
'현재 사용중인 요금제 정보입니다. 요금제 사용 내역을 쉽게 확인하고, 다가오는 청구서를 확인하며 필요에 따라 요금제를 변경할 수 있습니다.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
'Вот ваш текущий тарифный план. Вы можете легко просмотреть использование вашего тарифа, проверить предстоящий счет и вносить изменения в тариф по мере необходимости.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
'以下是您当前的计划。您可以轻松查看计划使用情况,检查即将到来的账单,并根据需要对计划进行更改。',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
'以下是您目前的計劃。您可以輕鬆查看計劃使用情況,檢查即將到來的帳單,並根據需要進行變更。',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
'這是您目前的方案。您可以輕鬆查看您的方案使用情況,檢查即將到來的帳單,並根據需要進行變更。',
Expand Down
Loading