Skip to content

Commit 53d8372

Browse files
Revert "Revert "chore(licenses): update the license events and the state name…"
This reverts commit 66adc7f.
1 parent c7c7b25 commit 53d8372

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

ee/query-service/model/license.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func NewLicenseV3(data map[string]interface{}) (*LicenseV3, error) {
140140
return nil, err
141141
}
142142
// if license status is inactive then default it to basic
143-
if status == LicenseStatusInactive {
143+
if status == LicenseStatusInvalid {
144144
planName = PlanNameBasic
145145
}
146146

ee/query-service/model/plans.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var (
2121
)
2222

2323
var (
24-
LicenseStatusInactive = "INACTIVE"
24+
LicenseStatusInvalid = "INVALID"
2525
)
2626

2727
const DisableUpsell = "DISABLE_UPSELL"

frontend/src/AppRoutes/Private.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
156156
const currentRoute = mapRoutes.get('current');
157157
const shouldSuspendWorkspace =
158158
activeLicenseV3.status === LicenseStatus.SUSPENDED &&
159-
activeLicenseV3.state === LicenseState.PAYMENT_FAILED;
159+
activeLicenseV3.state === LicenseState.DEFAULTED;
160160

161161
if (shouldSuspendWorkspace && currentRoute) {
162162
navigateToWorkSpaceSuspended(currentRoute);

frontend/src/container/AppLayout/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
250250
if (
251251
!isFetchingActiveLicenseV3 &&
252252
!isNull(activeLicenseV3) &&
253-
activeLicenseV3?.event_queue?.event === LicenseEvent.FAILED_PAYMENT
253+
activeLicenseV3?.event_queue?.event === LicenseEvent.DEFAULT
254254
) {
255255
setShowPaymentFailedWarning(true);
256256
}

frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function WorkspaceSuspended(): JSX.Element {
6161
if (!isFetchingActiveLicenseV3 && activeLicenseV3) {
6262
const shouldSuspendWorkspace =
6363
activeLicenseV3.status === LicenseStatus.SUSPENDED &&
64-
activeLicenseV3.state === LicenseState.PAYMENT_FAILED;
64+
activeLicenseV3.state === LicenseState.DEFAULTED;
6565

6666
if (!shouldSuspendWorkspace) {
6767
history.push(ROUTES.APPLICATION);

frontend/src/types/api/licensesV3/getActive.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export enum LicenseEvent {
22
NO_EVENT = '',
3-
FAILED_PAYMENT = 'FAILED_PAYMENT',
3+
DEFAULT = 'DEFAULT',
44
}
55

66
export enum LicenseStatus {
@@ -9,7 +9,7 @@ export enum LicenseStatus {
99
}
1010

1111
export enum LicenseState {
12-
PAYMENT_FAILED = 'PAYMENT_FAILED',
12+
DEFAULTED = 'DEFAULTED',
1313
ACTIVE = 'ACTIVE',
1414
}
1515

0 commit comments

Comments
 (0)