-
Notifications
You must be signed in to change notification settings - Fork 111
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
Add basic FormSteps flow for IdV React implementation #6195
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
32d34b2
Move PageHeading to components package
aduth ede90c9
Add basic FormSteps flow for IdV React implementation
aduth 8a17615
Initialize React I18nContext with global locale data
aduth 05964e2
Add basic personal key step content
aduth 2b4a387
Fix imports
aduth a59d94e
Update test default i18n context
aduth 42dab5a
Set default I18nContext value to shared i18n instance
aduth 57f25f2
Import t directly
aduth 5927e40
Remove unnecessary string interpolation
aduth 7e927d0
Update usage for I18nContext.Provider
aduth a96eda9
Update personal_key info string key
aduth 85de52f
Reorder props
aduth File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
16 changes: 7 additions & 9 deletions
16
...ument-capture/components/page-heading.jsx → ...ript/packages/components/page-heading.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
2 changes: 1 addition & 1 deletion
2
app/javascript/packages/document-capture/components/documents-step.jsx
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
2 changes: 1 addition & 1 deletion
2
app/javascript/packages/document-capture/components/submission-interstitial.jsx
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
2 changes: 1 addition & 1 deletion
2
app/javascript/packages/document-capture/components/warning.jsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
import { FormSteps } from '@18f/identity-form-steps'; | ||
import { STEPS } from './steps'; | ||
|
||
export function VerifyFlow() { | ||
return <div>Verify</div>; | ||
return <FormSteps steps={STEPS} />; | ||
} |
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,9 @@ | ||
import type { FormStep } from '@18f/identity-form-steps'; | ||
import PersonalKeyStep from './personal-key/personal-key-step'; | ||
|
||
export const STEPS: FormStep[] = [ | ||
{ | ||
name: 'personal-key', | ||
form: PersonalKeyStep, | ||
}, | ||
]; |
31 changes: 31 additions & 0 deletions
31
app/javascript/packages/verify-flow/steps/personal-key/personal-key-step.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,31 @@ | ||
import { PageHeading, Button } from '@18f/identity-components'; | ||
import { t } from '@18f/identity-i18n'; | ||
import { FormStepsContinueButton } from '@18f/identity-form-steps'; | ||
|
||
function PersonalKeyStep() { | ||
return ( | ||
<> | ||
<PageHeading>{t('headings.personal_key')}</PageHeading> | ||
<p>{t('instructions.personal_key.info')}</p> | ||
<div className="full-width-box margin-y-5" /> | ||
<Button isOutline className="margin-right-2 margin-bottom-2 tablet:margin-bottom-0"> | ||
{t('forms.backup_code.download')} | ||
</Button> | ||
<Button isOutline className="margin-right-2 margin-bottom-2 tablet:margin-bottom-0"> | ||
{t('users.personal_key.print')} | ||
</Button> | ||
<Button isOutline className="margin-bottom-2 tablet:margin-bottom-0"> | ||
{t('links.copy')} | ||
</Button> | ||
<div className="margin-y-5 clearfix"> | ||
<p className="margin-bottom-0"> | ||
<strong>{t('instructions.personal_key.email_title')}</strong> | ||
</p> | ||
<p>{t('instructions.personal_key.email_body')}</p> | ||
</div> | ||
<FormStepsContinueButton /> | ||
</> | ||
); | ||
} | ||
|
||
export default PersonalKeyStep; |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the reason we can remove this here is because we switched to
globalThis._locale_data
right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, indirectly that's what the previous logic here was doing anyways, since the default
i18n
instance from@18f/identity-i18n
is also initialized withglobalThis._locale_data
.identity-idp/app/javascript/packages/i18n/index.ts
Line 93 in 1e5396f
Now that I'm thinking about it, I wonder if there's a better way for the React context to reference that default
i18n
, rather than creating a new instance 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 0997d97. The value of an I18nContext is pretty low at this point since we have the shared instance to use now. Technically it could allow to use different locale data specific contexts, though I can't imagine we'd ever want to do that.
Might consider a future refactor:
Or maybe even merge the packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess there's one use-case after all 😅 77952d5b6