diff --git a/src/platform/packages/private/kbn-reporting/common/constants.ts b/src/platform/packages/private/kbn-reporting/common/constants.ts index 093868282a724..23803f8c7513e 100644 --- a/src/platform/packages/private/kbn-reporting/common/constants.ts +++ b/src/platform/packages/private/kbn-reporting/common/constants.ts @@ -8,6 +8,7 @@ */ import { + DISCOVER_APP_LOCATOR, CANVAS_APP_LOCATOR, DASHBOARD_APP_LOCATOR, LENS_APP_LOCATOR, @@ -62,6 +63,7 @@ export const JOB_COMPLETION_NOTIFICATIONS_SESSION_KEY = // Allowed locator types for reporting: the "reportable" analytical apps we expect to redirect to during screenshotting export const REPORTING_REDIRECT_ALLOWED_LOCATOR_TYPES = [ + DISCOVER_APP_LOCATOR, CANVAS_APP_LOCATOR, DASHBOARD_APP_LOCATOR, LENS_APP_LOCATOR, diff --git a/src/platform/packages/private/kbn-reporting/get_csv_panel_actions/panel_actions/get_csv_panel_action.tsx b/src/platform/packages/private/kbn-reporting/get_csv_panel_actions/panel_actions/get_csv_panel_action.tsx index 2610f75e0886f..7f6dfca7a6e50 100644 --- a/src/platform/packages/private/kbn-reporting/get_csv_panel_actions/panel_actions/get_csv_panel_action.tsx +++ b/src/platform/packages/private/kbn-reporting/get_csv_panel_actions/panel_actions/get_csv_panel_action.tsx @@ -19,7 +19,7 @@ import { HasTimeRange, } from '@kbn/discover-plugin/public'; import { LicensingPluginStart } from '@kbn/licensing-plugin/public'; -import { DISCOVER_APP_LOCATOR, type DiscoverAppLocatorParams } from '@kbn/discover-plugin/common'; +import { type DiscoverAppLocatorParams } from '@kbn/discover-plugin/common'; import { apiCanAccessViewMode, apiHasType, @@ -47,6 +47,7 @@ import { import type { ReportingAPIClient } from '@kbn/reporting-public/reporting_api_client'; import { LocatorParams } from '@kbn/reporting-common/types'; import { isOfAggregateQueryType } from '@kbn/es-query'; +import { DISCOVER_APP_LOCATOR } from '@kbn/deeplinks-analytics'; import { getI18nStrings } from './strings'; export interface PanelActionDependencies { diff --git a/src/platform/packages/private/kbn-reporting/get_csv_panel_actions/tsconfig.json b/src/platform/packages/private/kbn-reporting/get_csv_panel_actions/tsconfig.json index c44fd685f6652..d02a75ab4ad9b 100644 --- a/src/platform/packages/private/kbn-reporting/get_csv_panel_actions/tsconfig.json +++ b/src/platform/packages/private/kbn-reporting/get_csv_panel_actions/tsconfig.json @@ -29,5 +29,6 @@ "@kbn/presentation-publishing", "@kbn/reporting-common", "@kbn/es-query", + "@kbn/deeplinks-analytics", ] } diff --git a/src/platform/packages/shared/deeplinks/analytics/constants.ts b/src/platform/packages/shared/deeplinks/analytics/constants.ts index 32c8c6ab6398c..e2ff238704e68 100644 --- a/src/platform/packages/shared/deeplinks/analytics/constants.ts +++ b/src/platform/packages/shared/deeplinks/analytics/constants.ts @@ -7,6 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ +export const DISCOVER_APP_LOCATOR = 'DISCOVER_APP_LOCATOR'; + export const CANVAS_APP_LOCATOR = 'CANVAS_APP_LOCATOR'; export const DISCOVER_APP_ID = 'discover'; diff --git a/src/platform/packages/shared/deeplinks/analytics/index.ts b/src/platform/packages/shared/deeplinks/analytics/index.ts index 1507cfd4d2193..14ae160026e55 100644 --- a/src/platform/packages/shared/deeplinks/analytics/index.ts +++ b/src/platform/packages/shared/deeplinks/analytics/index.ts @@ -8,6 +8,7 @@ */ export { + DISCOVER_APP_LOCATOR, CANVAS_APP_LOCATOR, DASHBOARD_APP_ID, DISCOVER_APP_ID, diff --git a/x-pack/platform/plugins/private/reporting/public/management/components/report_exports_table.tsx b/x-pack/platform/plugins/private/reporting/public/management/components/report_exports_table.tsx index ed311cf11c92e..63f0ce39a587b 100644 --- a/x-pack/platform/plugins/private/reporting/public/management/components/report_exports_table.tsx +++ b/x-pack/platform/plugins/private/reporting/public/management/components/report_exports_table.tsx @@ -406,9 +406,15 @@ export class ReportExportsTable extends Component { onClick: (job) => this.setState({ selectedJob: job }), }, { - name: i18n.translate('xpack.reporting.exports.table.openInKibanaAppLabel', { - defaultMessage: 'Open Dashboard', - }), + name: (job) => + i18n.translate('xpack.reporting.schedules.table.openDashboard.title', { + defaultMessage: 'Open in {objectType}', + values: { + objectType: job.objectType + ? getDisplayNameFromObjectType(job.objectType) + : 'Kibana', + }, + }), 'data-test-subj': 'reportOpenInKibanaApp', description: i18n.translate( 'xpack.reporting.exports.table.openInKibanaAppDescription', diff --git a/x-pack/platform/plugins/private/reporting/public/management/components/report_schedules_table.tsx b/x-pack/platform/plugins/private/reporting/public/management/components/report_schedules_table.tsx index a3b9201f264bb..3fff5972e6d7a 100644 --- a/x-pack/platform/plugins/private/reporting/public/management/components/report_schedules_table.tsx +++ b/x-pack/platform/plugins/private/reporting/public/management/components/report_schedules_table.tsx @@ -204,17 +204,17 @@ export const ReportSchedulesTable = (props: { apiClient: ReportingAPIClient }) = { name: (item) => i18n.translate('xpack.reporting.schedules.table.openDashboard.title', { - defaultMessage: 'Open Dashboard', - }), - description: (item) => - i18n.translate('xpack.reporting.schedules.table.openDashboard.description', { - defaultMessage: 'Open associated {objectType}', + defaultMessage: 'Open in {objectType}', values: { objectType: item.payload?.objectType ? getDisplayNameFromObjectType(item.payload?.objectType) - : '', + : 'Kibana', }, }), + description: (item) => + i18n.translate('xpack.reporting.schedules.table.openDashboard.description', { + defaultMessage: 'Open the Kibana app where this report was generated.', + }), 'data-test-subj': (item) => `reportOpenDashboard-${item.id}`, type: 'icon', icon: 'dashboardApp', diff --git a/x-pack/platform/plugins/private/reporting/public/management/utils.ts b/x-pack/platform/plugins/private/reporting/public/management/utils.ts index 3e9098e0c9a3a..73411b41811f1 100644 --- a/x-pack/platform/plugins/private/reporting/public/management/utils.ts +++ b/x-pack/platform/plugins/private/reporting/public/management/utils.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { capitalize } from 'lodash'; import type { IconType } from '@elastic/eui'; import { JOB_STATUS } from '@kbn/reporting-common'; import { Job } from '@kbn/reporting-public'; @@ -47,9 +48,9 @@ export const guessAppIconTypeFromObjectType = (type: string): IconType => { export const getDisplayNameFromObjectType = (type: string): string => { switch (type) { case 'search': - return 'discover session'; + return 'Discover'; default: - return type; + return capitalize(type); } };