Skip to content

Commit c082868

Browse files
authored
chore: indicate premium vs enterprise on license page (coder#14008)
* chore: indicate premium vs enterprise on license page Premium licenses should say "premium" instead of "enterprise"
1 parent 9f3c1c7 commit c082868

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

site/src/api/api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ type Claims = {
329329
account_id?: string;
330330
trial: boolean;
331331
all_features: boolean;
332+
feature_set: string;
332333
version: number;
333334
features: Record<string, number>;
334335
require_telemetry?: boolean;

site/src/pages/DeploySettingsPage/LicensesSettingsPage/LicenseCard.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ export const LicenseCard: FC<LicenseCardProps> = ({
3131
const currentUserLimit =
3232
license.claims.features["user_limit"] || userLimitLimit;
3333

34+
const licenseType = license.claims.trial
35+
? "Trial"
36+
: license.claims.feature_set.toLowerCase() === "premium"
37+
? "Premium"
38+
: "Enterprise";
39+
3440
return (
3541
<Paper
3642
key={license.id}
@@ -64,7 +70,7 @@ export const LicenseCard: FC<LicenseCardProps> = ({
6470
>
6571
<span css={styles.licenseId}>#{license.id}</span>
6672
<span css={styles.accountType} className="account-type">
67-
{license.claims.trial ? "Trial" : "Enterprise"}
73+
{licenseType}
6874
</span>
6975
<Stack
7076
direction="row"

site/src/testHelpers/entities.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2619,6 +2619,35 @@ export const MockLicenseResponse: GetLicensesResponse[] = [
26192619
claims: {
26202620
trial: false,
26212621
all_features: true,
2622+
feature_set: "enterprise",
2623+
version: 1,
2624+
features: {},
2625+
license_expires: 3420244800,
2626+
},
2627+
},
2628+
{
2629+
id: 1,
2630+
uploaded_at: "1660104000",
2631+
expires_at: "3420244800", // expires on 5/20/2078
2632+
uuid: "1",
2633+
claims: {
2634+
trial: false,
2635+
all_features: true,
2636+
feature_set: "PREMIUM",
2637+
version: 1,
2638+
features: {},
2639+
license_expires: 3420244800,
2640+
},
2641+
},
2642+
{
2643+
id: 1,
2644+
uploaded_at: "1660104000",
2645+
expires_at: "3420244800", // expires on 5/20/2078
2646+
uuid: "1",
2647+
claims: {
2648+
trial: false,
2649+
all_features: true,
2650+
feature_set: "", // Legacy is empty
26222651
version: 1,
26232652
features: {},
26242653
license_expires: 3420244800,
@@ -2632,6 +2661,7 @@ export const MockLicenseResponse: GetLicensesResponse[] = [
26322661
claims: {
26332662
trial: false,
26342663
all_features: true,
2664+
feature_set: "", // Legacy is empty
26352665
version: 1,
26362666
features: {},
26372667
license_expires: 1660104000,
@@ -2645,6 +2675,7 @@ export const MockLicenseResponse: GetLicensesResponse[] = [
26452675
claims: {
26462676
trial: false,
26472677
all_features: true,
2678+
feature_set: "", // Legacy is empty
26482679
version: 1,
26492680
features: {},
26502681
license_expires: 1682346425,

0 commit comments

Comments
 (0)