Skip to content

Commit a2d096f

Browse files
fix(vis): explore embeddable not render due to explore services not set (#10888)
* fix(vis): explore embeddable not render due to explore services not set The code refactor in #10854 changed the import of getServices function from legacy discover to new exolore, however the new ExploreSerivces is set in mount function which requires explore app to be mount, this will not work if user opened dashboard directly because the ExploreSerivces not set. This commit revert the changes, but a proper refactor of the getServices function is required, related issue #10887 Signed-off-by: Yulong Ruan <[email protected]> * Changeset file for PR #10888 created/updated --------- Signed-off-by: Yulong Ruan <[email protected]> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
1 parent d8cfc2d commit a2d096f

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

changelogs/fragments/10888.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fix:
2+
- Explore embeddable not render due to explore services not set ([#10888](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/10888))

src/plugins/explore/public/embeddable/explore_embeddable_component.test.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ jest.mock('../application/legacy/discover/opensearch_dashboards_services', () =>
1313
getDocViewsRegistry: jest.fn(() => ({
1414
getDocViewsSorted: jest.fn(() => []),
1515
})),
16-
}));
17-
jest.mock('../services/services', () => ({
1816
getServices: jest.fn(() => ({
1917
uiSettings: {
2018
get: jest.fn((key) => {

src/plugins/explore/public/embeddable/explore_embeddable_component.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ import React, { useMemo } from 'react';
77
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
88
import { SearchProps } from './explore_embeddable';
99
import { VisualizationNoResults } from '../../../visualizations/public';
10-
import { getDocViewsRegistry } from '../application/legacy/discover/opensearch_dashboards_services';
10+
// TODO: refactor it to now use legacy getServices
11+
import {
12+
getDocViewsRegistry,
13+
getServices,
14+
} from '../application/legacy/discover/opensearch_dashboards_services';
1115
import { DataTable } from '../components/data_table/data_table';
1216
import { TableVis } from '../components/visualizations/table/table_vis';
1317
import { TableChartStyle } from '../components/visualizations/table/table_vis_config';
1418
import { getLegacyDisplayedColumns } from '../helpers/data_table_helper';
1519
import { SAMPLE_SIZE_SETTING } from '../../common';
16-
import { getServices } from '../services/services';
1720

1821
interface ExploreEmbeddableProps {
1922
searchProps: SearchProps;

0 commit comments

Comments
 (0)