-
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 <ohltyler@amazon.com> (cherry picked from commit ac60ae0) Co-authored-by: Tyler Ohlsen <ohltyler@amazon.com>
- Loading branch information
1 parent
e830158
commit a9cc15a
Showing
11 changed files
with
278 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export { UseCase } from './use_case'; |
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,53 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React, { useEffect } from 'react'; | ||
import { | ||
EuiText, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiTitle, | ||
EuiCard, | ||
EuiHorizontalRule, | ||
EuiButton, | ||
} from '@elastic/eui'; | ||
interface UseCaseProps { | ||
title: string; | ||
description: string; | ||
} | ||
|
||
export function UseCase(props: UseCaseProps) { | ||
return ( | ||
<EuiCard | ||
title={ | ||
<EuiTitle size="s"> | ||
<h2>{props.title}</h2> | ||
</EuiTitle> | ||
} | ||
titleSize="s" | ||
paddingSize="l" | ||
> | ||
<EuiFlexGroup direction="column" gutterSize="l"> | ||
<EuiHorizontalRule size="full" margin="m" /> | ||
<EuiFlexItem grow={true}> | ||
<EuiText>{props.description}</EuiText> | ||
</EuiFlexItem> | ||
<EuiFlexGroup direction="column" alignItems="center"> | ||
<EuiFlexItem grow={false}> | ||
<EuiButton | ||
disabled={false} | ||
isLoading={false} | ||
onClick={() => { | ||
// TODO: possibly link to the workflow builder with a pre-configured flow | ||
}} | ||
> | ||
Go | ||
</EuiButton> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</EuiFlexGroup> | ||
</EuiCard> | ||
); | ||
} |
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,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export { WorkflowBuilder } from './workflow_builder'; |
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,43 @@ | ||
/* | ||
* 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 { BREADCRUMBS } from '../../utils'; | ||
import { getCore } from '../../services'; | ||
|
||
export function WorkflowBuilder() { | ||
useEffect(() => { | ||
getCore().chrome.setBreadcrumbs([ | ||
BREADCRUMBS.AI_APPLICATION_BUILDER, | ||
BREADCRUMBS.WORKFLOW_BUILDER, | ||
]); | ||
}); | ||
|
||
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> | ||
); | ||
} |
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 { WorkflowList } from './workflow_list'; |
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,79 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React, { useState } from 'react'; | ||
import { EuiBasicTable } from '@elastic/eui'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-empty-interface | ||
interface WorkflowListProps {} | ||
|
||
interface WorkflowItem { | ||
name: string; | ||
description: string; | ||
} | ||
|
||
export function WorkflowList(props: WorkflowListProps) { | ||
const [pageIndex, setPageIndex] = useState(0); | ||
const [pageSize, setPageSize] = useState(5); | ||
const [sortField, setSortField] = useState('name'); | ||
const [sortDirection, setSortDirection] = useState('asc'); | ||
|
||
const columns = [ | ||
{ | ||
field: 'name', | ||
name: 'Name', | ||
sortable: true, | ||
}, | ||
{ | ||
field: 'description', | ||
name: 'Description', | ||
sortable: false, | ||
}, | ||
]; | ||
|
||
const items = [ | ||
{ | ||
name: 'Workflow 1', | ||
}, | ||
] as WorkflowItem[]; | ||
|
||
const sorting = { | ||
sort: { | ||
field: sortField, | ||
direction: sortDirection, | ||
}, | ||
enableAllColumns: false, | ||
readOnly: false, | ||
}; | ||
|
||
const pagination = { | ||
pageIndex, | ||
pageSize, | ||
totalItemCount: items.length, | ||
pageSizeOptions: [5, 10, 20], | ||
}; | ||
|
||
const onTableChange = ({ page = {}, sort = {} }) => { | ||
const { index, size } = page; | ||
const { field, direction } = sort; | ||
|
||
setPageIndex(index); | ||
setPageSize(size); | ||
setSortField(field); | ||
setSortDirection(direction); | ||
}; | ||
|
||
return ( | ||
<EuiBasicTable<WorkflowItem> | ||
items={items} | ||
rowHeader="name" | ||
columns={columns} | ||
sorting={sorting} | ||
pagination={pagination} | ||
onChange={onTableChange} | ||
noItemsMessage={'No existing workflows found'} | ||
/> | ||
); | ||
} |
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