Skip to content

Commit

Permalink
Merge branch 'eui-v88.4.x' of github.com:cee-chen/kibana into eui-v88…
Browse files Browse the repository at this point in the history
….4.x
  • Loading branch information
patrykkopycinski committed Sep 27, 2023
2 parents 9f1bf08 + 109fe71 commit b834f1b
Show file tree
Hide file tree
Showing 102 changed files with 3,264 additions and 1,035 deletions.
2 changes: 1 addition & 1 deletion api_docs/data_view_editor.devdocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,4 +320,4 @@
"misc": [],
"objects": []
}
}
}
6 changes: 3 additions & 3 deletions api_docs/kbn_deeplinks_ml.devdocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"label": "DeepLinkId",
"description": [],
"signature": [
"\"ml\" | \"ml:nodes\" | \"ml:notifications\" | \"ml:overview\" | \"ml:settings\" | \"ml:dataVisualizer\" | \"ml:anomalyDetection\" | \"ml:anomalyExplorer\" | \"ml:singleMetricViewer\" | \"ml:dataComparison\" | \"ml:dataFrameAnalytics\" | \"ml:resultExplorer\" | \"ml:analyticsMap\" | \"ml:aiOps\" | \"ml:logRateAnalysis\" | \"ml:logPatternAnalysis\" | \"ml:changePointDetections\" | \"ml:modelManagement\" | \"ml:nodesOverview\" | \"ml:memoryUsage\" | \"ml:fileUpload\" | \"ml:indexDataVisualizer\" | \"ml:calendarSettings\" | \"ml:filterListsSettings\""
"\"ml\" | \"ml:nodes\" | \"ml:notifications\" | \"ml:overview\" | \"ml:settings\" | \"ml:dataVisualizer\" | \"ml:anomalyDetection\" | \"ml:anomalyExplorer\" | \"ml:singleMetricViewer\" | \"ml:dataDrift\" | \"ml:dataFrameAnalytics\" | \"ml:resultExplorer\" | \"ml:analyticsMap\" | \"ml:aiOps\" | \"ml:logRateAnalysis\" | \"ml:logPatternAnalysis\" | \"ml:changePointDetections\" | \"ml:modelManagement\" | \"ml:nodesOverview\" | \"ml:memoryUsage\" | \"ml:fileUpload\" | \"ml:indexDataVisualizer\" | \"ml:calendarSettings\" | \"ml:filterListsSettings\""
],
"path": "packages/deeplinks/ml/deep_links.ts",
"deprecated": false,
Expand All @@ -60,7 +60,7 @@
"label": "LinkId",
"description": [],
"signature": [
"\"nodes\" | \"notifications\" | \"overview\" | \"settings\" | \"dataVisualizer\" | \"anomalyDetection\" | \"anomalyExplorer\" | \"singleMetricViewer\" | \"dataComparison\" | \"dataFrameAnalytics\" | \"resultExplorer\" | \"analyticsMap\" | \"aiOps\" | \"logRateAnalysis\" | \"logPatternAnalysis\" | \"changePointDetections\" | \"modelManagement\" | \"nodesOverview\" | \"memoryUsage\" | \"fileUpload\" | \"indexDataVisualizer\" | \"calendarSettings\" | \"filterListsSettings\""
"\"nodes\" | \"notifications\" | \"overview\" | \"settings\" | \"dataVisualizer\" | \"anomalyDetection\" | \"anomalyExplorer\" | \"singleMetricViewer\" | \"dataDrift\" | \"dataFrameAnalytics\" | \"resultExplorer\" | \"analyticsMap\" | \"aiOps\" | \"logRateAnalysis\" | \"logPatternAnalysis\" | \"changePointDetections\" | \"modelManagement\" | \"nodesOverview\" | \"memoryUsage\" | \"fileUpload\" | \"indexDataVisualizer\" | \"calendarSettings\" | \"filterListsSettings\""
],
"path": "packages/deeplinks/ml/deep_links.ts",
"deprecated": false,
Expand All @@ -70,4 +70,4 @@
],
"objects": []
}
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@
"maplibre-gl": "3.1.0",
"markdown-it": "^12.3.2",
"md5": "^2.1.0",
"mdast-util-to-hast": "10.0.1",
"mdast-util-to-hast": "10.2.0",
"memoize-one": "^6.0.0",
"mime": "^2.4.4",
"mime-types": "^2.1.27",
Expand Down Expand Up @@ -1042,7 +1042,7 @@
"type-detect": "^4.0.8",
"typescript-fsa": "^3.0.0",
"typescript-fsa-reducers": "^1.2.2",
"unified": "^9.2.1",
"unified": "9.2.2",
"use-resize-observer": "^9.1.0",
"usng.js": "^0.4.5",
"utility-types": "^3.10.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/deeplinks/ml/deep_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export type LinkId =
| 'anomalyDetection'
| 'anomalyExplorer'
| 'singleMetricViewer'
| 'dataComparison'
| 'dataDrift'
| 'dataFrameAnalytics'
| 'resultExplorer'
| 'analyticsMap'
Expand Down
4 changes: 2 additions & 2 deletions packages/default-nav/ml/default_navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ export const defaultNavigation: MlNodeDefinition = {
},
{
title: i18n.translate('defaultNavigation.ml.dataComparison', {
defaultMessage: 'Data comparison',
defaultMessage: 'Data drift',
}),
link: 'ml:dataComparison',
link: 'ml:dataDrift',
},
],
},
Expand Down
33 changes: 33 additions & 0 deletions packages/kbn-unified-data-table/src/components/data_table.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -432,4 +432,37 @@ describe('UnifiedDataTable', () => {
expect(tourStep).toEqual('test-expand');
});
});

describe('gridStyleOverride', () => {
it('should render the grid with the default style if no gridStyleOverride is provided', async () => {
const component = await getComponent({
...getProps(),
});

const grid = findTestSubject(component, 'docTable');

expect(grid.hasClass('euiDataGrid--bordersHorizontal')).toBeTruthy();
expect(grid.hasClass('euiDataGrid--fontSizeSmall')).toBeTruthy();
expect(grid.hasClass('euiDataGrid--paddingLarge')).toBeTruthy();
expect(grid.hasClass('euiDataGrid--rowHoverHighlight')).toBeTruthy();
expect(grid.hasClass('euiDataGrid--headerUnderline')).toBeTruthy();
expect(grid.hasClass('euiDataGrid--stripes')).toBeTruthy();
});
it('should render the grid with style override if gridStyleOverride is provided', async () => {
const component = await getComponent({
...getProps(),
gridStyleOverride: {
stripes: false,
rowHover: 'none',
border: 'none',
},
});

const grid = findTestSubject(component, 'docTable');

expect(grid.hasClass('euiDataGrid--stripes')).toBeFalsy();
expect(grid.hasClass('euiDataGrid--rowHoverHighlight')).toBeFalsy();
expect(grid.hasClass('euiDataGrid--bordersNone')).toBeTruthy();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
EuiDataGridControlColumn,
EuiDataGridCustomBodyProps,
EuiDataGridCellValueElementProps,
EuiDataGridStyle,
} from '@elastic/eui';
import type { DataView } from '@kbn/data-views-plugin/public';
import {
Expand Down Expand Up @@ -282,6 +283,10 @@ export interface UnifiedDataTableProps {
* Optional key/value pairs to set guided onboarding steps ids for a data table components included to guided tour.
*/
componentsTourSteps?: Record<string, string>;
/**
* Optional gridStyle override.
*/
gridStyleOverride?: EuiDataGridStyle;
}

export const EuiDataGridMemoized = React.memo(EuiDataGrid);
Expand Down Expand Up @@ -335,6 +340,7 @@ export const UnifiedDataTable = ({
externalCustomRenderers,
consumer = 'discover',
componentsTourSteps,
gridStyleOverride,
}: UnifiedDataTableProps) => {
const { fieldFormats, toastNotifications, dataViewFieldEditor, uiSettings, storage, data } =
services;
Expand Down Expand Up @@ -789,7 +795,7 @@ export const UnifiedDataTable = ({
toolbarVisibility={toolbarVisibility}
rowHeightsOptions={rowHeightsOptions}
inMemory={inMemory}
gridStyle={GRID_STYLE}
gridStyle={gridStyleOverride ?? GRID_STYLE}
renderCustomGridBody={renderCustomGridBody}
trailingControlColumns={trailingControlColumns}
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/shared-ux/chrome/navigation/mocks/src/navlinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const allNavLinks: AppDeepLinkId[] = [
'ml:fileUpload',
'ml:filterListsSettings',
'ml:indexDataVisualizer',
'ml:dataComparison',
'ml:dataDrift',
'ml:logPatternAnalysis',
'ml:logRateAnalysis',
'ml:memoryUsage',
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/plugins/data_view_editor/public/data_view_editor_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,24 @@ export const matchedIndiciesDefault = {
visibleIndices: [],
};

/**
* ConstructorArgs for DataViewEditorService
*/
export interface DataViewEditorServiceConstructorArgs {
/**
* Dependencies for the DataViewEditorService
*/
services: {
http: HttpSetup;
dataViews: DataViewsServicePublic;
};
/**
* Whether service requires requireTimestampField
*/
requireTimestampField?: boolean;
/**
* Initial type, indexPattern, and name to populate service
*/
initialValues: {
name?: string;
type?: INDEX_PATTERN_TYPE;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export { DataViewEditorService } from './data_view_editor_service';
6 changes: 5 additions & 1 deletion src/plugins/data_view_editor/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@

import { DataViewEditorPlugin } from './plugin';

export type { PluginStart as DataViewEditorStart, DataViewEditorProps } from './types';
export type {
PluginStart as DataViewEditorStart,
DataViewEditorProps,
DataViewEditorService,
} from './types';

export function plugin() {
return new DataViewEditorPlugin();
Expand Down
1 change: 1 addition & 0 deletions src/plugins/data_view_editor/public/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const createStartContract = (): Start => {
userPermissions: {
editDataView: jest.fn(),
},
dataViewEditorServiceFactory: jest.fn(),
};
};

Expand Down
8 changes: 8 additions & 0 deletions src/plugins/data_view_editor/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ export class DataViewEditorPlugin
userPermissions: {
editDataView: () => dataViews.getCanSaveSync(),
},
/**
* Helper method to generate a new data view editor service.
* @returns DataViewEditorService
*/
dataViewEditorServiceFactory: async () => {
const module = await import('./data_view_editor_service_lazy');
return module;
},
};
}

Expand Down
9 changes: 9 additions & 0 deletions src/plugins/data_view_editor/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import type {
INDEX_PATTERN_TYPE,
MatchedItem,
} from '@kbn/data-views-plugin/public';
import type { DataViewEditorService } from './data_view_editor_service';
import { DataPublicPluginStart, IndexPatternAggRestrictions } from './shared_imports';

export interface DataViewEditorContext {
Expand Down Expand Up @@ -74,12 +75,20 @@ export interface DataViewEditorProps {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface PluginSetup {}

export type { DataViewEditorService };
export interface PluginStart {
openEditor(options: DataViewEditorProps): () => void;
IndexPatternEditorComponent: FC<DataViewEditorProps>;
userPermissions: {
editDataView: () => boolean;
};
/**
* Helper method to generate a new data view editor service.
* @param requireTimestampField - whether service requires requireTimestampField
* @param initialValues - initial type, indexPattern, and name to populate service
* @returns DataViewEditorService
*/
dataViewEditorServiceFactory: () => Promise<typeof import('./data_view_editor_service_lazy')>;
}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ interface BaseSavedObjectFinder {
savedObjectMetaData: Array<SavedObjectMetaData<FinderAttributes>>;
showFilter?: boolean;
leftChildren?: ReactElement | ReactElement[];
children?: ReactElement | ReactElement[];
helpText?: string;
}

Expand Down
1 change: 0 additions & 1 deletion test/functional/apps/dashboard/group3/copy_panel_to.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const dashboardPanelActions = getService('dashboardPanelActions');
const testSubjects = getService('testSubjects');
const kibanaServer = getService('kibanaServer');
const find = getService('find');

const PageObjects = getPageObjects([
'header',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ export interface DocumentCountChartProps {
brushSelectionUpdateHandler?: BrushSelectionUpdateHandler;
/** Optional width */
width?: number;
/** Optional chart height */
height?: number;
/** Data chart points */
chartPoints: LogRateHistogramItem[];
/** Data chart points split */
Expand All @@ -130,6 +132,8 @@ export interface DocumentCountChartProps {
deviationBrush?: BrushSettings;
/** Optional settings override for the 'baseline' brush */
baselineBrush?: BrushSettings;
/** Optional data-test-subject */
dataTestSubj?: string;
}

const SPEC_ID = 'document_count';
Expand Down Expand Up @@ -174,9 +178,11 @@ function getBaselineBadgeOverflow(
*/
export const DocumentCountChart: FC<DocumentCountChartProps> = (props) => {
const {
dataTestSubj,
dependencies,
brushSelectionUpdateHandler,
width,
height,
chartPoints,
chartPointsSplit,
timeRangeEarliest,
Expand Down Expand Up @@ -417,7 +423,7 @@ export const DocumentCountChart: FC<DocumentCountChartProps> = (props) => {
return (
<>
{isBrushVisible && (
<div className="aiopsHistogramBrushes" data-test-subj="aiopsHistogramBrushes">
<div className="aiopsHistogramBrushes" data-test-subj={'aiopsHistogramBrushes'}>
<div css={{ height: BADGE_HEIGHT }}>
<BrushBadge
label={
Expand Down Expand Up @@ -461,11 +467,14 @@ export const DocumentCountChart: FC<DocumentCountChartProps> = (props) => {
</div>
</div>
)}
<div css={{ width: width ?? '100%' }} data-test-subj="aiopsDocumentCountChart">
<div
css={{ width: width ?? '100%' }}
data-test-subj={dataTestSubj ?? 'aiopsDocumentCountChart'}
>
<Chart
size={{
width: '100%',
height: 120,
height: height ?? 120,
}}
>
<Settings
Expand Down
Loading

0 comments on commit b834f1b

Please sign in to comment.