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

Bring toast copy in line with writing style. #16752

Merged
merged 1 commit into from
Feb 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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