mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: indicate premium vs enterprise on license page (#14008)
* chore: indicate premium vs enterprise on license page Premium licenses should say "premium" instead of "enterprise"
This commit is contained in:
@@ -329,6 +329,7 @@ type Claims = {
|
||||
account_id?: string;
|
||||
trial: boolean;
|
||||
all_features: boolean;
|
||||
feature_set: string;
|
||||
version: number;
|
||||
features: Record<string, number>;
|
||||
require_telemetry?: boolean;
|
||||
|
||||
@@ -31,6 +31,12 @@ export const LicenseCard: FC<LicenseCardProps> = ({
|
||||
const currentUserLimit =
|
||||
license.claims.features["user_limit"] || userLimitLimit;
|
||||
|
||||
const licenseType = license.claims.trial
|
||||
? "Trial"
|
||||
: license.claims.feature_set.toLowerCase() === "premium"
|
||||
? "Premium"
|
||||
: "Enterprise";
|
||||
|
||||
return (
|
||||
<Paper
|
||||
key={license.id}
|
||||
@@ -64,7 +70,7 @@ export const LicenseCard: FC<LicenseCardProps> = ({
|
||||
>
|
||||
<span css={styles.licenseId}>#{license.id}</span>
|
||||
<span css={styles.accountType} className="account-type">
|
||||
{license.claims.trial ? "Trial" : "Enterprise"}
|
||||
{licenseType}
|
||||
</span>
|
||||
<Stack
|
||||
direction="row"
|
||||
|
||||
@@ -2619,6 +2619,35 @@ export const MockLicenseResponse: GetLicensesResponse[] = [
|
||||
claims: {
|
||||
trial: false,
|
||||
all_features: true,
|
||||
feature_set: "enterprise",
|
||||
version: 1,
|
||||
features: {},
|
||||
license_expires: 3420244800,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
uploaded_at: "1660104000",
|
||||
expires_at: "3420244800", // expires on 5/20/2078
|
||||
uuid: "1",
|
||||
claims: {
|
||||
trial: false,
|
||||
all_features: true,
|
||||
feature_set: "PREMIUM",
|
||||
version: 1,
|
||||
features: {},
|
||||
license_expires: 3420244800,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
uploaded_at: "1660104000",
|
||||
expires_at: "3420244800", // expires on 5/20/2078
|
||||
uuid: "1",
|
||||
claims: {
|
||||
trial: false,
|
||||
all_features: true,
|
||||
feature_set: "", // Legacy is empty
|
||||
version: 1,
|
||||
features: {},
|
||||
license_expires: 3420244800,
|
||||
@@ -2632,6 +2661,7 @@ export const MockLicenseResponse: GetLicensesResponse[] = [
|
||||
claims: {
|
||||
trial: false,
|
||||
all_features: true,
|
||||
feature_set: "", // Legacy is empty
|
||||
version: 1,
|
||||
features: {},
|
||||
license_expires: 1660104000,
|
||||
@@ -2645,6 +2675,7 @@ export const MockLicenseResponse: GetLicensesResponse[] = [
|
||||
claims: {
|
||||
trial: false,
|
||||
all_features: true,
|
||||
feature_set: "", // Legacy is empty
|
||||
version: 1,
|
||||
features: {},
|
||||
license_expires: 1682346425,
|
||||
|
||||
Reference in New Issue
Block a user