mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 15:19:00 +08:00
task(licenses): update the license events and the state names (#7034)
* Revert "Revert "chore(licenses): update the license events and the state name…" This reverts commit 66adc7fbf97de197cad10728972828ce409c5a86. * chore(license): fix comment
This commit is contained in:
parent
c7c7b25651
commit
2b32ce190f
@ -139,8 +139,8 @@ func NewLicenseV3(data map[string]interface{}) (*LicenseV3, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
// if license status is inactive then default it to basic
|
// if license status is invalid then default it to basic
|
||||||
if status == LicenseStatusInactive {
|
if status == LicenseStatusInvalid {
|
||||||
planName = PlanNameBasic
|
planName = PlanNameBasic
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
LicenseStatusInactive = "INACTIVE"
|
LicenseStatusInvalid = "INVALID"
|
||||||
)
|
)
|
||||||
|
|
||||||
const DisableUpsell = "DISABLE_UPSELL"
|
const DisableUpsell = "DISABLE_UPSELL"
|
||||||
|
@ -156,7 +156,7 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
|
|||||||
const currentRoute = mapRoutes.get('current');
|
const currentRoute = mapRoutes.get('current');
|
||||||
const shouldSuspendWorkspace =
|
const shouldSuspendWorkspace =
|
||||||
activeLicenseV3.status === LicenseStatus.SUSPENDED &&
|
activeLicenseV3.status === LicenseStatus.SUSPENDED &&
|
||||||
activeLicenseV3.state === LicenseState.PAYMENT_FAILED;
|
activeLicenseV3.state === LicenseState.DEFAULTED;
|
||||||
|
|
||||||
if (shouldSuspendWorkspace && currentRoute) {
|
if (shouldSuspendWorkspace && currentRoute) {
|
||||||
navigateToWorkSpaceSuspended(currentRoute);
|
navigateToWorkSpaceSuspended(currentRoute);
|
||||||
|
@ -250,7 +250,7 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
|
|||||||
if (
|
if (
|
||||||
!isFetchingActiveLicenseV3 &&
|
!isFetchingActiveLicenseV3 &&
|
||||||
!isNull(activeLicenseV3) &&
|
!isNull(activeLicenseV3) &&
|
||||||
activeLicenseV3?.event_queue?.event === LicenseEvent.FAILED_PAYMENT
|
activeLicenseV3?.event_queue?.event === LicenseEvent.DEFAULT
|
||||||
) {
|
) {
|
||||||
setShowPaymentFailedWarning(true);
|
setShowPaymentFailedWarning(true);
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ function WorkspaceSuspended(): JSX.Element {
|
|||||||
if (!isFetchingActiveLicenseV3 && activeLicenseV3) {
|
if (!isFetchingActiveLicenseV3 && activeLicenseV3) {
|
||||||
const shouldSuspendWorkspace =
|
const shouldSuspendWorkspace =
|
||||||
activeLicenseV3.status === LicenseStatus.SUSPENDED &&
|
activeLicenseV3.status === LicenseStatus.SUSPENDED &&
|
||||||
activeLicenseV3.state === LicenseState.PAYMENT_FAILED;
|
activeLicenseV3.state === LicenseState.DEFAULTED;
|
||||||
|
|
||||||
if (!shouldSuspendWorkspace) {
|
if (!shouldSuspendWorkspace) {
|
||||||
history.push(ROUTES.APPLICATION);
|
history.push(ROUTES.APPLICATION);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
export enum LicenseEvent {
|
export enum LicenseEvent {
|
||||||
NO_EVENT = '',
|
NO_EVENT = '',
|
||||||
FAILED_PAYMENT = 'FAILED_PAYMENT',
|
DEFAULT = 'DEFAULT',
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum LicenseStatus {
|
export enum LicenseStatus {
|
||||||
@ -9,7 +9,7 @@ export enum LicenseStatus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export enum LicenseState {
|
export enum LicenseState {
|
||||||
PAYMENT_FAILED = 'PAYMENT_FAILED',
|
DEFAULTED = 'DEFAULTED',
|
||||||
ACTIVE = 'ACTIVE',
|
ACTIVE = 'ACTIVE',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user