Skip to content

Commit 02f8f6c

Browse files
committed
Updates license status handling
Adds teams plan
1 parent cf5e1c2 commit 02f8f6c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/plus/subscription/subscriptionService.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,10 +896,12 @@ interface GKLicenseInfo {
896896

897897
type GKLicenseType =
898898
| 'gitlens-pro'
899+
| 'gitlens-teams'
899900
| 'gitlens-hosted-enterprise'
900901
| 'gitlens-self-hosted-enterprise'
901902
| 'gitlens-standalone-enterprise'
902903
| 'bundle-pro'
904+
| 'bundle-teams'
903905
| 'bundle-hosted-enterprise'
904906
| 'bundle-self-hosted-enterprise'
905907
| 'bundle-standalone-enterprise';
@@ -909,6 +911,9 @@ function convertLicenseTypeToPlanId(licenseType: GKLicenseType): SubscriptionPla
909911
case 'gitlens-pro':
910912
case 'bundle-pro':
911913
return SubscriptionPlanId.Pro;
914+
case 'gitlens-teams':
915+
case 'bundle-teams':
916+
return SubscriptionPlanId.Teams;
912917
case 'gitlens-hosted-enterprise':
913918
case 'gitlens-self-hosted-enterprise':
914919
case 'gitlens-standalone-enterprise':
@@ -926,16 +931,19 @@ function licenseStatusPriority(status: GKLicense['latestStatus']): number {
926931
case 'active':
927932
return 100;
928933
case 'expired':
934+
case 'cancelled':
929935
return -100;
936+
case 'in_trial':
930937
case 'trial':
931938
return 1;
932939
case 'canceled':
940+
case 'non_renewing':
933941
return 0;
934942
}
935943
}
936944

937945
interface GKLicense {
938-
latestStatus: 'active' | 'canceled' | 'expired' | 'trial';
946+
latestStatus: 'active' | 'canceled' | 'cancelled' | 'expired' | 'in_trial' | 'non_renewing' | 'trial';
939947
latestStartDate: string;
940948
latestEndDate: string;
941949
}

0 commit comments

Comments
 (0)