-
Notifications
You must be signed in to change notification settings - Fork 43
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
✨ Questionnaire delete confirmation #1303
Conversation
client/src/app/pages/assessment-management/assessment-settings/assessment-settings-page.tsx
Outdated
Show resolved
Hide resolved
client/src/app/pages/assessment-management/assessment-settings/assessment-settings-page.tsx
Outdated
Show resolved
Hide resolved
...essment-management/assessment-settings/delete-questionnaire/delete-questionnaire-message.tsx
Outdated
Show resolved
Hide resolved
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1303 +/- ##
==========================================
+ Coverage 42.58% 42.59% +0.01%
==========================================
Files 136 136
Lines 4220 4221 +1
Branches 1000 1001 +1
==========================================
+ Hits 1797 1798 +1
Misses 2411 2411
Partials 12 12
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ 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.
Issues I found:
-
The Cancel button on the delete confirm modal is never enabled, but the X icon and the Esc key do work.
-
In other "type the name of the thing to delete" interactions I've used, the name of the thing is provided on the modal. Right now, if I don't remember the exact full name of the assessment questionnaire, I need to close the confirm box copy the name, then go back in, then paste it. Adding the name questionnaire being deleted to the confirm modal would help.
Hi @sjd78
That's not entirely accurate, the Cancel button is enabled only when submit is enabled as well, but I agree that that is not a wanted behavior, I should expose a new prop the ConfirmModal component to disable the submit only.
Agreed, will follow the example from Console "Delete project" modal: |
cdcffea
to
da2ad29
Compare
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 confirm deletion with the name of the entity to delete right there is perfect.
But looking more closely at the ConfirmDialog
component itself, I think this use is beyond what ConfirmDialog is really meant for. WDYT about just using a Modal
or enhancing DeleteQuestionnaireMessage
to ConfirmDeleteQuestionnaireModal
? That way the cancel button and the submit button can work exactly as we want without impacting any other use of ConfirmDialog
that really is just a message with Yes/No button kind of thing.
With ConfirmDeleteQuestionnaireModal
, it wouldn't need to be a controlled component. All the state logic could just live in the modal.
Maybe it seems like splitting hairs a bit, but I think it'll look nicer that way.
WDYT @ibolton336, @gildub, @mturley ?
@sjd78 I agree, I think there's a cleaner abstraction to be found here. I wonder if we are going to ever want another entity with type-the-name-to-confirm-deletion in this way? If so, maybe we should make a |
10c4a95
to
64030e6
Compare
@mturley @sjd78 @ibolton336 Hi there |
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.
Functionally looks much better. Just a few extra minor tweaks needed.
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.
You can drop the changes on this file now.
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.
Right, will revert changes
titleIconVariant={titleIconVariant} | ||
isOpen={isOpen} | ||
onClose={handleClose} | ||
aria-label={t("Confirm delete dialog")} |
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.
Either this key needs to be fixed to something like `"dialog.aria.confirmDelete" or just use the English string. I've not seen any other externalized aria labels.
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.
Right, habit from CNV, will change
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
Signed-off-by: Aviv Turgeman <aturgema@redhat.com>
Signed-off-by: Aviv Turgeman <aturgema@redhat.com>
Signed-off-by: Aviv Turgeman <aturgema@redhat.com>
Signed-off-by: Aviv Turgeman <aturgema@redhat.com>
Signed-off-by: Aviv Turgeman <aturgema@redhat.com>
9874556
to
c61ddce
Compare
closes #1276
Adding an explanation of what happens if the questionnaire is deleted and forcing the user to write the questionnaire's name to deletion.
Note: the input is case-sensitive to the name of the questionnaire.
Before:
After: