Skip to content

Commit

Permalink
Add skeleton for workflow builder page
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <[email protected]>
  • Loading branch information
ohltyler committed Sep 11, 2023
1 parent dfe708e commit 1e02397
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 1 deletion.
15 changes: 14 additions & 1 deletion public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Route, RouteComponentProps, Switch } from 'react-router-dom';
import { EuiPageSideBar, EuiSideNav, EuiPageTemplate } from '@elastic/eui';
import { CoreStart } from '../../../src/core/public';
import { Navigation, APP_PATH } from './utils';
import { Overview, UseCases, Workflows } from './pages';
import { Overview, UseCases, Workflows, WorkflowBuilder } from './pages';
import { CoreServicesConsumer } from './core_services';

// eslint-disable-next-line @typescript-eslint/no-empty-interface
Expand Down Expand Up @@ -37,6 +37,13 @@ export const AiFlowDashboardsApp = (props: Props) => {
href: `#${APP_PATH.WORKFLOWS}`,
isSelected: props.location.pathname === APP_PATH.WORKFLOWS,
},
{
name: Navigation.WorkflowBuilder,
id: 3,
href: `#${APP_PATH.WORKFLOW_BUILDER}`,
isSelected:
props.location.pathname === APP_PATH.WORKFLOW_BUILDER,
},
],
},
]}
Expand Down Expand Up @@ -65,6 +72,12 @@ export const AiFlowDashboardsApp = (props: Props) => {
path={APP_PATH.WORKFLOWS}
render={(routeProps: RouteComponentProps) => <Workflows />}
/>
<Route
path={APP_PATH.WORKFLOW_BUILDER}
render={(routeProps: RouteComponentProps) => (
<WorkflowBuilder />
)}
/>
{/* Defaulting to Overview page */}
<Route
path={`${APP_PATH.HOME}`}
Expand Down
1 change: 1 addition & 0 deletions public/pages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
export * from './use_cases';
export * from './workflows';
export * from './overview';
export * from './workflow_builder';
6 changes: 6 additions & 0 deletions public/pages/workflow_builder/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export { WorkflowBuilder } from './workflow_builder';
45 changes: 45 additions & 0 deletions public/pages/workflow_builder/workflow_builder.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React, { useEffect } from 'react';
import {
EuiPageHeader,
EuiFlexGroup,
EuiFlexItem,
EuiTitle,
EuiText,
EuiSpacer,
} from '@elastic/eui';
import { CoreServicesContext } from '../../core_services';
import { CoreStart } from '../../../../../src/core/public';
import { BREADCRUMBS } from '../../utils';

export function WorkflowBuilder() {
const core = React.useContext(CoreServicesContext) as CoreStart;
useEffect(() => {
core.chrome.setBreadcrumbs([
BREADCRUMBS.AI_APPLICATION_BUILDER,
BREADCRUMBS.WORKFLOWS,
]);
});

return (
<div>
<EuiPageHeader>
<EuiFlexGroup justifyContent="spaceBetween">
<EuiFlexItem grow={false}>
<EuiTitle size="l">
<h1>Workflow Builder</h1>
</EuiTitle>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPageHeader>
<EuiSpacer size="l" />
<EuiFlexItem>
<EuiText>Placeholder for workflow builder page...</EuiText>
</EuiFlexItem>
</div>
);
}
6 changes: 6 additions & 0 deletions public/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export enum Navigation {
AiApplicationBuilder = 'AI Application Builder',
UseCases = 'Use Cases',
Workflows = 'Workflows',
WorkflowBuilder = 'Workflow Builder',
}

export enum APP_PATH {
Expand All @@ -15,10 +16,15 @@ export enum APP_PATH {
WORKSPACE = '/workspace',
WORKFLOWS = '/workflows',
WORKFLOW_DETAIL = '/workflows/:workflowId/',
WORKFLOW_BUILDER = '/workflow-builder',
}

export const BREADCRUMBS = Object.freeze({
AI_APPLICATION_BUILDER: { text: 'AI application builder', href: '#/' },
USE_CASES: { text: 'Use cases', href: `#${APP_PATH.USE_CASES}` },
WORKFLOWS: { text: 'Workflows', href: `#${APP_PATH.WORKFLOWS}` },
WORKFLOW_BUILDER: {
text: 'Workflow builder',
href: `#${APP_PATH.WORKFLOW_BUILDER}`,
},
});

0 comments on commit 1e02397

Please sign in to comment.