diff --git a/docs/user/dashboard/drilldowns.asciidoc b/docs/user/dashboard/drilldowns.asciidoc index 85230f1b6f70d..e3d0e16630c5c 100644 --- a/docs/user/dashboard/drilldowns.asciidoc +++ b/docs/user/dashboard/drilldowns.asciidoc @@ -1,3 +1,4 @@ +[role="xpack"] [[drilldowns]] == Use drilldowns for dashboard actions diff --git a/docs/user/dashboard/url-drilldown.asciidoc b/docs/user/dashboard/url-drilldown.asciidoc index 4919625340da2..e6daf89d72718 100644 --- a/docs/user/dashboard/url-drilldown.asciidoc +++ b/docs/user/dashboard/url-drilldown.asciidoc @@ -1,6 +1,8 @@ [[url-drilldown]] === URL drilldown +beta[] + The URL drilldown allows you to navigate from a dashboard to an internal or external URL. The destination URL can be dynamic, depending on the dashboard context or user’s interaction with a visualization. diff --git a/x-pack/plugins/embeddable_enhanced/public/drilldowns/url_drilldown/url_drilldown.tsx b/x-pack/plugins/embeddable_enhanced/public/drilldowns/url_drilldown/url_drilldown.tsx index 04f60662d88a3..85e92d0827daa 100644 --- a/x-pack/plugins/embeddable_enhanced/public/drilldowns/url_drilldown/url_drilldown.tsx +++ b/x-pack/plugins/embeddable_enhanced/public/drilldowns/url_drilldown/url_drilldown.tsx @@ -51,6 +51,7 @@ export class UrlDrilldown implements Drilldown txtUrlDrilldownDisplayName; diff --git a/x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/action_wizard.test.tsx b/x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/action_wizard.test.tsx index 9cc64defc1795..fcea8caf9090e 100644 --- a/x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/action_wizard.test.tsx +++ b/x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/action_wizard.test.tsx @@ -82,3 +82,18 @@ test('If not enough license, button is disabled', () => { expect(screen.getByText(/Go to URL/i)).toBeDisabled(); }); + +test('if action is beta, beta badge is shown', () => { + const betaUrl = new ActionFactory( + { + ...urlDrilldownActionFactory, + isBeta: true, + }, + { + getLicense: () => licensingMock.createLicense(), + getFeatureUsageStart: () => licensingMock.createStart().featureUsage, + } + ); + const screen = render(); + expect(screen.getByText(/Beta/i)).toBeVisible(); +}); diff --git a/x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/action_wizard.tsx b/x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/action_wizard.tsx index 16d0250c5721e..a3f6cac3ba1b4 100644 --- a/x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/action_wizard.tsx +++ b/x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/action_wizard.tsx @@ -19,9 +19,12 @@ import { EuiTextColor, EuiTitle, EuiLink, + EuiBetaBadge, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { + txtBetaActionFactoryLabel, + txtBetaActionFactoryTooltip, txtChangeButton, txtTriggerPickerHelpText, txtTriggerPickerLabel, @@ -255,7 +258,15 @@ const SelectedActionFactory: React.FC = ({ )} -

{actionFactory.getDisplayName(context)}

+

+ {actionFactory.getDisplayName(context)}{' '} + {actionFactory.isBeta && ( + + )} +

{showDeselect && ( @@ -350,6 +361,10 @@ const ActionFactorySelector: React.FC = ({ data-test-subj={`${TEST_SUBJ_ACTION_FACTORY_ITEM}-${actionFactory.id}`} onClick={() => onActionFactorySelected(actionFactory)} disabled={!actionFactory.isCompatibleLicense()} + betaBadgeLabel={actionFactory.isBeta ? txtBetaActionFactoryLabel : undefined} + betaBadgeTooltipContent={ + actionFactory.isBeta ? txtBetaActionFactoryTooltip : undefined + } > {actionFactory.getIconType(context) && ( diff --git a/x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/i18n.ts b/x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/i18n.ts index f494ecfb51f32..43a3bd01daf37 100644 --- a/x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/i18n.ts +++ b/x-pack/plugins/ui_actions_enhanced/public/components/action_wizard/i18n.ts @@ -33,3 +33,17 @@ export const txtTriggerPickerHelpTooltip = i18n.translate( defaultMessage: 'Determines when the drilldown appears in context menu', } ); + +export const txtBetaActionFactoryLabel = i18n.translate( + 'xpack.uiActionsEnhanced.components.actionWizard.betaActionLabel', + { + defaultMessage: `Beta`, + } +); + +export const txtBetaActionFactoryTooltip = i18n.translate( + 'xpack.uiActionsEnhanced.components.actionWizard.betaActionTooltip', + { + defaultMessage: `This action is in beta and is subject to change. The design and code is less mature than official GA features and is being provided as-is with no warranties. Beta features are not subject to the support SLA of official GA features. Please help us by reporting any bugs or providing other feedback.`, + } +); diff --git a/x-pack/plugins/ui_actions_enhanced/public/drilldowns/drilldown_definition.ts b/x-pack/plugins/ui_actions_enhanced/public/drilldowns/drilldown_definition.ts index 8faccc088a327..f5e565d4090ff 100644 --- a/x-pack/plugins/ui_actions_enhanced/public/drilldowns/drilldown_definition.ts +++ b/x-pack/plugins/ui_actions_enhanced/public/drilldowns/drilldown_definition.ts @@ -36,6 +36,12 @@ export interface DrilldownDefinition< */ id: string; + /** + * Is this action factory not GA? + * Adds a beta badge on a list item representing this ActionFactory + */ + readonly isBeta?: boolean; + /** * Minimal license level * Empty means no restrictions diff --git a/x-pack/plugins/ui_actions_enhanced/public/drilldowns/url_drilldown/components/url_drilldown_collect_config/i18n.ts b/x-pack/plugins/ui_actions_enhanced/public/drilldowns/url_drilldown/components/url_drilldown_collect_config/i18n.ts index 78f7218dce22e..500ef21b61dc4 100644 --- a/x-pack/plugins/ui_actions_enhanced/public/drilldowns/url_drilldown/components/url_drilldown_collect_config/i18n.ts +++ b/x-pack/plugins/ui_actions_enhanced/public/drilldowns/url_drilldown/components/url_drilldown_collect_config/i18n.ts @@ -19,7 +19,8 @@ export const txtUrlTemplatePlaceholder = i18n.translate( export const txtUrlPreviewHelpText = i18n.translate( 'xpack.uiActionsEnhanced.drilldowns.urlDrilldownCollectConfig.urlPreviewHelpText', { - defaultMessage: 'Please note that \\{\\{event.*\\}\\} variables replaced by dummy values.', + defaultMessage: + 'Please note that in preview \\{\\{event.*\\}\\} variables are substituted with dummy values.', } ); diff --git a/x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.test.ts b/x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.test.ts index 032a4a63fe2e9..66a876bdbab85 100644 --- a/x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.test.ts +++ b/x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.test.ts @@ -114,3 +114,15 @@ describe('License & ActionFactory', () => { }); }); }); + +describe('isBeta', () => { + test('false by default', async () => { + const factory = createActionFactory(); + expect(factory.isBeta).toBe(false); + }); + + test('true', async () => { + const factory = createActionFactory({ isBeta: true }); + expect(factory.isBeta).toBe(true); + }); +}); diff --git a/x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts b/x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts index 35a82adf9896d..3ad6d4ee39749 100644 --- a/x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts +++ b/x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory.ts @@ -46,6 +46,7 @@ export class ActionFactory< } public readonly id = this.def.id; + public readonly isBeta = this.def.isBeta ?? false; public readonly minimalLicense = this.def.minimalLicense; public readonly licenseFeatureName = this.def.licenseFeatureName; public readonly order = this.def.order || 0; diff --git a/x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory_definition.ts b/x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory_definition.ts index 91b8c8ec1e5ef..7ec6b21485747 100644 --- a/x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory_definition.ts +++ b/x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory_definition.ts @@ -46,6 +46,12 @@ export interface ActionFactoryDefinition< */ licenseFeatureName?: string; + /** + * Is this action factory not GA? + * Adds a beta badge on a list item representing this ActionFactory + */ + readonly isBeta?: boolean; + /** * This method should return a definition of a new action, normally used to * register it in `ui_actions` registry. diff --git a/x-pack/plugins/ui_actions_enhanced/public/services/ui_actions_service_enhancements.ts b/x-pack/plugins/ui_actions_enhanced/public/services/ui_actions_service_enhancements.ts index b8086c16f5e71..ab0aa1200f5a7 100644 --- a/x-pack/plugins/ui_actions_enhanced/public/services/ui_actions_service_enhancements.ts +++ b/x-pack/plugins/ui_actions_enhanced/public/services/ui_actions_service_enhancements.ts @@ -89,6 +89,7 @@ export class UiActionsServiceEnhancements { ExecutionContext extends TriggerContextMapping[SupportedTriggers] = TriggerContextMapping[SupportedTriggers] >({ id: factoryId, + isBeta, order, CollectConfig, createConfig, @@ -109,6 +110,7 @@ export class UiActionsServiceEnhancements { ExecutionContext > = { id: factoryId, + isBeta, minimalLicense, licenseFeatureName, order,