Skip to content

Commit

Permalink
[MDS] Refactor DataSourceAggregatedView (opensearch-project#6500)
Browse files Browse the repository at this point in the history
* Refactor aggregated view

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Add empty state support

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

---------

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>
  • Loading branch information
huyaboo committed Apr 17, 2024
1 parent 0b90e9b commit bd0ea35
Show file tree
Hide file tree
Showing 12 changed files with 2,433 additions and 902 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { CoreStart, AppMountParameters } from '../../../src/core/public';
import { Home } from './components/home';

export const renderApp = (
{ notifications, http, savedObjects, application }: CoreStart,
{ notifications, http, savedObjects, application, uiSettings }: CoreStart,
dataSource: DataSourcePluginSetup,
dataSourceManagement: DataSourceManagementPluginSetup,
{ appBasePath, element, setHeaderActionMenu }: AppMountParameters,
Expand All @@ -28,6 +28,7 @@ export const renderApp = (
dataSourceManagement={dataSourceManagement}
navigateToApp={application.navigateToApp}
navigation={navigation}
uiSettings={uiSettings}
/>,
element
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ interface DataSourceListActiveExampleProps {
notifications: CoreStart['notifications'];
setActionMenu?: (menuMount: MountPoint | undefined) => void;
dataSourceManagement: DataSourceManagementPluginSetup;
uiSettings: CoreStart['uiSettings'];
}

export const DataSourceListActiveExample = ({
Expand All @@ -36,6 +37,7 @@ export const DataSourceListActiveExample = ({
notifications,
setActionMenu,
dataSourceManagement,
uiSettings,
}: DataSourceListActiveExampleProps) => {
const DataSourceMenu = dataSourceManagement.ui.getDataSourceMenu<
DataSourceAggregatedViewConfig
Expand Down Expand Up @@ -106,7 +108,10 @@ export const DataSourceListActiveExample = ({
fullWidth: false,
savedObjects: savedObjects.client,
notifications,
displayAllCompatibleDataSources: true,
displayAllCompatibleDataSources: false,
// To see selected options, obtain the datasource id and paste it here. Note that this needs to be defined when displayAllCompatibleDataSources is false
activeDataSourceIds: [],
uiSettings,
}}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ interface DataSourceListAllExampleProps {
notifications: CoreStart['notifications'];
setActionMenu?: (menuMount: MountPoint | undefined) => void;
dataSourceManagement: DataSourceManagementPluginSetup;
uiSettings: CoreStart['uiSettings'];
}

export const DataSourceListAllExample = ({
Expand All @@ -36,6 +37,7 @@ export const DataSourceListAllExample = ({
notifications,
setActionMenu,
dataSourceManagement,
uiSettings,
}: DataSourceListAllExampleProps) => {
const DataSourceMenu = dataSourceManagement.ui.getDataSourceMenu<
DataSourceAggregatedViewConfig
Expand Down Expand Up @@ -100,6 +102,7 @@ export const DataSourceListAllExample = ({
savedObjects: savedObjects.client,
notifications,
displayAllCompatibleDataSources: true,
uiSettings,
}}
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface HomeProps {
notifications: CoreStart['notifications'];
http: CoreStart['http'];
savedObjects: CoreStart['savedObjects'];
uiSettings: CoreStart['uiSettings'];
dataSourceEnabled: boolean;
dataSourceManagement: DataSourceManagementPluginSetup;
navigateToApp: CoreStart['application']['navigateToApp'];
Expand Down Expand Up @@ -65,6 +66,7 @@ export const Home = ({
basename,
notifications,
savedObjects,
uiSettings,
dataSourceEnabled,
setActionMenu,
dataSourceManagement,
Expand Down Expand Up @@ -133,6 +135,7 @@ export const Home = ({
dataSourceEnabled={dataSourceEnabled}
setActionMenu={setActionMenu}
dataSourceManagement={dataSourceManagement}
uiSettings={uiSettings}
/>
),
},
Expand All @@ -146,6 +149,7 @@ export const Home = ({
dataSourceEnabled={dataSourceEnabled}
setActionMenu={setActionMenu}
dataSourceManagement={dataSourceManagement}
uiSettings={uiSettings}
/>
),
},
Expand Down
Loading

0 comments on commit bd0ea35

Please sign in to comment.