Skip to content

Commit

Permalink
Merge branch 'main' into improve-find
Browse files Browse the repository at this point in the history
  • Loading branch information
ohltyler authored Jul 20, 2023
2 parents 4d30f3c + feadcb4 commit 995cc7e
Show file tree
Hide file tree
Showing 104 changed files with 1,060 additions and 1,277 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [WS-2021-0638] Bump mocha from `7.2.0` to `10.1.0` ([#2711](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2711))
- 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))
- [CVE-2022-25883] Resolve `semver` to `7.5.3` and remove unused package ([#4411](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4411))
- [CVE-2023-26115] Bump `word-wrap` from `1.2.3` to `1.2.4` ([#4589](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4589))

### 📈 Features/Enhancements

Expand Down Expand Up @@ -82,8 +83,10 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [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))
- Migrate from legacy elasticsearch client to opensearch-js client in `osd-opensearch-archiver` package([#4142](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4142))
- Replace the use of `bluebird` in `saved_objects` plugin ([#4026](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4026))
- [Maps Legacy] Removed KUI usage in `maps_legacy` plugin([#3998](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3998))
- Relocate tutorials imagery into `src/plugins/home/public/assets/tutorials/logos` ([#4382](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4382))
- [VisBuilder] Use OUI icon ([#4446](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4446))
- [Vis Colors] [VisLib] Update legend colors to use OUI color palette ([#4365](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4365))
- [Vis Colors] [Region Maps] Replace hardcode color to OUI color in `region_map` plugin ([#4299](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4299))
- [Vis Colors] Replace color maps with OUI color palettes ([#4293](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4293))
- [Vis Colors] [Maps] Replace hardcoded color to OUI color in `maps_legacy` plugin ([#4294](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4294))
Expand All @@ -93,6 +96,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [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))
- [Saved Objects Management] Add new or remove extra tags and styles ([#4069](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4069))
- [Console] Migrate `/lib/mappings/` module to TypeScript ([#4008](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4008))
- [Dashboard] Restructure the `Dashboard` plugin folder to be more cohesive with the project ([#4575](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4575))

### 🔩 Tests

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,22 @@ import {
IContainer,
ReferenceOrValueEmbeddable,
EmbeddableInput,
} from '../../embeddable_plugin';
import { DashboardContainer } from '../embeddable';
import { getSampleDashboardInput } from '../test_helpers';
ErrorEmbeddable,
ViewMode,
} from '../../../../embeddable/public';
import { embeddablePluginMock } from '../../../../embeddable/public/mocks';
import {
CONTACT_CARD_EMBEDDABLE,
ContactCardEmbeddableFactory,
ContactCardEmbeddable,
ContactCardEmbeddableInput,
ContactCardEmbeddableOutput,
} from '../../embeddable_plugin_test_samples';
} from '../../../../embeddable/public/lib/test_samples';
import { DashboardContainer } from '../embeddable';
import { getSampleDashboardInput } from '../test_helpers';
import { coreMock } from '../../../../../core/public/mocks';
import { CoreStart } from 'opensearch-dashboards/public';
import { AddToLibraryAction } from '.';
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
import { ErrorEmbeddable, ViewMode } from '../../../../embeddable/public';

const { setup, doStart } = embeddablePluginMock.createInstance();
setup.registerEmbeddableFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ import { i18n } from '@osd/i18n';
import _ from 'lodash';
import uuid from 'uuid';
import { EuiIconType } from '@elastic/eui/src/components/icon/icon';
import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin';
import { ViewMode, PanelState, IEmbeddable } from '../../embeddable_plugin';
import { ActionByType, IncompatibleActionError } from '../../../../ui_actions/public';
import {
PanelNotFoundError,
EmbeddableInput,
isReferenceOrValueEmbeddable,
isErrorEmbeddable,
ViewMode,
PanelState,
IEmbeddable,
} from '../../../../embeddable/public';
import { DashboardPanelState, DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '..';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@
* under the License.
*/

import { isErrorEmbeddable, IContainer, ErrorEmbeddable } from '../../embeddable_plugin';
import { DashboardContainer, DashboardPanelState } from '../embeddable';
import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers';
import { isErrorEmbeddable, IContainer, ErrorEmbeddable } from '../../../../embeddable/public';
import {
CONTACT_CARD_EMBEDDABLE,
ContactCardEmbeddableFactory,
ContactCardEmbeddable,
ContactCardEmbeddableInput,
ContactCardEmbeddableOutput,
} from '../../embeddable_plugin_test_samples';
} from '../../../../embeddable/public/lib/test_samples';
import { embeddablePluginMock } from '../../../../embeddable/public/mocks';
import { DashboardContainer, DashboardPanelState } from '../embeddable';
import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers';
import { coreMock } from '../../../../../core/public/mocks';
import { CoreStart } from 'opensearch-dashboards/public';
import { ClonePanelAction } from '.';
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';

const { setup, doStart } = embeddablePluginMock.createInstance();
setup.registerEmbeddableFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ import { CoreStart } from 'src/core/public';
import uuid from 'uuid';
import _ from 'lodash';
import { EuiIconType } from '@elastic/eui/src/components/icon/icon';
import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin';
import { ViewMode, PanelState, IEmbeddable } from '../../embeddable_plugin';
import { ActionByType, IncompatibleActionError } from '../../../../ui_actions/public';
import { SavedObject } from '../../../../saved_objects/public';
import {
PanelNotFoundError,
EmbeddableInput,
SavedObjectEmbeddableInput,
isErrorEmbeddable,
ViewMode,
PanelState,
IEmbeddable,
} from '../../../../embeddable/public';
import {
placePanelBeside,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@
* under the License.
*/

import { isErrorEmbeddable } from '../../embeddable_plugin';
import { ExpandPanelAction } from './expand_panel_action';
import { DashboardContainer } from '../embeddable';
import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers';
import { isErrorEmbeddable } from '../../../../embeddable/public';
import {
CONTACT_CARD_EMBEDDABLE,
ContactCardEmbeddableFactory,
ContactCardEmbeddable,
ContactCardEmbeddableInput,
ContactCardEmbeddableOutput,
} from '../../embeddable_plugin_test_samples';
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
} from '../../../../embeddable/public/lib/test_samples';
import { embeddablePluginMock } from '../../../../embeddable/public/mocks';
import { ExpandPanelAction } from './expand_panel_action';
import { DashboardContainer } from '../embeddable';
import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers';

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

import { EuiIconType } from '@elastic/eui/src/components/icon/icon';
import { i18n } from '@osd/i18n';
import { IEmbeddable } from '../../embeddable_plugin';
import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin';
import { IEmbeddable } from '../../../../embeddable/public';
import { ActionByType, IncompatibleActionError } from '../../../../ui_actions/public';
import { DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '../embeddable';

export const ACTION_EXPAND_PANEL = 'togglePanel';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,26 @@
* under the License.
*/

import { isErrorEmbeddable, ReferenceOrValueEmbeddable } from '../../embeddable_plugin';
import { DashboardContainer } from '../embeddable';
import { getSampleDashboardInput } from '../test_helpers';
import {
isErrorEmbeddable,
ReferenceOrValueEmbeddable,
ErrorEmbeddable,
IContainer,
ViewMode,
} from '../../../../embeddable/public';
import {
CONTACT_CARD_EMBEDDABLE,
ContactCardEmbeddableFactory,
ContactCardEmbeddable,
ContactCardEmbeddableInput,
ContactCardEmbeddableOutput,
} from '../../embeddable_plugin_test_samples';
} from '../../../../embeddable/public/lib/test_samples';
import { embeddablePluginMock } from '../../../../embeddable/public/mocks';
import { DashboardContainer } from '../embeddable';
import { getSampleDashboardInput } from '../test_helpers';
import { coreMock } from '../../../../../core/public/mocks';
import { CoreStart } from 'opensearch-dashboards/public';
import { LibraryNotificationAction } from '.';
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
import { ErrorEmbeddable, IContainer, ViewMode } from '../../../../embeddable/public';

const { setup, doStart } = embeddablePluginMock.createInstance();
setup.registerEmbeddableFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ import {
ViewMode,
isReferenceOrValueEmbeddable,
isErrorEmbeddable,
} from '../../embeddable_plugin';
import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin';
} from '../../../../embeddable/public';
import { ActionByType, IncompatibleActionError } from '../../../../ui_actions/public';
import { reactToUiComponent } from '../../../../opensearch_dashboards_react/public';

export const ACTION_LIBRARY_NOTIFICATION = 'ACTION_LIBRARY_NOTIFICATION';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import {
EmbeddableOutput,
EmbeddableStart,
IContainer,
} from '../../embeddable_plugin';
} from '../../../../embeddable/public';

export async function openReplacePanelFlyout(options: {
embeddable: IContainer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@
* under the License.
*/

import { isErrorEmbeddable } from '../../embeddable_plugin';
import { ReplacePanelAction } from './replace_panel_action';
import { DashboardContainer } from '../embeddable';
import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers';
import { isErrorEmbeddable } from '../../../../embeddable/public';
import {
CONTACT_CARD_EMBEDDABLE,
ContactCardEmbeddableFactory,
ContactCardEmbeddable,
ContactCardEmbeddableInput,
ContactCardEmbeddableOutput,
} from '../../embeddable_plugin_test_samples';
} from '../../../../embeddable/public/lib/test_samples';
import { embeddablePluginMock } from '../../../../embeddable/public/mocks';
import { ReplacePanelAction } from './replace_panel_action';
import { DashboardContainer } from '../embeddable';
import { getSampleDashboardInput, getSampleDashboardPanel } from '../test_helpers';
import { coreMock } from '../../../../../core/public/mocks';
import { CoreStart } from 'opensearch-dashboards/public';
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';

const { setup, doStart } = embeddablePluginMock.createInstance();
setup.registerEmbeddableFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
import { i18n } from '@osd/i18n';
import { CoreStart } from 'src/core/public';
import { EuiIconType } from '@elastic/eui/src/components/icon/icon';
import { IEmbeddable, ViewMode, EmbeddableStart } from '../../embeddable_plugin';
import { IEmbeddable, ViewMode, EmbeddableStart } from '../../../../embeddable/public';
import { DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '../embeddable';
import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin';
import { ActionByType, IncompatibleActionError } from '../../../../ui_actions/public';
import { openReplacePanelFlyout } from './open_replace_panel_flyout';

export const ACTION_REPLACE_PANEL = 'replacePanel';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {
IContainer,
IEmbeddable,
SavedObjectEmbeddableInput,
} from '../../embeddable_plugin';
} from '../../../../embeddable/public';

interface Props {
container: IContainer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,27 @@
* under the License.
*/

import { isErrorEmbeddable, IContainer, ReferenceOrValueEmbeddable } from '../../embeddable_plugin';
import { DashboardContainer } from '../embeddable';
import { getSampleDashboardInput } from '../test_helpers';
import {
isErrorEmbeddable,
IContainer,
ReferenceOrValueEmbeddable,
ViewMode,
SavedObjectEmbeddableInput,
ErrorEmbeddable,
} from '../../../../embeddable/public';
import {
CONTACT_CARD_EMBEDDABLE,
ContactCardEmbeddableFactory,
ContactCardEmbeddable,
ContactCardEmbeddableInput,
ContactCardEmbeddableOutput,
} from '../../embeddable_plugin_test_samples';
} from '../../../../embeddable/public/lib/test_samples';
import { embeddablePluginMock } from '../../../../embeddable/public/mocks';
import { DashboardContainer } from '../embeddable';
import { getSampleDashboardInput } from '../test_helpers';
import { coreMock } from '../../../../../core/public/mocks';
import { CoreStart } from 'opensearch-dashboards/public';
import { UnlinkFromLibraryAction } from '.';
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
import {
ViewMode,
SavedObjectEmbeddableInput,
ErrorEmbeddable,
} from '../../../../embeddable/public';

const { setup, doStart } = embeddablePluginMock.createInstance();
setup.registerEmbeddableFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ import { i18n } from '@osd/i18n';
import _ from 'lodash';
import uuid from 'uuid';
import { EuiIconType } from '@elastic/eui/src/components/icon/icon';
import { ActionByType, IncompatibleActionError } from '../../ui_actions_plugin';
import { ViewMode, PanelState, IEmbeddable } from '../../embeddable_plugin';
import { ActionByType, IncompatibleActionError } from '../../../../ui_actions/public';
import {
PanelNotFoundError,
EmbeddableInput,
isReferenceOrValueEmbeddable,
isErrorEmbeddable,
ViewMode,
PanelState,
IEmbeddable,
} from '../../../../embeddable/public';
import { DashboardPanelState, DASHBOARD_CONTAINER_TYPE, DashboardContainer } from '..';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { findTestSubject } from '@elastic/eui/lib/test';
import React from 'react';

import { CreateButton } from './create_button';
import { DashboardProvider } from '../../types';
import { DashboardProvider } from '../../../types';

const provider = (type?: string, url?: string, text?: string): DashboardProvider => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
EuiFlexItem,
EuiPopover,
} from '@elastic/eui';
import type { DashboardProvider } from '../../types';
import type { DashboardProvider } from '../../../types';

interface CreateButtonProps {
dashboardProviders?: { [key: string]: DashboardProvider };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ jest.mock(
() => ({
...jest.requireActual('lodash'),
// mock debounce to fire immediately with no internal timer
debounce: (func) => {
function debounced(...args) {
debounce: (func: any) => {
function debounced(this: any, ...args: any[]) {
return func.apply(this, args);
}
return debounced;
Expand All @@ -49,9 +49,9 @@ jest.mock(
import React from 'react';
import { shallow } from 'enzyme';

import { DashboardListing } from '../components/dashboard_listing';
import { DashboardListing } from './dashboard_listing';

const find = (num) => {
const find = (num: number) => {
const hits = [];
for (let i = 0; i < num; i++) {
hits.push({
Expand All @@ -62,7 +62,7 @@ const find = (num) => {
}
return Promise.resolve({
total: num,
hits: hits,
hits,
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import { useLocation } from 'react-router-dom';
import {
useOpenSearchDashboards,
TableListView,
} from '../../../../opensearch_dashboards_react/public';
import { CreateButton } from '../listing/create_button';
import { DashboardConstants, createDashboardEditUrl } from '../../dashboard_constants';
import { DashboardServices } from '../../types';
import { getTableColumns } from '../utils/get_table_columns';
import { getNoItemsMessage } from '../utils/get_no_items_message';
import { syncQueryStateWithUrl } from '../../../../data/public';
} from '../../../../../opensearch_dashboards_react/public';
import { CreateButton } from './create_button';
import { DashboardConstants, createDashboardEditUrl } from '../../../dashboard_constants';
import { DashboardServices } from '../../../types';
import { getTableColumns } from '../../utils/get_table_columns';
import { getNoItemsMessage } from '../../utils/get_no_items_message';
import { syncQueryStateWithUrl } from '../../../../../data/public';

export const EMPTY_FILTER = '';

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export { CreateButton } from './create_button';
export { DashboardListing } from './dashboard_listing';
Loading

0 comments on commit 995cc7e

Please sign in to comment.