-
Notifications
You must be signed in to change notification settings - Fork 53
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
Remove save button in user settings #1030
Merged
Merged
Changes from 18 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
e412ed8
refactor(stacked-panes): Separate layout code from save/cancel buttons.
binh-dam-ibigroup c93a6ca
refactor(stacked-panes): Add more types to component.
binh-dam-ibigroup 2874d67
refactor(existing-account-display): Submit changes right away.
binh-dam-ibigroup ae94f94
refactor(existing-account-display): Fix types
binh-dam-ibigroup 1af40ce
refactor(notification-prefs-pane): Set onChange handler explicitly.
binh-dam-ibigroup 263c940
refactor(notification-prefs-pane): Add missing i18n
binh-dam-ibigroup 9a5ffc7
refactor(user-account-screen): Remove form element when viewing exist…
binh-dam-ibigroup 06b9bc6
refactor(user-account-screen): Remove unused validation.
binh-dam-ibigroup 9783e83
improvement(existing-account-display): Display toast to confirm field…
binh-dam-ibigroup 9904996
style(existing-account-display): Clean up code.
binh-dam-ibigroup 57a9b68
refactor(user-account-screen): Convert to TypeScript
binh-dam-ibigroup f482067
Merge branch 'dev' into remove-user-setting-save-btn
binh-dam-ibigroup 15cd0be
chore(i18n): Add i18n group exceptions.
binh-dam-ibigroup 760539b
improvement(existing-account-display): Disable inputs during user dat…
binh-dam-ibigroup fafbe96
improvement(user-account-screen): Consolidate input change handling.
binh-dam-ibigroup 2052b17
refactor(user-account-screen): Fix types.
binh-dam-ibigroup 64f98db
improvement(user-account-screen): Add i18n to profile upd error, reen…
binh-dam-ibigroup c9407f7
Merge branch 'dev' into remove-user-setting-save-btn
binh-dam-ibigroup 86bd255
Merge branch 'dev' into remove-user-setting-save-btn
binh-dam-ibigroup 9487b54
improvement(user-account-screen): Add visuals to denote submission pr…
binh-dam-ibigroup 70b8881
improvement(user-account-screen): Apply animation styles to all brows…
binh-dam-ibigroup 0c33524
improvement(user-account-screen): Add "updating" toast while user upd…
binh-dam-ibigroup eb85c70
refactor(user-account-screen): Tweak types
binh-dam-ibigroup b188043
improvement(user-account-screen): Add wait cursor to label of changed…
binh-dam-ibigroup 18f430b
Merge branch 'dev' into remove-user-setting-save-btn
binh-dam-ibigroup 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
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
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 |
---|---|---|
|
@@ -3,23 +3,21 @@ import React, { useEffect, useState } from 'react' | |
|
||
import { InlineLoading } from '../narrative/loading' | ||
|
||
import { PageHeading, StackedPaneContainer } from './styled' | ||
import FormNavigationButtons from './form-navigation-buttons' | ||
import StackedPanes, { Props as StackedPanesProps } from './stacked-panes' | ||
|
||
type Props = { | ||
interface Props extends StackedPanesProps { | ||
onCancel: () => void | ||
paneSequence: any[] | ||
title?: string | JSX.Element | ||
} | ||
|
||
/** | ||
* This component handles the flow between screens for new OTP user accounts. | ||
* | ||
* TODO: add types once Pane type exists | ||
*/ | ||
const StackedPaneDisplay = ({ | ||
const StackedPanesWithSave = ({ | ||
onCancel, | ||
paneSequence, | ||
panes, | ||
title | ||
}: Props): JSX.Element => { | ||
// Create indicator of if cancel button was clicked so that child components can know | ||
|
@@ -28,22 +26,11 @@ const StackedPaneDisplay = ({ | |
|
||
useEffect(() => { | ||
setButtonClicked('') | ||
}, [paneSequence]) | ||
}, [panes]) | ||
|
||
return ( | ||
<> | ||
{title && <PageHeading>{title}</PageHeading>} | ||
{paneSequence.map( | ||
({ hidden, pane: Pane, props, title }, index) => | ||
!hidden && ( | ||
<StackedPaneContainer key={index}> | ||
<h3>{title}</h3> | ||
<div> | ||
<Pane canceled={isBeingCanceled} {...props} /> | ||
</div> | ||
</StackedPaneContainer> | ||
) | ||
)} | ||
<StackedPanes canceling={isBeingCanceled} panes={panes} title={title} /> | ||
|
||
<FormNavigationButtons | ||
backButton={{ | ||
|
@@ -78,4 +65,4 @@ const StackedPaneDisplay = ({ | |
</> | ||
) | ||
} | ||
export default StackedPaneDisplay | ||
export default StackedPanesWithSave | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we do this instead of adding a prop? Is it formik nonsense? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's to separate the code noise brought by handling the navigation button states. |
Oops, something went wrong.
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.
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.
why was this changed to a single value array? Is this to allow for more notification channels like 'sms'
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.
Correct. I also changed the type of the user data to
EditedUser
, for which enabled notifications channels are stored in an array.