diff --git a/.changeset/popular-adults-hope.md b/.changeset/popular-adults-hope.md new file mode 100644 index 0000000000..a2274d8eae --- /dev/null +++ b/.changeset/popular-adults-hope.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/onboarding-ui": patch +--- + +feat(onboarding-ui): Remove standalone and introduce offline server registration diff --git a/packages/onboarding-ui/.i18n/en.i18n.json b/packages/onboarding-ui/.i18n/en.i18n.json index f5ebc0e616..5e47bcd8e1 100644 --- a/packages/onboarding-ui/.i18n/en.i18n.json +++ b/packages/onboarding-ui/.i18n/en.i18n.json @@ -6,9 +6,12 @@ "back": "Back", "next": "Next", "skip": "Skip this step", + "registerWorkspace": "Register workspace", "register": "Register", - "registerNow": "Register now", - "confirm": "Confirm" + "registerOffline": "Register offline", + "confirm": "Confirm", + "pasteHere": "Paste here...", + "completeRegistration": "Complete registration" }, "termsAndConditions": "I agree with <1>Terms and Conditions and <3>Privacy Policy" }, @@ -184,12 +187,6 @@ "notConnectedToInternet": "The server is not connected to the internet, so you’ll have to do an offline registration for this workspace.", "registrationEngagement": "Registration allows automatic license updates, notifications of critical vulnerabilities and access to Rocket.Chat Cloud services. No sensitive workspace data is shared; statistics sent to Rocket.Chat are made visible to you within the administration area." }, - "standaloneServerForm": { - "title": "Standalone Server Confirmation", - "servicesUnavailable": "Some of the services will be unavailable or will require manual setup", - "publishOwnApp": "In order to send push notitications you need to compile and publish your own app to Google Play and App Store", - "manuallyIntegrate": "Need to manually integrate with external services" - }, "createCloudWorkspace": { "title": "New Cloud Workspace", "fields": { @@ -216,6 +213,20 @@ "keepMeInformed": "Keep me informed about news and events" } }, + "registerOfflineForm": { + "title": "Register Offline", + "copyStep": { + "description": "If for any reason your workspace can’t be connected to the internet, follow these steps:<1>1. Go to: <2>cloud.rocket.chat > Workspaces and click “<3>Register self-managed”<4>2. Click “<5>Continue offline”<6>3. In the <7>Register offline workspace dialog in cloud.rocket.chat, paste the token in the box below" + }, + "pasteStep": { + "description": "1. In <1>cloud.rocket.chat get the generated text and paste below to complete your registration process" + }, + "fields": { + "registrationToken": { + "inputLabel": "Registration token" + } + } + }, "requestTrialForm": { "fields": { "emailAddress": { diff --git a/packages/onboarding-ui/src/flows/SelfHostedRegistration/stories.tsx b/packages/onboarding-ui/src/flows/SelfHostedRegistration/stories.tsx index 9f6487b2e5..ccab58dd4e 100644 --- a/packages/onboarding-ui/src/flows/SelfHostedRegistration/stories.tsx +++ b/packages/onboarding-ui/src/flows/SelfHostedRegistration/stories.tsx @@ -4,14 +4,15 @@ import { useState } from 'react'; import type { AdminInfoPayload } from '../../forms/AdminInfoForm/AdminInfoForm'; import type { OrganizationInfoPayload } from '../../forms/OrganizationInfoForm/OrganizationInfoForm'; +import type { RegisterOfflinePayload } from '../../forms/RegisterOfflineForm/RegisterOfflineForm'; import type { RegisterServerPayload } from '../../forms/RegisterServerForm/RegisterServerForm'; import AdminInfoPage from '../../pages/AdminInfoPage'; import AwaitingConfirmationPage from '../../pages/AwaitingConfirmationPage'; import ConfirmationProcessPage from '../../pages/ConfirmationProcessPage'; import EmailConfirmedPage from '../../pages/EmailConfirmedPage'; import OrganizationInfoPage from '../../pages/OrganizationInfoPage'; +import RegisterOfflinePage from '../../pages/RegisterOfflinePage'; import RegisteredServerPage from '../../pages/RegisterServerPage'; -import StandaloneServerPage from '../../pages/StandaloneServerPage'; import { countryOptions, logSubmit, @@ -36,7 +37,7 @@ export const SelfHostedRegistration: Story = ({ offline }) => { | 'admin-info' | 'org-info' | 'register-server' - | 'standalone-confirmation' + | 'register-offline' | 'cloud-email' | 'awaiting' | 'home' @@ -57,6 +58,11 @@ export const SelfHostedRegistration: Story = ({ offline }) => { securityCode?: string; }>(); + const [offlineRegistration, setOfflineRegistration] = useState<{ + agreement?: boolean; + token?: string; + }>(); + const handleAdminInfoSubmit = logSubmit((data: AdminInfoPayload) => { setAdminInfo(data); navigateTo('/org-info'); @@ -82,6 +88,17 @@ export const SelfHostedRegistration: Story = ({ offline }) => { } ); + const handleRegisterOfflineSubmit = logSubmit( + (data: RegisterOfflinePayload) => { + setOfflineRegistration((offlineRegistration) => ({ + ...offlineRegistration, + agreement: data.agreement, + token: data.token, + })); + navigateTo('/awaiting'); + } + ); + if (path === '/admin-info') { return ( { }), }} onSubmit={handleRegisterServerSubmit} + onClickRegisterOffline={() => navigateTo('/register-offline')} offline={offline} - onClickRegisterLater={() => navigateTo('/standalone-confirmation')} /> ); } - if (path === '/standalone-confirmation') { + if (path === '/register-offline') { return ( - navigateTo('/register-server')} - onSubmit={() => navigateTo('/home')} + onSubmit={handleRegisterOfflineSubmit} /> ); } if (path === '/awaiting') { - if (!serverRegistration?.cloudAccountEmail) { - throw new Error('missing cloud account email'); + if (!serverRegistration?.cloudAccountEmail || !offlineRegistration?.token) { + throw new Error('missing cloud account email or token'); } - if (!serverRegistration?.securityCode) { + if (!serverRegistration?.securityCode || !offlineRegistration?.token) { throw new Error('missing verification code'); } diff --git a/packages/onboarding-ui/src/pages/StandaloneServerPage/StandaloneServerPage.spec.tsx b/packages/onboarding-ui/src/forms/RegisterOfflineForm/RegisterOfflineForm.spec.tsx similarity index 66% rename from packages/onboarding-ui/src/pages/StandaloneServerPage/StandaloneServerPage.spec.tsx rename to packages/onboarding-ui/src/forms/RegisterOfflineForm/RegisterOfflineForm.spec.tsx index f87ac2c43d..0f3d82759e 100644 --- a/packages/onboarding-ui/src/pages/StandaloneServerPage/StandaloneServerPage.spec.tsx +++ b/packages/onboarding-ui/src/forms/RegisterOfflineForm/RegisterOfflineForm.spec.tsx @@ -1,15 +1,16 @@ import ReactDOM from 'react-dom'; -import StandaloneServerPage from './StandaloneServerPage'; +import RegisterOfflineForm from './RegisterOfflineForm'; it('renders without crashing', () => { const div = document.createElement('div'); ReactDOM.render( - undefined} + undefined} + onSubmit={() => undefined} />, div ); diff --git a/packages/onboarding-ui/src/forms/RegisterOfflineForm/RegisterOfflineForm.stories.tsx b/packages/onboarding-ui/src/forms/RegisterOfflineForm/RegisterOfflineForm.stories.tsx new file mode 100644 index 0000000000..122fc4892b --- /dev/null +++ b/packages/onboarding-ui/src/forms/RegisterOfflineForm/RegisterOfflineForm.stories.tsx @@ -0,0 +1,23 @@ +import type { Meta, Story } from '@storybook/react'; +import type { ComponentProps } from 'react'; + +import RegisterOfflineForm from './RegisterOfflineForm'; + +type Args = ComponentProps; + +export default { + title: 'forms/RegisterOfflineForm', + component: RegisterOfflineForm, + parameters: { + layout: 'centered', + actions: { argTypesRegex: '^on.*' }, + }, + args: { + clientKey: + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA', + }, +} as Meta; + +export const _RegisterOfflineForm: Story = (args) => ( + +); diff --git a/packages/onboarding-ui/src/forms/RegisterOfflineForm/RegisterOfflineForm.tsx b/packages/onboarding-ui/src/forms/RegisterOfflineForm/RegisterOfflineForm.tsx new file mode 100644 index 0000000000..9b5360a959 --- /dev/null +++ b/packages/onboarding-ui/src/forms/RegisterOfflineForm/RegisterOfflineForm.tsx @@ -0,0 +1,71 @@ +import { Form } from '@rocket.chat/layout'; +import { useState, type ReactElement } from 'react'; +import type { SubmitHandler } from 'react-hook-form'; +import { useForm, FormProvider } from 'react-hook-form'; +import { useTranslation } from 'react-i18next'; + +import CopyStep from './steps/CopyStep'; +import PasteStep from './steps/PasteStep'; + +export type RegisterOfflinePayload = { + token: string; + agreement: boolean; +}; + +type RegisterOfflineFormProps = { + termsHref: string; + policyHref: string; + clientKey: string; + onSubmit: SubmitHandler; + onBackButtonClick: () => void; +}; + +export const Steps = { + COPY: 'copy', + PASTE: 'paste', +}; + +const RegisterOfflineForm = ({ + termsHref, + policyHref, + clientKey, + onSubmit, + onBackButtonClick, +}: RegisterOfflineFormProps): ReactElement => { + const { t } = useTranslation(); + + const [step, setStep] = useState(Steps.COPY); + + const form = useForm({ + mode: 'onChange', + defaultValues: { + token: '', + agreement: false, + }, + }); + + const { handleSubmit } = form; + + return ( + +
+ + {t('form.registerOfflineForm.title')} + + {step === Steps.COPY ? ( + + ) : ( + + )} + +
+ ); +}; + +export default RegisterOfflineForm; diff --git a/packages/onboarding-ui/src/forms/RegisterOfflineForm/index.ts b/packages/onboarding-ui/src/forms/RegisterOfflineForm/index.ts new file mode 100644 index 0000000000..8436183767 --- /dev/null +++ b/packages/onboarding-ui/src/forms/RegisterOfflineForm/index.ts @@ -0,0 +1 @@ +export { default } from './RegisterOfflineForm'; diff --git a/packages/onboarding-ui/src/forms/RegisterOfflineForm/steps/CopyStep.tsx b/packages/onboarding-ui/src/forms/RegisterOfflineForm/steps/CopyStep.tsx new file mode 100644 index 0000000000..153d61fb7b --- /dev/null +++ b/packages/onboarding-ui/src/forms/RegisterOfflineForm/steps/CopyStep.tsx @@ -0,0 +1,130 @@ +import { + Box, + Button, + ButtonGroup, + CheckBox, + Label, + Scrollable, +} from '@rocket.chat/fuselage'; +import { useBreakpoints, useClipboard } from '@rocket.chat/fuselage-hooks'; +import { Form } from '@rocket.chat/layout'; +import { type ReactElement } from 'react'; +import { useFormContext } from 'react-hook-form'; +import { Trans, useTranslation } from 'react-i18next'; + +import { Steps } from '../RegisterOfflineForm'; + +type CopyStepProps = { + termsHref: string; + policyHref: string; + clientKey: string; + onBackButtonClick: () => void; + setStep: (step: string) => void; +}; + +const CopyStep = ({ + termsHref, + policyHref, + clientKey, + setStep, + onBackButtonClick, +}: CopyStepProps): ReactElement => { + const { t } = useTranslation(); + const breakpoints = useBreakpoints(); + const isMobile = !breakpoints.includes('md'); + + const { + register, + formState: { isValid }, + } = useFormContext(); + + const clipboard = useClipboard(clientKey); + + return ( + <> + + + + If for any reason your workspace can’t be connected to the internet, + follow these steps: + + 1. Go to: {'cloud.rocket.chat > Workspaces'} and + click “Register self-managed
+ 2. Click “Continue offline” +
+ 3. In the Register offline workspace dialog in + cloud.rocket.chat, paste the token in the box below +
+
+ + + + {clientKey} + + + + + + + + + ); +}; + +export default CopyStep; diff --git a/packages/onboarding-ui/src/forms/RegisterOfflineForm/steps/PasteStep.tsx b/packages/onboarding-ui/src/forms/RegisterOfflineForm/steps/PasteStep.tsx new file mode 100644 index 0000000000..30d6838a95 --- /dev/null +++ b/packages/onboarding-ui/src/forms/RegisterOfflineForm/steps/PasteStep.tsx @@ -0,0 +1,75 @@ +import { Box, Button, ButtonGroup, Scrollable } from '@rocket.chat/fuselage'; +import { useBreakpoints } from '@rocket.chat/fuselage-hooks'; +import { Form } from '@rocket.chat/layout'; +import type { ReactElement } from 'react'; +import { useFormContext } from 'react-hook-form'; +import { Trans, useTranslation } from 'react-i18next'; + +import { Steps } from '../RegisterOfflineForm'; + +type PasteStepProps = { + setStep: (step: string) => void; +}; + +const PasteStep = ({ setStep }: PasteStepProps): ReactElement => { + const { t } = useTranslation(); + const breakpoints = useBreakpoints(); + const isMobile = !breakpoints.includes('md'); + const { + register, + formState: { isSubmitting, isValid }, + } = useFormContext(); + + return ( + <> + + + + 1. In cloud.rocket.chat get the generated text and + paste below to complete your registration process + + + + + + + + + + + + + + + + + + ); +}; + +export default PasteStep; diff --git a/packages/onboarding-ui/src/forms/RegisterServerForm/RegisterServerForm.spec.tsx b/packages/onboarding-ui/src/forms/RegisterServerForm/RegisterServerForm.spec.tsx index de7eb4cc39..55c1cdcc1f 100644 --- a/packages/onboarding-ui/src/forms/RegisterServerForm/RegisterServerForm.spec.tsx +++ b/packages/onboarding-ui/src/forms/RegisterServerForm/RegisterServerForm.spec.tsx @@ -9,7 +9,7 @@ it('renders without crashing', () => { currentStep={1} stepCount={1} validateEmail={() => true} - onClickRegisterLater={() => undefined} + onClickRegisterOffline={() => undefined} onSubmit={() => undefined} />, div diff --git a/packages/onboarding-ui/src/forms/RegisterServerForm/RegisterServerForm.tsx b/packages/onboarding-ui/src/forms/RegisterServerForm/RegisterServerForm.tsx index cd5479c776..0699e362ac 100644 --- a/packages/onboarding-ui/src/forms/RegisterServerForm/RegisterServerForm.tsx +++ b/packages/onboarding-ui/src/forms/RegisterServerForm/RegisterServerForm.tsx @@ -11,7 +11,7 @@ import { FieldError, } from '@rocket.chat/fuselage'; import { useUniqueId, useBreakpoints } from '@rocket.chat/fuselage-hooks'; -import { Form, ActionLink } from '@rocket.chat/layout'; +import { Form } from '@rocket.chat/layout'; import type { ReactElement } from 'react'; import type { SubmitHandler, Validate } from 'react-hook-form'; import { useForm, FormProvider } from 'react-hook-form'; @@ -19,7 +19,6 @@ import { useTranslation, Trans } from 'react-i18next'; export type RegisterServerPayload = { email: string; - registerType: 'registered' | 'standalone'; agreement: boolean; updates: boolean; }; @@ -30,7 +29,7 @@ type RegisterServerFormProps = { initialValues?: Partial; validateEmail?: Validate; onSubmit: SubmitHandler; - onClickRegisterLater: () => void; + onClickRegisterOffline: () => void; termsHref?: string; policyHref?: string; offline?: boolean; @@ -43,9 +42,9 @@ const RegisterServerForm = ({ validateEmail, offline, onSubmit, - onClickRegisterLater, termsHref = 'https://rocket.chat/terms', policyHref = 'https://rocket.chat/privacy', + onClickRegisterOffline, }: RegisterServerFormProps): ReactElement => { const { t } = useTranslation(); const emailField = useUniqueId(); @@ -57,7 +56,6 @@ const RegisterServerForm = ({ mode: 'onChange', defaultValues: { email: '', - registerType: 'registered', agreement: false, updates: true, ...initialValues, @@ -77,7 +75,7 @@ const RegisterServerForm = ({ {t('form.registeredServerForm.title')} - {!offline && ( + { - )} - {offline && ( - - - {t('form.registeredServerForm.notConnectedToInternet')} - - - )} + } {offline && ( - - - {t('form.registeredServerForm.registerLater')} - - + )} diff --git a/packages/onboarding-ui/src/forms/StandaloneServerForm/StandaloneServerForm.stories.tsx b/packages/onboarding-ui/src/forms/StandaloneServerForm/StandaloneServerForm.stories.tsx deleted file mode 100644 index 075f0c4e3f..0000000000 --- a/packages/onboarding-ui/src/forms/StandaloneServerForm/StandaloneServerForm.stories.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import type { Meta, Story } from '@storybook/react'; -import type { ComponentProps } from 'react'; - -import StandaloneServerForm from './StandaloneServerForm'; - -type Args = ComponentProps; - -export default { - title: 'forms/StandaloneServerForm', - component: StandaloneServerForm, - parameters: { - layout: 'centered', - actions: { argTypesRegex: '^on.*' }, - }, - args: { - currentStep: 1, - stepCount: 1, - }, -} as Meta; - -export const _StandaloneServerForm: Story = (args) => ( - -); -_StandaloneServerForm.storyName = 'StandaloneServerForm'; diff --git a/packages/onboarding-ui/src/forms/StandaloneServerForm/StandaloneServerForm.tsx b/packages/onboarding-ui/src/forms/StandaloneServerForm/StandaloneServerForm.tsx deleted file mode 100644 index 95c97b70a1..0000000000 --- a/packages/onboarding-ui/src/forms/StandaloneServerForm/StandaloneServerForm.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import { Box, ButtonGroup, Button } from '@rocket.chat/fuselage'; -import { Form, List } from '@rocket.chat/layout'; -import type { ReactElement } from 'react'; -import type { SubmitHandler } from 'react-hook-form'; -import { useForm, FormProvider } from 'react-hook-form'; -import { useTranslation } from 'react-i18next'; - -export type StandaloneServerPayload = { - registerType: 'registered' | 'standalone'; -}; - -type StandaloneServerFormProps = { - currentStep: number; - stepCount: number; - initialValues?: Partial; - onSubmit: SubmitHandler; - onBackButtonClick: () => void; -}; - -const StandaloneServerForm = ({ - currentStep, - stepCount, - initialValues, - onSubmit, - onBackButtonClick, -}: StandaloneServerFormProps): ReactElement => { - const { t } = useTranslation(); - - const form = useForm({ - mode: 'onChange', - defaultValues: { - registerType: 'standalone', - ...initialValues, - }, - }); - - const { - formState: { isValidating, isSubmitting, isValid }, - handleSubmit, - } = form; - - return ( - -
- - - {t('form.standaloneServerForm.title')} - - - - - - {t('form.standaloneServerForm.servicesUnavailable')} - - - {t('form.standaloneServerForm.publishOwnApp')} - - - {t('form.standaloneServerForm.manuallyIntegrate')} - - - - - - - - - -
-
- ); -}; - -export default StandaloneServerForm; diff --git a/packages/onboarding-ui/src/forms/StandaloneServerForm/index.ts b/packages/onboarding-ui/src/forms/StandaloneServerForm/index.ts deleted file mode 100644 index b009a834f7..0000000000 --- a/packages/onboarding-ui/src/forms/StandaloneServerForm/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './StandaloneServerForm'; diff --git a/packages/onboarding-ui/src/index.ts b/packages/onboarding-ui/src/index.ts index 263485b6ca..64d8b19988 100644 --- a/packages/onboarding-ui/src/index.ts +++ b/packages/onboarding-ui/src/index.ts @@ -8,7 +8,7 @@ export { default as InvalidLinkPage } from './pages/InvalidLinkPage'; export { default as LoginLinkEmailPage } from './pages/LoginLinkEmailPage'; export { default as OrganizationInfoPage } from './pages/OrganizationInfoPage'; export { default as RegisterServerPage } from './pages/RegisterServerPage'; -export { default as StandaloneServerPage } from './pages/StandaloneServerPage'; +export { default as RegisterOfflinePage } from './pages/RegisterOfflinePage'; export { default as RequestTrialPage } from './pages/RequestTrialPage'; export { default as LoginPage } from './pages/LoginPage'; export { default as CreateNewAccountPage } from './pages/CreateNewAccountPage'; diff --git a/packages/onboarding-ui/src/forms/StandaloneServerForm/StandaloneServerForm.spec.tsx b/packages/onboarding-ui/src/pages/RegisterOfflinePage/RegisterOfflinePage.spec.tsx similarity index 68% rename from packages/onboarding-ui/src/forms/StandaloneServerForm/StandaloneServerForm.spec.tsx rename to packages/onboarding-ui/src/pages/RegisterOfflinePage/RegisterOfflinePage.spec.tsx index 8676dc0d60..7d18de7083 100644 --- a/packages/onboarding-ui/src/forms/StandaloneServerForm/StandaloneServerForm.spec.tsx +++ b/packages/onboarding-ui/src/pages/RegisterOfflinePage/RegisterOfflinePage.spec.tsx @@ -1,15 +1,16 @@ import ReactDOM from 'react-dom'; -import StandaloneServerForm from './StandaloneServerForm'; +import RegisterOfflinePage from '.'; it('renders without crashing', () => { const div = document.createElement('div'); ReactDOM.render( - undefined} + undefined} + onBackButtonClick={() => undefined} />, div ); diff --git a/packages/onboarding-ui/src/pages/RegisterOfflinePage/RegisterOfflinePage.stories.tsx b/packages/onboarding-ui/src/pages/RegisterOfflinePage/RegisterOfflinePage.stories.tsx new file mode 100644 index 0000000000..6078c6015f --- /dev/null +++ b/packages/onboarding-ui/src/pages/RegisterOfflinePage/RegisterOfflinePage.stories.tsx @@ -0,0 +1,24 @@ +import { action } from '@storybook/addon-actions'; +import type { Story, Meta } from '@storybook/react'; +import type { ComponentProps } from 'react'; + +import RegisterOfflinePage from './RegisterOfflinePage'; + +type Args = ComponentProps; + +export default { + title: 'pages/RegisterOfflinePage', + component: RegisterOfflinePage, + parameters: { + actions: { argTypesRegex: '^on.*' }, + layout: 'fullscreen', + }, + args: { + onSubmit: action('onSubmit'), + onBackButtonClick: action('onBackButtonClick'), + }, +} as Meta; + +export const _RegisterOfflinePage: Story = (args) => ( + +); diff --git a/packages/onboarding-ui/src/pages/RegisterOfflinePage/RegisterOfflinePage.tsx b/packages/onboarding-ui/src/pages/RegisterOfflinePage/RegisterOfflinePage.tsx new file mode 100644 index 0000000000..2ae4138ced --- /dev/null +++ b/packages/onboarding-ui/src/pages/RegisterOfflinePage/RegisterOfflinePage.tsx @@ -0,0 +1,30 @@ +import { BackgroundLayer } from '@rocket.chat/layout'; +import type { ReactElement } from 'react'; +import type { SubmitHandler } from 'react-hook-form'; + +import type { FormPageLayoutStyleProps } from '../../Types'; +import FormPageLayout from '../../common/FormPageLayout'; +import RegisterOfflineForm from '../../forms/RegisterOfflineForm'; +import type { RegisterOfflinePayload } from '../../forms/RegisterOfflineForm/RegisterOfflineForm'; + +type RegisterOfflinePageProps = { + termsHref: string; + policyHref: string; + clientKey: string; + onSubmit: SubmitHandler; + onBackButtonClick: () => void; +}; + +const pageLayoutStyleProps: FormPageLayoutStyleProps = { + justifyContent: 'center', +}; + +const RegisterOfflinePage = (props: RegisterOfflinePageProps): ReactElement => ( + + + + + +); + +export default RegisterOfflinePage; diff --git a/packages/onboarding-ui/src/pages/RegisterOfflinePage/index.ts b/packages/onboarding-ui/src/pages/RegisterOfflinePage/index.ts new file mode 100644 index 0000000000..f5e5b05c62 --- /dev/null +++ b/packages/onboarding-ui/src/pages/RegisterOfflinePage/index.ts @@ -0,0 +1 @@ +export { default } from './RegisterOfflinePage'; diff --git a/packages/onboarding-ui/src/pages/RegisterServerPage/RegisterServerPage.spec.tsx b/packages/onboarding-ui/src/pages/RegisterServerPage/RegisterServerPage.spec.tsx index 31a47e3ff9..267195bcce 100644 --- a/packages/onboarding-ui/src/pages/RegisterServerPage/RegisterServerPage.spec.tsx +++ b/packages/onboarding-ui/src/pages/RegisterServerPage/RegisterServerPage.spec.tsx @@ -9,7 +9,7 @@ it('renders without crashing', () => { currentStep={1} stepCount={1} onSubmit={() => undefined} - onClickRegisterLater={() => undefined} + onClickRegisterOffline={() => undefined} />, div ); diff --git a/packages/onboarding-ui/src/pages/RegisterServerPage/RegisterServerPage.tsx b/packages/onboarding-ui/src/pages/RegisterServerPage/RegisterServerPage.tsx index 82044985b4..adc88d3f12 100644 --- a/packages/onboarding-ui/src/pages/RegisterServerPage/RegisterServerPage.tsx +++ b/packages/onboarding-ui/src/pages/RegisterServerPage/RegisterServerPage.tsx @@ -12,7 +12,7 @@ type RegisterServerPageProps = { stepCount: number; initialValues?: Partial; onSubmit: SubmitHandler; - onClickRegisterLater: () => void; + onClickRegisterOffline: () => void; offline?: boolean; validateEmail?: Validate; termsHref?: string; diff --git a/packages/onboarding-ui/src/pages/StandaloneServerPage/StandaloneServerPage.stories.tsx b/packages/onboarding-ui/src/pages/StandaloneServerPage/StandaloneServerPage.stories.tsx deleted file mode 100644 index e4db43a23a..0000000000 --- a/packages/onboarding-ui/src/pages/StandaloneServerPage/StandaloneServerPage.stories.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import type { Story, Meta } from '@storybook/react'; -import type { ComponentProps } from 'react'; - -import StandaloneServerPage from './StandaloneServerPage'; - -type Args = ComponentProps; - -export default { - title: 'pages/StandaloneServerPage', - component: StandaloneServerPage, - parameters: { - actions: { argTypesRegex: '^on.*' }, - layout: 'fullscreen', - }, - args: { - currentStep: 1, - stepCount: 1, - }, -} as Meta; - -export const _StandaloneServerPage: Story = (args) => ( - -); -_StandaloneServerPage.storyName = 'StandaloneServerPage'; diff --git a/packages/onboarding-ui/src/pages/StandaloneServerPage/StandaloneServerPage.tsx b/packages/onboarding-ui/src/pages/StandaloneServerPage/StandaloneServerPage.tsx deleted file mode 100644 index 425b0e0bff..0000000000 --- a/packages/onboarding-ui/src/pages/StandaloneServerPage/StandaloneServerPage.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import { - BackgroundLayer, - FormPageLayout as FormLayout, -} from '@rocket.chat/layout'; -import type { ReactElement } from 'react'; -import type { SubmitHandler } from 'react-hook-form'; -import { Trans } from 'react-i18next'; - -import type { FormPageLayoutStyleProps } from '../../Types'; -import FormPageLayout from '../../common/FormPageLayout'; -import StandaloneServerForm from '../../forms/StandaloneServerForm'; -import type { StandaloneServerPayload } from '../../forms/StandaloneServerForm/StandaloneServerForm'; - -type RegisteredServerPageProps = { - currentStep: number; - stepCount: number; - initialValues?: Partial; - onSubmit: SubmitHandler; - onBackButtonClick: () => void; -}; - -const pageLayoutStyleProps: FormPageLayoutStyleProps = { - justifyContent: 'center', -}; - -const StandaloneServerPage = ( - props: RegisteredServerPageProps -): ReactElement => ( - - - Let's - Launch - Your Workspace - - } - styleProps={pageLayoutStyleProps} - > - - - -); - -export default StandaloneServerPage; diff --git a/packages/onboarding-ui/src/pages/StandaloneServerPage/index.ts b/packages/onboarding-ui/src/pages/StandaloneServerPage/index.ts deleted file mode 100644 index fefde0953a..0000000000 --- a/packages/onboarding-ui/src/pages/StandaloneServerPage/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './StandaloneServerPage';