Skip to content

Commit 555ee27

Browse files
authored
Remove licensor component (#16983)
* Remove licensor component * Update docker version to v20.10.23
1 parent 62a359f commit 555ee27

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+19
-2654
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
/install/installer/pkg/components/ws-manager-bridge @gitpod-io/engineering-webapp
6262
/install/installer/pkg/components/ws-proxy @gitpod-io/engineering-workspace
6363
/install/installer/pkg/config/versions @gitpod-io/engineering-ide
64-
/components/licensor @gitpod-io/engineering-webapp
6564
/components/local-app-api @csweichel @akosyakov
6665
/components/local-app @gitpod-io/engineering-ide
6766
/components/openvsx-proxy @gitpod-io/engineering-ide

WORKSPACE.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ defaultArgs:
2222
jbBackendVersion: "latest"
2323
REPLICATED_API_TOKEN: ""
2424
REPLICATED_APP: ""
25-
dockerVersion: 20.10.17
25+
dockerVersion: 20.10.23
2626
dockerComposeVersion: "2.16.0-gitpod.0"
2727
provenance:
2828
enabled: true

codecov.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ flags:
4141
components-image-builder-app:
4242
paths:
4343
- components/image-builder/
44-
components-licensor-app:
45-
paths:
46-
- components/licensor/
4744
components-local-app-api-go-lib:
4845
paths:
4946
- components/local-app-api/go/

components/dashboard/src/admin/License.tsx

Lines changed: 6 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ export default function License() {
3333
// eslint-disable-next-line react-hooks/exhaustive-deps
3434
}, []);
3535

36-
const featureList = license?.enabledFeatures;
37-
const features = license?.features;
38-
39-
// if user seats is 0, it means that there is no user limit in the license
40-
const userLimit = license?.seats === 0 ? "Unlimited" : license?.seats;
36+
const userLimit = "Unlimited";
4137

4238
const [licenseLevel, paid, statusMessage] = license ? getSubscriptionLevel(license) : defaultMessage();
4339

@@ -49,20 +45,6 @@ export default function License() {
4945
<span>
5046
{licenseLevel}
5147
{paid}
52-
<div className="mt-4 font-semibold text-sm">Available features:</div>
53-
<div className="flex flex-col items-start text-sm">
54-
{features &&
55-
features.map((feat: string) => (
56-
<span className="inline-flex space-x-1">
57-
{featureList?.includes(feat) ? (
58-
<CheckSvg fill="currentColor" className="self-center mt-1" />
59-
) : (
60-
<XSvg fill="currentColor" className="self-center h-2 mt-1" />
61-
)}
62-
<span>{capitalizeInitials(feat)}</span>
63-
</span>
64-
))}
65-
</div>
6648
</span>
6749
</Card>
6850
<SolidCard className="w-72 h-64">
@@ -71,18 +53,6 @@ export default function License() {
7153
<p className="dark:text-gray-500 font-semibold">Registered Users</p>
7254
<span className="dark:text-gray-300 text-lg">{license?.userCount || 0}</span>
7355
<span className="dark:text-gray-500 text-gray-400 pt-1 text-lg"> / {userLimit} </span>
74-
<p className="dark:text-gray-500 pt-2 font-semibold">License Type</p>
75-
<h4 className="dark:text-gray-300 text-lg">{capitalizeInitials(license?.type || "")}</h4>
76-
<a
77-
className="gp-link flex flex-row mr-2 justify-end font-semibold space-x-2 mt-6"
78-
href="https://www.gitpod.io/self-hosted"
79-
target="_blank"
80-
>
81-
<span className="text-sm">Compare Plans</span>
82-
<div className="self-end">
83-
<LinkSvg />
84-
</div>
85-
</a>
8656
</span>
8757
</SolidCard>
8858
</div>
@@ -91,26 +61,8 @@ export default function License() {
9161
);
9262
}
9363

94-
function capitalizeInitials(str: string): string {
95-
return str
96-
.split("-")
97-
.map((item) => {
98-
return item.charAt(0).toUpperCase() + item.slice(1);
99-
})
100-
.join(" ");
101-
}
102-
10364
function getSubscriptionLevel(license: LicenseInfo): ReactElement[] {
104-
switch (license.plan) {
105-
case "prod":
106-
case "trial":
107-
return professionalPlan(license.userCount || 0, license.seats, license.plan == "trial", license.validUntil);
108-
case "community":
109-
return communityPlan(license.userCount || 0, license.seats, license.fallbackAllowed);
110-
default: {
111-
return defaultMessage();
112-
}
113-
}
65+
return professionalPlan(license.userCount || 0);
11466
}
11567

11668
function licenseLevel(level: string): ReactElement {
@@ -136,16 +88,9 @@ function defaultMessage(): ReactElement[] {
13688
return [licenseLevel("Inactive"), additionalLicenseInfo("Free"), alertMessage()];
13789
}
13890

139-
function professionalPlan(userCount: number, seats: number, trial: boolean, validUntil: string): ReactElement[] {
140-
const alertMessage = (aboveLimit: boolean) => {
141-
return aboveLimit ? (
142-
<span className="text-red-700 dark:text-red-400 flex font-semibold items-center">
143-
<div>You have exceeded the usage limit.</div>
144-
<div className="flex justify-right my-4 mr-2 ml-4">
145-
<Alert className="h-6 w-6" />
146-
</div>
147-
</span>
148-
) : (
91+
function professionalPlan(userCount: number): ReactElement[] {
92+
const alertMessage = () => {
93+
return (
14994
<span className="text-green-600 dark:text-green-400 flex font-semibold items-center">
15095
<div>You have an active professional license.</div>
15196
<div className="flex justify-right my-4 mr-2 ml-4">
@@ -155,56 +100,5 @@ function professionalPlan(userCount: number, seats: number, trial: boolean, vali
155100
);
156101
};
157102

158-
// seats === 0 means unlimited number of users
159-
const aboveLimit: boolean = seats === 0 ? false : userCount > seats;
160-
161-
const licenseTitle = () => {
162-
const expDate = new Date(validUntil);
163-
if (typeof expDate.getTime !== "function") {
164-
return trial ? additionalLicenseInfo("Trial") : additionalLicenseInfo("Paid");
165-
} else {
166-
return additionalLicenseInfo(
167-
"Expires on " +
168-
expDate.toLocaleDateString("en-DB", { year: "numeric", month: "short", day: "numeric" }),
169-
);
170-
}
171-
};
172-
173-
return [licenseLevel("Professional"), licenseTitle(), alertMessage(aboveLimit)];
174-
}
175-
176-
function communityPlan(userCount: number, seats: number, fallbackAllowed: boolean): ReactElement[] {
177-
const alertMessage = (aboveLimit: boolean) => {
178-
if (aboveLimit) {
179-
return fallbackAllowed ? (
180-
<div className="text-gray-600 dark:text-gray-50 flex font-semibold items-center">
181-
<div>No active license. You are using community edition.</div>
182-
<div className="my-4 mr-2 ml-4">
183-
<Success className="h-8 w-8" />
184-
</div>
185-
</div>
186-
) : (
187-
<span className="text-red-700 dark:text-red-400 flex font-semibold items-center">
188-
<div>No active license. You have exceeded the usage limit.</div>
189-
<div className="flex justify-right my-4 mr-2 ml-4">
190-
<Alert className="h-8 w-8" />
191-
</div>
192-
</span>
193-
);
194-
} else {
195-
return (
196-
<span className="text-green-600 dark:text-green-400 flex font-semibold items-center">
197-
<div>You are using the free community edition.</div>
198-
<div className="flex justify-right my-4 mr-2 ml-4">
199-
<Success fill="green" className="h-8 w-8" />
200-
</div>
201-
</span>
202-
);
203-
}
204-
};
205-
206-
// seats === 0 means unlimited number of users
207-
const aboveLimit: boolean = seats === 0 ? false : userCount > seats;
208-
209-
return [licenseLevel("Community"), additionalLicenseInfo("Free"), alertMessage(aboveLimit)];
103+
return [licenseLevel("Professional"), additionalLicenseInfo("Paid"), alertMessage()];
210104
}

components/gitpod-protocol/src/license-protocol.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,19 @@
77
export interface LicenseValidationResult {
88
valid: boolean;
99
msg?: string;
10-
issue?: LicenseIssue;
1110
}
1211

13-
export type LicenseIssue = "seats-exhausted";
14-
1512
export interface LicenseInfo {
16-
key: string;
17-
seats: number;
1813
userCount?: number;
19-
valid: boolean;
20-
validUntil: string;
21-
plan?: string;
22-
features?: string[];
23-
enabledFeatures?: string[];
24-
type?: string;
25-
errorMsg?: string;
26-
fallbackAllowed: boolean;
2714
}
2815

2916
export interface GetLicenseInfoResult {
3017
isAdmin: boolean;
3118
licenseInfo: LicenseInfo;
3219
}
3320

34-
export enum LicenseFeature {
35-
CreateSnapshot = "create-snapshot",
36-
// room for more
37-
}
38-
3921
export interface LicenseService {
4022
validateLicense(): Promise<LicenseValidationResult>;
4123
getLicenseInfo(): Promise<GetLicenseInfoResult>;
4224
adminGetLicense(): Promise<LicenseInfo>;
43-
licenseIncludesFeature(feature: LicenseFeature): Promise<boolean>;
4425
}

components/licensor/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

components/licensor/BUILD.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

components/licensor/ee/cmd/genkey.go

Lines changed: 0 additions & 69 deletions
This file was deleted.

components/licensor/ee/cmd/root.go

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)