[Lens] reduce sync bundle size and update package size limit (#130156) (#130335)

(cherry picked from commit 72c40f2119)

Co-authored-by: Andrew Tate <andrew.tate@elastic.co>
This commit is contained in:
Kibana Machine 2022-04-14 17:53:36 -05:00 committed by GitHub
parent 84fed4732f
commit cbab89d8a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 15 deletions

View file

@ -30,7 +30,7 @@ pageLoadAssetSize:
inputControlVis: 172675
inspector: 148711
kibanaOverview: 56279
lens: 96624
lens: 35000
licenseManagement: 41817
licensing: 29004
lists: 22900

View file

@ -31,11 +31,7 @@ import {
DispatchSetState,
} from '../state_management';
import { getIndexPatternsObjects, getIndexPatternsIds, getResolvedDateRange } from '../utils';
import {
combineQueryAndFilters,
getLayerMetaInfo,
getShowUnderlyingDataLabel,
} from './show_underlying_data';
import { combineQueryAndFilters, getLayerMetaInfo } from './show_underlying_data';
function getLensTopNavConfig(options: {
showSaveAndReturn: boolean;
@ -103,11 +99,15 @@ function getLensTopNavConfig(options: {
}
if (showOpenInDiscover) {
const exploreDataInDiscoverLabel = i18n.translate('xpack.lens.app.exploreDataInDiscover', {
defaultMessage: 'Explore data in Discover',
});
topNavMenu.push({
label: getShowUnderlyingDataLabel(),
label: exploreDataInDiscoverLabel,
run: () => {},
testId: 'lnsApp_openInDiscover',
description: getShowUnderlyingDataLabel(),
description: exploreDataInDiscoverLabel,
disableButton: Boolean(tooltips.showUnderlyingDataWarning()),
tooltip: tooltips.showUnderlyingDataWarning,
target: '_blank',

View file

@ -20,11 +20,6 @@ import { partition } from 'lodash';
import { TableInspectorAdapter } from '../editor_frame_service/types';
import { Datasource } from '../types';
export const getShowUnderlyingDataLabel = () =>
i18n.translate('xpack.lens.app.exploreRawData', {
defaultMessage: 'Explore data in Discover',
});
/**
* Joins a series of queries.
*

View file

@ -6,11 +6,11 @@
*/
import type { IEmbeddable } from 'src/plugins/embeddable/public';
import { i18n } from '@kbn/i18n';
import { createAction } from '../../../../../src/plugins/ui_actions/public';
import type { Embeddable } from '../embeddable';
import type { DiscoverStart } from '../../../../../src/plugins/discover/public';
import { DOC_TYPE } from '../../common';
import { getShowUnderlyingDataLabel } from '../app_plugin/show_underlying_data';
const ACTION_OPEN_IN_DISCOVER = 'ACTION_OPEN_IN_DISCOVER';
@ -20,7 +20,10 @@ export const createOpenInDiscoverAction = (discover: DiscoverStart, hasDiscoverA
id: ACTION_OPEN_IN_DISCOVER,
order: 19, // right after Inspect which is 20
getIconType: () => 'popout',
getDisplayName: () => getShowUnderlyingDataLabel(),
getDisplayName: () =>
i18n.translate('xpack.lens.app.exploreDataInDiscover', {
defaultMessage: 'Explore data in Discover',
}),
isCompatible: async (context: { embeddable: IEmbeddable }) => {
if (!hasDiscoverAccess) return false;
return (