-
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.
Signed-off-by: Tyler Ohlsen <[email protected]>
- Loading branch information
Showing
13 changed files
with
123 additions
and
172 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 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
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,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, | ||
}, | ||
]; |
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,3 +4,4 @@ | |
*/ | ||
|
||
export * from './workspace_reducer'; | ||
export * from './workflows_reducer'; |
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,40 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { createSlice } from '@reduxjs/toolkit'; | ||
import { Workflow } from '../../../common'; | ||
|
||
const initialState = { | ||
// TODO: fetch from server-side later | ||
workflows: [ | ||
{ | ||
name: 'Workflow-1', | ||
id: 'workflow-1-id', | ||
description: 'description for workflow 1', | ||
}, | ||
{ | ||
name: 'Workflow-2', | ||
id: 'workflow-2-id', | ||
description: 'description for workflow 2', | ||
}, | ||
] as Workflow[], | ||
loading: false, | ||
}; | ||
|
||
const workflowsSlice = createSlice({ | ||
name: 'workflows', | ||
initialState, | ||
reducers: { | ||
setWorkflows(state, action) { | ||
state.workflows = action.payload; | ||
}, | ||
setLoading(state, action) { | ||
state.loading = action.payload; | ||
}, | ||
}, | ||
}); | ||
|
||
export const workflowsReducer = workflowsSlice.reducer; | ||
export const { setWorkflows, setLoading } = workflowsSlice.actions; |
Oops, something went wrong.