-
Notifications
You must be signed in to change notification settings - Fork 29
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
fix: Enhance confirmation modal provider to offer customizable option… #1545
Conversation
Quality Gate passedIssues Measures |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1545 +/- ##
=======================================
Coverage ? 79.96%
Complexity ? 259
=======================================
Files ? 276
Lines ? 7787
Branches ? 1531
=======================================
Hits ? 6227
Misses ? 1500
Partials ? 60 ☔ View full report in Codecov by Sentry. |
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.
TL;DR
Hi @igarashitm,
I think we can simplify the modal in the light of the intended changes, but I reckon this is a building block for another feature, so I want to propose a couple of alternatives:
- Move forward with this PR as is and then we will revisit it at a later stage
- We introduce the changes in this PR or in another one
Either option is good 👍 , if you wanna know the reasoning behind, please check the paragraph below.
Hi @igarashitm,
I would like to comment a couple of topics:
- Having numeric indexes for the
key
attribute for React is not ideal, maybe in this particular case won't matter much as the array is static. Nevertheless, what you receive as output (1, 2, 0) perhaps is not as convenient, especially because it looks like despite changing the return type of the modal, is still working for the existingDeleteStep
andDeleteGroup
? 😄 - Since this modal is used beyond simply deleting items, I think we could simplify the logic by removing everything that is
Delete
-related and assume the consumer will mention what exactly needs to be shown at all times.
Things like:
options.buttonOptions
? setButtonOptions(options.buttonOptions)
: setButtonOptions([{ index: ACTION_INDEX_CONFIRM, buttonText: 'Confirm', variant: ButtonVariant.danger }]);
can be simplified to:
setButtonOptions(options.buttonOptions)
I understand this is a building block for another feature, so feel free to move forward as-is and we can revisit it later, alternatively, I can lend a hand if you want as well.
Thanks for handling this 👍
Hi @lordrip thanks for the comments 👍 I'd start from this particular question
Yes and I kinda tried to - fix the cancel index to |
We decided to go with this for now, a clean up would come later. |
…s/buttons
Fixes: #1537