[Drilldowns] Copy improvements (#65838)

* update toast messages

* update HelloBar text

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Anton Dosov 2020-05-11 12:38:39 +02:00 committed by GitHub
parent e148eb4437
commit ae38c6ba4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 46 deletions

View file

@ -289,8 +289,8 @@ function useDrilldownsStateManager(
await run(async () => {
await actionManager.createEvent(action, selectedTriggers);
notifications.toasts.addSuccess({
title: toastDrilldownCreated.title,
text: toastDrilldownCreated.text(action.name),
title: toastDrilldownCreated.title(action.name),
text: toastDrilldownCreated.text,
});
});
}
@ -303,8 +303,8 @@ function useDrilldownsStateManager(
await run(async () => {
await actionManager.updateEvent(drilldownId, action, selectedTriggers);
notifications.toasts.addSuccess({
title: toastDrilldownEdited.title,
text: toastDrilldownEdited.text(action.name),
title: toastDrilldownEdited.title(action.name),
text: toastDrilldownEdited.text,
});
});
}
@ -320,8 +320,8 @@ function useDrilldownsStateManager(
text: toastDrilldownDeleted.text,
}
: {
title: toastDrilldownsDeleted.title,
text: toastDrilldownsDeleted.text(drilldownIds.length),
title: toastDrilldownsDeleted.title(drilldownIds.length),
text: toastDrilldownsDeleted.text,
}
);
});

View file

@ -7,35 +7,41 @@
import { i18n } from '@kbn/i18n';
export const toastDrilldownCreated = {
title: i18n.translate(
'xpack.drilldowns.components.flyoutDrilldownWizard.toast.drilldownCreatedTitle',
title: (drilldownName: string) =>
i18n.translate(
'xpack.drilldowns.components.flyoutDrilldownWizard.toast.drilldownCreatedTitle',
{
defaultMessage: 'Drilldown "{drilldownName}" created',
values: {
drilldownName,
},
}
),
text: i18n.translate(
'xpack.drilldowns.components.flyoutDrilldownWizard.toast.drilldownCreatedText',
{
defaultMessage: 'Drilldown created',
// TODO: remove `Save your dashboard before testing.` part
// when drilldowns are used not only in dashboard
// or after https://github.com/elastic/kibana/issues/65179 implemented
defaultMessage: 'Save your dashboard before testing.',
}
),
text: (drilldownName: string) =>
i18n.translate('xpack.drilldowns.components.flyoutDrilldownWizard.toast.drilldownCreatedText', {
defaultMessage: 'You created "{drilldownName}". Save dashboard before testing.',
values: {
drilldownName,
},
}),
};
export const toastDrilldownEdited = {
title: i18n.translate(
'xpack.drilldowns.components.flyoutDrilldownWizard.toast.drilldownEditedTitle',
{
defaultMessage: 'Drilldown edited',
}
),
text: (drilldownName: string) =>
i18n.translate('xpack.drilldowns.components.flyoutDrilldownWizard.toast.drilldownEditedText', {
defaultMessage: 'You edited "{drilldownName}". Save dashboard before testing.',
title: (drilldownName: string) =>
i18n.translate('xpack.drilldowns.components.flyoutDrilldownWizard.toast.drilldownEditedTitle', {
defaultMessage: 'Drilldown "{drilldownName}" updated',
values: {
drilldownName,
},
}),
text: i18n.translate(
'xpack.drilldowns.components.flyoutDrilldownWizard.toast.drilldownEditedText',
{
defaultMessage: 'Save your dashboard before testing.',
}
),
};
export const toastDrilldownDeleted = {
@ -48,28 +54,26 @@ export const toastDrilldownDeleted = {
text: i18n.translate(
'xpack.drilldowns.components.flyoutDrilldownWizard.toast.drilldownDeletedText',
{
defaultMessage: 'You deleted a drilldown.',
defaultMessage: 'Save your dashboard before testing.',
}
),
};
export const toastDrilldownsDeleted = {
title: i18n.translate(
'xpack.drilldowns.components.flyoutDrilldownWizard.toast.drilldownsDeletedTitle',
{
defaultMessage: 'Drilldowns deleted',
}
),
text: (n: number) =>
title: (n: number) =>
i18n.translate(
'xpack.drilldowns.components.flyoutDrilldownWizard.toast.drilldownsDeletedText',
'xpack.drilldowns.components.flyoutDrilldownWizard.toast.drilldownsDeletedTitle',
{
defaultMessage: 'You deleted {n} drilldowns',
values: {
n,
},
defaultMessage: '{n} drilldowns deleted',
values: { n },
}
),
text: i18n.translate(
'xpack.drilldowns.components.flyoutDrilldownWizard.toast.drilldownsDeletedText',
{
defaultMessage: 'Save your dashboard before testing.',
}
),
};
export const toastDrilldownsCRUDError = i18n.translate(
@ -79,10 +83,3 @@ export const toastDrilldownsCRUDError = i18n.translate(
description: 'Title for generic error toast when persisting drilldown updates failed',
}
);
export const toastDrilldownsFetchError = i18n.translate(
'xpack.drilldowns.components.flyoutDrilldownWizard.toast.drilldownsFetchErrorTitle',
{
defaultMessage: 'Error fetching drilldowns',
}
);

View file

@ -10,7 +10,7 @@ export const txtHelpText = i18n.translate(
'xpack.drilldowns.components.DrilldownHelloBar.helpText',
{
defaultMessage:
'Drilldowns provide the ability to define a new behavior when interacting with a panel. You can add multiple options or simply override the default filtering behavior.',
'Drilldowns enable you to define new behaviors for interacting with panels. You can add multiple actions and override the default filter.',
}
);