-
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.
Browse files
Browse the repository at this point in the history
(cherry picked from commit 16a0967) Co-authored-by: Tyler Ohlsen <[email protected]>
- Loading branch information
1 parent
c452485
commit e3ec37f
Showing
14 changed files
with
169 additions
and
104 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 |
---|---|---|
|
@@ -4,5 +4,4 @@ | |
*/ | ||
|
||
export * from './workflows'; | ||
export * from './overview'; | ||
export * from './workflow_detail'; |
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,17 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export const columns = [ | ||
{ | ||
field: 'id', | ||
name: 'ID', | ||
sortable: true, | ||
}, | ||
{ | ||
field: 'type', | ||
name: 'Type', | ||
sortable: true, | ||
}, | ||
]; |
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,54 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React, { useState, useEffect } from 'react'; | ||
import { | ||
EuiInMemoryTable, | ||
Direction, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
} from '@elastic/eui'; | ||
import { Workflow, WorkflowResource } from '../../../../common'; | ||
import { columns } from './columns'; | ||
|
||
interface ResourceListProps { | ||
workflow?: Workflow; | ||
} | ||
|
||
/** | ||
* The searchable list of resources for a particular workflow. | ||
*/ | ||
export function ResourceList(props: ResourceListProps) { | ||
const [allResources, setAllResources] = useState<WorkflowResource[]>([]); | ||
|
||
// Hook to initialize all resources | ||
useEffect(() => { | ||
if (props.workflow?.resourcesCreated) { | ||
setAllResources(props.workflow.resourcesCreated); | ||
} | ||
}, [props.workflow?.resourcesCreated]); | ||
|
||
const sorting = { | ||
sort: { | ||
field: 'id', | ||
direction: 'asc' as Direction, | ||
}, | ||
}; | ||
|
||
return ( | ||
<EuiFlexGroup direction="column"> | ||
<EuiFlexItem> | ||
<EuiInMemoryTable<WorkflowResource> | ||
items={allResources} | ||
rowHeader="id" | ||
columns={columns} | ||
sorting={sorting} | ||
pagination={true} | ||
message={'No existing resources found'} | ||
/> | ||
</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
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
Oops, something went wrong.