-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
replace KuiConfirmModal with EuiConfirmModal in confirm-modal directive #15693
Conversation
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!
Should we give it a title? Or update the EUI one to not have so much space at the top if no title was given? Ultimately I'll defer to @cjcenizal, just wanted to point it out. Otherwise, LGTM. |
@stacey-gammon Good catch! Yes, I think we should have a title, to adhere to the pattern in the EUI docs: This will entail updating the 11 or so instances where we invoke |
I'd suggest pairing up with @gchaps when figuring out what the titles should be. |
Yep, I can help. I'm not a fan of "Are you sure," though. Just extra words to read and not as direct. |
The confirm modal is used in the following places. Titles will be needed for these.
|
@nreese and I worked on the titles and body text. |
@gchaps I think we need to update the text for 8, |
@alexfrancoeur @elastic/kibana-design The existing implementation for the "Cancel dashboard editing" confirm modal contains logic to display the name(s) of any filters that have been edited.
The updated wording keeps things simple and just displays "Once you discard your changes, there's no getting them back". Number 1 in #15693 (comment). Should the confirm message retain the specific warning about filters? Or should a static message be displayed? |
FYI, for the one about discarding changes, we have some additional logic that specifically points out changes made to your query an/or the time range (if time is saved with a dashboard). We added this logic because these settings can be modified in view mode. If you then go into edit mode and hit cancel without changing anything, you'll get the warning but might be confused as to why. Here is an example flow: It does the same thing if you edited the query in the query bar. Personally I'm okay with getting rid of the logic and just using the simpler error message. I doubt people read that far into the message anyway. But I did want to point it out. @cjcenizal - do you have any thoughts on this, since you were a part of the original discussions for how to handle that odd situation of editing a part of a dashboard in view mode then going into edit mode? |
@nreese The title and the sentence below it say the same thing. Can we simply say: Automatically overwrite all saved objects? No, prompt for each object Yes, overwrite all objects --or-- Automatically overwrite all saved objects? Currently saved objects will be lost. No, prompt for each object Yes, overwrite all objects |
SGTM |
@stacey-gammon @cjcenizal Would you mind taking another look at this PR. With the addition of rewording each confirmation modal, lots has changed since your initial approvals. |
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.
Changes LGTM overall, just had some questions for Gail.
onConfirm: () => { $scope.indexPattern.removeScriptedField(field.name); } | ||
confirmButtonText: 'Delete', | ||
onConfirm: () => { $scope.indexPattern.removeScriptedField(field.name); }, | ||
title: `Delete scripted field ${field.name}?` |
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.
@gchaps Should we wrap custom names of things in quotation marks? For example, if the scripted field happens to be named "field", this message will read:
Delete scripted field field?
It seems like any generic-sounding word will make that sentence read funny. I think quotation marks would clarify the question:
Delete scripted field "field"?
@@ -117,9 +117,10 @@ app.controller('timelion', function ( | |||
|
|||
const confirmModalOptions = { | |||
onConfirm: doDelete, | |||
confirmButtonText: 'Delete sheet' | |||
confirmButtonText: 'Delete', | |||
title: `Delete Timelion sheet ${title}?` |
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.
@gchaps Same idea here regarding quotation marks.
onConfirm: doDelete | ||
confirmButtonText: 'Delete', | ||
onConfirm: doDelete, | ||
title: `Delete field ${self.field.name}?` |
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.
@gchaps Same idea here regarding quotation marks.
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.
Good point, @cjcenizal
Our writing guidelines say to avoid unnecessary punctuation unless it helps clarify meaning, which in this case it does. I did some research and I noticed that others do use quotation marks around a field name in a title. For example:
Delete file “New Text Document”
If this looks too heavy, we can also try single quotation marks:
Delete file ‘New Text Document’
Or if you don’t want punctuation in the title, we can use a title followed by a sentence. For example,
Delete this file?
The file ‘New Text Document’ will be moved to the Recycle bin.
My preference is to use single quotation marks.
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.
Single quotation marks sounds good to me. What do you think @nreese ?
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.
@gchaps Can you also update the writing guidelines with this rule?
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.
@cjcenizal Yes, good idea to add this to the guidelines.
… clean up wording for import saved objects modal
…ve (elastic#15693) * replace KuiConfirmModal with EuiConfirmModal * add titles to confirm modals. Update modal text and button text * updates for newest version of EUI * use EUI class in overlay and EUI button constants * remove logic about changed filters in cancel dashboard editing modal, clean up wording for import saved objects modal * fix broken function test - management delete index pattern * wrap names in single quotes
…ve (#15693) (#15898) * replace KuiConfirmModal with EuiConfirmModal * add titles to confirm modals. Update modal text and button text * updates for newest version of EUI * use EUI class in overlay and EUI button constants * remove logic about changed filters in cancel dashboard editing modal, clean up wording for import saved objects modal * fix broken function test - management delete index pattern * wrap names in single quotes
replace KuiConfirmModal with EuiConfirmModal in confirm-modal directive
EuiConfirmModal is a drop in replacement for KuiConfirmModal but provides better styling - like theming for dark mode