@@ -32,6 +32,7 @@ import {
32
32
WORKFLOW_STATE ,
33
33
processNodes ,
34
34
reduceToTemplate ,
35
+ ReactFlowEdge ,
35
36
} from '../../../../common' ;
36
37
import { validateWorkspaceFlow , toTemplateFlows } from '../utils' ;
37
38
import {
@@ -133,8 +134,13 @@ export function ResizableWorkspace(props: ResizableWorkspaceProps) {
133
134
* - open the panel if a node is selected and the panel is closed
134
135
* - it is assumed that only one node can be selected at once
135
136
*/
136
- // TODO: make more typesafe
137
- function onSelectionChange ( { nodes, edges } ) {
137
+ function onSelectionChange ( {
138
+ nodes,
139
+ edges,
140
+ } : {
141
+ nodes : ReactFlowComponent [ ] ;
142
+ edges : ReactFlowEdge [ ] ;
143
+ } ) {
138
144
if ( nodes && nodes . length > 0 ) {
139
145
setSelectedComponent ( nodes [ 0 ] ) ;
140
146
if ( ! isDetailsPanelOpen ) {
@@ -276,7 +282,6 @@ export function ResizableWorkspace(props: ResizableWorkspaceProps) {
276
282
} as Workflow ;
277
283
processWorkflowFn ( updatedWorkflow ) ;
278
284
} else {
279
- // TODO: bubble up flow error?
280
285
setFlowValidOnSubmit ( false ) ;
281
286
setIsSaving ( false ) ;
282
287
}
@@ -336,7 +341,10 @@ export function ResizableWorkspace(props: ResizableWorkspaceProps) {
336
341
setIsDeprovisioning ( false ) ;
337
342
} ) ;
338
343
} else {
339
- // TODO: this case should not happen
344
+ // This case should not happen
345
+ console . debug (
346
+ 'Deprovisioning triggered on an invalid workflow. Ignoring.'
347
+ ) ;
340
348
}
341
349
} }
342
350
>
@@ -360,7 +368,10 @@ export function ResizableWorkspace(props: ResizableWorkspaceProps) {
360
368
setIsProvisioning ( false ) ;
361
369
} ) ;
362
370
} else {
363
- // TODO: this case should not happen
371
+ // This case should not happen
372
+ console . debug (
373
+ 'Provisioning triggered on an invalid workflow. Ignoring.'
374
+ ) ;
364
375
}
365
376
} }
366
377
>
@@ -370,7 +381,6 @@ export function ResizableWorkspace(props: ResizableWorkspaceProps) {
370
381
fill = { false }
371
382
disabled = { ! isSaveable || isLoadingGlobal || isDeprovisionable }
372
383
isLoading = { isSaving }
373
- // TODO: if props.isNewWorkflow is true, clear the workflow cache if saving is successful.
374
384
onClick = { ( ) => {
375
385
setIsSaving ( true ) ;
376
386
dispatch ( removeDirty ( ) ) ;
0 commit comments