-
Notifications
You must be signed in to change notification settings - Fork 166
LG-6087 Add prep page to in-person flow #6515
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
Merged
tomas-nava
merged 53 commits into
main
from
tomas/lg-6087-build-verify-your-identity-page
Jul 14, 2022
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
f8135d0
add naive process & icon list React components
5519601
add new copy (english)
0984795
no identity-doc-auth gem anymore
31ea8fe
add welcome step (will rename)
6dae588
add WelcomeStep to the flow
58b1faf
organize list components into directories
b646be5
rename ipp/welcome to ipp/prepare
23b40f3
finish styling prepare component
38c5e4a
cleanup
001db33
add placement location page
3414b74
new component for submit button in troubleshooting
7858f0f
LG-6087: Update IPP flow button styles to match accompanying links
NavaTim 8209620
LG-6087: Update IPP flow button styles to override other styles more …
NavaTim dd25c1e
LG-6087: Fix minor issues with IPP button styling changes
NavaTim 5ec4fca
refactor new components
0046960
skip unnecessary logic
90b9c72
remove errors
027b25e
collapse icon & process list components
4e0f0a9
remove location & prepare steps
0952c36
placement French & Spanish translations
193bfb9
Merge remote-tracking branch 'origin/main' into tomas/lg-6087-build-v…
09236c9
clean up new steps
d44243c
gate inclusion of in person steps
f98aa1d
Merge remote-tracking branch 'origin/main' into tomas/lg-6087-build-v…
455db4e
Merge remote-tracking branch 'origin/main' into tomas/lg-6087-build-v…
4fbe237
fix scss formatting
d4f6d84
remove unused annotations
a71df2b
small troubleshooting options refactor
a70db95
url is optional
7b861a4
click continue to go to in person flow
04bf8d3
Merge remote-tracking branch 'origin/main' into tomas/lg-6087-build-v…
49f5abf
Merge remote-tracking branch 'origin/main' into tomas/lg-6087-build-v…
054e427
Merge remote-tracking branch 'origin/main' into tomas/lg-6087-build-v…
ba91aea
allow steps to tell FormSteps they're complete
4c07cbe
remove unload protection when leaving prep step
5fa4687
fix linting errors
3240e31
fix tests
5ec5d15
fix lint errors on test file
ef79a6d
normalize yaml
6fe4f9f
add changelog
82d1b9f
tests for new components
65664ff
remove tabIndex
590b475
rename style & target selectors we're overriding
ac32914
no className param in components that don't use it
c45132a
rename stepIsComplete to stepCanComplete
06f40f9
reset hash in URL if there is no matching step
f208acd
test for button type
2a37cb9
Merge remote-tracking branch 'origin/main' into tomas/lg-6087-build-v…
73179dc
wrap stepName reset in useEffect
32c2939
Merge remote-tracking branch 'origin/main' into tomas/lg-6087-build-v…
bcb422e
move styles into icon list components statically
a61875d
allow IPP help center URL
ba18ea8
Merge remote-tracking branch 'origin/main' into tomas/lg-6087-build-v…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
app/assets/stylesheets/components/_block-submit-button.scss
This file contains hidden or 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,17 @@ | ||
| .block-submit-button { | ||
| cursor: pointer; | ||
|
|
||
| &.usa-button--unstyled { | ||
| display: block; | ||
| line-height: 1.5; | ||
|
|
||
| &:hover, | ||
| &:active { | ||
| text-decoration: none; | ||
| } | ||
|
|
||
| &:focus { | ||
| outline: none; | ||
| } | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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,18 @@ | ||
| function BlockLinkArrow() { | ||
| return ( | ||
| <svg | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| viewBox="0 0 5.2 8.91" | ||
| focusable="false" | ||
| aria-hidden="true" | ||
| className="block-link__arrow" | ||
| > | ||
| <path | ||
| d="M5.11 4.66L1 8.82a.36.36 0 01-.21.09.31.31 0 01-.2-.09l-.5-.45a.29.29 0 01-.09-.2A.36.36 0 01.09 8L3.6 4.45.09 1A.36.36 0 010 .74a.31.31 0 01.09-.2L.54.09A.31.31 0 01.74 0 .36.36 0 011 .09l4.11 4.16a.31.31 0 01.09.2.31.31 0 01-.09.21z" | ||
| fill="currentColor" | ||
| /> | ||
| </svg> | ||
| ); | ||
| } | ||
|
|
||
| export default BlockLinkArrow; |
This file contains hidden or 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
30 changes: 30 additions & 0 deletions
30
app/javascript/packages/components/block-submit-button.spec.tsx
This file contains hidden or 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 { render } from '@testing-library/react'; | ||
| import BlockSubmitButton from './block-submit-button'; | ||
|
|
||
| describe('BlockSubmitButton', () => { | ||
| const buttonLabel = 'Click here to submit'; | ||
|
|
||
| it('renders a button with an expected class name, type, and arrow content', () => { | ||
| const { getByRole } = render(<BlockSubmitButton>{buttonLabel}</BlockSubmitButton>); | ||
|
|
||
| const button = getByRole('button') as HTMLInputElement; | ||
|
|
||
| expect(button.classList.contains('block-submit-button')).to.be.true(); | ||
| expect(button.querySelector('.block-link__arrow')).to.exist(); | ||
| expect(button.textContent).to.equal(buttonLabel); | ||
| expect(button.type).to.equal('submit'); | ||
| }); | ||
|
|
||
| context('with custom css class', () => { | ||
| it('renders a link with passed class name', () => { | ||
| const { getByRole } = render( | ||
| <BlockSubmitButton className="my-custom-class">{buttonLabel}</BlockSubmitButton>, | ||
| ); | ||
|
|
||
| const button = getByRole('button'); | ||
|
|
||
| expect(button.classList.contains('block-submit-button')).to.be.true(); | ||
| expect(button.classList.contains('my-custom-class')).to.be.true(); | ||
| }); | ||
| }); | ||
| }); |
36 changes: 36 additions & 0 deletions
36
app/javascript/packages/components/block-submit-button.tsx
This file contains hidden or 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,36 @@ | ||
| import type { ReactNode } from 'react'; | ||
| import BlockLinkArrow from './block-link-arrow'; | ||
|
|
||
| interface BlockSubmitButtonProps extends React.ComponentPropsWithoutRef<'button'> { | ||
| /** | ||
| * Link text. | ||
| */ | ||
| children?: ReactNode; | ||
|
|
||
| /** | ||
| * Additional class names to apply. | ||
| */ | ||
| className?: string; | ||
| } | ||
|
|
||
| function BlockSubmitButton({ children, className, ...linkProps }: BlockSubmitButtonProps) { | ||
| const classes = [ | ||
| 'block-submit-button', | ||
| 'usa-button--unstyled', | ||
| 'usa-link', | ||
| 'block-link', | ||
| 'width-full', | ||
| className, | ||
| ] | ||
| .filter(Boolean) | ||
| .join(' '); | ||
|
|
||
| return ( | ||
| <button type="submit" {...linkProps} className={classes}> | ||
| {children} | ||
| <BlockLinkArrow /> | ||
| </button> | ||
| ); | ||
| } | ||
|
|
||
| export default BlockSubmitButton; | ||
18 changes: 18 additions & 0 deletions
18
app/javascript/packages/components/icon-list/icon-list-content.spec.tsx
This file contains hidden or 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,18 @@ | ||
| import { render } from '@testing-library/react'; | ||
| import IconListContent from './icon-list-content'; | ||
|
|
||
| describe('IconListContent', () => { | ||
| it('renders the component with expected class and children', () => { | ||
| const { getByText } = render( | ||
| <IconListContent> | ||
| <div>Example</div> | ||
| </IconListContent>, | ||
| ); | ||
|
|
||
| const child = getByText('Example'); | ||
| const item = child.parentElement!; | ||
|
|
||
| expect(item.classList.contains('usa-icon-list__content')).to.be.true(); | ||
| expect(item.textContent).to.equal('Example'); | ||
| }); | ||
| }); |
13 changes: 13 additions & 0 deletions
13
app/javascript/packages/components/icon-list/icon-list-content.tsx
This file contains hidden or 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,13 @@ | ||
| import type { ReactNode } from 'react'; | ||
|
|
||
| interface IconListContentProps { | ||
| children?: ReactNode; | ||
| } | ||
|
|
||
| function IconListContent({ children }: IconListContentProps) { | ||
| const classes = 'usa-icon-list__content'; | ||
|
|
||
| return <div className={classes}>{children}</div>; | ||
| } | ||
|
|
||
| export default IconListContent; |
19 changes: 19 additions & 0 deletions
19
app/javascript/packages/components/icon-list/icon-list-icon.spec.tsx
This file contains hidden or 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 { render } from '@testing-library/react'; | ||
| import IconListIcon from './icon-list-icon'; | ||
|
|
||
| describe('IconListIcon', () => { | ||
| it('renders the component with expected class and children', () => { | ||
| const { getByText } = render( | ||
| <IconListIcon className="example-class"> | ||
| <div>Example</div> | ||
| </IconListIcon>, | ||
| ); | ||
|
|
||
| const child = getByText('Example'); | ||
| const item = child.parentElement!; | ||
|
|
||
| expect(item.classList.contains('usa-icon-list__icon')).to.be.true(); | ||
| expect(item.classList.contains('example-class')).to.be.true(); | ||
| expect(item.textContent).to.equal('Example'); | ||
| }); | ||
| }); |
15 changes: 15 additions & 0 deletions
15
app/javascript/packages/components/icon-list/icon-list-icon.tsx
This file contains hidden or 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,15 @@ | ||
| import type { ReactNode } from 'react'; | ||
|
|
||
| interface IconListIconProps { | ||
| children?: ReactNode; | ||
|
|
||
| className?: string; | ||
| } | ||
|
|
||
| function IconListIcon({ children, className }: IconListIconProps) { | ||
| const classes = ['usa-icon-list__icon', 'text-primary-dark', className].filter(Boolean).join(' '); | ||
|
|
||
| return <div className={classes}>{children}</div>; | ||
| } | ||
|
|
||
| export default IconListIcon; |
27 changes: 27 additions & 0 deletions
27
app/javascript/packages/components/icon-list/icon-list-item.spec.tsx
This file contains hidden or 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,27 @@ | ||
| import { render } from '@testing-library/react'; | ||
| import IconListItem from './icon-list-item'; | ||
|
|
||
| describe('IconListItem', () => { | ||
| it('renders the component with expected class and children', () => { | ||
| const { container } = render( | ||
| <IconListItem icon="check_circle" title="Example title"> | ||
| <div>Example</div> | ||
| </IconListItem>, | ||
| ); | ||
|
|
||
| const wrapper = container.firstElementChild!; | ||
| expect(wrapper.classList.contains('usa-icon-list__item')).to.be.true(); | ||
|
|
||
| const iconListIcon = wrapper.firstElementChild!; | ||
| expect(iconListIcon.classList.contains('usa-icon-list__icon')).to.be.true(); | ||
| const icon = iconListIcon.firstElementChild!; | ||
| expect(icon.classList.contains('usa-icon')).to.be.true(); | ||
| const iconListContent = iconListIcon.nextElementSibling!; | ||
| expect(iconListContent.classList.contains('usa-icon-list__content')).to.be.true(); | ||
| const iconListTitle = iconListContent.firstElementChild!; | ||
| expect(iconListTitle.classList.contains('usa-icon-list__title')).to.be.true(); | ||
| expect(iconListTitle.textContent).to.equal('Example title'); | ||
| const child = iconListTitle.nextElementSibling!; | ||
| expect(child.textContent).to.equal('Example'); | ||
| }); | ||
| }); |
29 changes: 29 additions & 0 deletions
29
app/javascript/packages/components/icon-list/icon-list-item.tsx
This file contains hidden or 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,29 @@ | ||
| import { Icon, IconListContent, IconListIcon, IconListTitle } from '@18f/identity-components'; | ||
| import type { ReactNode } from 'react'; | ||
| import type { DesignSystemIcon } from '../icon'; | ||
|
|
||
| interface IconListItemProps { | ||
| children?: ReactNode; | ||
|
|
||
| icon: DesignSystemIcon; | ||
|
|
||
| title: string; | ||
| } | ||
|
|
||
| function IconListItem({ children, icon, title }: IconListItemProps) { | ||
| const classes = 'usa-icon-list__item'; | ||
|
|
||
| return ( | ||
| <li className={classes}> | ||
| <IconListIcon> | ||
| <Icon icon={icon} /> | ||
| </IconListIcon> | ||
| <IconListContent> | ||
| <IconListTitle>{title}</IconListTitle> | ||
| {children} | ||
| </IconListContent> | ||
| </li> | ||
| ); | ||
| } | ||
|
|
||
| export default IconListItem; |
18 changes: 18 additions & 0 deletions
18
app/javascript/packages/components/icon-list/icon-list-title.spec.tsx
This file contains hidden or 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,18 @@ | ||
| import { render } from '@testing-library/react'; | ||
| import IconListTitle from './icon-list-title'; | ||
|
|
||
| describe('IconListTitle', () => { | ||
| it('renders the component with expected class and children', () => { | ||
| const { getByText } = render( | ||
| <IconListTitle> | ||
| <div>Example</div> | ||
| </IconListTitle>, | ||
| ); | ||
|
|
||
| const child = getByText('Example'); | ||
| const item = child.parentElement!; | ||
|
|
||
| expect(item.classList.contains('usa-icon-list__title')).to.be.true(); | ||
| expect(item.textContent).to.equal('Example'); | ||
| }); | ||
| }); |
17 changes: 17 additions & 0 deletions
17
app/javascript/packages/components/icon-list/icon-list-title.tsx
This file contains hidden or 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,17 @@ | ||
| import type { ReactNode } from 'react'; | ||
|
|
||
| interface IconListTitleProps { | ||
| children?: ReactNode; | ||
|
|
||
| className?: string; | ||
| } | ||
|
|
||
| function IconListTitle({ children, className }: IconListTitleProps) { | ||
| const classes = ['usa-icon-list__title', 'font-sans-md', 'padding-top-0', className] | ||
| .filter(Boolean) | ||
| .join(' '); | ||
|
|
||
| return <h3 className={classes}>{children}</h3>; | ||
| } | ||
|
|
||
| export default IconListTitle; |
18 changes: 18 additions & 0 deletions
18
app/javascript/packages/components/icon-list/icon-list.spec.tsx
This file contains hidden or 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,18 @@ | ||
| import { render } from '@testing-library/react'; | ||
| import IconList from './icon-list'; | ||
|
|
||
| describe('IconList', () => { | ||
| it('renders the component with expected class and children', () => { | ||
| const { getByText } = render( | ||
| <IconList> | ||
| <div>Example</div> | ||
| </IconList>, | ||
| ); | ||
|
|
||
| const child = getByText('Example'); | ||
| const item = child.parentElement!; | ||
|
|
||
| expect(item.classList.contains('usa-icon-list')).to.be.true(); | ||
| expect(item.textContent).to.equal('Example'); | ||
| }); | ||
| }); |
13 changes: 13 additions & 0 deletions
13
app/javascript/packages/components/icon-list/icon-list.tsx
This file contains hidden or 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,13 @@ | ||
| import type { ReactNode } from 'react'; | ||
|
|
||
| interface IconListProps { | ||
| children?: ReactNode; | ||
| } | ||
|
|
||
| function IconList({ children }: IconListProps) { | ||
| const classes = 'usa-icon-list'; | ||
|
|
||
| return <ul className={classes}>{children}</ul>; | ||
| } | ||
|
|
||
| export default IconList; |
This file contains hidden or 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
30 changes: 30 additions & 0 deletions
30
app/javascript/packages/components/process-list/process-list-heading.spec.tsx
This file contains hidden or 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 { render } from '@testing-library/react'; | ||
| import ProcessListHeading from './process-list-heading'; | ||
|
|
||
| describe('ProcessListHeading', () => { | ||
| it('renders the component with expected class and children', () => { | ||
| const { getByText } = render( | ||
| <ProcessListHeading> | ||
| <li>Example</li> | ||
| </ProcessListHeading>, | ||
| ); | ||
|
|
||
| const child = getByText('Example'); | ||
| const item = child.parentElement!; | ||
|
|
||
| expect(item.classList.contains('usa-process-list__heading')).to.be.true(); | ||
| expect(item.textContent).to.equal('Example'); | ||
| }); | ||
|
|
||
| it('renders the component with no class if unstyled is passed', () => { | ||
| const { container } = render( | ||
| <ProcessListHeading unstyled> | ||
| <li>Example</li> | ||
| </ProcessListHeading>, | ||
| ); | ||
|
|
||
| const item = container.firstElementChild!; | ||
|
|
||
| expect(item.classList).to.be.empty(); | ||
| }); | ||
| }); |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.