Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Rewrite AwaitingConfirmationPage page #30514

Closed
wants to merge 8 commits into from
5 changes: 5 additions & 0 deletions .changeset/tiny-insects-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/meteor": patch
---

refactor: Rewrite `AwaitingConfirmationPage` page
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ const SetupWizardProvider = ({ children }: { children: ReactElement }): ReactEle
saveWorkspaceData,
saveOrganizationData,
completeSetupWizard,
maxSteps: data.serverAlreadyRegistered ? 2 : 3,
maxSteps: data.serverAlreadyRegistered ? 2 : 4,
}),
[
setupWizardData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const setIntervalTime = (interval?: number): number => (interval ? interval * 10
const CloudAccountConfirmation = (): ReactElement => {
const {
registerServer,
currentStep,
maxSteps,
goToStep,
setupWizardData: { registrationData },
saveWorkspaceData,
Expand Down Expand Up @@ -43,6 +45,8 @@ const CloudAccountConfirmation = (): ReactElement => {

return (
<AwaitingConfirmationPage
currentStep={currentStep}
stepCount={maxSteps}
emailAddress={registrationData.cloudEmail}
securityCode={registrationData.user_code}
onResendEmailRequest={(): Promise<void> => registerServer({ email: registrationData.cloudEmail, resend: true })}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const SERVER_OPTIONS = {
};

const RegisterServerStep = (): ReactElement => {
const { goToPreviousStep, currentStep, setSetupWizardData, registerServer, maxSteps, offline, completeSetupWizard } =
const { goToPreviousStep, currentStep, goToNextStep, setSetupWizardData, registerServer, maxSteps, offline, completeSetupWizard } =
useSetupWizardContext();
const [serverOption, setServerOption] = useState(SERVER_OPTIONS.REGISTERED);

Expand All @@ -24,6 +24,7 @@ const RegisterServerStep = (): ReactElement => {

const handleRegister: ComponentProps<typeof RegisterServerPage>['onSubmit'] = async (data) => {
if (data.registerType !== 'standalone') {
goToNextStep();
setSetupWizardData((prevState) => ({ ...prevState, serverData: data }));
await registerServer(data);
}
Expand Down
7 changes: 4 additions & 3 deletions apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -5860,10 +5860,8 @@
"onboarding.component.form.action.registerNow": "Register now",
"onboarding.component.form.action.confirm": "Confirm",
"onboarding.component.form.termsAndConditions": "I agree with <1>Terms and Conditions</1> and <3>Privacy Policy</3>",
"onboarding.component.emailCodeFallback": "Didn’t receive email? <1>Resend</1> or <3>Change email</3>",
"onboarding.component.emailCodeFallback": "Didn’t receive email? <1>Resend</1> or <3>Change email</3>.",
"onboarding.page.form.title": "Let's launch your workspace",
"onboarding.page.awaitingConfirmation.title": "Awaiting confirmation",
"onboarding.page.awaitingConfirmation.subtitle": "We have sent you an email to {{emailAddress}} with a confirmation link. Please verify that the security code below matches the one in the email.",
"onboarding.page.emailConfirmed.title": "Email Confirmed!",
"onboarding.page.emailConfirmed.subtitle": "You can return to your Rocket.Chat application – we have launched your workspace already.",
"onboarding.page.checkYourEmail.title": "Check your email",
Expand Down Expand Up @@ -5899,6 +5897,9 @@
"onboarding.form.adminInfoForm.fields.password.label": "Password",
"onboarding.form.adminInfoForm.fields.password.placeholder": "Create password",
"onboarding.form.adminInfoForm.fields.keepPosted.label": "Keep me posted about Rocket.Chat updates",
"onboarding.form.awaitConfirmationForm.title": "Awaiting confirmation",
"onboarding.form.awaitConfirmationForm.content.securityCode": "Security code",
"onboarding.form.awaitConfirmationForm.content.sentEmail": "Email sent to <1>{{email}}</1> with a confirmation link.Please verify that the security code below matches the one in the email.",
"onboarding.form.organizationInfoForm.title": "Organization Info",
"onboarding.form.organizationInfoForm.subtitle": "We need to know who you are.",
"onboarding.form.organizationInfoForm.fields.organizationName.label": "Organization name",
Expand Down
Loading