Skip to content

Commit 995cc7e

Browse files
authored
Merge branch 'main' into improve-find
2 parents 4d30f3c + feadcb4 commit 995cc7e

File tree

104 files changed

+1060
-1277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+1060
-1277
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1515
- [WS-2021-0638] Bump mocha from `7.2.0` to `10.1.0` ([#2711](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2711))
1616
- Bump `joi` to v14 to avoid the possibility of prototype poisoning in a nested dependency ([#3952](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3952))
1717
- [CVE-2022-25883] Resolve `semver` to `7.5.3` and remove unused package ([#4411](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4411))
18+
- [CVE-2023-26115] Bump `word-wrap` from `1.2.3` to `1.2.4` ([#4589](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4589))
1819

1920
### 📈 Features/Enhancements
2021

@@ -82,8 +83,10 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
8283
- [Table Visualization] Remove custom styling for text-align:center in favor of OUI utility class. ([#4164](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4164))
8384
- Migrate from legacy elasticsearch client to opensearch-js client in `osd-opensearch-archiver` package([#4142](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4142))
8485
- Replace the use of `bluebird` in `saved_objects` plugin ([#4026](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4026))
86+
- [Maps Legacy] Removed KUI usage in `maps_legacy` plugin([#3998](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3998))
8587
- Relocate tutorials imagery into `src/plugins/home/public/assets/tutorials/logos` ([#4382](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4382))
8688
- [VisBuilder] Use OUI icon ([#4446](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4446))
89+
- [Vis Colors] [VisLib] Update legend colors to use OUI color palette ([#4365](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4365))
8790
- [Vis Colors] [Region Maps] Replace hardcode color to OUI color in `region_map` plugin ([#4299](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4299))
8891
- [Vis Colors] Replace color maps with OUI color palettes ([#4293](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4293))
8992
- [Vis Colors] [Maps] Replace hardcoded color to OUI color in `maps_legacy` plugin ([#4294](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4294))
@@ -93,6 +96,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
9396
- [Vis colors] Update legacy mapped colors in charts plugin to use `ouiPaletteColorBlind()`, Update default color in legacy visualizations to use `ouiPaletteColorBlind()[0]` ([#4398](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4398))
9497
- [Saved Objects Management] Add new or remove extra tags and styles ([#4069](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4069))
9598
- [Console] Migrate `/lib/mappings/` module to TypeScript ([#4008](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4008))
99+
- [Dashboard] Restructure the `Dashboard` plugin folder to be more cohesive with the project ([#4575](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4575))
96100

97101
### 🔩 Tests
98102

src/plugins/dashboard/public/application/actions/add_to_library_action.test.tsx

+7-6
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,22 @@ import {
3333
IContainer,
3434
ReferenceOrValueEmbeddable,
3535
EmbeddableInput,
36-
} from '../../embeddable_plugin';
37-
import { DashboardContainer } from '../embeddable';
38-
import { getSampleDashboardInput } from '../test_helpers';
36+
ErrorEmbeddable,
37+
ViewMode,
38+
} from '../../../../embeddable/public';
39+
import { embeddablePluginMock } from '../../../../embeddable/public/mocks';
3940
import {
4041
CONTACT_CARD_EMBEDDABLE,
4142
ContactCardEmbeddableFactory,
4243
ContactCardEmbeddable,
4344
ContactCardEmbeddableInput,
4445
ContactCardEmbeddableOutput,
45-
} from '../../embeddable_plugin_test_samples';
46+
} from '../../../../embeddable/public/lib/test_samples';
47+
import { DashboardContainer } from '../embeddable';
48+
import { getSampleDashboardInput } from '../test_helpers';
4649
import { coreMock } from '../../../../../core/public/mocks';
4750
import { CoreStart } from 'opensearch-dashboards/public';
4851
import { AddToLibraryAction } from '.';
49-
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
50-
import { ErrorEmbeddable, ViewMode } from '../../../../embeddable/public';
5152

5253
const { setup, doStart } = embeddablePluginMock.createInstance();
5354
setup.registerEmbeddableFactory(

src/plugins/dashboard/public/application/actions/add_to_library_action.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ import { i18n } from '@osd/i18n';
3232
import _ from 'lodash';
3333
import uuid from 'uuid';
3434
import { EuiIconType } from '@elastic/eui/src/components/icon/icon';
35-
import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin';
36-
import { ViewMode, PanelState, IEmbeddable } from '../../embeddable_plugin';
35+
import { ActionByType, IncompatibleActionError } from '../../../../ui_actions/public';
3736
import {
3837
PanelNotFoundError,
3938
EmbeddableInput,
4039
isReferenceOrValueEmbeddable,
4140
isErrorEmbeddable,
41+
ViewMode,
42+
PanelState,
43+
IEmbeddable,
4244
} from '../../../../embeddable/public';
4345
import { DashboardPanelState, DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '..';
4446

src/plugins/dashboard/public/application/actions/clone_panel_action.test.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@
2828
* under the License.
2929
*/
3030

31-
import { isErrorEmbeddable, IContainer, ErrorEmbeddable } from '../../embeddable_plugin';
32-
import { DashboardContainer, DashboardPanelState } from '../embeddable';
33-
import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers';
31+
import { isErrorEmbeddable, IContainer, ErrorEmbeddable } from '../../../../embeddable/public';
3432
import {
3533
CONTACT_CARD_EMBEDDABLE,
3634
ContactCardEmbeddableFactory,
3735
ContactCardEmbeddable,
3836
ContactCardEmbeddableInput,
3937
ContactCardEmbeddableOutput,
40-
} from '../../embeddable_plugin_test_samples';
38+
} from '../../../../embeddable/public/lib/test_samples';
39+
import { embeddablePluginMock } from '../../../../embeddable/public/mocks';
40+
import { DashboardContainer, DashboardPanelState } from '../embeddable';
41+
import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers';
4142
import { coreMock } from '../../../../../core/public/mocks';
4243
import { CoreStart } from 'opensearch-dashboards/public';
4344
import { ClonePanelAction } from '.';
44-
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
4545

4646
const { setup, doStart } = embeddablePluginMock.createInstance();
4747
setup.registerEmbeddableFactory(

src/plugins/dashboard/public/application/actions/clone_panel_action.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,16 @@ import { CoreStart } from 'src/core/public';
3333
import uuid from 'uuid';
3434
import _ from 'lodash';
3535
import { EuiIconType } from '@elastic/eui/src/components/icon/icon';
36-
import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin';
37-
import { ViewMode, PanelState, IEmbeddable } from '../../embeddable_plugin';
36+
import { ActionByType, IncompatibleActionError } from '../../../../ui_actions/public';
3837
import { SavedObject } from '../../../../saved_objects/public';
3938
import {
4039
PanelNotFoundError,
4140
EmbeddableInput,
4241
SavedObjectEmbeddableInput,
4342
isErrorEmbeddable,
43+
ViewMode,
44+
PanelState,
45+
IEmbeddable,
4446
} from '../../../../embeddable/public';
4547
import {
4648
placePanelBeside,

src/plugins/dashboard/public/application/actions/expand_panel_action.test.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@
2828
* under the License.
2929
*/
3030

31-
import { isErrorEmbeddable } from '../../embeddable_plugin';
32-
import { ExpandPanelAction } from './expand_panel_action';
33-
import { DashboardContainer } from '../embeddable';
34-
import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers';
31+
import { isErrorEmbeddable } from '../../../../embeddable/public';
3532
import {
3633
CONTACT_CARD_EMBEDDABLE,
3734
ContactCardEmbeddableFactory,
3835
ContactCardEmbeddable,
3936
ContactCardEmbeddableInput,
4037
ContactCardEmbeddableOutput,
41-
} from '../../embeddable_plugin_test_samples';
42-
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
38+
} from '../../../../embeddable/public/lib/test_samples';
39+
import { embeddablePluginMock } from '../../../../embeddable/public/mocks';
40+
import { ExpandPanelAction } from './expand_panel_action';
41+
import { DashboardContainer } from '../embeddable';
42+
import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers';
4343

4444
const { setup, doStart } = embeddablePluginMock.createInstance();
4545

src/plugins/dashboard/public/application/actions/expand_panel_action.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030

3131
import { EuiIconType } from '@elastic/eui/src/components/icon/icon';
3232
import { i18n } from '@osd/i18n';
33-
import { IEmbeddable } from '../../embeddable_plugin';
34-
import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin';
33+
import { IEmbeddable } from '../../../../embeddable/public';
34+
import { ActionByType, IncompatibleActionError } from '../../../../ui_actions/public';
3535
import { DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '../embeddable';
3636

3737
export const ACTION_EXPAND_PANEL = 'togglePanel';

src/plugins/dashboard/public/application/actions/library_notification_action.test.tsx

+11-6
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,26 @@
2828
* under the License.
2929
*/
3030

31-
import { isErrorEmbeddable, ReferenceOrValueEmbeddable } from '../../embeddable_plugin';
32-
import { DashboardContainer } from '../embeddable';
33-
import { getSampleDashboardInput } from '../test_helpers';
31+
import {
32+
isErrorEmbeddable,
33+
ReferenceOrValueEmbeddable,
34+
ErrorEmbeddable,
35+
IContainer,
36+
ViewMode,
37+
} from '../../../../embeddable/public';
3438
import {
3539
CONTACT_CARD_EMBEDDABLE,
3640
ContactCardEmbeddableFactory,
3741
ContactCardEmbeddable,
3842
ContactCardEmbeddableInput,
3943
ContactCardEmbeddableOutput,
40-
} from '../../embeddable_plugin_test_samples';
44+
} from '../../../../embeddable/public/lib/test_samples';
45+
import { embeddablePluginMock } from '../../../../embeddable/public/mocks';
46+
import { DashboardContainer } from '../embeddable';
47+
import { getSampleDashboardInput } from '../test_helpers';
4148
import { coreMock } from '../../../../../core/public/mocks';
4249
import { CoreStart } from 'opensearch-dashboards/public';
4350
import { LibraryNotificationAction } from '.';
44-
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
45-
import { ErrorEmbeddable, IContainer, ViewMode } from '../../../../embeddable/public';
4651

4752
const { setup, doStart } = embeddablePluginMock.createInstance();
4853
setup.registerEmbeddableFactory(

src/plugins/dashboard/public/application/actions/library_notification_action.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ import {
3737
ViewMode,
3838
isReferenceOrValueEmbeddable,
3939
isErrorEmbeddable,
40-
} from '../../embeddable_plugin';
41-
import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin';
40+
} from '../../../../embeddable/public';
41+
import { ActionByType, IncompatibleActionError } from '../../../../ui_actions/public';
4242
import { reactToUiComponent } from '../../../../opensearch_dashboards_react/public';
4343

4444
export const ACTION_LIBRARY_NOTIFICATION = 'ACTION_LIBRARY_NOTIFICATION';

src/plugins/dashboard/public/application/actions/open_replace_panel_flyout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import {
3838
EmbeddableOutput,
3939
EmbeddableStart,
4040
IContainer,
41-
} from '../../embeddable_plugin';
41+
} from '../../../../embeddable/public';
4242

4343
export async function openReplacePanelFlyout(options: {
4444
embeddable: IContainer;

src/plugins/dashboard/public/application/actions/replace_panel_action.test.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@
2828
* under the License.
2929
*/
3030

31-
import { isErrorEmbeddable } from '../../embeddable_plugin';
32-
import { ReplacePanelAction } from './replace_panel_action';
33-
import { DashboardContainer } from '../embeddable';
34-
import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers';
31+
import { isErrorEmbeddable } from '../../../../embeddable/public';
3532
import {
3633
CONTACT_CARD_EMBEDDABLE,
3734
ContactCardEmbeddableFactory,
3835
ContactCardEmbeddable,
3936
ContactCardEmbeddableInput,
4037
ContactCardEmbeddableOutput,
41-
} from '../../embeddable_plugin_test_samples';
38+
} from '../../../../embeddable/public/lib/test_samples';
39+
import { embeddablePluginMock } from '../../../../embeddable/public/mocks';
40+
import { ReplacePanelAction } from './replace_panel_action';
41+
import { DashboardContainer } from '../embeddable';
42+
import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers';
4243
import { coreMock } from '../../../../../core/public/mocks';
4344
import { CoreStart } from 'opensearch-dashboards/public';
44-
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
4545

4646
const { setup, doStart } = embeddablePluginMock.createInstance();
4747
setup.registerEmbeddableFactory(

src/plugins/dashboard/public/application/actions/replace_panel_action.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
import { i18n } from '@osd/i18n';
3232
import { CoreStart } from 'src/core/public';
3333
import { EuiIconType } from '@elastic/eui/src/components/icon/icon';
34-
import { IEmbeddable, ViewMode, EmbeddableStart } from '../../embeddable_plugin';
34+
import { IEmbeddable, ViewMode, EmbeddableStart } from '../../../../embeddable/public';
3535
import { DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '../embeddable';
36-
import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin';
36+
import { ActionByType, IncompatibleActionError } from '../../../../ui_actions/public';
3737
import { openReplacePanelFlyout } from './open_replace_panel_flyout';
3838

3939
export const ACTION_REPLACE_PANEL = 'replacePanel';

src/plugins/dashboard/public/application/actions/replace_panel_flyout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import {
4040
IContainer,
4141
IEmbeddable,
4242
SavedObjectEmbeddableInput,
43-
} from '../../embeddable_plugin';
43+
} from '../../../../embeddable/public';
4444

4545
interface Props {
4646
container: IContainer;

src/plugins/dashboard/public/application/actions/unlink_from_library_action.test.tsx

+12-10
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,27 @@
2828
* under the License.
2929
*/
3030

31-
import { isErrorEmbeddable, IContainer, ReferenceOrValueEmbeddable } from '../../embeddable_plugin';
32-
import { DashboardContainer } from '../embeddable';
33-
import { getSampleDashboardInput } from '../test_helpers';
31+
import {
32+
isErrorEmbeddable,
33+
IContainer,
34+
ReferenceOrValueEmbeddable,
35+
ViewMode,
36+
SavedObjectEmbeddableInput,
37+
ErrorEmbeddable,
38+
} from '../../../../embeddable/public';
3439
import {
3540
CONTACT_CARD_EMBEDDABLE,
3641
ContactCardEmbeddableFactory,
3742
ContactCardEmbeddable,
3843
ContactCardEmbeddableInput,
3944
ContactCardEmbeddableOutput,
40-
} from '../../embeddable_plugin_test_samples';
45+
} from '../../../../embeddable/public/lib/test_samples';
46+
import { embeddablePluginMock } from '../../../../embeddable/public/mocks';
47+
import { DashboardContainer } from '../embeddable';
48+
import { getSampleDashboardInput } from '../test_helpers';
4149
import { coreMock } from '../../../../../core/public/mocks';
4250
import { CoreStart } from 'opensearch-dashboards/public';
4351
import { UnlinkFromLibraryAction } from '.';
44-
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
45-
import {
46-
ViewMode,
47-
SavedObjectEmbeddableInput,
48-
ErrorEmbeddable,
49-
} from '../../../../embeddable/public';
5052

5153
const { setup, doStart } = embeddablePluginMock.createInstance();
5254
setup.registerEmbeddableFactory(

src/plugins/dashboard/public/application/actions/unlink_from_library_action.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ import { i18n } from '@osd/i18n';
3232
import _ from 'lodash';
3333
import uuid from 'uuid';
3434
import { EuiIconType } from '@elastic/eui/src/components/icon/icon';
35-
import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin';
36-
import { ViewMode, PanelState, IEmbeddable } from '../../embeddable_plugin';
35+
import { ActionByType, IncompatibleActionError } from '../../../../ui_actions/public';
3736
import {
3837
PanelNotFoundError,
3938
EmbeddableInput,
4039
isReferenceOrValueEmbeddable,
4140
isErrorEmbeddable,
41+
ViewMode,
42+
PanelState,
43+
IEmbeddable,
4244
} from '../../../../embeddable/public';
4345
import { DashboardPanelState, DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '..';
4446

src/plugins/dashboard/public/application/listing/create_button.test.tsx src/plugins/dashboard/public/application/components/dashboard_listing/create_button.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { findTestSubject } from '@elastic/eui/lib/test';
1515
import React from 'react';
1616

1717
import { CreateButton } from './create_button';
18-
import { DashboardProvider } from '../../types';
18+
import { DashboardProvider } from '../../../types';
1919

2020
const provider = (type?: string, url?: string, text?: string): DashboardProvider => {
2121
return {

src/plugins/dashboard/public/application/listing/create_button.tsx src/plugins/dashboard/public/application/components/dashboard_listing/create_button.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
EuiFlexItem,
1212
EuiPopover,
1313
} from '@elastic/eui';
14-
import type { DashboardProvider } from '../../types';
14+
import type { DashboardProvider } from '../../../types';
1515

1616
interface CreateButtonProps {
1717
dashboardProviders?: { [key: string]: DashboardProvider };

src/plugins/dashboard/public/application/listing/dashboard_listing.test.js src/plugins/dashboard/public/application/components/dashboard_listing/dashboard_listing.test.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jest.mock(
3636
() => ({
3737
...jest.requireActual('lodash'),
3838
// mock debounce to fire immediately with no internal timer
39-
debounce: (func) => {
40-
function debounced(...args) {
39+
debounce: (func: any) => {
40+
function debounced(this: any, ...args: any[]) {
4141
return func.apply(this, args);
4242
}
4343
return debounced;
@@ -49,9 +49,9 @@ jest.mock(
4949
import React from 'react';
5050
import { shallow } from 'enzyme';
5151

52-
import { DashboardListing } from '../components/dashboard_listing';
52+
import { DashboardListing } from './dashboard_listing';
5353

54-
const find = (num) => {
54+
const find = (num: number) => {
5555
const hits = [];
5656
for (let i = 0; i < num; i++) {
5757
hits.push({
@@ -62,7 +62,7 @@ const find = (num) => {
6262
}
6363
return Promise.resolve({
6464
total: num,
65-
hits: hits,
65+
hits,
6666
});
6767
};
6868

src/plugins/dashboard/public/application/components/dashboard_listing.tsx src/plugins/dashboard/public/application/components/dashboard_listing/dashboard_listing.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import { useLocation } from 'react-router-dom';
1010
import {
1111
useOpenSearchDashboards,
1212
TableListView,
13-
} from '../../../../opensearch_dashboards_react/public';
14-
import { CreateButton } from '../listing/create_button';
15-
import { DashboardConstants, createDashboardEditUrl } from '../../dashboard_constants';
16-
import { DashboardServices } from '../../types';
17-
import { getTableColumns } from '../utils/get_table_columns';
18-
import { getNoItemsMessage } from '../utils/get_no_items_message';
19-
import { syncQueryStateWithUrl } from '../../../../data/public';
13+
} from '../../../../../opensearch_dashboards_react/public';
14+
import { CreateButton } from './create_button';
15+
import { DashboardConstants, createDashboardEditUrl } from '../../../dashboard_constants';
16+
import { DashboardServices } from '../../../types';
17+
import { getTableColumns } from '../../utils/get_table_columns';
18+
import { getNoItemsMessage } from '../../utils/get_no_items_message';
19+
import { syncQueryStateWithUrl } from '../../../../../data/public';
2020

2121
export const EMPTY_FILTER = '';
2222

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
* Copyright OpenSearch Contributors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
export { CreateButton } from './create_button';
7+
export { DashboardListing } from './dashboard_listing';

0 commit comments

Comments
 (0)