-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:RocketChat/fuselage into refactor/F…
…ield
- Loading branch information
Showing
21 changed files
with
246 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@rocket.chat/onboarding-ui": patch | ||
--- | ||
|
||
feat(onboarding-ui): Required fields adjustments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@rocket.chat/onboarding-ui": patch | ||
--- | ||
|
||
refactor(onboarding-ui): Rewrite `AwaitingConfirmationPage` page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@rocket.chat/fuselage": patch | ||
--- | ||
|
||
Fixed tooltip not being displayed on `PaginatedSelect` options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/onboarding-ui/src/forms/AwaitConfirmationForm/AwaitConfirmationForm.spec.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import ReactDOM from 'react-dom'; | ||
|
||
import AwaitConfirmationForm from './AwaitConfirmationForm'; | ||
|
||
it('renders without crashing', () => { | ||
const div = document.createElement('div'); | ||
ReactDOM.render( | ||
<AwaitConfirmationForm | ||
currentStep={4} | ||
stepCount={4} | ||
securityCode='Funny Tortoise In The Hat' | ||
emailAddress='[email protected]' | ||
onResendEmailRequest={() => true} | ||
onChangeEmailRequest={() => true} | ||
/>, | ||
div | ||
); | ||
ReactDOM.unmountComponentAtNode(div); | ||
}); |
30 changes: 30 additions & 0 deletions
30
packages/onboarding-ui/src/forms/AwaitConfirmationForm/AwaitConfirmationForm.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import type { Story, Meta } from '@storybook/react'; | ||
import type { ComponentProps } from 'react'; | ||
|
||
import AwaitConfirmationForm from './AwaitConfirmationForm'; | ||
|
||
type Args = ComponentProps<typeof AwaitConfirmationForm>; | ||
|
||
export default { | ||
title: 'forms/AwaitConfirmationForm', | ||
component: AwaitConfirmationForm, | ||
parameters: { | ||
actions: { argTypesRegex: '^on.*' }, | ||
layout: 'centered', | ||
}, | ||
argTypes: { | ||
onResendEmailRequest: { action: 'resetEmailRequest' }, | ||
onChangeEmailRequest: { action: 'changeEmailRequest' }, | ||
}, | ||
args: { | ||
currentStep: 4, | ||
stepCount: 4, | ||
securityCode: 'Funny Tortoise In The Hat', | ||
emailAddress: '[email protected]', | ||
}, | ||
} as Meta<Args>; | ||
|
||
export const _AwaitConfirmationForm: Story<Args> = (args) => ( | ||
<AwaitConfirmationForm {...args} /> | ||
); | ||
_AwaitConfirmationForm.storyName = 'AwaitConfirmationForm'; |
65 changes: 65 additions & 0 deletions
65
packages/onboarding-ui/src/forms/AwaitConfirmationForm/AwaitConfirmationForm.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { Box, Label } from '@rocket.chat/fuselage'; | ||
import { Form } from '@rocket.chat/layout'; | ||
import type { ReactElement } from 'react'; | ||
import { Trans, useTranslation } from 'react-i18next'; | ||
|
||
import EmailCodeFallback from '../../common/EmailCodeFallback'; | ||
|
||
type AwaitingConfirmationFormProps = { | ||
currentStep: number; | ||
stepCount: number; | ||
securityCode: string; | ||
emailAddress: string; | ||
onResendEmailRequest: () => void; | ||
onChangeEmailRequest: () => void; | ||
}; | ||
|
||
const AwaitingConfirmationForm = ({ | ||
currentStep, | ||
stepCount, | ||
securityCode, | ||
emailAddress, | ||
onResendEmailRequest, | ||
onChangeEmailRequest, | ||
}: AwaitingConfirmationFormProps): ReactElement => { | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<Form> | ||
<Form.Header> | ||
<Form.Steps currentStep={currentStep} stepCount={stepCount} /> | ||
<Form.Title>{t('form.awaitConfirmationForm.title')}</Form.Title> | ||
</Form.Header> | ||
<Form.Container> | ||
<Box fontScale='c1' mbe={24}> | ||
<Trans i18nKey='form.awaitConfirmationForm.content.sentEmail'> | ||
Email sent to <strong>{{ emailAddress }}</strong> with a | ||
confirmation link.Please verify that the security code below matches | ||
the one in the email. | ||
</Trans> | ||
</Box> | ||
<Label> | ||
{t('form.awaitConfirmationForm.content.securityCode')} | ||
<Box | ||
padding='12px' | ||
width='full' | ||
fontScale='p2b' | ||
lineHeight='20px' | ||
backgroundColor='tint' | ||
elevation='1' | ||
> | ||
{securityCode} | ||
</Box> | ||
</Label> | ||
</Form.Container> | ||
<Form.Footer> | ||
<EmailCodeFallback | ||
onResendEmailRequest={onResendEmailRequest} | ||
onChangeEmailRequest={onChangeEmailRequest} | ||
/> | ||
</Form.Footer> | ||
</Form> | ||
); | ||
}; | ||
|
||
export default AwaitingConfirmationForm; |
1 change: 1 addition & 0 deletions
1
packages/onboarding-ui/src/forms/AwaitConfirmationForm/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './AwaitConfirmationForm'; |
Oops, something went wrong.