-
Notifications
You must be signed in to change notification settings - Fork 73
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
(feat) O3-3165: Add modal confirmation modal when deleting repeated question #267
Merged
+137
−220
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a9ebe9c
(feat): add modal for confirmation when deleting question
NethmiRodrigo a63ecb1
update test cases
NethmiRodrigo 1541d6d
rename components to convention
NethmiRodrigo 4ea81b5
remove style sheet and update carbon version
NethmiRodrigo 6361610
(fix): rename selectedQuestion state
NethmiRodrigo df1efaa
(fix): change primary button color of modal
NethmiRodrigo 715e071
(refactor) Move modal to patient chart and have fallback for no modal
NethmiRodrigo cad48a9
(refactor): add confirmation modal handler as prop
NethmiRodrigo 970415b
(fix): add error handler
NethmiRodrigo 7cc4ac3
(fix): Replace global store with react context
NethmiRodrigo c13a8c4
(refactor): Changed context name to be more generic
NethmiRodrigo 97d56dc
Slightly cleaner @carbon/react version pinning
ibacher 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
(refactor): add confirmation modal handler as prop
commit cad48a9e1d3b9bfdba74552ccf9d617fa087052b
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
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.
I think rather than using a global store for this, it makes more sense to use a React context. Context's are local to a React tree, so we have fewer issues around naming conflicts, etc. Global stores are for things we need to be shared across different React trees, but here I don't see a reason for it.
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.
Thanks, Ian. I've updated to using context instead, as suggested.
Could you please review the context part? I hope I've implemented it 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.
LGTM. I might rename the context
ExternalFunctionContext
or something so it's reusable for other similar functions (since I imagine we'll need something like this for other uses). Nice job!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.
Gotcha. I changed the context name and pulled it out of the
components/repeat
nested folder into the root of src, because it looked wrong to have it nested there when made generic.