diff --git a/packages/editor-ui/src/plugins/i18n/locales/en.json b/packages/editor-ui/src/plugins/i18n/locales/en.json index 4fdbc6ac8214f..6f19a7ce77d4a 100644 --- a/packages/editor-ui/src/plugins/i18n/locales/en.json +++ b/packages/editor-ui/src/plugins/i18n/locales/en.json @@ -116,8 +116,8 @@ "auth.signup.setupYourAccount": "Set up your account", "auth.signup.setupYourAccountError": "Problem setting up your account", "auth.signup.tokenValidationError": "Issue validating invite token", - "banners.confirmEmail.message.1": "You need access to your admin email inbox to make sure you can reach your admin dashboard. Please make sure that your admin email", - "banners.confirmEmail.message.2": "is accessible and confirmed.", + "banners.confirmEmail.message.1": "To secure your account and prevent future access issues, please confirm your", + "banners.confirmEmail.message.2": "email address.", "banners.confirmEmail.button": "Confirm email", "banners.confirmEmail.toast.success.heading": "Confirmation email sent", "banners.confirmEmail.toast.success.message": "Please check your inbox and click the confirmation link.", diff --git a/packages/editor-ui/src/stores/__tests__/ui.test.ts b/packages/editor-ui/src/stores/__tests__/ui.test.ts index 91365a36d999c..6177ce790e70a 100644 --- a/packages/editor-ui/src/stores/__tests__/ui.test.ts +++ b/packages/editor-ui/src/stores/__tests__/ui.test.ts @@ -10,6 +10,7 @@ import { getTrialExpiredUserResponse, getTrialingUserResponse, getUserCloudInfo, + getNotTrialingUserResponse, } from './utils/cloudStoreUtils'; let uiStore: ReturnType; @@ -128,6 +129,8 @@ describe('UI store', () => { expect(fetchCloudSpy).toHaveBeenCalled(); expect(fetchUserCloudAccountSpy).toHaveBeenCalled(); expect(uiStore.bannerStack).toContain('TRIAL'); + // There should be no email confirmation banner for trialing users + expect(uiStore.bannerStack).not.toContain('EMAIL_CONFIRMATION'); }); it('should add trial over banner to the the stack', async () => { @@ -143,12 +146,14 @@ describe('UI store', () => { expect(fetchCloudSpy).toHaveBeenCalled(); expect(fetchUserCloudAccountSpy).toHaveBeenCalled(); expect(uiStore.bannerStack).toContain('TRIAL_OVER'); + // There should be no email confirmation banner for trialing users + expect(uiStore.bannerStack).not.toContain('EMAIL_CONFIRMATION'); }); it('should add email confirmation banner to the the stack', async () => { const fetchCloudSpy = vi .spyOn(cloudPlanApi, 'getCurrentPlan') - .mockResolvedValue(getTrialExpiredUserResponse()); + .mockResolvedValue(getNotTrialingUserResponse()); const fetchUserCloudAccountSpy = vi .spyOn(cloudPlanApi, 'getCloudUserInfo') .mockResolvedValue(getUserCloudInfo(false)); @@ -157,7 +162,6 @@ describe('UI store', () => { await cloudPlanStore.fetchUserCloudAccount(); expect(fetchCloudSpy).toHaveBeenCalled(); expect(fetchUserCloudAccountSpy).toHaveBeenCalled(); - expect(uiStore.bannerStack).toContain('TRIAL_OVER'); expect(uiStore.bannerStack).toContain('EMAIL_CONFIRMATION'); }); }); diff --git a/packages/editor-ui/src/stores/__tests__/utils/cloudStoreUtils.ts b/packages/editor-ui/src/stores/__tests__/utils/cloudStoreUtils.ts index 448f4ba421ffd..35010b2898bbe 100644 --- a/packages/editor-ui/src/stores/__tests__/utils/cloudStoreUtils.ts +++ b/packages/editor-ui/src/stores/__tests__/utils/cloudStoreUtils.ts @@ -1,7 +1,7 @@ import type { Cloud } from '@/Interface'; // Mocks cloud plan API responses with different trial expiration dates -function getUserPlanData(trialExpirationDate: Date): Cloud.PlanData { +function getUserPlanData(trialExpirationDate: Date, isTrial = true): Cloud.PlanData { return { planId: 0, monthlyExecutionsLimit: 1000, @@ -10,7 +10,7 @@ function getUserPlanData(trialExpirationDate: Date): Cloud.PlanData { isActive: true, displayName: 'Trial', metadata: { - group: 'trial', + group: isTrial ? 'trial' : 'pro', slug: 'trial-1', trial: { gracePeriod: 3, @@ -42,3 +42,9 @@ export function getTrialExpiredUserResponse(): Cloud.PlanData { dateInThePast.setDate(dateInThePast.getDate() - 3); return getUserPlanData(dateInThePast); } + +export function getNotTrialingUserResponse(): Cloud.PlanData { + const inThreeDays = new Date(); + inThreeDays.setDate(inThreeDays.getDate() + 3); + return getUserPlanData(inThreeDays, false); +} diff --git a/packages/editor-ui/src/stores/cloudPlan.store.ts b/packages/editor-ui/src/stores/cloudPlan.store.ts index f6cdecdb39267..be47d8fcb2c2f 100644 --- a/packages/editor-ui/src/stores/cloudPlan.store.ts +++ b/packages/editor-ui/src/stores/cloudPlan.store.ts @@ -62,7 +62,7 @@ export const useCloudPlanStore = defineStore(STORES.CLOUD_PLAN, () => { try { if (useUsersStore().isInstanceOwner) { await usersStore.fetchUserCloudAccount(); - if (!usersStore.currentUserCloudInfo?.confirmed) { + if (!usersStore.currentUserCloudInfo?.confirmed && !userIsTrialing.value) { useUIStore().pushBannerToStack('EMAIL_CONFIRMATION'); } }