From 0ab27952d76a7c42d071449e5e4eb18f6900edf4 Mon Sep 17 00:00:00 2001 From: Davis McPhee Date: Tue, 3 Dec 2024 20:02:35 -0400 Subject: [PATCH] Show data view name when available in UA --- .../server/deprecations/scripted_fields.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/plugins/data_views/server/deprecations/scripted_fields.ts b/src/plugins/data_views/server/deprecations/scripted_fields.ts index 2c6890040de1..a70bb29219dc 100644 --- a/src/plugins/data_views/server/deprecations/scripted_fields.ts +++ b/src/plugins/data_views/server/deprecations/scripted_fields.ts @@ -19,7 +19,7 @@ import type { DocLinks } from '@kbn/doc-links'; import type { DeprecationDetailsMessage } from '@kbn/core-deprecations-common'; import type { DataViewAttributes } from '../../common'; -type DataViewAttributesWithFields = Pick; +type DataViewAttributesWithFields = Pick; export const createScriptedFieldsDeprecationsConfig: ( core: CoreSetup @@ -29,7 +29,7 @@ export const createScriptedFieldsDeprecationsConfig: ( { type: 'index-pattern', perPage: 1000, - fields: ['title', 'fields'], + fields: ['name', 'title', 'fields'], namespaces: ['*'], } ); @@ -96,10 +96,10 @@ const dataViewIdLabel = i18n.translate('dataViews.deprecations.scriptedFields.da defaultMessage: 'ID', }); -const dataViewTitleLabel = i18n.translate( - 'dataViews.deprecations.scriptedFields.dataViewTitleLabel', +const dataViewNameLabel = i18n.translate( + 'dataViews.deprecations.scriptedFields.dataViewNameLabel', { - defaultMessage: 'Title', + defaultMessage: 'Name', } ); @@ -113,7 +113,11 @@ const dataViewSpacesLabel = i18n.translate( const buildDataViewsListEntry = ( so: SavedObjectsFindResult ) => `- **${dataViewIdLabel}:** ${so.id} - - **${dataViewTitleLabel}:** ${so.attributes.title} + - **${dataViewNameLabel}:** ${ + so.attributes.name + ? `!{tooltip[${so.attributes.name}](${so.attributes.title})}` + : so.attributes.title +} - **${dataViewSpacesLabel}:** ${so.namespaces?.join(', ')}`; const buildMessage = ({