Skip to content

Commit

Permalink
Adds GitKraken license type and default for status priority
Browse files Browse the repository at this point in the history
  • Loading branch information
axosoft-ramint authored and eamodio committed Oct 25, 2023
1 parent 7db0ad0 commit bd6dfc4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/plus/subscription/subscriptionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,12 @@ type GKLicenseType =
| 'bundle-teams'
| 'bundle-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 {
readonly id: string;
Expand All @@ -1139,16 +1144,21 @@ function convertLicenseTypeToPlanId(licenseType: GKLicenseType): SubscriptionPla
switch (licenseType) {
case 'gitlens-pro':
case 'bundle-pro':
case 'gitkraken_v1-pro':
return SubscriptionPlanId.Pro;
case 'gitlens-teams':
case 'bundle-teams':
case 'gitkraken_v1-teams':
return SubscriptionPlanId.Teams;
case 'gitlens-hosted-enterprise':
case 'gitlens-self-hosted-enterprise':
case 'gitlens-standalone-enterprise':
case 'bundle-hosted-enterprise':
case 'bundle-self-hosted-enterprise':
case 'bundle-standalone-enterprise':
case 'gitkraken_v1-hosted-enterprise':
case 'gitkraken_v1-self-hosted-enterprise':
case 'gitkraken_v1-standalone-enterprise':
return SubscriptionPlanId.Enterprise;
default:
return SubscriptionPlanId.FreePlus;
Expand Down Expand Up @@ -1181,5 +1191,7 @@ function licenseStatusPriority(status: GKLicense['latestStatus']): number {
case 'canceled':
case 'non_renewing':
return 0;
default:
return -200;
}
}

0 comments on commit bd6dfc4

Please sign in to comment.