From 66adc7fbf97de197cad10728972828ce409c5a86 Mon Sep 17 00:00:00 2001 From: Vikrant Gupta Date: Wed, 5 Feb 2025 12:38:56 +0530 Subject: [PATCH] Revert "chore(licenses): update the license events and the state names (#7021)" (#7029) This reverts commit e414215786513924da73bf6ff1d19703594e6f84. --- ee/query-service/model/license.go | 2 +- ee/query-service/model/plans.go | 2 +- frontend/src/AppRoutes/Private.tsx | 2 +- frontend/src/container/AppLayout/index.tsx | 2 +- frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.tsx | 2 +- frontend/src/types/api/licensesV3/getActive.ts | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ee/query-service/model/license.go b/ee/query-service/model/license.go index d878eac8dd..b96f6737a3 100644 --- a/ee/query-service/model/license.go +++ b/ee/query-service/model/license.go @@ -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 == LicenseStatusInvalid { + if status == LicenseStatusInactive { planName = PlanNameBasic } diff --git a/ee/query-service/model/plans.go b/ee/query-service/model/plans.go index 6dbfa8ba56..cb9760180b 100644 --- a/ee/query-service/model/plans.go +++ b/ee/query-service/model/plans.go @@ -21,7 +21,7 @@ var ( ) var ( - LicenseStatusInvalid = "INVALID" + LicenseStatusInactive = "INACTIVE" ) const DisableUpsell = "DISABLE_UPSELL" diff --git a/frontend/src/AppRoutes/Private.tsx b/frontend/src/AppRoutes/Private.tsx index 87ad2bcc3a..162ca5de6b 100644 --- a/frontend/src/AppRoutes/Private.tsx +++ b/frontend/src/AppRoutes/Private.tsx @@ -156,7 +156,7 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element { const currentRoute = mapRoutes.get('current'); const shouldSuspendWorkspace = activeLicenseV3.status === LicenseStatus.SUSPENDED && - activeLicenseV3.state === LicenseState.DEFAULTED; + activeLicenseV3.state === LicenseState.PAYMENT_FAILED; if (shouldSuspendWorkspace && currentRoute) { navigateToWorkSpaceSuspended(currentRoute); diff --git a/frontend/src/container/AppLayout/index.tsx b/frontend/src/container/AppLayout/index.tsx index ab73a3fbb7..78f8fa1564 100644 --- a/frontend/src/container/AppLayout/index.tsx +++ b/frontend/src/container/AppLayout/index.tsx @@ -250,7 +250,7 @@ function AppLayout(props: AppLayoutProps): JSX.Element { if ( !isFetchingActiveLicenseV3 && !isNull(activeLicenseV3) && - activeLicenseV3?.event_queue?.event === LicenseEvent.DEFAULT + activeLicenseV3?.event_queue?.event === LicenseEvent.FAILED_PAYMENT ) { setShowPaymentFailedWarning(true); } diff --git a/frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.tsx b/frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.tsx index e4dd11dc0b..ed8894ffe7 100644 --- a/frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.tsx +++ b/frontend/src/pages/WorkspaceSuspended/WorkspaceSuspended.tsx @@ -61,7 +61,7 @@ function WorkspaceSuspended(): JSX.Element { if (!isFetchingActiveLicenseV3 && activeLicenseV3) { const shouldSuspendWorkspace = activeLicenseV3.status === LicenseStatus.SUSPENDED && - activeLicenseV3.state === LicenseState.DEFAULTED; + activeLicenseV3.state === LicenseState.PAYMENT_FAILED; if (!shouldSuspendWorkspace) { history.push(ROUTES.APPLICATION); diff --git a/frontend/src/types/api/licensesV3/getActive.ts b/frontend/src/types/api/licensesV3/getActive.ts index 5e89b2a75e..e12af475e9 100644 --- a/frontend/src/types/api/licensesV3/getActive.ts +++ b/frontend/src/types/api/licensesV3/getActive.ts @@ -1,6 +1,6 @@ export enum LicenseEvent { NO_EVENT = '', - DEFAULT = 'DEFAULT', + FAILED_PAYMENT = 'FAILED_PAYMENT', } export enum LicenseStatus { @@ -9,7 +9,7 @@ export enum LicenseStatus { } export enum LicenseState { - DEFAULTED = 'DEFAULTED', + PAYMENT_FAILED = 'PAYMENT_FAILED', ACTIVE = 'ACTIVE', }