Browse Source

Adds GitKraken license type and default for status priority

main
Ramin Tadayon 1 year ago
parent
commit
5237c5696f
No known key found for this signature in database GPG Key ID: 79D60DDE3DFB95F5
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      src/plus/subscription/subscriptionService.ts

+ 13
- 1
src/plus/subscription/subscriptionService.ts View File

@ -1124,7 +1124,12 @@ type GKLicenseType =
| 'bundle-teams' | 'bundle-teams'
| 'bundle-hosted-enterprise' | 'bundle-hosted-enterprise'
| 'bundle-self-hosted-enterprise' | 'bundle-self-hosted-enterprise'
| 'bundle-standalone-enterprise';
| 'bundle-standalone-enterprise'
| 'gitkraken_v1-pro'
| 'gitkraken_v1-teams'
| 'gitkraken_v1-hosted-enterprise'
| 'gitkraken_v1-self-hosted-enterprise'
| 'gitkraken_v1-standalone-enterprise';
interface GKUser { interface GKUser {
readonly id: string; readonly id: string;
@ -1139,9 +1144,11 @@ function convertLicenseTypeToPlanId(licenseType: GKLicenseType): SubscriptionPla
switch (licenseType) { switch (licenseType) {
case 'gitlens-pro': case 'gitlens-pro':
case 'bundle-pro': case 'bundle-pro':
case 'gitkraken_v1-pro':
return SubscriptionPlanId.Pro; return SubscriptionPlanId.Pro;
case 'gitlens-teams': case 'gitlens-teams':
case 'bundle-teams': case 'bundle-teams':
case 'gitkraken_v1-teams':
return SubscriptionPlanId.Teams; return SubscriptionPlanId.Teams;
case 'gitlens-hosted-enterprise': case 'gitlens-hosted-enterprise':
case 'gitlens-self-hosted-enterprise': case 'gitlens-self-hosted-enterprise':
@ -1149,6 +1156,9 @@ function convertLicenseTypeToPlanId(licenseType: GKLicenseType): SubscriptionPla
case 'bundle-hosted-enterprise': case 'bundle-hosted-enterprise':
case 'bundle-self-hosted-enterprise': case 'bundle-self-hosted-enterprise':
case 'bundle-standalone-enterprise': case 'bundle-standalone-enterprise':
case 'gitkraken_v1-hosted-enterprise':
case 'gitkraken_v1-self-hosted-enterprise':
case 'gitkraken_v1-standalone-enterprise':
return SubscriptionPlanId.Enterprise; return SubscriptionPlanId.Enterprise;
default: default:
return SubscriptionPlanId.FreePlus; return SubscriptionPlanId.FreePlus;
@ -1181,5 +1191,7 @@ function licenseStatusPriority(status: GKLicense['latestStatus']): number {
case 'canceled': case 'canceled':
case 'non_renewing': case 'non_renewing':
return 0; return 0;
default:
return -200;
} }
} }

Loading…
Cancel
Save