diff --git a/public/pages/workflows/workflows.tsx b/public/pages/workflows/workflows.tsx index 1a5ca628..ede3e40f 100644 --- a/public/pages/workflows/workflows.tsx +++ b/public/pages/workflows/workflows.tsx @@ -19,7 +19,7 @@ import { import queryString from 'query-string'; import { useSelector } from 'react-redux'; import { BREADCRUMBS } from '../../utils'; -import { getCore } from '../../services'; +import { getApplication, getCore, getNavigationUI, getUISettings } from '../../services'; import { WorkflowList } from './workflow_list'; import { NewWorkflow } from './new_workflow'; import { AppState, searchWorkflows, useAppDispatch } from '../../store'; @@ -77,7 +77,7 @@ export function Workflows(props: WorkflowsProps) { const location = useLocation(); const queryParams = getDataSourceFromURL(location); const dataSourceEnabled = getDataSourceEnabled().enabled; - const [dataSourceId, setDataSourceId] = useState( + const [dataSourceId, setDataSourceId] = useState( queryParams.dataSourceId ); const { workflows, loading } = useSelector( @@ -196,6 +196,39 @@ export function Workflows(props: WorkflowsProps) { ); }, [getSavedObjectsClient, getNotifications(), props.setActionMenu]); } + // const uiSettings = getUISettings(); + // const showActionsInHeader = uiSettings.get('home:useNewHomePage'); + // const pageTitleAndDescription = showActionsInHeader ? ( + // + // ) : ( + // + // + //

{title}

+ //
+ // + // + //

{description}

+ //
+ //
+ // ); + + + + // if (showActionsInHeader) { + // const { HeaderControl } = getNavigationUI(); + // const { setAppBottomControls } = getApplication(); + + // return ( + // + // ); + // } + return ( <> diff --git a/public/plugin.ts b/public/plugin.ts index f8c406ff..328c28cb 100644 --- a/public/plugin.ts +++ b/public/plugin.ts @@ -12,6 +12,7 @@ import { import { FlowFrameworkDashboardsPluginStart, FlowFrameworkDashboardsPluginSetup, + AppPluginStartDependencies, } from './types'; import { PLUGIN_ID } from '../common'; import { @@ -21,9 +22,12 @@ import { setDataSourceManagementPlugin, setDataSourceEnabled, setNotifications, + setNavigationUI, } from './services'; import { configureRoutes } from './route_service'; +import { NavigationPublicPluginStart } from '../../../src/plugins/navigation/public'; + export class FlowFrameworkDashboardsPlugin implements Plugin< @@ -64,9 +68,10 @@ export class FlowFrameworkDashboardsPlugin }; } - public start(core: CoreStart): FlowFrameworkDashboardsPluginStart { + public start(core: CoreStart, {navigation}:AppPluginStartDependencies): FlowFrameworkDashboardsPluginStart { setNotifications(core.notifications); setSavedObjectsClient(core.savedObjects.client); + setNavigationUI(navigation.ui); return {}; } diff --git a/public/services.ts b/public/services.ts index 35eeb56b..2665a38b 100644 --- a/public/services.ts +++ b/public/services.ts @@ -4,9 +4,10 @@ */ import { createGetterSetter } from '../../../src/plugins/opensearch_dashboards_utils/public'; -import { CoreStart, NotificationsStart } from '../../../src/core/public'; +import { CoreStart, NotificationsStart, IUiSettingsClient } from '../../../src/core/public'; import { RouteService } from './route_service'; import { DataSourceManagementPluginSetup } from '../../../src/plugins/data_source_management/public'; +import { NavigationPublicPluginStart } from '../../../src/plugins/navigation/public'; export interface DataSourceEnabled { enabled: boolean; @@ -37,3 +38,9 @@ export const [getDataSourceEnabled, setDataSourceEnabled] = createGetterSetter< export const [getNotifications, setNotifications] = createGetterSetter< NotificationsStart >('Notifications'); + +export const [getUISettings, setUISettings] = createGetterSetter('UISettings'); + +export const [getApplication, setApplication] = createGetterSetter('application'); + +export const [getNavigationUI, setNavigationUI] = createGetterSetter('navigation'); diff --git a/public/types.ts b/public/types.ts index d46b8319..b3bc6a5d 100644 --- a/public/types.ts +++ b/public/types.ts @@ -12,7 +12,9 @@ export interface FlowFrameworkDashboardsPluginSetup { dataSource: DataSourcePluginSetup; } -export interface FlowFrameworkDashboardsPluginStart {} +export interface FlowFrameworkDashboardsPluginStart +{ +} export interface AppPluginStartDependencies { navigation: NavigationPublicPluginStart;