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

[Drilldowns] Copy improvements #65838

Merged
merged 4 commits into from
May 11, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
});
}
Expand All @@ -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,
});
});
}
Expand All @@ -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,
}
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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(
Expand All @@ -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',
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
}
);

Expand Down