Skip to content

Commit

Permalink
Bring toast copy in line with writing style. (#16752)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal authored Feb 15, 2018
1 parent 5c180d0 commit 6c57778
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/core_plugins/kibana/public/dashboard/dashboard_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ app.directive('dashboardApp', function ($injector) {
$scope.addVis = function (hit, showToast = true) {
dashboardStateManager.addNewPanel(hit.id, 'visualization');
if (showToast) {
toastNotifications.addSuccess('Added visualization to your dashboard');
toastNotifications.addSuccess('Visualization was added to your dashboard');
}
};

$scope.addSearch = function (hit) {
dashboardStateManager.addNewPanel(hit.id, 'search');
toastNotifications.addSuccess({
title: 'Added saved search to your dashboard',
title: 'Saved search was added to your dashboard',
'data-test-subj': 'addSavedSearchToDashboardSuccess',
});
};
Expand Down Expand Up @@ -274,7 +274,7 @@ app.directive('dashboardApp', function ($injector) {
$scope.kbnTopNav.close('save');
if (id) {
toastNotifications.addSuccess({
title: `Saved '${dash.title}'`,
title: `Dashboard '${dash.title}' was saved`,
'data-test-subj': 'saveDashboardSuccess',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ function discoverController(

if (id) {
toastNotifications.addSuccess({
title: `Saved '${savedSearch.title}'`,
title: `Search '${savedSearch.title}' was saved`,
'data-test-subj': 'saveSearchSuccess',
});

Expand Down
12 changes: 6 additions & 6 deletions src/ui/public/notify/toasts/TOAST_NOTIFICATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ toastNotifications.add('Copied to clipboard');
Let the user know that an action was successful, such as saving or deleting an object.

```js
toastNotifications.addSuccess('Saved document');
toastNotifications.addSuccess('Your document was saved');
```

#### Warning

If something OK or good happened, but perhaps wasn't perfect, show a warning toast.

```js
toastNotifications.addWarning('Saved document, but not edit history');
toastNotifications.addWarning('Your document was saved, but not its edit history');
```

#### Danger
Expand All @@ -51,7 +51,7 @@ toastNotifications.addDanger('An error caused your document to be lost');
Toasts will automatically be dismissed after a brief delay, but if for some reason you want to dismiss a toast, you can use the returned toast from one of the `add` methods and then pass it to `remove`.

```js
const toast = toastNotifications.add('Saved document');
const toast = toastNotifications.add('Your document was saved');
toastNotifications.remove(toast);
```

Expand All @@ -61,7 +61,7 @@ If you want to configure the toast further you can provide an object instead of

```js
toastNotifications.add({
title: 'Saved document',
title: 'Your document was saved',
text: 'Only you have access to this document',
color: 'success',
iconType: 'check',
Expand All @@ -73,7 +73,7 @@ Because the underlying components are React, you can use JSX to pass in React el

```js
toastNotifications.add({
title: 'Saved document',
title: 'Your document was saved',
text: (
<div>
<p>
Expand All @@ -94,7 +94,7 @@ Functional tests are commonly used to verify that a user action yielded a sucess

```js
toastNotifications.addSuccess({
title: 'Saved document',
title: 'Your document was saved',
'data-test-subj': 'saveDocumentSuccess',
});
```
2 changes: 1 addition & 1 deletion src/ui/public/share/directives/share.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ app.directive('share', function (Private) {
const isCopied = document.execCommand('copy');
if (isCopied) {
toastNotifications.add({
title: 'URL copied to clipboard',
title: 'URL was copied to the clipboard',
'data-test-subj': 'shareCopyToClipboardSuccess',
});
} else {
Expand Down

0 comments on commit 6c57778

Please sign in to comment.