+
{typeof group.suggestedValue?.() === 'number' ? (
) : (
diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.scss b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.scss
index 0efd82bc31063..3afcc0173ca2e 100644
--- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.scss
+++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.scss
@@ -41,19 +41,19 @@
}
// Add border to the top of the next same panel
- & + & {
+ &+& {
border-top: $euiBorderThin;
margin-top: 0;
}
- & > * {
+ &>* {
margin-bottom: 0;
}
// Targeting EUI class as we are unable to apply a class to this element in component
&,
.euiFormRow__fieldWrapper {
- & > * + * {
+ &>*+* {
margin-top: $euiSizeS;
}
}
@@ -64,121 +64,31 @@
padding: $euiSizeS $euiSize;
}
-.lnsLayerPanel__dimensionRemove {
- margin-right: $euiSizeS;
- opacity: 0;
-
- &:focus {
- opacity: 1;
- }
-}
-
-.lnsLayerPanel__dimension {
- @include euiFontSizeS;
- border-radius: $euiBorderRadius;
- display: flex;
- align-items: center;
- overflow: hidden;
- min-height: $euiSizeXL;
- position: relative;
-
- // NativeRenderer is messing this up
- > div {
- flex-grow: 1;
- }
-
- &:hover,
- &:focus {
- .lnsLayerPanel__dimensionRemove {
- visibility: visible;
- opacity: 1;
- transition: opacity $euiAnimSpeedFast ease-in-out;
- }
- }
+.lnsLayerPanel__styleEditor {
+ padding: $euiSize;
}
-.lnsLayerPanel__dimension--empty {
- border: $euiBorderWidthThin dashed $euiBorderColor !important;
-
- &:focus,
- &:focus-within {
- @include euiFocusRing;
- }
-}
+// Start dimension style overrides
.lnsLayerPanel__dimensionContainer {
position: relative;
- & + & {
+ &+& {
margin-top: $euiSizeS;
}
}
-.lnsLayerPanel__triggerText {
- width: 100%;
- padding: $euiSizeXS $euiSizeS;
- word-break: break-word;
- font-weight: $euiFontWeightRegular;
-}
-
-.lnsLayerPanel__dimensionLink {
- &:hover {
- text-decoration: none;
- }
-}
-
-.lnsLayerPanel__triggerTextLabel {
- transition: background-color $euiAnimSpeedFast ease-in-out;
-
- &:hover {
- text-decoration: underline;
- }
-}
-
.domDragDrop-isReplacing {
- .lnsLayerPanel__triggerText {
+ .dimensionTrigger__textLabel {
text-decoration: line-through;
}
}
-.lnsLayerPanel__triggerTextContent {
- // Make EUI button content not centered
- justify-content: flex-start;
- padding: 0 !important; // sass-lint:disable-line no-important
- color: $euiTextSubduedColor;
-}
-
-.lnsLayerPanel__styleEditor {
- padding: $euiSize;
-}
-
-.lnsLayerPanel__colorIndicator {
- margin-left: $euiSizeS;
-}
-
-.lnsLayerPanel__paletteContainer {
- position: absolute;
- bottom: 0;
- left: 0;
- right: 0;
-}
-
-.lnsLayerPanel__palette {
- height: $euiSizeXS / 2;
- border-radius: 0 0 ($euiBorderRadius - 1px) ($euiBorderRadius - 1px);
-
- &::after {
- border: none;
- }
-}
-
// Added .lnsLayerPanel__dimension specificity required for animation style override
.lnsLayerPanel__dimension .lnsLayerPanel__dimensionLink {
- width: 100%;
-
&:focus {
- @include passDownFocusRing('.lnsLayerPanel__triggerTextLabel');
+ @include passDownFocusRing('.dimensionTrigger__textLabel');
background-color: transparent;
text-decoration-thickness: $euiBorderWidthThin !important;
}
-}
+}
\ No newline at end of file
diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.test.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.test.tsx
index 18b5acd160aaf..eae473567922d 100644
--- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.test.tsx
+++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.test.tsx
@@ -21,6 +21,7 @@ import {
mountWithProvider,
} from '../../../mocks';
import { createIndexPatternServiceMock } from '../../../mocks/data_views_service_mock';
+import { DimensionButton } from '@kbn/visualization-ui-components/public';
jest.mock('../../../id_generator');
@@ -714,9 +715,7 @@ describe('LayerPanel', () => {
expect(instance.exists('[data-test-subj="lns-fakeDimension"]')).toBeTruthy();
expect(
- instance
- .find('[data-test-subj="lns-fakeDimension"] .lnsLayerPanel__triggerTextLabel')
- .text()
+ instance.find('[data-test-subj="lns-fakeDimension"] .dimensionTrigger__textLabel').text()
).toBe(fakeAccessorLabel);
});
@@ -826,7 +825,7 @@ describe('LayerPanel', () => {
const dragDropElement = instance
.find('[data-test-subj="lnsGroup"] DragDrop')
.first()
- .find('.lnsLayerPanel__dimension')
+ .find(DimensionButton)
.first();
dragDropElement.simulate('dragOver');
diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx
index a7314f2c1b6b4..736a46a38630f 100644
--- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx
+++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_panel.tsx
@@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
import { css } from '@emotion/react';
import { euiThemeVars } from '@kbn/ui-theme';
import { DragDropIdentifier, ReorderProvider, DropType } from '@kbn/dom-drag-drop';
-import { DimensionButton } from '@kbn/visualization-ui-components/public';
+import { DimensionButton, DimensionTrigger } from '@kbn/visualization-ui-components/public';
import { LayerActions } from './layer_actions';
import { IndexPatternServiceAPI } from '../../../data_views_service/service';
import { NativeRenderer } from '../../../native_renderer';
@@ -572,7 +572,6 @@ export function LayerPanel(
indexPatterns={dataViews.indexPatterns}
>
-
-
- {group.fakeFinalAccessor.label}
-
-
+ />
)}
diff --git a/x-pack/plugins/lens/public/shared_components/dimension_trigger/index.tsx b/x-pack/plugins/lens/public/shared_components/dimension_trigger/index.tsx
deleted file mode 100644
index d705c50017a8d..0000000000000
--- a/x-pack/plugins/lens/public/shared_components/dimension_trigger/index.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-import { EuiText, EuiFlexItem } from '@elastic/eui';
-import { i18n } from '@kbn/i18n';
-import React from 'react';
-import { EuiTextProps } from '@elastic/eui/src/components/text/text';
-
-export const defaultDimensionTriggerTooltip = (
-
- {i18n.translate('xpack.lens.configure.invalidConfigTooltip', {
- defaultMessage: 'Invalid configuration.',
- })}
-
- {i18n.translate('xpack.lens.configure.invalidConfigTooltipClick', {
- defaultMessage: 'Click for more details.',
- })}
-
-);
-
-export const DimensionTrigger = ({
- id,
- label,
- color,
- dataTestSubj,
-}: {
- label: string;
- id: string;
- color?: EuiTextProps['color'];
- dataTestSubj?: string;
-}) => {
- return (
-
-
-
- {label}
-
-
-
- );
-};
diff --git a/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/index.ts b/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/index.ts
index b7bc603fae05f..b6e3f9e82d785 100644
--- a/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/index.ts
+++ b/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/index.ts
@@ -9,6 +9,8 @@ import type { CoreStart } from '@kbn/core/public';
import { EventAnnotationServiceType } from '@kbn/event-annotation-plugin/public';
import { SavedObjectTaggingPluginStart } from '@kbn/saved-objects-tagging-plugin/public';
import { DataViewsContract } from '@kbn/data-views-plugin/public';
+import { VISUALIZE_APP_NAME } from '@kbn/visualizations-plugin/common/constants';
+import { ANNOTATIONS_LISTING_VIEW_ID } from '@kbn/event-annotation-plugin/common';
import type { LayerAction, StateSetter } from '../../../../types';
import { XYState, XYAnnotationLayerConfig } from '../../types';
import { getUnlinkLayerAction } from './unlink_action';
@@ -51,6 +53,10 @@ export const createAnnotationActions = ({
toasts: core.notifications.toasts,
savedObjectsTagging,
dataViews,
+ goToAnnotationLibrary: () =>
+ core.application.navigateToApp(VISUALIZE_APP_NAME, {
+ path: `#/${ANNOTATIONS_LISTING_VIEW_ID}`,
+ }),
})
);
}
diff --git a/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/save_action.test.tsx b/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/save_action.test.tsx
index e5256ec49b78a..8505f9811749a 100644
--- a/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/save_action.test.tsx
+++ b/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/save_action.test.tsx
@@ -153,7 +153,7 @@ describe('annotation group save action', () => {
toExpression: jest.fn(),
toFetchExpression: jest.fn(),
renderEventAnnotationGroupSavedObjectFinder: jest.fn(),
- } as EventAnnotationServiceType,
+ } as Partial
as EventAnnotationServiceType,
toasts: toastsServiceMock.createStartContract(),
modalOnSaveProps: {
newTitle: 'my title',
@@ -165,6 +165,7 @@ describe('annotation group save action', () => {
onTitleDuplicate: () => {},
},
dataViews,
+ goToAnnotationLibrary: () => Promise.resolve(),
};
};
diff --git a/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/save_action.tsx b/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/save_action.tsx
index 0e66654af48c1..1b4ae5fd4958d 100644
--- a/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/save_action.tsx
+++ b/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/save_action.tsx
@@ -17,7 +17,7 @@ import {
SavedObjectSaveModal,
} from '@kbn/saved-objects-plugin/public';
import { EventAnnotationGroupConfig } from '@kbn/event-annotation-plugin/common';
-import { EuiIcon } from '@elastic/eui';
+import { EuiIcon, EuiLink } from '@elastic/eui';
import { type SavedObjectTaggingPluginStart } from '@kbn/saved-objects-tagging-plugin/public';
import { DataViewsContract } from '@kbn/data-views-plugin/public';
import type { LayerAction, StateSetter } from '../../../../types';
@@ -116,7 +116,7 @@ const saveAnnotationGroupToLibrary = async (
title: newTitle,
description: newDescription,
tags: newTags,
- dataViewSpec: dataView.isPersisted() ? undefined : dataView.toSpec(),
+ dataViewSpec: dataView.isPersisted() ? undefined : dataView.toSpec(false),
};
if (saveAsNew) {
@@ -140,6 +140,7 @@ export const onSave = async ({
toasts,
modalOnSaveProps: { newTitle, newDescription, newTags, closeModal, newCopyOnSave },
dataViews,
+ goToAnnotationLibrary,
}: {
state: XYState;
layer: XYAnnotationLayerConfig;
@@ -148,6 +149,7 @@ export const onSave = async ({
toasts: ToastsStart;
modalOnSaveProps: ModalOnSaveProps;
dataViews: DataViewsContract;
+ goToAnnotationLibrary: () => Promise;
}) => {
let savedInfo: Awaited>;
try {
@@ -203,9 +205,21 @@ export const onSave = async ({
annotation library,
+ link: (
+ goToAnnotationLibrary()}
+ >
+ {i18n.translate(
+ 'xpack.lens.xyChart.annotations.saveAnnotationGroupToLibrary.annotationLibrary',
+ {
+ defaultMessage: 'annotation library',
+ }
+ )}
+
+ ),
}}
/>
,
@@ -222,6 +236,7 @@ export const getSaveLayerAction = ({
toasts,
savedObjectsTagging,
dataViews,
+ goToAnnotationLibrary,
}: {
state: XYState;
layer: XYAnnotationLayerConfig;
@@ -230,6 +245,7 @@ export const getSaveLayerAction = ({
toasts: ToastsStart;
savedObjectsTagging?: SavedObjectTaggingPluginStart;
dataViews: DataViewsContract;
+ goToAnnotationLibrary: () => Promise;
}): LayerAction => {
const neverSaved = !isByReferenceAnnotationsLayer(layer);
@@ -261,6 +277,7 @@ export const getSaveLayerAction = ({
toasts,
modalOnSaveProps: props,
dataViews,
+ goToAnnotationLibrary,
});
}}
title={neverSaved ? '' : layer.__lastSaved.title}
diff --git a/x-pack/plugins/lens/public/visualizations/xy/annotations/helpers.tsx b/x-pack/plugins/lens/public/visualizations/xy/annotations/helpers.tsx
index 6174017f3054b..3bf619cc76129 100644
--- a/x-pack/plugins/lens/public/visualizations/xy/annotations/helpers.tsx
+++ b/x-pack/plugins/lens/public/visualizations/xy/annotations/helpers.tsx
@@ -8,19 +8,19 @@
import { i18n } from '@kbn/i18n';
import moment from 'moment';
import {
- defaultAnnotationColor,
- defaultAnnotationRangeColor,
+ getAnnotationAccessor,
isQueryAnnotationConfig,
- isRangeAnnotationConfig,
} from '@kbn/event-annotation-plugin/public';
-import { EventAnnotationConfig } from '@kbn/event-annotation-plugin/common';
+import {
+ createCopiedAnnotation,
+ EventAnnotationConfig,
+ getDefaultQueryAnnotation,
+} from '@kbn/event-annotation-plugin/common';
import { IconChartBarAnnotations } from '@kbn/chart-icons';
import { LayerTypes } from '@kbn/expression-xy-plugin/public';
-import type { AccessorConfig } from '@kbn/visualization-ui-components/public';
import { isDraggedDataViewField } from '../../../utils';
import type { FramePublicAPI, Visualization } from '../../../types';
import { isHorizontalChart } from '../state_helpers';
-import { annotationsIconSet } from '../xy_config_panel/annotations_config_panel/icon_set';
import type { XYState, XYDataLayerConfig, XYAnnotationLayerConfig, XYLayerConfig } from '../types';
import {
checkScaleOperation,
@@ -129,50 +129,6 @@ export const getAnnotationsSupportedLayer = (
};
};
-const getDefaultManualAnnotation = (id: string, timestamp: string): EventAnnotationConfig => ({
- label: defaultAnnotationLabel,
- type: 'manual',
- key: {
- type: 'point_in_time',
- timestamp,
- },
- icon: 'triangle',
- id,
-});
-
-const getDefaultQueryAnnotation = (
- id: string,
- fieldName: string,
- timeField: string
-): EventAnnotationConfig => ({
- filter: {
- type: 'kibana_query',
- query: `${fieldName}: *`,
- language: 'kuery',
- },
- timeField,
- type: 'query',
- key: {
- type: 'point_in_time',
- },
- id,
- label: `${fieldName}: *`,
-});
-
-const createCopiedAnnotation = (
- newId: string,
- timestamp: string,
- source?: EventAnnotationConfig
-): EventAnnotationConfig => {
- if (!source) {
- return getDefaultManualAnnotation(newId, timestamp);
- }
- return {
- ...source,
- id: newId,
- };
-};
-
export const onAnnotationDrop: Visualization['onDrop'] = ({
prevState,
frame,
@@ -446,26 +402,8 @@ export const setAnnotationsDimension: Visualization['setDimension'] = (
};
};
-export const getSingleColorAnnotationConfig = (
- annotation: EventAnnotationConfig
-): AccessorConfig => {
- const annotationIcon = !isRangeAnnotationConfig(annotation)
- ? annotationsIconSet.find((option) => option.value === annotation?.icon) ||
- annotationsIconSet.find((option) => option.value === 'triangle')
- : undefined;
- const icon = annotationIcon?.icon ?? annotationIcon?.value;
- return {
- columnId: annotation.id,
- triggerIconType: annotation.isHidden ? 'invisible' : icon ? 'custom' : 'color',
- customIcon: icon,
- color:
- annotation?.color ||
- (isRangeAnnotationConfig(annotation) ? defaultAnnotationRangeColor : defaultAnnotationColor),
- };
-};
-
export const getAnnotationsAccessorColorConfig = (layer: XYAnnotationLayerConfig) =>
- layer.annotations.map((annotation) => getSingleColorAnnotationConfig(annotation));
+ layer.annotations.map((annotation) => getAnnotationAccessor(annotation));
export const getAnnotationsConfiguration = ({
state,
diff --git a/x-pack/plugins/lens/public/visualizations/xy/index.ts b/x-pack/plugins/lens/public/visualizations/xy/index.ts
index 244d47cd5b114..6f590000d512a 100644
--- a/x-pack/plugins/lens/public/visualizations/xy/index.ts
+++ b/x-pack/plugins/lens/public/visualizations/xy/index.ts
@@ -30,7 +30,15 @@ export class XyVisualization {
const { getXyVisualization } = await import('../../async_services');
const [
coreStart,
- { charts, data, fieldFormats, eventAnnotation, unifiedSearch, savedObjectsTagging },
+ {
+ charts,
+ data,
+ fieldFormats,
+ eventAnnotation,
+ unifiedSearch,
+ savedObjectsTagging,
+ dataViews,
+ },
] = await core.getStartServices();
const [palettes, eventAnnotationService] = await Promise.all([
charts.palettes.getPalettes(),
@@ -47,6 +55,7 @@ export class XyVisualization {
useLegacyTimeAxis,
kibanaTheme: core.theme,
unifiedSearch,
+ dataViewsService: dataViews,
savedObjectsTagging,
});
});
diff --git a/x-pack/plugins/lens/public/visualizations/xy/to_expression.test.ts b/x-pack/plugins/lens/public/visualizations/xy/to_expression.test.ts
index a1378a1442698..9cdf33c134c8c 100644
--- a/x-pack/plugins/lens/public/visualizations/xy/to_expression.test.ts
+++ b/x-pack/plugins/lens/public/visualizations/xy/to_expression.test.ts
@@ -20,6 +20,7 @@ import { LegendSize } from '@kbn/visualizations-plugin/common';
import { dataPluginMock } from '@kbn/data-plugin/public/mocks';
import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public';
import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks';
+import { DataViewsServicePublic } from '@kbn/data-views-plugin/public';
describe('#toExpression', () => {
const xyVisualization = getXyVisualization({
@@ -32,6 +33,7 @@ describe('#toExpression', () => {
storage: {} as IStorageWrapper,
data: dataPluginMock.createStartContract(),
unifiedSearch: unifiedSearchPluginMock.createStartContract(),
+ dataViewsService: {} as DataViewsServicePublic,
});
let mockDatasource: ReturnType;
let frame: ReturnType;
diff --git a/x-pack/plugins/lens/public/visualizations/xy/visualization.test.tsx b/x-pack/plugins/lens/public/visualizations/xy/visualization.test.tsx
index 6f720f0e21f2f..bcd5ed68aa38c 100644
--- a/x-pack/plugins/lens/public/visualizations/xy/visualization.test.tsx
+++ b/x-pack/plugins/lens/public/visualizations/xy/visualization.test.tsx
@@ -52,6 +52,7 @@ import { set } from '@kbn/safer-lodash-set';
import { SavedObjectReference } from '@kbn/core-saved-objects-api-server';
import { getAnnotationsLayers } from './visualization_helpers';
import { cloneDeep } from 'lodash';
+import { DataViewsServicePublic } from '@kbn/data-views-plugin/public';
const DATE_HISTORGRAM_COLUMN_ID = 'date_histogram_column';
const exampleAnnotation: EventAnnotationConfig = {
@@ -108,6 +109,7 @@ const xyVisualization = getXyVisualization({
storage: {} as IStorageWrapper,
data: dataPluginMock.createStartContract(),
unifiedSearch: unifiedSearchPluginMock.createStartContract(),
+ dataViewsService: {} as DataViewsServicePublic,
});
describe('xy_visualization', () => {
diff --git a/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx b/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx
index d4f6d4411b5a7..cdbd189790e07 100644
--- a/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx
+++ b/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx
@@ -14,7 +14,10 @@ import type { PaletteRegistry } from '@kbn/coloring';
import { IconChartBarReferenceLine, IconChartBarAnnotations } from '@kbn/chart-icons';
import { FieldFormatsStart } from '@kbn/field-formats-plugin/public';
import { CoreStart, SavedObjectReference, ThemeServiceStart } from '@kbn/core/public';
-import type { EventAnnotationServiceType } from '@kbn/event-annotation-plugin/public';
+import {
+ EventAnnotationServiceType,
+ getAnnotationAccessor,
+} from '@kbn/event-annotation-plugin/public';
import { KibanaContextProvider, KibanaThemeProvider } from '@kbn/kibana-react-plugin/public';
import { VIS_EVENT_TO_TRIGGER } from '@kbn/visualizations-plugin/public';
import type { DataPublicPluginStart } from '@kbn/data-plugin/public';
@@ -24,7 +27,8 @@ import { LayerTypes } from '@kbn/expression-xy-plugin/public';
import { SavedObjectTaggingPluginStart } from '@kbn/saved-objects-tagging-plugin/public';
import { EventAnnotationGroupConfig } from '@kbn/event-annotation-plugin/common';
import { isEqual } from 'lodash';
-import type { AccessorConfig } from '@kbn/visualization-ui-components/public';
+import { type AccessorConfig, DimensionTrigger } from '@kbn/visualization-ui-components/public';
+import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public';
import { generateId } from '../../id_generator';
import {
isDraggedDataViewField,
@@ -36,8 +40,8 @@ import {
import { getSuggestions } from './xy_suggestions';
import { XyToolbar } from './xy_config_panel';
import {
+ DataDimensionEditor,
DataDimensionEditorDataSectionExtra,
- DimensionEditor,
} from './xy_config_panel/dimension_editor';
import { LayerHeader, LayerHeaderContent } from './xy_config_panel/layer_header';
import type {
@@ -79,7 +83,6 @@ import {
getUniqueLabels,
onAnnotationDrop,
isDateHistogram,
- getSingleColorAnnotationConfig,
} from './annotations/helpers';
import {
checkXAccessorCompatibility,
@@ -105,7 +108,6 @@ import { groupAxesByType } from './axes_configuration';
import type { XYState } from './types';
import { ReferenceLinePanel } from './xy_config_panel/reference_line_config_panel';
import { AnnotationsPanel } from './xy_config_panel/annotations_config_panel';
-import { DimensionTrigger } from '../../shared_components/dimension_trigger';
import { defaultAnnotationLabel } from './annotations/helpers';
import { onDropForVisualization } from '../../editor_frame_service/editor_frame/config_panel/buttons/drop_targets_utils';
import { createAnnotationActions } from './annotations/actions';
@@ -127,6 +129,7 @@ export const getXyVisualization = ({
kibanaTheme,
eventAnnotationService,
unifiedSearch,
+ dataViewsService,
savedObjectsTagging,
}: {
core: CoreStart;
@@ -138,6 +141,7 @@ export const getXyVisualization = ({
useLegacyTimeAxis: boolean;
kibanaTheme: ThemeServiceStart;
unifiedSearch: UnifiedSearchPublicPluginStart;
+ dataViewsService: DataViewsPublicPluginStart;
savedObjectsTagging?: SavedObjectTaggingPluginStart;
}): Visualization => ({
id: XY_ID,
@@ -651,9 +655,9 @@ export const getXyVisualization = ({
const dimensionEditor = isReferenceLayer(layer) ? (
) : isAnnotationsLayer(layer) ? (
-
+
) : (
-
+
);
render(
@@ -1142,7 +1146,7 @@ function getVisualizationInfo(
palette.push(
...layer.annotations
.filter(({ isHidden }) => !isHidden)
- .map((annotation) => getSingleColorAnnotationConfig(annotation).color)
+ .map((annotation) => getAnnotationAccessor(annotation).color)
);
}
diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/annotations_panel.tsx b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/annotations_panel.tsx
index 9cb5f4d64079e..19bbcc7f4bfc8 100644
--- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/annotations_panel.tsx
+++ b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/annotations_panel.tsx
@@ -5,59 +5,30 @@
* 2.0.
*/
-import './index.scss';
-import React, { useCallback, useEffect } from 'react';
-import { i18n } from '@kbn/i18n';
-import { EuiFormRow, EuiSwitch, EuiSwitchEvent, EuiButtonGroup, EuiSpacer } from '@elastic/eui';
-import type { PaletteRegistry } from '@kbn/coloring';
+import React, { useCallback, useEffect, useState } from 'react';
import type { DatatableUtilitiesService } from '@kbn/data-plugin/common';
-import {
- defaultAnnotationColor,
- defaultAnnotationRangeColor,
- isQueryAnnotationConfig,
- isRangeAnnotationConfig,
-} from '@kbn/event-annotation-plugin/public';
-import {
- EventAnnotationConfig,
- PointInTimeEventAnnotationConfig,
- QueryPointEventAnnotationConfig,
-} from '@kbn/event-annotation-plugin/common';
+import { AnnotationEditorControls } from '@kbn/event-annotation-plugin/public';
+import { EventAnnotationConfig } from '@kbn/event-annotation-plugin/common';
+import { useKibana } from '@kbn/kibana-react-plugin/public';
+import { useDebouncedValue } from '@kbn/visualization-ui-components/public';
+import { DataViewsPublicPluginStart, DataView } from '@kbn/data-views-plugin/public';
import moment from 'moment';
-import { useExistingFieldsReader } from '@kbn/unified-field-list-plugin/public';
-import {
- IconSelectSetting,
- FieldOption,
- FieldOptionValue,
- FieldPicker,
- NameInput,
- useDebouncedValue,
- DimensionEditorSection,
- ColorPicker,
-} from '@kbn/visualization-ui-components/public';
-import { FormatFactory } from '../../../../../common/types';
-import { isHorizontalChart } from '../../state_helpers';
-import { defaultAnnotationLabel, defaultRangeAnnotationLabel } from '../../annotations/helpers';
-import { TextDecorationSetting } from '../shared/marker_decoration_settings';
-import { LineStyleSettings } from '../shared/line_style_settings';
+import { search } from '@kbn/data-plugin/public';
+import { LENS_APP_NAME } from '../../../../../common/constants';
+import { DONT_CLOSE_DIMENSION_CONTAINER_ON_CLICK_CLASS } from '../../../../utils';
+import { LensAppServices } from '../../../../app_plugin/types';
import { updateLayer } from '..';
-import { annotationsIconSet } from './icon_set';
-import type { VisualizationDimensionEditorProps } from '../../../../types';
-import type { State, XYState, XYAnnotationLayerConfig } from '../../types';
-import { ConfigPanelManualAnnotation } from './manual_annotation_panel';
-import { ConfigPanelQueryAnnotation } from './query_annotation_panel';
-import { TooltipSection } from './tooltip_annotation_panel';
-import { sanitizeProperties, toLineAnnotationColor } from './helpers';
+import type { FramePublicAPI, VisualizationDimensionEditorProps } from '../../../../types';
+import type { State, XYState, XYAnnotationLayerConfig, XYDataLayerConfig } from '../../types';
+import { isDataLayer } from '../../visualization_helpers';
export const AnnotationsPanel = (
props: VisualizationDimensionEditorProps & {
datatableUtilities: DatatableUtilitiesService;
- formatFactory: FormatFactory;
- paletteService: PaletteRegistry;
+ dataViewsService: DataViewsPublicPluginStart;
}
) => {
const { state, setState, layerId, accessor, frame } = props;
- const isHorizontal = isHorizontalChart(state.layers);
- const { hasFieldData } = useExistingFieldsReader();
const { inputValue: localState, handleInputChange: setLocalState } = useDebouncedValue({
value: state,
@@ -71,26 +42,15 @@ export const AnnotationsPanel = (
const currentAnnotation = localLayer.annotations?.find((c) => c.id === accessor);
- const isQueryBased = isQueryAnnotationConfig(currentAnnotation);
- const isRange = isRangeAnnotationConfig(currentAnnotation);
- const [queryInputShouldOpen, setQueryInputShouldOpen] = React.useState(false);
- useEffect(() => {
- setQueryInputShouldOpen(!isQueryBased);
- }, [isQueryBased]);
-
- const setAnnotations = useCallback(
- (annotation: Partial | undefined) => {
+ const setAnnotation = useCallback(
+ (annotation: EventAnnotationConfig) => {
if (annotation == null) {
return;
}
const newConfigs = [...(localLayer.annotations || [])];
const existingIndex = newConfigs.findIndex((c) => c.id === accessor);
if (existingIndex !== -1) {
- const existingConfig = newConfigs[existingIndex];
- newConfigs[existingIndex] = sanitizeProperties({
- ...existingConfig,
- ...annotation,
- });
+ newConfigs[existingIndex] = annotation;
} else {
throw new Error(
'should never happen because annotation is created before config panel is opened'
@@ -101,305 +61,81 @@ export const AnnotationsPanel = (
[accessor, index, localState, localLayer, setLocalState]
);
- return (
- <>
-
-
- {
- const typeFromId = id.replace(
- 'lens_xyChart_annotation_',
- ''
- ) as EventAnnotationConfig['type'];
- if (currentAnnotation?.type === typeFromId) {
- return;
- }
- if (typeFromId === 'query') {
- const currentIndexPattern =
- frame.dataViews.indexPatterns[localLayer.indexPatternId];
- // If coming from a range type, it requires some additional resets
- const additionalRangeResets = isRangeAnnotationConfig(currentAnnotation)
- ? {
- label:
- currentAnnotation.label === defaultRangeAnnotationLabel
- ? defaultAnnotationLabel
- : currentAnnotation.label,
- color: toLineAnnotationColor(currentAnnotation.color),
- }
- : {};
- return setAnnotations({
- type: typeFromId,
- timeField:
- (currentIndexPattern.timeFieldName ||
- // fallback to the first avaiable date field in the dataView
- currentIndexPattern.fields.find(({ type: fieldType }) => fieldType === 'date')
- ?.displayName) ??
- '',
- key: { type: 'point_in_time' },
- ...additionalRangeResets,
- });
- }
- // From query to manual annotation
- return setAnnotations({
- type: typeFromId,
- key: { type: 'point_in_time', timestamp: moment().toISOString() },
- });
- }}
- isFullWidth
- />
-
- {isQueryBased ? (
-
- ) : (
-
- )}
-
-
- {
- setAnnotations({ label: value });
- }}
- />
- {!isRange && (
- <>
- setAnnotations({ icon })}
- defaultIcon="triangle"
- currentIcon={currentAnnotation?.icon}
- customIconSet={annotationsIconSet}
- />
-
- {(textDecorationSelected) => {
- if (textDecorationSelected !== 'field') {
- return null;
- }
- const currentIndexPattern =
- frame.dataViews.indexPatterns[localLayer.indexPatternId];
- const options = currentIndexPattern.fields
- .filter(({ displayName, type }) => displayName && type !== 'document')
- .map(
- (field) =>
- ({
- label: field.displayName,
- value: {
- type: 'field',
- field: field.name,
- dataType: field.type,
- },
- exists: hasFieldData(currentIndexPattern.id, field.name),
- compatible: true,
- 'data-test-subj': `lnsXY-annotation-fieldOption-${field.name}`,
- } as FieldOption)
- );
- const selectedField = (currentAnnotation as QueryPointEventAnnotationConfig)
- .textField;
+ const [currentDataView, setCurrentDataView] = useState();
+
+ useEffect(() => {
+ const updateDataView = async () => {
+ let dataView: DataView;
+ const availableIds = await props.dataViewsService.getIds();
+ if (availableIds.includes(localLayer.indexPatternId)) {
+ dataView = await props.dataViewsService.get(localLayer.indexPatternId);
+ } else {
+ dataView = await props.dataViewsService.create(
+ frame.dataViews.indexPatterns[localLayer.indexPatternId].spec
+ );
+ }
+ setCurrentDataView(dataView);
+ };
+
+ updateDataView();
+ }, [frame.dataViews.indexPatterns, localLayer.indexPatternId, props.dataViewsService]);
- const fieldIsValid = selectedField
- ? Boolean(currentIndexPattern.getFieldByName(selectedField))
- : true;
- return (
- <>
-
-
- >
- );
- }}
-
-
- >
- )}
- {isRange && (
-
- {
- setAnnotations({
- outside: id === `lens_xyChart_fillStyle_outside`,
- });
- }}
- isFullWidth
- />
-
- )}
+ const queryInputServices = useKibana().services;
-
- setAnnotations({ isHidden: ev.target.checked })}
- />
-
- {isQueryBased && currentAnnotation && (
-
-
-
-
-
- )}
- >
- );
-};
+ if (!currentAnnotation) {
+ throw new Error('Annotation not found... this should never happen!');
+ }
-const ConfigPanelGenericSwitch = ({
- label,
- ['data-test-subj']: dataTestSubj,
- value,
- onChange,
-}: {
- label: string;
- 'data-test-subj': string;
- value: boolean;
- onChange: (event: EuiSwitchEvent) => void;
-}) => (
-
- setAnnotation(newAnnotation)}
+ dataView={currentDataView}
+ getDefaultRangeEnd={(rangeStart) =>
+ getEndTimestamp(
+ props.datatableUtilities,
+ rangeStart,
+ frame,
+ localState.layers.filter(isDataLayer)
+ )
+ }
+ queryInputServices={queryInputServices}
+ calendarClassName={DONT_CLOSE_DIMENSION_CONTAINER_ON_CLICK_CLASS}
+ appName={LENS_APP_NAME}
/>
-
-);
+ ) : null;
+};
+
+const getEndTimestamp = (
+ datatableUtilities: DatatableUtilitiesService,
+ startTime: string,
+ { activeData, dateRange }: FramePublicAPI,
+ dataLayers: XYDataLayerConfig[]
+) => {
+ const startTimeNumber = moment(startTime).valueOf();
+ const dateRangeFraction =
+ (moment(dateRange.toDate).valueOf() - moment(dateRange.fromDate).valueOf()) * 0.1;
+ const fallbackValue = moment(startTimeNumber + dateRangeFraction).toISOString();
+ const dataLayersId = dataLayers.map(({ layerId }) => layerId);
+ if (
+ !dataLayersId.length ||
+ !activeData ||
+ Object.entries(activeData)
+ .filter(([key]) => dataLayersId.includes(key))
+ .every(([, { rows }]) => !rows || !rows.length)
+ ) {
+ return fallbackValue;
+ }
+ const xColumn = activeData?.[dataLayersId[0]].columns.find(
+ (column) => column.id === dataLayers[0].xAccessor
+ );
+ if (!xColumn) {
+ return fallbackValue;
+ }
+
+ const dateInterval = datatableUtilities.getDateHistogramMeta(xColumn)?.interval;
+ if (!dateInterval) return fallbackValue;
+ const intervalDuration = search.aggs.parseInterval(dateInterval);
+ if (!intervalDuration) return fallbackValue;
+ return moment(startTimeNumber + 3 * intervalDuration.as('milliseconds')).toISOString();
+};
diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/helpers.ts b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/helpers.ts
deleted file mode 100644
index 0eb80c1018dc2..0000000000000
--- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/helpers.ts
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { search } from '@kbn/data-plugin/public';
-import { transparentize } from '@elastic/eui';
-import type { DatatableUtilitiesService } from '@kbn/data-plugin/common';
-import type {
- EventAnnotationConfig,
- RangeEventAnnotationConfig,
- PointInTimeEventAnnotationConfig,
- QueryPointEventAnnotationConfig,
-} from '@kbn/event-annotation-plugin/common';
-import {
- defaultAnnotationColor,
- defaultAnnotationRangeColor,
- isQueryAnnotationConfig,
- isRangeAnnotationConfig,
-} from '@kbn/event-annotation-plugin/public';
-import chroma from 'chroma-js';
-import { pick } from 'lodash';
-import moment from 'moment';
-import type { FramePublicAPI } from '../../../../types';
-import type { XYDataLayerConfig } from '../../types';
-
-export const toRangeAnnotationColor = (color = defaultAnnotationColor) => {
- return chroma(transparentize(color, 0.1)).hex().toUpperCase();
-};
-
-export const toLineAnnotationColor = (color = defaultAnnotationRangeColor) => {
- return chroma(transparentize(color, 1)).hex().toUpperCase();
-};
-
-export const getEndTimestamp = (
- datatableUtilities: DatatableUtilitiesService,
- startTime: string,
- { activeData, dateRange }: FramePublicAPI,
- dataLayers: XYDataLayerConfig[]
-) => {
- const startTimeNumber = moment(startTime).valueOf();
- const dateRangeFraction =
- (moment(dateRange.toDate).valueOf() - moment(dateRange.fromDate).valueOf()) * 0.1;
- const fallbackValue = moment(startTimeNumber + dateRangeFraction).toISOString();
- const dataLayersId = dataLayers.map(({ layerId }) => layerId);
- if (
- !dataLayersId.length ||
- !activeData ||
- Object.entries(activeData)
- .filter(([key]) => dataLayersId.includes(key))
- .every(([, { rows }]) => !rows || !rows.length)
- ) {
- return fallbackValue;
- }
- const xColumn = activeData?.[dataLayersId[0]].columns.find(
- (column) => column.id === dataLayers[0].xAccessor
- );
- if (!xColumn) {
- return fallbackValue;
- }
-
- const dateInterval = datatableUtilities.getDateHistogramMeta(xColumn)?.interval;
- if (!dateInterval) return fallbackValue;
- const intervalDuration = search.aggs.parseInterval(dateInterval);
- if (!intervalDuration) return fallbackValue;
- return moment(startTimeNumber + 3 * intervalDuration.as('milliseconds')).toISOString();
-};
-
-export const sanitizeProperties = (annotation: EventAnnotationConfig) => {
- if (isRangeAnnotationConfig(annotation)) {
- const rangeAnnotation: RangeEventAnnotationConfig = pick(annotation, [
- 'type',
- 'label',
- 'key',
- 'id',
- 'isHidden',
- 'color',
- 'outside',
- ]);
- return rangeAnnotation;
- }
- if (isQueryAnnotationConfig(annotation)) {
- const lineAnnotation: QueryPointEventAnnotationConfig = pick(annotation, [
- 'type',
- 'id',
- 'label',
- 'key',
- 'timeField',
- 'isHidden',
- 'lineStyle',
- 'lineWidth',
- 'color',
- 'icon',
- 'textVisibility',
- 'textField',
- 'filter',
- 'extraFields',
- ]);
- return lineAnnotation;
- }
- const lineAnnotation: PointInTimeEventAnnotationConfig = pick(annotation, [
- 'type',
- 'id',
- 'label',
- 'key',
- 'isHidden',
- 'lineStyle',
- 'lineWidth',
- 'color',
- 'icon',
- 'textVisibility',
- ]);
- return lineAnnotation;
-};
diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/icon_set.ts b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/icon_set.ts
deleted file mode 100644
index 3e67cd8e5c14e..0000000000000
--- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/icon_set.ts
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import { i18n } from '@kbn/i18n';
-import { AvailableAnnotationIcon } from '@kbn/event-annotation-plugin/common';
-import { IconTriangle, IconCircle } from '@kbn/chart-icons';
-import { type IconSet } from '@kbn/visualization-ui-components/public';
-
-export const annotationsIconSet: IconSet = [
- {
- value: 'asterisk',
- label: i18n.translate('xpack.lens.xyChart.iconSelect.asteriskIconLabel', {
- defaultMessage: 'Asterisk',
- }),
- },
- {
- value: 'alert',
- label: i18n.translate('xpack.lens.xyChart.iconSelect.alertIconLabel', {
- defaultMessage: 'Alert',
- }),
- },
- {
- value: 'bell',
- label: i18n.translate('xpack.lens.xyChart.iconSelect.bellIconLabel', {
- defaultMessage: 'Bell',
- }),
- },
- {
- value: 'bolt',
- label: i18n.translate('xpack.lens.xyChart.iconSelect.boltIconLabel', {
- defaultMessage: 'Bolt',
- }),
- },
- {
- value: 'bug',
- label: i18n.translate('xpack.lens.xyChart.iconSelect.bugIconLabel', {
- defaultMessage: 'Bug',
- }),
- },
- {
- value: 'circle',
- label: i18n.translate('xpack.lens.xyChart.iconSelect.circleIconLabel', {
- defaultMessage: 'Circle',
- }),
- icon: IconCircle,
- canFill: true,
- },
-
- {
- value: 'editorComment',
- label: i18n.translate('xpack.lens.xyChart.iconSelect.commentIconLabel', {
- defaultMessage: 'Comment',
- }),
- },
- {
- value: 'flag',
- label: i18n.translate('xpack.lens.xyChart.iconSelect.flagIconLabel', {
- defaultMessage: 'Flag',
- }),
- },
- {
- value: 'heart',
- label: i18n.translate('xpack.lens.xyChart.iconSelect.heartLabel', { defaultMessage: 'Heart' }),
- },
- {
- value: 'mapMarker',
- label: i18n.translate('xpack.lens.xyChart.iconSelect.mapMarkerLabel', {
- defaultMessage: 'Map Marker',
- }),
- },
- {
- value: 'pinFilled',
- label: i18n.translate('xpack.lens.xyChart.iconSelect.mapPinLabel', {
- defaultMessage: 'Map Pin',
- }),
- },
- {
- value: 'starEmpty',
- label: i18n.translate('xpack.lens.xyChart.iconSelect.starLabel', { defaultMessage: 'Star' }),
- },
- {
- value: 'starFilled',
- label: i18n.translate('xpack.lens.xyChart.iconSelect.starFilledLabel', {
- defaultMessage: 'Star filled',
- }),
- },
- {
- value: 'tag',
- label: i18n.translate('xpack.lens.xyChart.iconSelect.tagIconLabel', {
- defaultMessage: 'Tag',
- }),
- },
- {
- value: 'triangle',
- label: i18n.translate('xpack.lens.xyChart.iconSelect.triangleIconLabel', {
- defaultMessage: 'Triangle',
- }),
- icon: IconTriangle,
- shouldRotate: true,
- canFill: true,
- },
-];
diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/index.test.tsx b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/index.test.tsx
deleted file mode 100644
index 92fa248979fc3..0000000000000
--- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/index.test.tsx
+++ /dev/null
@@ -1,668 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import React from 'react';
-import { mountWithIntl as mount } from '@kbn/test-jest-helpers';
-import { createDatatableUtilitiesMock } from '@kbn/data-plugin/common/mocks';
-import { LayerTypes } from '@kbn/expression-xy-plugin/public';
-import { AnnotationsPanel } from '.';
-import { FramePublicAPI } from '../../../../types';
-import { DatasourcePublicAPI } from '../../../..';
-import { createMockFramePublicAPI } from '../../../../mocks';
-import { State, XYState } from '../../types';
-import { Position } from '@elastic/charts';
-import { chartPluginMock } from '@kbn/charts-plugin/public/mocks';
-import moment from 'moment';
-import { EventAnnotationConfig } from '@kbn/event-annotation-plugin/common';
-import { createMockDataViewsState } from '../../../../data_views_service/mocks';
-import { createMockedIndexPattern } from '../../../../datasources/form_based/mocks';
-import { act } from 'react-dom/test-utils';
-import { EuiButtonGroup } from '@elastic/eui';
-
-jest.mock('lodash', () => {
- const original = jest.requireActual('lodash');
-
- return {
- ...original,
- debounce: (fn: unknown) => fn,
- };
-});
-
-jest.mock('@kbn/unified-search-plugin/public', () => ({
- QueryStringInput: () => {
- return 'QueryStringInput';
- },
-}));
-
-const customLineStaticAnnotation: EventAnnotationConfig = {
- id: 'ann1',
- type: 'manual',
- key: { type: 'point_in_time' as const, timestamp: '2022-03-18T08:25:00.000Z' },
- label: 'Event',
- icon: 'triangle' as const,
- color: 'red',
- lineStyle: 'dashed' as const,
- lineWidth: 3,
-};
-
-describe('AnnotationsPanel', () => {
- const datatableUtilities = createDatatableUtilitiesMock();
- let frame: FramePublicAPI;
-
- function testState(): State {
- return {
- legend: { isVisible: true, position: Position.Right },
- valueLabels: 'hide',
- preferredSeriesType: 'bar',
- layers: [
- {
- layerType: LayerTypes.ANNOTATIONS,
- layerId: 'annotation',
- indexPatternId: 'indexPattern1',
- annotations: [customLineStaticAnnotation],
- ignoreGlobalFilters: true,
- },
- ],
- };
- }
-
- beforeEach(() => {
- frame = createMockFramePublicAPI({ datasourceLayers: {} });
- });
-
- describe('Dimension Editor', () => {
- test('shows correct options for line annotations', () => {
- const state = testState();
- const component = mount(
-
- );
-
- expect(
- component.find('EuiDatePicker[data-test-subj="lns-xyAnnotation-time"]').prop('selected')
- ).toEqual(moment('2022-03-18T08:25:00.000Z'));
- expect(
- component.find('EuiDatePicker[data-test-subj="lns-xyAnnotation-fromTime"]').exists()
- ).toBeFalsy();
- expect(
- component.find('EuiDatePicker[data-test-subj="lns-xyAnnotation-toTime"]').exists()
- ).toBeFalsy();
- expect(
- component.find('EuiSwitch[data-test-subj="lns-xyAnnotation-rangeSwitch"]').prop('checked')
- ).toEqual(false);
- expect(
- component.find('EuiFieldText[data-test-subj="column-label-edit"]').prop('value')
- ).toEqual('Event');
- expect(
- component.find('EuiComboBox[data-test-subj="lns-icon-select"]').prop('selectedOptions')
- ).toEqual([{ label: 'Triangle', value: 'triangle' }]);
- expect(component.find('TextDecorationSetting').exists()).toBeTruthy();
- expect(component.find('LineStyleSettings').exists()).toBeTruthy();
- expect(
- component.find('EuiButtonGroup[data-test-subj="lns-xyAnnotation-fillStyle"]').exists()
- ).toBeFalsy();
- });
- test('shows correct options for range annotations', () => {
- const state = testState();
- state.layers[0] = {
- annotations: [
- {
- color: 'red',
- icon: 'triangle',
- id: 'ann1',
- type: 'manual',
- isHidden: undefined,
- key: {
- endTimestamp: '2022-03-21T10:49:00.000Z',
- timestamp: '2022-03-18T08:25:00.000Z',
- type: 'range',
- },
- label: 'Event range',
- lineStyle: 'dashed',
- lineWidth: 3,
- },
- ],
- layerId: 'annotation',
- layerType: 'annotations',
- indexPatternId: 'indexPattern1',
- ignoreGlobalFilters: true,
- };
- const component = mount(
-
- );
-
- expect(
- component.find('EuiDatePicker[data-test-subj="lns-xyAnnotation-fromTime"]').prop('selected')
- ).toEqual(moment('2022-03-18T08:25:00.000Z'));
- expect(
- component.find('EuiDatePicker[data-test-subj="lns-xyAnnotation-toTime"]').prop('selected')
- ).toEqual(moment('2022-03-21T10:49:00.000Z'));
- expect(
- component.find('EuiDatePicker[data-test-subj="lns-xyAnnotation-time"]').exists()
- ).toBeFalsy();
- expect(
- component.find('EuiSwitch[data-test-subj="lns-xyAnnotation-rangeSwitch"]').prop('checked')
- ).toEqual(true);
- expect(
- component.find('EuiFieldText[data-test-subj="column-label-edit"]').prop('value')
- ).toEqual('Event range');
- expect(component.find('EuiComboBox[data-test-subj="lns-icon-select"]').exists()).toBeFalsy();
- expect(component.find('TextDecorationSetting').exists()).toBeFalsy();
- expect(component.find('LineStyleSettings').exists()).toBeFalsy();
- expect(component.find('[data-test-subj="lns-xyAnnotation-fillStyle"]').exists()).toBeTruthy();
- });
-
- test('calculates correct endTimstamp and transparent color when switching for range annotation and back', () => {
- const state = testState();
- const setState = jest.fn();
- const component = mount(
-
- );
-
- component.find('button[data-test-subj="lns-xyAnnotation-rangeSwitch"]').simulate('click');
-
- expect(setState).toBeCalledWith({
- ...state,
- layers: [
- {
- annotations: [
- {
- color: '#FF00001A',
- id: 'ann1',
- isHidden: undefined,
- label: 'Event range',
- type: 'manual',
- key: {
- endTimestamp: '2022-03-21T10:49:00.000Z',
- timestamp: '2022-03-18T08:25:00.000Z',
- type: 'range',
- },
- },
- ],
- indexPatternId: 'indexPattern1',
- layerId: 'annotation',
- layerType: 'annotations',
- ignoreGlobalFilters: true,
- },
- ],
- });
- component.find('button[data-test-subj="lns-xyAnnotation-rangeSwitch"]').simulate('click');
- expect(setState).toBeCalledWith({
- ...state,
- layers: [
- {
- annotations: [
- {
- color: '#FF0000',
- id: 'ann1',
- isHidden: undefined,
- key: {
- timestamp: '2022-03-18T08:25:00.000Z',
- type: 'point_in_time',
- },
- label: 'Event',
- type: 'manual',
- },
- ],
- indexPatternId: 'indexPattern1',
- layerId: 'annotation',
- layerType: 'annotations',
- ignoreGlobalFilters: true,
- },
- ],
- });
- });
-
- test('shows correct options for query based', () => {
- const state = testState();
- const indexPattern = createMockedIndexPattern();
- state.layers[0] = {
- annotations: [
- {
- color: 'red',
- icon: 'triangle',
- id: 'ann1',
- type: 'query',
- isHidden: undefined,
- timeField: 'timestamp',
- key: {
- type: 'point_in_time',
- },
- label: 'Query based event',
- lineStyle: 'dashed',
- lineWidth: 3,
- filter: { type: 'kibana_query', query: '', language: 'kuery' },
- },
- ],
- layerId: 'annotation',
- layerType: 'annotations',
- indexPatternId: indexPattern.id,
- ignoreGlobalFilters: true,
- };
- const frameMock = createMockFramePublicAPI({
- datasourceLayers: {},
- dataViews: createMockDataViewsState({
- indexPatterns: { [indexPattern.id]: indexPattern },
- }),
- });
-
- const component = mount(
-
- );
-
- expect(
- component.find('[data-test-subj="lnsXY-annotation-query-based-field-picker"]').exists()
- ).toBeTruthy();
- expect(
- component.find('[data-test-subj="lnsXY-annotation-query-based-query-input"]').exists()
- ).toBeTruthy();
-
- // The provided indexPattern has 2 date fields
- expect(
- component
- .find('[data-test-subj="lnsXY-annotation-query-based-field-picker"]')
- .at(0)
- .prop('options')
- ).toHaveLength(2);
- // When in query mode a new "field" option is added to the previous 2 ones
- expect(
- component.find('[data-test-subj="lns-lineMarker-text-visibility"]').at(0).prop('options')
- ).toHaveLength(3);
- expect(
- component.find('[data-test-subj="lnsXY-annotation-tooltip-add_field"]').exists()
- ).toBeTruthy();
- });
-
- test('should prefill timeField with the default time field when switching to query based annotations', () => {
- const state = testState();
- const indexPattern = createMockedIndexPattern();
- state.layers[0] = {
- annotations: [customLineStaticAnnotation],
- layerId: 'annotation',
- layerType: 'annotations',
- ignoreGlobalFilters: true,
- indexPatternId: indexPattern.id,
- };
- const frameMock = createMockFramePublicAPI({
- datasourceLayers: {},
- dataViews: createMockDataViewsState({
- indexPatterns: { [indexPattern.id]: indexPattern },
- }),
- });
-
- const setState = jest.fn();
-
- const component = mount(
-
- );
-
- act(() => {
- component
- .find(`[data-test-subj="lns-xyAnnotation-placementType"]`)
- .find(EuiButtonGroup)
- .prop('onChange')!('lens_xyChart_annotation_query');
- });
- component.update();
-
- expect(setState).toHaveBeenCalledWith(
- expect.objectContaining({
- layers: [
- expect.objectContaining({
- annotations: [expect.objectContaining({ timeField: 'timestamp' })],
- }),
- ],
- })
- );
- });
-
- test('should avoid to retain specific manual configurations when switching to query based annotations', () => {
- const state = testState();
- const indexPattern = createMockedIndexPattern();
- state.layers[0] = {
- annotations: [customLineStaticAnnotation],
- layerId: 'annotation',
- layerType: 'annotations',
- ignoreGlobalFilters: true,
- indexPatternId: indexPattern.id,
- };
- const frameMock = createMockFramePublicAPI({
- datasourceLayers: {},
- dataViews: createMockDataViewsState({
- indexPatterns: { [indexPattern.id]: indexPattern },
- }),
- });
-
- const setState = jest.fn();
-
- const component = mount(
-
- );
-
- act(() => {
- component
- .find(`[data-test-subj="lns-xyAnnotation-placementType"]`)
- .find(EuiButtonGroup)
- .prop('onChange')!('lens_xyChart_annotation_query');
- });
- component.update();
-
- expect(setState).toHaveBeenCalledWith(
- expect.objectContaining({
- layers: [
- expect.objectContaining({
- annotations: [
- expect.objectContaining({
- key: expect.not.objectContaining({ timestamp: expect.any('string') }),
- }),
- ],
- }),
- ],
- })
- );
- });
-
- test('should avoid to retain range manual configurations when switching to query based annotations', () => {
- const state = testState();
- const indexPattern = createMockedIndexPattern();
- state.layers[0] = {
- annotations: [
- {
- color: 'red',
- icon: 'triangle',
- id: 'ann1',
- type: 'manual',
- isHidden: undefined,
- key: {
- endTimestamp: '2022-03-21T10:49:00.000Z',
- timestamp: '2022-03-18T08:25:00.000Z',
- type: 'range',
- },
- label: 'Event range',
- lineStyle: 'dashed',
- lineWidth: 3,
- },
- ],
- layerId: 'annotation',
- layerType: 'annotations',
- ignoreGlobalFilters: true,
- indexPatternId: indexPattern.id,
- };
- const frameMock = createMockFramePublicAPI({
- datasourceLayers: {},
- dataViews: createMockDataViewsState({
- indexPatterns: { [indexPattern.id]: indexPattern },
- }),
- });
-
- const setState = jest.fn();
-
- const component = mount(
-
- );
-
- act(() => {
- component
- .find(`[data-test-subj="lns-xyAnnotation-placementType"]`)
- .find(EuiButtonGroup)
- .prop('onChange')!('lens_xyChart_annotation_query');
- });
- component.update();
-
- expect(setState).toHaveBeenCalledWith(
- expect.objectContaining({
- layers: [
- expect.objectContaining({
- annotations: [
- expect.objectContaining({ label: expect.not.stringContaining('Event range') }),
- ],
- }),
- ],
- })
- );
- });
-
- test('should set a default tiemstamp when switching from query based to manual annotations', () => {
- const state = testState();
- const indexPattern = createMockedIndexPattern();
- state.layers[0] = {
- annotations: [
- {
- color: 'red',
- icon: 'triangle',
- id: 'ann1',
- type: 'query',
- isHidden: undefined,
- timeField: 'timestamp',
- key: {
- type: 'point_in_time',
- },
- label: 'Query based event',
- lineStyle: 'dashed',
- lineWidth: 3,
- filter: { type: 'kibana_query', query: '', language: 'kuery' },
- },
- ],
- layerId: 'annotation',
- layerType: 'annotations',
- indexPatternId: indexPattern.id,
- ignoreGlobalFilters: true,
- };
- const frameMock = createMockFramePublicAPI({
- datasourceLayers: {},
- dataViews: createMockDataViewsState({
- indexPatterns: { [indexPattern.id]: indexPattern },
- }),
- });
-
- const setState = jest.fn();
-
- const component = mount(
-
- );
-
- act(() => {
- component
- .find(`[data-test-subj="lns-xyAnnotation-placementType"]`)
- .find(EuiButtonGroup)
- .prop('onChange')!('lens_xyChart_annotation_manual');
- });
- component.update();
-
- expect(setState).toHaveBeenCalledWith(
- expect.objectContaining({
- layers: [
- expect.objectContaining({
- annotations: [
- expect.objectContaining({
- key: { type: 'point_in_time', timestamp: expect.any(String) },
- }),
- ],
- }),
- ],
- })
- );
-
- // also check query specific props are not carried over
- expect(setState).toHaveBeenCalledWith(
- expect.objectContaining({
- layers: [
- expect.objectContaining({
- annotations: [expect.not.objectContaining({ timeField: 'timestamp' })],
- }),
- ],
- })
- );
- });
-
- test('should fallback to the first date field available in the dataView if not time-based', () => {
- const state = testState();
- const indexPattern = createMockedIndexPattern({ timeFieldName: '' });
- state.layers[0] = {
- annotations: [customLineStaticAnnotation],
- layerId: 'annotation',
- layerType: 'annotations',
- ignoreGlobalFilters: true,
- indexPatternId: indexPattern.id,
- };
- const frameMock = createMockFramePublicAPI({
- datasourceLayers: {},
- dataViews: createMockDataViewsState({
- indexPatterns: { [indexPattern.id]: indexPattern },
- }),
- });
-
- const setState = jest.fn();
-
- const component = mount(
-
- );
-
- act(() => {
- component
- .find(`[data-test-subj="lns-xyAnnotation-placementType"]`)
- .find(EuiButtonGroup)
- .prop('onChange')!('lens_xyChart_annotation_query');
- });
- component.update();
-
- expect(setState).toHaveBeenCalledWith(
- expect.objectContaining({
- layers: [
- expect.objectContaining({
- annotations: [expect.objectContaining({ timeField: 'timestampLabel' })],
- }),
- ],
- })
- );
- });
- });
-});
diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/types.ts b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/types.ts
deleted file mode 100644
index f446afb6be265..0000000000000
--- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/annotations_config_panel/types.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0; you may not use this file except in compliance with the Elastic License
- * 2.0.
- */
-
-import {
- PointInTimeEventAnnotationConfig,
- RangeEventAnnotationConfig,
-} from '@kbn/event-annotation-plugin/common';
-
-export type ManualEventAnnotationType =
- | PointInTimeEventAnnotationConfig
- | RangeEventAnnotationConfig;
diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/dimension_editor.tsx b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/dimension_editor.tsx
index f5d19edd81c5e..4ce681eedbd51 100644
--- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/dimension_editor.tsx
+++ b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/dimension_editor.tsx
@@ -9,7 +9,6 @@ import React, { useCallback, useMemo } from 'react';
import { i18n } from '@kbn/i18n';
import { EuiButtonGroup, EuiFormRow, htmlIdGenerator } from '@elastic/eui';
import type { PaletteRegistry } from '@kbn/coloring';
-import type { DatatableUtilitiesService } from '@kbn/data-plugin/common';
import { useDebouncedValue } from '@kbn/visualization-ui-components/public';
import { ColorPicker } from '@kbn/visualization-ui-components/public';
import type { VisualizationDimensionEditorProps } from '../../../types';
@@ -17,9 +16,7 @@ import { State, XYState, XYDataLayerConfig, YConfig, YAxisMode } from '../types'
import { FormatFactory } from '../../../../common/types';
import { getSeriesColor, isHorizontalChart } from '../state_helpers';
import { PalettePicker } from '../../../shared_components';
-import { getDataLayers, isAnnotationsLayer, isReferenceLayer } from '../visualization_helpers';
-import { ReferenceLinePanel } from './reference_line_config_panel';
-import { AnnotationsPanel } from './annotations_config_panel';
+import { getDataLayers } from '../visualization_helpers';
import { CollapseSetting } from '../../../shared_components/collapse_setting';
import { getSortedAccessors } from '../to_expression';
import { getColorAssignments, getAssignedColorConfig } from '../color_assignment';
@@ -42,26 +39,6 @@ export function updateLayer(
export const idPrefix = htmlIdGenerator()();
-export function DimensionEditor(
- props: VisualizationDimensionEditorProps & {
- datatableUtilities: DatatableUtilitiesService;
- formatFactory: FormatFactory;
- paletteService: PaletteRegistry;
- }
-) {
- const { state, layerId } = props;
- const index = state.layers.findIndex((l) => l.layerId === layerId);
- const layer = state.layers[index];
- if (isAnnotationsLayer(layer)) {
- return ;
- }
-
- if (isReferenceLayer(layer)) {
- return ;
- }
- return ;
-}
-
export function DataDimensionEditor(
props: VisualizationDimensionEditorProps & {
formatFactory: FormatFactory;
diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/reference_line_panel.tsx b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/reference_line_panel.tsx
index d160777eeaa4d..6f6b4807b6f96 100644
--- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/reference_line_panel.tsx
+++ b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/reference_line_panel.tsx
@@ -14,6 +14,8 @@ import {
useDebouncedValue,
IconSelectSetting,
ColorPicker,
+ LineStyleSettings,
+ TextDecorationSetting,
} from '@kbn/visualization-ui-components/public';
import type { VisualizationDimensionEditorProps } from '../../../../types';
import { State, XYState, XYReferenceLineLayerConfig, YConfig } from '../../types';
@@ -22,11 +24,7 @@ import { FormatFactory } from '../../../../../common/types';
import { updateLayer } from '..';
import { idPrefix } from '../dimension_editor';
import { isHorizontalChart } from '../../state_helpers';
-import {
- MarkerDecorationPosition,
- TextDecorationSetting,
-} from '../shared/marker_decoration_settings';
-import { LineStyleSettings } from '../shared/line_style_settings';
+import { MarkerDecorationPosition } from '../shared/marker_decoration_settings';
import { referenceLineIconsSet } from './icon_set';
import { defaultReferenceLineColor } from '../../color_assignment';
@@ -77,7 +75,11 @@ export const ReferenceLinePanel = (
return (
<>
-
+
setConfig({ icon })}
currentIcon={localConfig?.icon}
@@ -88,11 +90,7 @@ export const ReferenceLinePanel = (
setConfig={setConfig}
currentConfig={localConfig}
/>
-
+
{
textField?: string;
}
-function getSelectedOption(
- { textField, textVisibility }: MarkerDecorationConfig = {},
- isQueryBased?: boolean
-) {
- if (!textVisibility) {
- return 'none';
- }
- if (isQueryBased && textField) {
- return 'field';
- }
- return 'name';
-}
-
-export function TextDecorationSetting({
- currentConfig,
- setConfig,
- isQueryBased,
- children,
-}: {
- currentConfig?: MarkerDecorationConfig;
- setConfig: (config: MarkerDecorationConfig) => void;
- isQueryBased?: boolean;
- /** A children render function for custom sub fields on textDecoration change */
- children?: (textDecoration: 'none' | 'name' | 'field') => JSX.Element | null;
-}) {
- // To model the temporary state for label based on field when user didn't pick up the field yet,
- // use a local state
- const [selectedVisibleOption, setVisibleOption] = useState<'none' | 'name' | 'field'>(
- getSelectedOption(currentConfig, isQueryBased)
- );
- const options = [
- {
- id: `${idPrefix}none`,
- label: i18n.translate('xpack.lens.xyChart.lineMarker.textVisibility.none', {
- defaultMessage: 'None',
- }),
- 'data-test-subj': 'lnsXY_textVisibility_none',
- },
- {
- id: `${idPrefix}name`,
- label: i18n.translate('xpack.lens.xyChart.lineMarker.textVisibility.name', {
- defaultMessage: 'Name',
- }),
- 'data-test-subj': 'lnsXY_textVisibility_name',
- },
- ];
- if (isQueryBased) {
- options.push({
- id: `${idPrefix}field`,
- label: i18n.translate('xpack.lens.xyChart.lineMarker.textVisibility.field', {
- defaultMessage: 'Field',
- }),
- 'data-test-subj': 'lnsXY_textVisibility_field',
- });
- }
-
- return (
-
-
- {
- const chosenOption = id.replace(idPrefix, '') as 'none' | 'name' | 'field';
- if (chosenOption === 'none') {
- setConfig({
- textVisibility: false,
- textField: undefined,
- });
- } else if (chosenOption === 'name') {
- setConfig({
- textVisibility: true,
- textField: undefined,
- });
- } else if (chosenOption === 'field') {
- setConfig({
- textVisibility: Boolean(currentConfig?.textField),
- });
- }
-
- setVisibleOption(chosenOption);
- }}
- isFullWidth
- />
- {children?.(selectedVisibleOption)}
-
-
- );
-}
-
export function MarkerDecorationPosition({
currentConfig,
setConfig,
diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/xy_config_panel.test.tsx b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/xy_config_panel.test.tsx
index 6caa8238808e9..252c3de6b8e57 100644
--- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/xy_config_panel.test.tsx
+++ b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/xy_config_panel.test.tsx
@@ -8,9 +8,8 @@
import React from 'react';
import { mountWithIntl as mount, shallowWithIntl as shallow } from '@kbn/test-jest-helpers';
import { EuiButtonGroupProps, EuiButtonGroup } from '@elastic/eui';
-import { createDatatableUtilitiesMock } from '@kbn/data-plugin/common/mocks';
import { XyToolbar } from '.';
-import { DimensionEditor } from './dimension_editor';
+import { DataDimensionEditor } from './dimension_editor';
import { AxisSettingsPopover } from './axis_settings_popover';
import { FramePublicAPI, DatasourcePublicAPI } from '../../../types';
import { State, XYState, XYDataLayerConfig } from '../types';
@@ -254,12 +253,10 @@ describe('XY Config panels', () => {
});
describe('Dimension Editor', () => {
- const datatableUtilities = createDatatableUtilitiesMock();
-
test('shows the correct axis side options when in horizontal mode', () => {
const state = testState();
const component = mount(
- {
...state,
layers: [{ ...state.layers[0], seriesType: 'bar_horizontal' } as XYDataLayerConfig],
}}
- datatableUtilities={datatableUtilities}
formatFactory={jest.fn()}
paletteService={chartPluginMock.createPaletteRegistry()}
panelRef={React.createRef()}
@@ -290,14 +286,13 @@ describe('XY Config panels', () => {
test('shows the default axis side options when not in horizontal mode', () => {
const state = testState();
const component = mount(
- {
],
} as XYState;
const component = mount(
- {
accessor="bar"
groupId="left"
state={state}
- datatableUtilities={datatableUtilities}
formatFactory={jest.fn()}
paletteService={chartPluginMock.createPaletteRegistry()}
panelRef={React.createRef()}
@@ -376,7 +370,7 @@ describe('XY Config panels', () => {
} as XYState;
const component = mount(
- {
accessor="bar"
groupId="left"
state={state}
- datatableUtilities={datatableUtilities}
formatFactory={jest.fn()}
paletteService={chartPluginMock.createPaletteRegistry()}
panelRef={React.createRef()}
@@ -422,7 +415,7 @@ describe('XY Config panels', () => {
} as XYState;
const component = mount(
- {
accessor="bar"
groupId="left"
state={state}
- datatableUtilities={datatableUtilities}
formatFactory={jest.fn()}
paletteService={chartPluginMock.createPaletteRegistry()}
panelRef={React.createRef()}
diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_suggestions.test.ts b/x-pack/plugins/lens/public/visualizations/xy/xy_suggestions.test.ts
index 0007493f3b8eb..8417d02d79995 100644
--- a/x-pack/plugins/lens/public/visualizations/xy/xy_suggestions.test.ts
+++ b/x-pack/plugins/lens/public/visualizations/xy/xy_suggestions.test.ts
@@ -25,6 +25,7 @@ import { coreMock, themeServiceMock } from '@kbn/core/public/mocks';
import { dataPluginMock } from '@kbn/data-plugin/public/mocks';
import { IStorageWrapper } from '@kbn/kibana-utils-plugin/public';
import { unifiedSearchPluginMock } from '@kbn/unified-search-plugin/public/mocks';
+import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public';
jest.mock('../../id_generator');
@@ -38,6 +39,7 @@ const xyVisualization = getXyVisualization({
storage: {} as IStorageWrapper,
data: dataPluginMock.createStartContract(),
unifiedSearch: unifiedSearchPluginMock.createStartContract(),
+ dataViewsService: {} as DataViewsPublicPluginStart,
});
describe('xy_suggestions', () => {
diff --git a/x-pack/plugins/maps/public/render_app.tsx b/x-pack/plugins/maps/public/render_app.tsx
index c4bddf5a71541..3897e38222eef 100644
--- a/x-pack/plugins/maps/public/render_app.tsx
+++ b/x-pack/plugins/maps/public/render_app.tsx
@@ -15,7 +15,7 @@ import { ExitFullScreenButtonKibanaProvider } from '@kbn/shared-ux-button-exit-f
import { KibanaThemeProvider, toMountPoint } from '@kbn/kibana-react-plugin/public';
import { FormattedRelative } from '@kbn/i18n-react';
import type { SavedObjectTaggingPluginStart } from '@kbn/saved-objects-tagging-plugin/public';
-import { TableListViewKibanaProvider } from '@kbn/content-management-table-list';
+import { TableListViewKibanaProvider } from '@kbn/content-management-table-list-view-table';
import {
getCoreChrome,
getCoreI18n,
diff --git a/x-pack/plugins/maps/public/routes/list_page/maps_list_view.tsx b/x-pack/plugins/maps/public/routes/list_page/maps_list_view.tsx
index d98444057097d..93fc858f1c9d8 100644
--- a/x-pack/plugins/maps/public/routes/list_page/maps_list_view.tsx
+++ b/x-pack/plugins/maps/public/routes/list_page/maps_list_view.tsx
@@ -9,8 +9,8 @@ import React, { useCallback, memo, useEffect } from 'react';
import type { SavedObjectsFindOptionsReference, ScopedHistory } from '@kbn/core/public';
import { METRIC_TYPE } from '@kbn/analytics';
import { i18n } from '@kbn/i18n';
-import { TableListView } from '@kbn/content-management-table-list';
-import type { UserContentCommonSchema } from '@kbn/content-management-table-list';
+import { TableListView } from '@kbn/content-management-table-list-view';
+import type { UserContentCommonSchema } from '@kbn/content-management-table-list-view';
import type { MapItem } from '../../../common/content_management';
import { APP_ID, APP_NAME, getEditPath, MAP_PATH } from '../../../common/constants';
@@ -133,7 +133,7 @@ function MapsListViewComp({ history }: Props) {
entityNamePlural={i18n.translate('xpack.maps.mapListing.entityNamePlural', {
defaultMessage: 'maps',
})}
- tableListTitle={APP_NAME}
+ title={APP_NAME}
onClickTitle={({ id }) => history.push(getEditPath(id))}
/>
);
diff --git a/x-pack/plugins/maps/tsconfig.json b/x-pack/plugins/maps/tsconfig.json
index 6f24d4d7d3c5e..b0e27ee323dba 100644
--- a/x-pack/plugins/maps/tsconfig.json
+++ b/x-pack/plugins/maps/tsconfig.json
@@ -50,7 +50,6 @@
"@kbn/field-formats-plugin",
"@kbn/shared-ux-button-exit-full-screen",
"@kbn/i18n-react",
- "@kbn/content-management-table-list",
"@kbn/react-field",
"@kbn/analytics",
"@kbn/mapbox-gl",
@@ -71,6 +70,8 @@
"@kbn/core-saved-objects-server",
"@kbn/maps-vector-tile-utils",
"@kbn/core-http-common",
+ "@kbn/content-management-table-list-view-table",
+ "@kbn/content-management-table-list-view",
],
"exclude": [
"target/**/*",
diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json
index 009cb044b4c3e..65e1cae7b8ec6 100644
--- a/x-pack/plugins/translations/translations/fr-FR.json
+++ b/x-pack/plugins/translations/translations/fr-FR.json
@@ -20922,7 +20922,6 @@
"xpack.lens.legacyUrlConflict.objectNoun": "Visualisation Lens",
"xpack.lens.lensSavedObjectLabel": "Visualisation Lens",
"xpack.lens.lineMarker.positionRequirementTooltip": "Vous devez sélectionner une icône ou afficher le nom pour pouvoir en modifier la position.",
- "xpack.lens.lineMarker.textVisibility": "Décoration du texte",
"xpack.lens.metric.addLayer": "Visualisation",
"xpack.lens.metric.breakdownBy": "Répartir par",
"xpack.lens.metric.color": "Couleur",
@@ -21041,7 +21040,6 @@
"xpack.lens.pieChart.visualOptionsLabel": "Options visuelles",
"xpack.lens.primaryMetric.headingLabel": "Valeur",
"xpack.lens.primaryMetric.label": "Indicateur principal",
- "xpack.lens.queryInput.appName": "Lens",
"xpack.lens.reporting.shareContextMenu.csvReportsButtonLabel": "Téléchargement CSV",
"xpack.lens.resetLayerAriaLabel": "Effacer le calque",
"xpack.lens.saveDuplicateRejectedDescription": "La confirmation d'enregistrement avec un doublon de titre a été rejetée.",
@@ -21157,22 +21155,7 @@
"xpack.lens.xyChart.addDataLayerLabel": "Visualisation",
"xpack.lens.xyChart.addReferenceLineLayerLabel": "Lignes de référence",
"xpack.lens.xyChart.addReferenceLineLayerLabelDisabledHelp": "Ajouter des données pour activer le calque de référence",
- "xpack.lens.xyChart.annotation.hide": "Masquer l’annotation",
- "xpack.lens.xyChart.annotation.manual": "Date statique",
- "xpack.lens.xyChart.annotation.query": "Requête personnalisée",
- "xpack.lens.xyChart.annotation.queryField": "Champ de date cible",
- "xpack.lens.xyChart.annotation.queryInput": "Requête sur les annotations",
- "xpack.lens.xyChart.annotation.tooltip": "Afficher les champs supplémentaires",
- "xpack.lens.xyChart.annotation.tooltip.addField": "Ajouter un champ",
- "xpack.lens.xyChart.annotation.tooltip.deleteButtonLabel": "Supprimer",
- "xpack.lens.xyChart.annotation.tooltip.noFields": "Aucune sélection",
- "xpack.lens.xyChart.annotationDate": "Date de l’annotation",
- "xpack.lens.xyChart.annotationDate.from": "De",
- "xpack.lens.xyChart.annotationDate.placementType": "Type de placement",
- "xpack.lens.xyChart.annotationDate.to": "À",
"xpack.lens.xyChart.annotationError.timeFieldEmpty": "Le champ temporel est manquant",
- "xpack.lens.xyChart.appearance": "Apparence",
- "xpack.lens.xyChart.applyAsRange": "Appliquer en tant que plage",
"xpack.lens.xyChart.axisOrientation.angled": "En angle",
"xpack.lens.xyChart.axisOrientation.horizontal": "Horizontal",
"xpack.lens.xyChart.axisOrientation.label": "Orientation",
@@ -21195,9 +21178,6 @@
"xpack.lens.xyChart.fill.label": "Remplir",
"xpack.lens.xyChart.fill.none": "Aucun",
"xpack.lens.xyChart.fillOpacityLabel": "Opacité de remplissage",
- "xpack.lens.xyChart.fillStyle": "Remplir",
- "xpack.lens.xyChart.fillStyle.inside": "Intérieur",
- "xpack.lens.xyChart.fillStyle.outside": "Extérieur",
"xpack.lens.xyChart.Gridlines": "Quadrillage",
"xpack.lens.xyChart.horizontalAxisLabel": "Axe horizontal",
"xpack.lens.xyChart.horizontalLeftAxisLabel": "Axe supérieur horizontal",
@@ -21207,17 +21187,10 @@
"xpack.lens.xyChart.iconSelect.bellIconLabel": "Cloche",
"xpack.lens.xyChart.iconSelect.boltIconLabel": "Éclair",
"xpack.lens.xyChart.iconSelect.bugIconLabel": "Bug",
- "xpack.lens.xyChart.iconSelect.circleIconLabel": "Cercle",
"xpack.lens.xyChart.iconSelect.commentIconLabel": "Commentaire",
"xpack.lens.xyChart.iconSelect.flagIconLabel": "Drapeau",
- "xpack.lens.xyChart.iconSelect.heartLabel": "Cœur",
- "xpack.lens.xyChart.iconSelect.mapMarkerLabel": "Repère",
- "xpack.lens.xyChart.iconSelect.mapPinLabel": "Punaise",
"xpack.lens.xyChart.iconSelect.noIconLabel": "Aucun",
- "xpack.lens.xyChart.iconSelect.starFilledLabel": "Étoile remplie",
- "xpack.lens.xyChart.iconSelect.starLabel": "Étoile",
"xpack.lens.xyChart.iconSelect.tagIconLabel": "Balise",
- "xpack.lens.xyChart.iconSelect.triangleIconLabel": "Triangle",
"xpack.lens.xyChart.layerAnnotation": "Annotation",
"xpack.lens.xyChart.layerAnnotationsIgnoreTitle": "Calques ignorant les filtres globaux",
"xpack.lens.xyChart.layerAnnotationsLabel": "Annotations",
@@ -21233,13 +21206,6 @@
"xpack.lens.xyChart.lineColor.label": "Couleur",
"xpack.lens.xyChart.lineMarker.auto": "Auto",
"xpack.lens.xyChart.lineMarker.position": "Position de la décoration",
- "xpack.lens.xyChart.lineMarker.textVisibility.field": "Champ",
- "xpack.lens.xyChart.lineMarker.textVisibility.name": "Nom",
- "xpack.lens.xyChart.lineMarker.textVisibility.none": "Aucun",
- "xpack.lens.xyChart.lineStyle.dashed": "Tirets",
- "xpack.lens.xyChart.lineStyle.dotted": "Pointillé",
- "xpack.lens.xyChart.lineStyle.label": "Ligne",
- "xpack.lens.xyChart.lineStyle.solid": "Uni",
"xpack.lens.xyChart.markerPosition.above": "Haut",
"xpack.lens.xyChart.markerPosition.below": "Bas",
"xpack.lens.xyChart.markerPosition.left": "Gauche",
@@ -21248,7 +21214,6 @@
"xpack.lens.xyChart.missingValuesLabelHelpText": "Par défaut, les graphiques en aires et en courbes masquent les blancs entre les données. Pour remplir le blanc, effectuez une sélection.",
"xpack.lens.xyChart.missingValuesStyle": "Afficher sous la forme d’une ligne pointillée",
"xpack.lens.xyChart.nestUnderRoot": "Ensemble de données entier",
- "xpack.lens.xyChart.placement": "Placement",
"xpack.lens.xyChart.rightAxisDisabledHelpText": "Ce paramètre s'applique uniquement lorsque l'axe de droite est activé.",
"xpack.lens.xyChart.rightAxisLabel": "Axe de droite",
"xpack.lens.xyChart.scaleLinear": "Linéaire",
@@ -21258,7 +21223,6 @@
"xpack.lens.xyChart.showCurrenTimeMarker": "Afficher le repère de temps actuel",
"xpack.lens.xyChart.showEnzones": "Afficher les marqueurs de données partielles",
"xpack.lens.xyChart.splitSeries": "Répartition",
- "xpack.lens.xyChart.tooltip": "Infobulle",
"xpack.lens.xyChart.topAxisDisabledHelpText": "Ce paramètre s'applique uniquement lorsque l'axe du haut est activé.",
"xpack.lens.xyChart.topAxisLabel": "Axe du haut",
"xpack.lens.xyChart.valuesHistogramDisabledHelpText": "Ce paramètre ne peut pas être modifié dans les histogrammes.",
diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json
index 44eebedd74528..30ca83889d63f 100644
--- a/x-pack/plugins/translations/translations/ja-JP.json
+++ b/x-pack/plugins/translations/translations/ja-JP.json
@@ -20922,7 +20922,6 @@
"xpack.lens.legacyUrlConflict.objectNoun": "レンズビジュアライゼーション",
"xpack.lens.lensSavedObjectLabel": "レンズビジュアライゼーション",
"xpack.lens.lineMarker.positionRequirementTooltip": "位置を変更するには、アイコンを選択するか、名前を表示する必要があります",
- "xpack.lens.lineMarker.textVisibility": "テキスト装飾",
"xpack.lens.metric.addLayer": "ビジュアライゼーション",
"xpack.lens.metric.breakdownBy": "内訳の基準",
"xpack.lens.metric.color": "色",
@@ -21041,7 +21040,6 @@
"xpack.lens.pieChart.visualOptionsLabel": "視覚オプション",
"xpack.lens.primaryMetric.headingLabel": "値",
"xpack.lens.primaryMetric.label": "主メトリック",
- "xpack.lens.queryInput.appName": "レンズ",
"xpack.lens.reporting.shareContextMenu.csvReportsButtonLabel": "CSVダウンロード",
"xpack.lens.resetLayerAriaLabel": "レイヤーをクリア",
"xpack.lens.saveDuplicateRejectedDescription": "重複ファイルの保存確認が拒否されました",
@@ -21157,22 +21155,7 @@
"xpack.lens.xyChart.addDataLayerLabel": "ビジュアライゼーション",
"xpack.lens.xyChart.addReferenceLineLayerLabel": "基準線",
"xpack.lens.xyChart.addReferenceLineLayerLabelDisabledHelp": "一部のデータを追加して、基準レイヤーを有効にする",
- "xpack.lens.xyChart.annotation.hide": "注釈を非表示",
- "xpack.lens.xyChart.annotation.manual": "固定日付",
- "xpack.lens.xyChart.annotation.query": "カスタムクエリ",
- "xpack.lens.xyChart.annotation.queryField": "ターゲット日付フィールド",
- "xpack.lens.xyChart.annotation.queryInput": "注釈クエリ",
- "xpack.lens.xyChart.annotation.tooltip": "追加フィールドを表示",
- "xpack.lens.xyChart.annotation.tooltip.addField": "フィールドの追加",
- "xpack.lens.xyChart.annotation.tooltip.deleteButtonLabel": "削除",
- "xpack.lens.xyChart.annotation.tooltip.noFields": "選択されていません",
- "xpack.lens.xyChart.annotationDate": "注釈日",
- "xpack.lens.xyChart.annotationDate.from": "開始:",
- "xpack.lens.xyChart.annotationDate.placementType": "配置タイプ",
- "xpack.lens.xyChart.annotationDate.to": "終了:",
"xpack.lens.xyChart.annotationError.timeFieldEmpty": "時刻フィールドがありません",
- "xpack.lens.xyChart.appearance": "見た目",
- "xpack.lens.xyChart.applyAsRange": "範囲として適用",
"xpack.lens.xyChart.axisOrientation.angled": "傾斜",
"xpack.lens.xyChart.axisOrientation.horizontal": "横",
"xpack.lens.xyChart.axisOrientation.label": "向き",
@@ -21195,9 +21178,6 @@
"xpack.lens.xyChart.fill.label": "塗りつぶし",
"xpack.lens.xyChart.fill.none": "なし",
"xpack.lens.xyChart.fillOpacityLabel": "塗りつぶしの透明度",
- "xpack.lens.xyChart.fillStyle": "塗りつぶし",
- "xpack.lens.xyChart.fillStyle.inside": "内部",
- "xpack.lens.xyChart.fillStyle.outside": "外側",
"xpack.lens.xyChart.Gridlines": "グリッド線",
"xpack.lens.xyChart.horizontalAxisLabel": "横軸",
"xpack.lens.xyChart.horizontalLeftAxisLabel": "横上軸",
@@ -21207,17 +21187,10 @@
"xpack.lens.xyChart.iconSelect.bellIconLabel": "ベル",
"xpack.lens.xyChart.iconSelect.boltIconLabel": "ボルト",
"xpack.lens.xyChart.iconSelect.bugIconLabel": "バグ",
- "xpack.lens.xyChart.iconSelect.circleIconLabel": "円",
"xpack.lens.xyChart.iconSelect.commentIconLabel": "コメント",
"xpack.lens.xyChart.iconSelect.flagIconLabel": "旗",
- "xpack.lens.xyChart.iconSelect.heartLabel": "ハート",
- "xpack.lens.xyChart.iconSelect.mapMarkerLabel": "マップマーカー",
- "xpack.lens.xyChart.iconSelect.mapPinLabel": "マップピン",
"xpack.lens.xyChart.iconSelect.noIconLabel": "なし",
- "xpack.lens.xyChart.iconSelect.starFilledLabel": "塗りつぶされた星",
- "xpack.lens.xyChart.iconSelect.starLabel": "星",
"xpack.lens.xyChart.iconSelect.tagIconLabel": "タグ",
- "xpack.lens.xyChart.iconSelect.triangleIconLabel": "三角形",
"xpack.lens.xyChart.layerAnnotation": "注釈",
"xpack.lens.xyChart.layerAnnotationsIgnoreTitle": "グローバルフィルターを無視するレイヤー",
"xpack.lens.xyChart.layerAnnotationsLabel": "注釈",
@@ -21233,13 +21206,6 @@
"xpack.lens.xyChart.lineColor.label": "色",
"xpack.lens.xyChart.lineMarker.auto": "自動",
"xpack.lens.xyChart.lineMarker.position": "装飾位置",
- "xpack.lens.xyChart.lineMarker.textVisibility.field": "フィールド",
- "xpack.lens.xyChart.lineMarker.textVisibility.name": "名前",
- "xpack.lens.xyChart.lineMarker.textVisibility.none": "なし",
- "xpack.lens.xyChart.lineStyle.dashed": "鎖線",
- "xpack.lens.xyChart.lineStyle.dotted": "点線",
- "xpack.lens.xyChart.lineStyle.label": "折れ線",
- "xpack.lens.xyChart.lineStyle.solid": "塗りつぶし",
"xpack.lens.xyChart.markerPosition.above": "トップ",
"xpack.lens.xyChart.markerPosition.below": "一番下",
"xpack.lens.xyChart.markerPosition.left": "左",
@@ -21248,7 +21214,6 @@
"xpack.lens.xyChart.missingValuesLabelHelpText": "デフォルトでは、面グラフと折れ線グラフはデータのギャップが非表示になります。ギャップを埋めるには、選択します。",
"xpack.lens.xyChart.missingValuesStyle": "点線として表示",
"xpack.lens.xyChart.nestUnderRoot": "データセット全体",
- "xpack.lens.xyChart.placement": "配置",
"xpack.lens.xyChart.rightAxisDisabledHelpText": "この設定は、右の軸が有効であるときにのみ適用されます。",
"xpack.lens.xyChart.rightAxisLabel": "右の軸",
"xpack.lens.xyChart.scaleLinear": "線形",
@@ -21258,7 +21223,6 @@
"xpack.lens.xyChart.showCurrenTimeMarker": "現在時刻マーカーを表示",
"xpack.lens.xyChart.showEnzones": "部分データマーカーを表示",
"xpack.lens.xyChart.splitSeries": "内訳",
- "xpack.lens.xyChart.tooltip": "ツールチップ",
"xpack.lens.xyChart.topAxisDisabledHelpText": "この設定は、上の軸が有効であるときにのみ適用されます。",
"xpack.lens.xyChart.topAxisLabel": "上の軸",
"xpack.lens.xyChart.valuesHistogramDisabledHelpText": "この設定はヒストグラムで変更できません。",
diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json
index 73eb81fb3bc38..212f1bed8ff47 100644
--- a/x-pack/plugins/translations/translations/zh-CN.json
+++ b/x-pack/plugins/translations/translations/zh-CN.json
@@ -20922,7 +20922,6 @@
"xpack.lens.legacyUrlConflict.objectNoun": "Lens 可视化",
"xpack.lens.lensSavedObjectLabel": "Lens 可视化",
"xpack.lens.lineMarker.positionRequirementTooltip": "必须选择图标或显示名称才能更改其位置",
- "xpack.lens.lineMarker.textVisibility": "文本装饰",
"xpack.lens.metric.addLayer": "可视化",
"xpack.lens.metric.breakdownBy": "细分方式",
"xpack.lens.metric.color": "颜色",
@@ -21041,7 +21040,6 @@
"xpack.lens.pieChart.visualOptionsLabel": "视觉选项",
"xpack.lens.primaryMetric.headingLabel": "值",
"xpack.lens.primaryMetric.label": "主要指标",
- "xpack.lens.queryInput.appName": "Lens",
"xpack.lens.reporting.shareContextMenu.csvReportsButtonLabel": "CSV 下载",
"xpack.lens.resetLayerAriaLabel": "清除图层",
"xpack.lens.saveDuplicateRejectedDescription": "已拒绝使用重复标题保存确认",
@@ -21157,22 +21155,7 @@
"xpack.lens.xyChart.addDataLayerLabel": "可视化",
"xpack.lens.xyChart.addReferenceLineLayerLabel": "参考线",
"xpack.lens.xyChart.addReferenceLineLayerLabelDisabledHelp": "添加一些数据以启用参考图层",
- "xpack.lens.xyChart.annotation.hide": "隐藏标注",
- "xpack.lens.xyChart.annotation.manual": "静态日期",
- "xpack.lens.xyChart.annotation.query": "定制查询",
- "xpack.lens.xyChart.annotation.queryField": "目标日期字段",
- "xpack.lens.xyChart.annotation.queryInput": "标注查询",
- "xpack.lens.xyChart.annotation.tooltip": "显示其他字段",
- "xpack.lens.xyChart.annotation.tooltip.addField": "添加字段",
- "xpack.lens.xyChart.annotation.tooltip.deleteButtonLabel": "删除",
- "xpack.lens.xyChart.annotation.tooltip.noFields": "未选择任何内容",
- "xpack.lens.xyChart.annotationDate": "标注日期",
- "xpack.lens.xyChart.annotationDate.from": "自",
- "xpack.lens.xyChart.annotationDate.placementType": "位置类型",
- "xpack.lens.xyChart.annotationDate.to": "至",
"xpack.lens.xyChart.annotationError.timeFieldEmpty": "缺少时间字段",
- "xpack.lens.xyChart.appearance": "外观",
- "xpack.lens.xyChart.applyAsRange": "应用为范围",
"xpack.lens.xyChart.axisOrientation.angled": "带角度",
"xpack.lens.xyChart.axisOrientation.horizontal": "水平",
"xpack.lens.xyChart.axisOrientation.label": "方向",
@@ -21195,9 +21178,6 @@
"xpack.lens.xyChart.fill.label": "填充",
"xpack.lens.xyChart.fill.none": "无",
"xpack.lens.xyChart.fillOpacityLabel": "填充透明度",
- "xpack.lens.xyChart.fillStyle": "填充",
- "xpack.lens.xyChart.fillStyle.inside": "内部",
- "xpack.lens.xyChart.fillStyle.outside": "外部",
"xpack.lens.xyChart.Gridlines": "网格线",
"xpack.lens.xyChart.horizontalAxisLabel": "水平轴",
"xpack.lens.xyChart.horizontalLeftAxisLabel": "水平顶轴",
@@ -21207,17 +21187,10 @@
"xpack.lens.xyChart.iconSelect.bellIconLabel": "钟铃",
"xpack.lens.xyChart.iconSelect.boltIconLabel": "闪电",
"xpack.lens.xyChart.iconSelect.bugIconLabel": "昆虫",
- "xpack.lens.xyChart.iconSelect.circleIconLabel": "圆形",
"xpack.lens.xyChart.iconSelect.commentIconLabel": "注释",
"xpack.lens.xyChart.iconSelect.flagIconLabel": "旗帜",
- "xpack.lens.xyChart.iconSelect.heartLabel": "心形",
- "xpack.lens.xyChart.iconSelect.mapMarkerLabel": "地图标记",
- "xpack.lens.xyChart.iconSelect.mapPinLabel": "地图图钉",
"xpack.lens.xyChart.iconSelect.noIconLabel": "无",
- "xpack.lens.xyChart.iconSelect.starFilledLabel": "星形填充",
- "xpack.lens.xyChart.iconSelect.starLabel": "五角星",
"xpack.lens.xyChart.iconSelect.tagIconLabel": "标签",
- "xpack.lens.xyChart.iconSelect.triangleIconLabel": "三角形",
"xpack.lens.xyChart.layerAnnotation": "标注",
"xpack.lens.xyChart.layerAnnotationsIgnoreTitle": "忽略全局筛选的图层",
"xpack.lens.xyChart.layerAnnotationsLabel": "标注",
@@ -21233,13 +21206,6 @@
"xpack.lens.xyChart.lineColor.label": "颜色",
"xpack.lens.xyChart.lineMarker.auto": "自动",
"xpack.lens.xyChart.lineMarker.position": "装饰位置",
- "xpack.lens.xyChart.lineMarker.textVisibility.field": "字段",
- "xpack.lens.xyChart.lineMarker.textVisibility.name": "名称",
- "xpack.lens.xyChart.lineMarker.textVisibility.none": "无",
- "xpack.lens.xyChart.lineStyle.dashed": "虚线",
- "xpack.lens.xyChart.lineStyle.dotted": "点线",
- "xpack.lens.xyChart.lineStyle.label": "折线图",
- "xpack.lens.xyChart.lineStyle.solid": "纯色",
"xpack.lens.xyChart.markerPosition.above": "顶部",
"xpack.lens.xyChart.markerPosition.below": "底部",
"xpack.lens.xyChart.markerPosition.left": "左",
@@ -21248,7 +21214,6 @@
"xpack.lens.xyChart.missingValuesLabelHelpText": "默认情况下,面积图和折线图会隐藏数据中的缺口。要填充缺口,请进行选择。",
"xpack.lens.xyChart.missingValuesStyle": "显示为虚线",
"xpack.lens.xyChart.nestUnderRoot": "整个数据集",
- "xpack.lens.xyChart.placement": "位置",
"xpack.lens.xyChart.rightAxisDisabledHelpText": "此设置仅在启用右轴时应用。",
"xpack.lens.xyChart.rightAxisLabel": "右轴",
"xpack.lens.xyChart.scaleLinear": "线性",
@@ -21258,7 +21223,6 @@
"xpack.lens.xyChart.showCurrenTimeMarker": "显示当前时间标记",
"xpack.lens.xyChart.showEnzones": "显示部分数据标记",
"xpack.lens.xyChart.splitSeries": "细目",
- "xpack.lens.xyChart.tooltip": "工具提示",
"xpack.lens.xyChart.topAxisDisabledHelpText": "此设置仅在启用顶轴时应用。",
"xpack.lens.xyChart.topAxisLabel": "顶轴",
"xpack.lens.xyChart.valuesHistogramDisabledHelpText": "不能在直方图上更改此设置。",
diff --git a/x-pack/test/functional/apps/lens/group6/annotations.ts b/x-pack/test/functional/apps/lens/group6/annotations.ts
index 4bec636f52625..aa3b409d21fb0 100644
--- a/x-pack/test/functional/apps/lens/group6/annotations.ts
+++ b/x-pack/test/functional/apps/lens/group6/annotations.ts
@@ -22,6 +22,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const retry = getService('retry');
const toastsService = getService('toasts');
const testSubjects = getService('testSubjects');
+ const listingTable = getService('listingTable');
const from = 'Sep 19, 2015 @ 06:31:44.000';
const to = 'Sep 23, 2015 @ 18:31:44.000';
@@ -156,7 +157,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const toastContents = await toastsService.getToastContent(1);
expect(toastContents).to.be(
- `Saved "${ANNOTATION_GROUP_TITLE}"\nView or manage in the annotation library`
+ `Saved "${ANNOTATION_GROUP_TITLE}"\nView or manage in the annotation library.`
);
await PageObjects.lens.save(FIRST_VIS_TITLE);
@@ -181,15 +182,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
});
it('should remove layer for deleted annotation group', async () => {
- // TODO - delete from listing page instead
-
- await PageObjects.settings.navigateTo();
- await PageObjects.settings.clickKibanaSavedObjects();
- await PageObjects.savedObjects.searchForObject(ANNOTATION_GROUP_TITLE);
- await PageObjects.savedObjects.clickCheckboxByTitle(ANNOTATION_GROUP_TITLE);
- await PageObjects.savedObjects.clickDelete({ confirmDelete: true });
-
await PageObjects.visualize.gotoVisualizationLandingPage();
+ await PageObjects.visualize.selectAnnotationsTab();
+ await listingTable.deleteItem(ANNOTATION_GROUP_TITLE);
+ await PageObjects.visualize.selectVisualizationsTab();
await PageObjects.visualize.loadSavedVisualization(FIRST_VIS_TITLE, {
navigateToVisualize: false,
});
diff --git a/x-pack/test/functional/page_objects/lens_page.ts b/x-pack/test/functional/page_objects/lens_page.ts
index 7bbcc5dc73321..4370e7d143779 100644
--- a/x-pack/test/functional/page_objects/lens_page.ts
+++ b/x-pack/test/functional/page_objects/lens_page.ts
@@ -128,7 +128,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
extraFields?: string[];
}) {
// type * in the query editor
- const queryInput = await testSubjects.find('lnsXY-annotation-query-based-query-input');
+ const queryInput = await testSubjects.find('annotation-query-based-query-input');
await queryInput.type(opts.queryString);
await testSubjects.click('indexPattern-filters-existingFilterTrigger');
await this.selectOptionFromComboBox(
@@ -773,7 +773,7 @@ export function LensPageProvider({ getService, getPageObjects }: FtrProviderCont
},
async editDimensionLabel(label: string) {
- await testSubjects.setValue('column-label-edit', label, { clearWithKeyboard: true });
+ await testSubjects.setValue('name-input', label, { clearWithKeyboard: true });
},
async editDimensionFormat(format: string, options?: { decimals?: number; prefix?: string }) {
await this.selectOptionFromComboBox('indexPattern-dimension-format', format);
diff --git a/yarn.lock b/yarn.lock
index 365d7ef74d20e..0d175c93031de 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3180,7 +3180,15 @@
version "0.0.0"
uid ""
-"@kbn/content-management-table-list@link:packages/content-management/table_list":
+"@kbn/content-management-tabbed-table-list-view@link:packages/content-management/tabbed_table_list_view":
+ version "0.0.0"
+ uid ""
+
+"@kbn/content-management-table-list-view-table@link:packages/content-management/table_list_view_table":
+ version "0.0.0"
+ uid ""
+
+"@kbn/content-management-table-list-view@link:packages/content-management/table_list_view":
version "0.0.0"
uid ""