Skip to content
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

Merged
merged 7 commits into from
Jan 8, 2018

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Dec 19, 2017

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

screen shot 2017-12-19 at 10 25 09 am

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cjcenizal cjcenizal added Team:Platform-Design Team Label for Kibana Design Team. Support the Analyze group of plugins. v6.2.0 v7.0.0 :Sharing and removed Team:Platform-Design Team Label for Kibana Design Team. Support the Analyze group of plugins. labels Dec 19, 2017
@stacey-gammon
Copy link
Contributor

stacey-gammon commented Dec 20, 2017

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.

before:
screen shot 2017-12-20 at 2 11 29 pm

after:
screen shot 2017-12-20 at 2 09 14 pm

Otherwise, LGTM.

@cjcenizal
Copy link
Contributor

@stacey-gammon Good catch! Yes, I think we should have a title, to adhere to the pattern in the EUI docs:

image

This will entail updating the 11 or so instances where we invoke confirmModal to make sure we're always providing it with a title.

@cjcenizal
Copy link
Contributor

I'd suggest pairing up with @gchaps when figuring out what the titles should be.

@gchaps
Copy link
Contributor

gchaps commented Dec 20, 2017

Yep, I can help. I'm not a fan of "Are you sure," though. Just extra words to read and not as direct.

@nreese
Copy link
Contributor Author

nreese commented Dec 20, 2017

The confirm modal is used in the following places. Titles will be needed for these.

  1. Dashboard Editing - Cancel changes. Message text Are you sure you want to cancel and lose changes?
  2. Deleting dashboards Are you sure you want to delete the selected dashboards? This action is irreversible!
  3. Index Pattern management - refresh field list This will reset the field popularity counters. Are you sure you want to refresh your fields?
  4. Index Pattern management - delete index pattern Are you sure you want to remove this index pattern?
  5. Index Pattern management - delete scripted field Are you sure want to delete ${field.name}? This action is irreversible!
  6. Index Pattern management - delete Source Filters Are you sure want to delete this filter?
  7. Saved Object management - bulk delete Are you sure you want to delete the selected ${$scope.currentTab.title}? This action is irreversible!
  8. Saved Object management - import If any of the objects already exist, do you want to automatically overwrite them?
  9. Saved Object management - delete Are you sure want to delete this object? This action is irreversible!
  10. Visualize - delete Are you sure you want to delete the selected visualizations? This action is irreversible!
  11. Timelion - delete sheet Are you sure you want to delete the sheet ${title}?
  12. Field editor - delete Are you sure want to delete '${self.field.name}'? This action is irreversible!

@gchaps
Copy link
Contributor

gchaps commented Dec 21, 2017

screen shot 2017-12-21 at 12 33 54 pm

@gchaps
Copy link
Contributor

gchaps commented Dec 21, 2017

screen shot 2017-12-21 at 12 35 46 pm

@gchaps
Copy link
Contributor

gchaps commented Dec 21, 2017

screen shot 2017-12-21 at 12 36 35 pm

@gchaps
Copy link
Contributor

gchaps commented Dec 21, 2017

@nreese and I worked on the titles and body text.

@nreese
Copy link
Contributor Author

nreese commented Jan 2, 2018

@gchaps I think we need to update the text for 8, Import saved Kibana objects. The prompt is asking about auto updating all or getting a confirm button for each existing saved object before overwriting. How about something like the below screen shot?

screen shot 2018-01-02 at 11 09 51 am

@nreese
Copy link
Contributor Author

nreese commented Jan 2, 2018

@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.

export function getUnsavedChangesWarningMessage(changedFilters) {
  const changedFilterList = createStringList(changedFilters);

  return changedFilterList ?
    `Are you sure you want to cancel and lose changes, including changes made to your ${changedFilterList}?` :
    `Are you sure you want to cancel and lose changes?`;
}

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?

cc @stacey-gammon

@stacey-gammon
Copy link
Contributor

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:

time changed

It does the same thing if you edited the query in the query bar.

screen shot 2018-01-02 at 2 26 41 pm

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?

@gchaps
Copy link
Contributor

gchaps commented Jan 2, 2018

@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

@cjcenizal
Copy link
Contributor

Personally I'm okay with getting rid of the logic and just using the simpler error message

SGTM

@nreese
Copy link
Contributor Author

nreese commented Jan 3, 2018

@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.

Copy link
Contributor

@cjcenizal cjcenizal left a 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}?`
Copy link
Contributor

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}?`
Copy link
Contributor

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}?`
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

@cjcenizal cjcenizal Jan 5, 2018

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 ?

Copy link
Contributor

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?

Copy link
Contributor

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.

@nreese nreese merged commit faf0633 into elastic:master Jan 8, 2018
nreese added a commit to nreese/kibana that referenced this pull request Jan 8, 2018
…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
nreese added a commit that referenced this pull request Jan 8, 2018
…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
@nreese nreese deleted the confirmModal branch February 13, 2018 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants