Skip to content

Commit

Permalink
Bump
Browse files Browse the repository at this point in the history
Signed-off-by: saimedhi <[email protected]>
  • Loading branch information
saimedhi committed Aug 14, 2024
1 parent 10392e8 commit 4bf47e5
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 55 deletions.
126 changes: 72 additions & 54 deletions public/pages/workflows/workflows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ import {
} from '@elastic/eui';
import queryString from 'query-string';
import { useSelector } from 'react-redux';
import { BREADCRUMBS } from '../../utils';
import { getApplication, getCore, getNavigationUI, getUISettings } from '../../services';
import { BREADCRUMBS, NEW_BREADCRUMBS } from '../../utils';
import {
getApplication,
getCore,
getNavigationUI,
getUISettings,
} from '../../services';
import { WorkflowList } from './workflow_list';
import { NewWorkflow } from './new_workflow';
import { AppState, searchWorkflows, useAppDispatch } from '../../store';
Expand All @@ -30,6 +35,7 @@ import { MountPoint } from '../../../../../src/core/public';
import { DataSourceSelectableConfig } from '../../../../../src/plugins/data_source_management/public';

import { getDataSourceFromURL } from '../../utils/utils';
import { FormattedMessage } from '@osd/i18n/react';

import {
getDataSourceManagementPlugin,
Expand Down Expand Up @@ -77,13 +83,18 @@ export function Workflows(props: WorkflowsProps) {
const location = useLocation();
const queryParams = getDataSourceFromURL(location);
const dataSourceEnabled = getDataSourceEnabled().enabled;
const [dataSourceId, setDataSourceId] = useState<string|undefined>(
const [dataSourceId, setDataSourceId] = useState<string | undefined>(
queryParams.dataSourceId
);
const { workflows, loading } = useSelector(
(state: AppState) => state.workflows
);

const uiSettings = getUISettings();
const showActionsInHeader = uiSettings.get('home:useNewHomePage');
const { HeaderControl } = getNavigationUI();
const { setAppBottomControls } = getApplication();

// import modal state
const [isImportModalOpen, setIsImportModalOpen] = useState<boolean>(false);

Expand Down Expand Up @@ -117,16 +128,32 @@ export function Workflows(props: WorkflowsProps) {
}, [selectedTabId]);

useEffect(() => {
if (dataSourceEnabled) {
getCore().chrome.setBreadcrumbs([
BREADCRUMBS.FLOW_FRAMEWORK,
BREADCRUMBS.WORKFLOWS(dataSourceId),
]);
if (showActionsInHeader) {
if (dataSourceEnabled) {
getCore().chrome.setBreadcrumbs([
NEW_BREADCRUMBS.FLOW_FRAMEWORK,
NEW_BREADCRUMBS.WORKFLOWS(dataSourceId),
NEW_BREADCRUMBS.Title,
]);
} else {
getCore().chrome.setBreadcrumbs([
NEW_BREADCRUMBS.FLOW_FRAMEWORK,
NEW_BREADCRUMBS.WORKFLOWS(),
NEW_BREADCRUMBS.Title,
]);
}
} else {
getCore().chrome.setBreadcrumbs([
BREADCRUMBS.FLOW_FRAMEWORK,
BREADCRUMBS.WORKFLOWS(),
]);
if (dataSourceEnabled) {
getCore().chrome.setBreadcrumbs([
BREADCRUMBS.FLOW_FRAMEWORK,
BREADCRUMBS.WORKFLOWS(dataSourceId),
]);
} else {
getCore().chrome.setBreadcrumbs([
BREADCRUMBS.FLOW_FRAMEWORK,
BREADCRUMBS.WORKFLOWS(),
]);
}
}
});

Expand Down Expand Up @@ -196,39 +223,40 @@ 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();
const description = (
<FormattedMessage
id="indexPatternManagement.indexPatternTable.indexPatternExplanation"
defaultMessage="Create and manage the index patterns that help you retrieve your data from OpenSearch."
/>
);
const pageTitleAndDescription = showActionsInHeader ? (
<HeaderControl
controls={[{ description }]}
setMountPoint={setAppBottomControls}
/>
) : (
<EuiFlexGroup direction="column" style={{ margin: '0px' }}>
<EuiTitle size="l">
<h1>Search Studio</h1>
</EuiTitle>
<EuiText color="subdued">
Design, experiment, and prototype your solutions with workflows. Build
your search and last mile ingestion flows.
</EuiText>
</EuiFlexGroup>
);

// return (
// <HeaderControl
// setMountPoint={setAppBottomControls}
// controls={[{ renderComponent: callOut }]}
// />
// );
// }
if (showActionsInHeader) {
const { HeaderControl } = getNavigationUI();
const { setAppBottomControls } = getApplication();

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

return (
<>
Expand All @@ -243,17 +271,7 @@ export function Workflows(props: WorkflowsProps) {
<EuiPage>
<EuiPageBody>
<EuiPageHeader
pageTitle={
<EuiFlexGroup direction="column" style={{ margin: '0px' }}>
<EuiTitle size="l">
<h1>Search Studio</h1>
</EuiTitle>
<EuiText color="subdued">
Design, experiment, and prototype your solutions with
workflows. Build your search and last mile ingestion flows.
</EuiText>
</EuiFlexGroup>
}
pageTitle={pageTitleAndDescription}
tabs={[
{
id: WORKFLOWS_TAB.MANAGE,
Expand Down
6 changes: 5 additions & 1 deletion public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ import {
setDataSourceEnabled,
setNotifications,
setNavigationUI,
setApplication,
setUISettings,
} from './services';
import { configureRoutes } from './route_service';

import { NavigationPublicPluginStart } from '../../../src/plugins/navigation/public';
//import { NavigationPublicPluginStart } from '../../../src/plugins/navigation/public';

export class FlowFrameworkDashboardsPlugin
implements
Expand Down Expand Up @@ -70,6 +72,7 @@ export class FlowFrameworkDashboardsPlugin
showInAllNavGroup: true,
},
]);
setUISettings(core.uiSettings);
setDataSourceManagementPlugin(plugins.dataSourceManagement);
const enabled = !!plugins.dataSource;
setDataSourceEnabled({ enabled });
Expand All @@ -86,6 +89,7 @@ export class FlowFrameworkDashboardsPlugin
setNotifications(core.notifications);
setSavedObjectsClient(core.savedObjects.client);
setNavigationUI(navigation.ui);
setApplication(core.application);
return {};
}

Expand Down
9 changes: 9 additions & 0 deletions public/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,12 @@ export const BREADCRUMBS = Object.freeze({
href: constructHrefWithDataSourceId(APP_PATH.WORKFLOWS, dataSourceId),
}),
});

export const NEW_BREADCRUMBS = Object.freeze({
FLOW_FRAMEWORK: { text: 'Flow Framework' },
WORKFLOWS: (dataSourceId?: string) => ({
text: 'Workflows',
href: constructHrefWithDataSourceId(APP_PATH.WORKFLOWS, dataSourceId),
}),
Title: { text: 'Search Studio' },
});

0 comments on commit 4bf47e5

Please sign in to comment.