5509 remove flash on intermediate verify step when sign in with sso (#5526)
- remove flash on /verify - remove flash on signInUp - remove useless redirections and hooks - Remove DefaultHomePage component - Move redirections to /objects/companies in PageChangeEffect - add useShowAuthModal hooks and tests - add usePageChangeEffectNaviteLocation hooks and tests - fix refresh token expired produces blank screen
This commit is contained in:
@ -9,6 +9,7 @@ describe('getOnboardingStatus', () => {
|
||||
isLoggedIn: false,
|
||||
currentWorkspaceMember: null,
|
||||
currentWorkspace: null,
|
||||
isBillingEnabled: false,
|
||||
});
|
||||
|
||||
const ongoingWorkspaceActivation = getOnboardingStatus({
|
||||
@ -18,6 +19,7 @@ describe('getOnboardingStatus', () => {
|
||||
id: '1',
|
||||
activationStatus: 'inactive',
|
||||
} as CurrentWorkspace,
|
||||
isBillingEnabled: false,
|
||||
});
|
||||
|
||||
const ongoingProfileCreation = getOnboardingStatus({
|
||||
@ -30,6 +32,7 @@ describe('getOnboardingStatus', () => {
|
||||
id: '1',
|
||||
activationStatus: 'active',
|
||||
} as CurrentWorkspace,
|
||||
isBillingEnabled: false,
|
||||
});
|
||||
|
||||
const completed = getOnboardingStatus({
|
||||
@ -45,6 +48,7 @@ describe('getOnboardingStatus', () => {
|
||||
id: '1',
|
||||
activationStatus: 'active',
|
||||
} as CurrentWorkspace,
|
||||
isBillingEnabled: false,
|
||||
});
|
||||
|
||||
const incomplete = getOnboardingStatus({
|
||||
@ -78,6 +82,7 @@ describe('getOnboardingStatus', () => {
|
||||
activationStatus: 'active',
|
||||
subscriptionStatus: 'incomplete',
|
||||
} as CurrentWorkspace,
|
||||
isBillingEnabled: false,
|
||||
});
|
||||
|
||||
const canceled = getOnboardingStatus({
|
||||
|
||||
@ -25,7 +25,7 @@ export const getOnboardingStatus = ({
|
||||
'createdAt' | 'updatedAt' | 'userId' | 'userEmail' | '__typename'
|
||||
> | null;
|
||||
currentWorkspace: CurrentWorkspace | null;
|
||||
isBillingEnabled?: boolean;
|
||||
isBillingEnabled: boolean;
|
||||
}) => {
|
||||
if (!isLoggedIn) {
|
||||
return OnboardingStatus.OngoingUserCreation;
|
||||
@ -38,7 +38,7 @@ export const getOnboardingStatus = ({
|
||||
}
|
||||
|
||||
if (
|
||||
isBillingEnabled === true &&
|
||||
isBillingEnabled &&
|
||||
currentWorkspace.subscriptionStatus === 'incomplete'
|
||||
) {
|
||||
return OnboardingStatus.Incomplete;
|
||||
@ -55,31 +55,19 @@ export const getOnboardingStatus = ({
|
||||
return OnboardingStatus.OngoingProfileCreation;
|
||||
}
|
||||
|
||||
if (
|
||||
isBillingEnabled === true &&
|
||||
currentWorkspace.subscriptionStatus === 'canceled'
|
||||
) {
|
||||
if (isBillingEnabled && currentWorkspace.subscriptionStatus === 'canceled') {
|
||||
return OnboardingStatus.Canceled;
|
||||
}
|
||||
|
||||
if (
|
||||
isBillingEnabled === true &&
|
||||
currentWorkspace.subscriptionStatus === 'past_due'
|
||||
) {
|
||||
if (isBillingEnabled && currentWorkspace.subscriptionStatus === 'past_due') {
|
||||
return OnboardingStatus.PastDue;
|
||||
}
|
||||
|
||||
if (
|
||||
isBillingEnabled === true &&
|
||||
currentWorkspace.subscriptionStatus === 'unpaid'
|
||||
) {
|
||||
if (isBillingEnabled && currentWorkspace.subscriptionStatus === 'unpaid') {
|
||||
return OnboardingStatus.Unpaid;
|
||||
}
|
||||
|
||||
if (
|
||||
isBillingEnabled === true &&
|
||||
!currentWorkspace.currentBillingSubscription
|
||||
) {
|
||||
if (isBillingEnabled && !currentWorkspace.currentBillingSubscription) {
|
||||
return OnboardingStatus.CompletedWithoutSubscription;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user