File tree 4 files changed +24
-7
lines changed
public/pages/workflows/workflow_list
4 files changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -37,3 +37,5 @@ export const GET_PRESET_WORKFLOWS_NODE_API_PATH = `${BASE_WORKFLOW_NODE_API_PATH
37
37
export const NEW_WORKFLOW_ID_URL = 'new' ;
38
38
export const START_FROM_SCRATCH_WORKFLOW_NAME = 'Start From Scratch' ;
39
39
export const DEFAULT_NEW_WORKFLOW_NAME = 'new_workflow' ;
40
+ export const DATE_FORMAT_PATTERN = 'MM/DD/YY hh:mm A' ;
41
+ export const EMPTY_FIELD_STRING = '--' ;
Original file line number Diff line number Diff line change 3
3
* SPDX-License-Identifier: Apache-2.0
4
4
*/
5
5
6
+ import moment from 'moment' ;
6
7
import {
7
8
WorkspaceFlowState ,
8
9
ReactFlowComponent ,
@@ -13,6 +14,7 @@ import {
13
14
ReactFlowEdge ,
14
15
TemplateFlows ,
15
16
WorkflowTemplate ,
17
+ DATE_FORMAT_PATTERN ,
16
18
} from './' ;
17
19
18
20
// TODO: implement this and remove hardcoded return values
@@ -91,3 +93,7 @@ export function validateWorkflowTemplate(
91
93
) : boolean {
92
94
return true ;
93
95
}
96
+
97
+ export function toFormattedDate ( timestampMillis : number ) : String {
98
+ return moment ( new Date ( timestampMillis ) ) . format ( DATE_FORMAT_PATTERN ) ;
99
+ }
Original file line number Diff line number Diff line change 5
5
6
6
import React from 'react' ;
7
7
import { EuiLink } from '@elastic/eui' ;
8
- import { PLUGIN_ID , Workflow } from '../../../../common' ;
8
+ import {
9
+ EMPTY_FIELD_STRING ,
10
+ PLUGIN_ID ,
11
+ Workflow ,
12
+ toFormattedDate ,
13
+ } from '../../../../common' ;
9
14
10
15
export const columns = ( actions : any [ ] ) => [
11
16
{
@@ -30,11 +35,19 @@ export const columns = (actions: any[]) => [
30
35
field : 'lastUpdated' ,
31
36
name : 'Last updated' ,
32
37
sortable : true ,
38
+ render : ( lastUpdated : number ) =>
39
+ lastUpdated !== undefined
40
+ ? toFormattedDate ( lastUpdated )
41
+ : EMPTY_FIELD_STRING ,
33
42
} ,
34
43
{
35
44
field : 'lastLaunched' ,
36
45
name : 'Last launched' ,
37
46
sortable : true ,
47
+ render : ( lastLaunched : number ) =>
48
+ lastLaunched !== undefined
49
+ ? toFormattedDate ( lastLaunched )
50
+ : EMPTY_FIELD_STRING ,
38
51
} ,
39
52
{
40
53
name : 'Actions' ,
Original file line number Diff line number Diff line change @@ -30,9 +30,8 @@ function toWorkflowObj(workflowHit: any): Workflow {
30
30
description : hitSource . description || '' ,
31
31
version : hitSource . version ,
32
32
workflows : hitSource . workflows ,
33
- // TODO: this needs to be persisted by backend. Tracking issue:
34
- // https://github.com/opensearch-project/flow-framework/issues/548
35
- lastUpdated : 1234 ,
33
+ lastUpdated : hitSource . last_updated_time ,
34
+ lastLaunched : hitSource . last_provisioned_time ,
36
35
} as Workflow ;
37
36
}
38
37
@@ -57,9 +56,6 @@ export function getWorkflowsFromResponses(
57
56
...workflowDict [ workflowHit . _id ] ,
58
57
// @ts -ignore
59
58
state : WORKFLOW_STATE [ workflowState ] ,
60
- // TODO: this needs to be persisted by backend. Tracking issue:
61
- // https://github.com/opensearch-project/flow-framework/issues/548
62
- lastLaunched : 1234 ,
63
59
} ;
64
60
}
65
61
} ) ;
You can’t perform that action at this time.
0 commit comments