-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Signed-off-by: Tyler Ohlsen <[email protected]> (cherry picked from commit ea04bce) Co-authored-by: Tyler Ohlsen <[email protected]>
- Loading branch information
1 parent
6054b8f
commit 660ad90
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
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 { IWorkflow } from '../../../../common'; | ||
|
||
interface WorkflowDetailHeaderProps { | ||
workflow: IWorkflow | 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, IWorkflow } from '../../../../common'; | ||
|
||
export const columns = [ | ||
{ | ||
field: 'name', | ||
name: 'Name', | ||
sortable: true, | ||
render: (name: string, workflow: IWorkflow) => ( | ||
<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.