-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove workflow builder; add workflow details
Signed-off-by: Tyler Ohlsen <[email protected]>
- Loading branch information
Showing
29 changed files
with
252 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
// TODO: this will grow as more fields are defined and what frontend reqts there will be | ||
export interface Workflow { | ||
name: string; | ||
id: string; | ||
description: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { EuiPageHeader, EuiButton } from '@elastic/eui'; | ||
import { Workflow } from '../../../../common'; | ||
|
||
interface WorkflowDetailHeaderProps { | ||
workflow: Workflow | undefined; | ||
} | ||
|
||
export function WorkflowDetailHeader(props: WorkflowDetailHeaderProps) { | ||
return ( | ||
<div> | ||
<EuiPageHeader | ||
pageTitle={props.workflow ? props.workflow.name : ''} | ||
description={props.workflow ? props.workflow.description : ''} | ||
rightSideItems={[ | ||
<EuiButton fill={false} onClick={() => {}}> | ||
Prototype | ||
</EuiButton>, | ||
<EuiButton fill={false} onClick={() => {}}> | ||
Save | ||
</EuiButton>, | ||
]} | ||
/> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export { WorkflowDetailHeader } from './header'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export * from './workflow_detail'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React, { useEffect } from 'react'; | ||
import { RouteComponentProps } from 'react-router-dom'; | ||
import { useSelector } from 'react-redux'; | ||
import { EuiSpacer } from '@elastic/eui'; | ||
import { BREADCRUMBS } from '../../utils'; | ||
import { getCore } from '../../services'; | ||
import { WorkflowDetailHeader } from './components'; | ||
import { Workspace } from './workspace'; | ||
import { AppState } from '../../store'; | ||
|
||
export interface WorkflowDetailRouterProps { | ||
workflowId: string; | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
interface WorkflowDetailProps | ||
extends RouteComponentProps<WorkflowDetailRouterProps> {} | ||
|
||
export function WorkflowDetail(props: WorkflowDetailProps) { | ||
const { workflows } = useSelector((state: AppState) => state.workflows); | ||
|
||
const workflow = workflows.find( | ||
(wf) => wf.id === props.match?.params?.workflowId | ||
); | ||
const workflowName = workflow ? workflow.name : ''; | ||
|
||
useEffect(() => { | ||
getCore().chrome.setBreadcrumbs([ | ||
BREADCRUMBS.AI_APPLICATION_BUILDER, | ||
BREADCRUMBS.WORKFLOWS, | ||
{ text: workflowName }, | ||
]); | ||
}); | ||
|
||
return ( | ||
<div> | ||
<WorkflowDetailHeader workflow={workflow} /> | ||
<EuiSpacer size="l" /> | ||
<Workspace /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export { Workspace } from './workspace'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { useSelector } from 'react-redux'; | ||
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; | ||
import { AppState } from '../../../store'; | ||
import { WorkspaceComponent } from '../workspace_component'; | ||
|
||
export function Workspace() { | ||
const { components } = useSelector((state: AppState) => state.workspace); | ||
|
||
return ( | ||
<EuiFlexGroup direction="row"> | ||
{components.map((component, idx) => { | ||
return ( | ||
<EuiFlexItem key={idx}> | ||
<WorkspaceComponent component={component} /> | ||
</EuiFlexItem> | ||
); | ||
})} | ||
</EuiFlexGroup> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export { WorkspaceComponent } from './workspace_component'; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { EuiLink } from '@elastic/eui'; | ||
import { PLUGIN_ID, Workflow } from '../../../../common'; | ||
|
||
export const columns = [ | ||
{ | ||
field: 'name', | ||
name: 'Name', | ||
sortable: true, | ||
render: (name: string, workflow: Workflow) => ( | ||
<EuiLink href={`${PLUGIN_ID}#/workflows/${workflow.id}`}>{name}</EuiLink> | ||
), | ||
}, | ||
{ | ||
field: 'id', | ||
name: 'ID', | ||
sortable: true, | ||
}, | ||
{ | ||
field: 'description', | ||
name: 'Description', | ||
sortable: false, | ||
}, | ||
]; |
Oops, something went wrong.