Skip to content

Commit

Permalink
chore(licenses): update the license events and the state names (#7021)
Browse files Browse the repository at this point in the history
  • Loading branch information
vikrantgupta25 authored Feb 4, 2025
1 parent 5fe0407 commit e414215
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ee/query-service/model/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func NewLicenseV3(data map[string]interface{}) (*LicenseV3, error) {
return nil, err
}
// if license status is inactive then default it to basic
if status == LicenseStatusInactive {
if status == LicenseStatusInvalid {
planName = PlanNameBasic
}

Expand Down
2 changes: 1 addition & 1 deletion ee/query-service/model/plans.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var (
)

var (
LicenseStatusInactive = "INACTIVE"
LicenseStatusInvalid = "INVALID"
)

const DisableUpsell = "DISABLE_UPSELL"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/AppRoutes/Private.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
const currentRoute = mapRoutes.get('current');
const shouldSuspendWorkspace =
activeLicenseV3.status === LicenseStatus.SUSPENDED &&
activeLicenseV3.state === LicenseState.PAYMENT_FAILED;
activeLicenseV3.state === LicenseState.DEFAULTED;

if (shouldSuspendWorkspace && currentRoute) {
navigateToWorkSpaceSuspended(currentRoute);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/container/AppLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
if (
!isFetchingActiveLicenseV3 &&
!isNull(activeLicenseV3) &&
activeLicenseV3?.event_queue?.event === LicenseEvent.FAILED_PAYMENT
activeLicenseV3?.event_queue?.event === LicenseEvent.DEFAULT
) {
setShowPaymentFailedWarning(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function WorkspaceSuspended(): JSX.Element {
if (!isFetchingActiveLicenseV3 && activeLicenseV3) {
const shouldSuspendWorkspace =
activeLicenseV3.status === LicenseStatus.SUSPENDED &&
activeLicenseV3.state === LicenseState.PAYMENT_FAILED;
activeLicenseV3.state === LicenseState.DEFAULTED;

if (!shouldSuspendWorkspace) {
history.push(ROUTES.APPLICATION);
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/types/api/licensesV3/getActive.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export enum LicenseEvent {
NO_EVENT = '',
FAILED_PAYMENT = 'FAILED_PAYMENT',
DEFAULT = 'DEFAULT',
}

export enum LicenseStatus {
Expand All @@ -9,7 +9,7 @@ export enum LicenseStatus {
}

export enum LicenseState {
PAYMENT_FAILED = 'PAYMENT_FAILED',
DEFAULTED = 'DEFAULTED',
ACTIVE = 'ACTIVE',
}

Expand Down

0 comments on commit e414215

Please sign in to comment.