Skip to content

chore: indicate premium vs enterprise on license page #14008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: indicate premium vs enterprise on license page
Premium licenses should say "premium" instead of "enterprise"
  • Loading branch information
Emyrk committed Jul 24, 2024
commit 7d7688a7559059175f9b7f3b079946aa251d146f
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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"
Expand Down
31 changes: 31 additions & 0 deletions site/src/testHelpers/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2567,6 +2567,34 @@ export const MockWorkspaceAgentLogs: TypesGen.WorkspaceAgentLog[] = [
];

export const MockLicenseResponse: GetLicensesResponse[] = [
{
id: 2,
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: 3,
uploaded_at: "1660104000",
expires_at: "3420244800", // expires on 5/20/2078
uuid: "1",
claims: {
trial: false,
all_features: true,
feature_set: "enterprise",
version: 1,
features: {},
license_expires: 3420244800,
},
},
{
id: 1,
uploaded_at: "1660104000",
Expand All @@ -2575,6 +2603,7 @@ export const MockLicenseResponse: GetLicensesResponse[] = [
claims: {
trial: false,
all_features: true,
feature_set: "", // Legacy is empty
version: 1,
features: {},
license_expires: 3420244800,
Expand All @@ -2588,6 +2617,7 @@ export const MockLicenseResponse: GetLicensesResponse[] = [
claims: {
trial: false,
all_features: true,
feature_set: "", // Legacy is empty
version: 1,
features: {},
license_expires: 1660104000,
Expand All @@ -2601,6 +2631,7 @@ export const MockLicenseResponse: GetLicensesResponse[] = [
claims: {
trial: false,
all_features: true,
feature_set: "", // Legacy is empty
version: 1,
features: {},
license_expires: 1682346425,
Expand Down
Loading