Skip to content

Commit

Permalink
changed
Browse files Browse the repository at this point in the history
Signed-off-by: Sai Medhini Reddy Maryada <[email protected]>
  • Loading branch information
Sai Medhini Reddy Maryada authored and Sai Medhini Reddy Maryada committed Aug 13, 2024
1 parent c8bc682 commit 209e9f2
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 5 deletions.
37 changes: 35 additions & 2 deletions public/pages/workflows/workflows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -77,7 +77,7 @@ export function Workflows(props: WorkflowsProps) {
const location = useLocation();
const queryParams = getDataSourceFromURL(location);
const dataSourceEnabled = getDataSourceEnabled().enabled;
const [dataSourceId, setDataSourceId] = useState<string>(
const [dataSourceId, setDataSourceId] = useState<string|undefined>(
queryParams.dataSourceId
);
const { workflows, loading } = useSelector(
Expand Down Expand Up @@ -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 ? (
// <HeaderControl
// controls={[{ description }]}
// setMountPoint={application.setAppDescriptionControls}
// />
// ) : (
// <EuiFlexItem grow={false}>
// <EuiTitle>
// <h2>{title}</h2>
// </EuiTitle>
// <EuiSpacer size="s" />
// <EuiText>
// <p>{description}</p>
// </EuiText>
// </EuiFlexItem>
// );



// if (showActionsInHeader) {
// const { HeaderControl } = getNavigationUI();
// const { setAppBottomControls } = getApplication();

// return (
// <HeaderControl
// setMountPoint={setAppBottomControls}
// controls={[{ renderComponent: callOut }]}
// />
// );
// }


return (
<>
Expand Down
7 changes: 6 additions & 1 deletion public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import {
FlowFrameworkDashboardsPluginStart,
FlowFrameworkDashboardsPluginSetup,
AppPluginStartDependencies,
} from './types';
import { PLUGIN_ID } from '../common';
import {
Expand All @@ -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<
Expand Down Expand Up @@ -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 {};
}

Expand Down
9 changes: 8 additions & 1 deletion public/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -37,3 +38,9 @@ export const [getDataSourceEnabled, setDataSourceEnabled] = createGetterSetter<
export const [getNotifications, setNotifications] = createGetterSetter<
NotificationsStart
>('Notifications');

export const [getUISettings, setUISettings] = createGetterSetter<IUiSettingsClient>('UISettings');

export const [getApplication, setApplication] = createGetterSetter<CoreStart['application']>('application');

export const [getNavigationUI, setNavigationUI] = createGetterSetter<NavigationPublicPluginStart['ui']>('navigation');
4 changes: 3 additions & 1 deletion public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export interface FlowFrameworkDashboardsPluginSetup {
dataSource: DataSourcePluginSetup;
}

export interface FlowFrameworkDashboardsPluginStart {}
export interface FlowFrameworkDashboardsPluginStart
{
}

export interface AppPluginStartDependencies {
navigation: NavigationPublicPluginStart;
Expand Down

0 comments on commit 209e9f2

Please sign in to comment.