@@ -3,6 +3,8 @@ import Flow, { init } from 'components/molecules/flow';
33import { useTabStore } from 'stores/TabStore' ;
44import useCanvasStore from 'stores/CanvasStore' ;
55import TabPanelHeader from '../headers/TabPanelHeader' ;
6+ import { OBJ_TYPES } from 'constants/Common' ;
7+ import Env from '../environment' ;
68
79const WorkspaceContent = ( ) => {
810 const setNodes = useCanvasStore ( ( state ) => state . setNodes ) ;
@@ -17,89 +19,25 @@ const WorkspaceContent = () => {
1719 console . log ( `Tab changed to: ${ focusTabId } ` ) ;
1820 console . log ( focusTab ) ;
1921 // perform actions based on the new tabId
20- const result = init ( focusTab . flowDataDraft ? focusTab . flowDataDraft : focusTab . flowData ) ;
21- setNodes ( result . nodes ) ;
22- setEdges ( result . edges ) ;
23- setLogs ( [ ] ) ;
22+ if ( focusTab . type === OBJ_TYPES . flowtest ) {
23+ const result = init ( focusTab . flowDataDraft ? focusTab . flowDataDraft : focusTab . flowData ) ;
24+ setNodes ( result . nodes ) ;
25+ setEdges ( result . edges ) ;
26+ setLogs ( [ ] ) ;
27+ }
2428 }
2529
2630 return (
27- < div className = 'flex h-full flex-col' >
28- < TabPanelHeader />
29- { focusTab ? (
30- < Flow collectionId = { focusTab . collectionId } />
31- ) : (
32- // This code will be exported out as its own component
33- < div className = 'p-4' >
34- < div > Test Tab panel for environment</ div >
35- < div className = 'overflow-x-auto' >
36- < table className = 'table table-zebra' >
37- { /* head */ }
38- < thead >
39- < tr >
40- < th > </ th >
41- < th > Key</ th >
42- < th > Value</ th >
43- < th > New Value</ th >
44- </ tr >
45- </ thead >
46- < tbody >
47- < tr >
48- < th > 1</ th >
49- < td > Test variable 1</ td >
50- < td > ABC</ td >
51- < td >
52- < input
53- type = 'text'
54- className = 'block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 text-sm text-gray-900 outline-blue-300 focus:border-blue-100 focus:ring-blue-100'
55- placeholder = 'label'
56- required
57- onChange = { ( event ) => {
58- const labelValue = event . target . value ;
59- console . log ( `New value for ABC: ${ labelValue } ` ) ;
60- } }
61- />
62- </ td >
63- </ tr >
64- < tr >
65- < th > 2</ th >
66- < td > Test variable 2</ td >
67- < td > DEF</ td >
68- < td >
69- < input
70- type = 'text'
71- className = 'block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 text-sm text-gray-900 outline-blue-300 focus:border-blue-100 focus:ring-blue-100'
72- placeholder = 'label'
73- required
74- onChange = { ( event ) => {
75- const labelValue = event . target . value ;
76- console . log ( `New value for DEF: ${ labelValue } ` ) ;
77- } }
78- />
79- </ td >
80- </ tr >
81- < tr >
82- < th > 3</ th >
83- < td > Test variable 3</ td >
84- < td > ZXE</ td >
85- < td >
86- < input
87- type = 'text'
88- className = 'block w-full rounded-lg border border-gray-300 bg-gray-50 p-2.5 text-sm text-gray-900 outline-blue-300 focus:border-blue-100 focus:ring-blue-100'
89- placeholder = 'label'
90- required
91- onChange = { ( event ) => {
92- const labelValue = event . target . value ;
93- console . log ( `New value for ZXE: ${ labelValue } ` ) ;
94- } }
95- />
96- </ td >
97- </ tr >
98- </ tbody >
99- </ table >
100- </ div >
101- </ div >
102- ) }
31+ < div className = 'flex flex-col h-full' >
32+ { focusTab &&
33+ ( focusTab . type === OBJ_TYPES . flowtest ? (
34+ < >
35+ < TabPanelHeader />
36+ < Flow collectionId = { focusTab . collectionId } />
37+ </ >
38+ ) : (
39+ < Env />
40+ ) ) }
10341 </ div >
10442 ) ;
10543} ;
0 commit comments