Skip to content

Commit

Permalink
Show data view name when available in UA
Browse files Browse the repository at this point in the history
  • Loading branch information
davismcphee committed Dec 4, 2024
1 parent 367119a commit 0ab2795
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/plugins/data_views/server/deprecations/scripted_fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<DataViewAttributes, 'title' | 'fields'>;
type DataViewAttributesWithFields = Pick<DataViewAttributes, 'name' | 'title' | 'fields'>;

export const createScriptedFieldsDeprecationsConfig: (
core: CoreSetup
Expand All @@ -29,7 +29,7 @@ export const createScriptedFieldsDeprecationsConfig: (
{
type: 'index-pattern',
perPage: 1000,
fields: ['title', 'fields'],
fields: ['name', 'title', 'fields'],
namespaces: ['*'],
}
);
Expand Down Expand Up @@ -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',
}
);

Expand All @@ -113,7 +113,11 @@ const dataViewSpacesLabel = i18n.translate(
const buildDataViewsListEntry = (
so: SavedObjectsFindResult<DataViewAttributesWithFields>
) => `- **${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 = ({
Expand Down

0 comments on commit 0ab2795

Please sign in to comment.