From 1a6a2c0ae9e1ea4d4aafcd6b8ee35ace1976869d Mon Sep 17 00:00:00 2001 From: Dan Funk Date: Fri, 7 Jul 2023 10:11:12 -0400 Subject: [PATCH] Feature/fix diagram zoom (#378) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Revert "set undefined values to null rjsf form data w/ burnettk (#336)" This reverts commit cca9b147f6648b2aa0717c7859ce88056640f4a8. * Quick test to check if calls are happening correctly to resize the diagram. * Quick test to check if calls are happening correctly to resize the diagram. * remove all the logic around fitviewport limitations, which doesn't seem to be requured. For some reason (modeler as any).constructor.name return '_9' on the dev server, rather than returning 'Modeler', 'Viewer' etal ... * drop console log * Clean up comments. --------- Co-authored-by: Jakub SokoĊ‚owski Co-authored-by: jasquat Co-authored-by: burnettk Co-authored-by: Madhurya Liyanage --- .../src/components/ReactDiagramEditor.tsx | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/spiffworkflow-frontend/src/components/ReactDiagramEditor.tsx b/spiffworkflow-frontend/src/components/ReactDiagramEditor.tsx index 8d4eb8af..194c7968 100644 --- a/spiffworkflow-frontend/src/components/ReactDiagramEditor.tsx +++ b/spiffworkflow-frontend/src/components/ReactDiagramEditor.tsx @@ -425,17 +425,7 @@ export default function ReactDiagramEditor({ } const canvas = (modeler as any).get('canvas'); - - // only get the canvas if the dmn active viewer is actually - // a Modeler and not an Editor which is what it will be when we are - // actively editing a decision table - if ((modeler as any).constructor.name === 'Modeler') { - canvas.zoom(FitViewport, 'auto'); - } - - if ((modeler as any).constructor.name === 'Viewer') { - canvas.zoom(FitViewport, 'auto'); - } + canvas.zoom(FitViewport, 'auto'); // Concerned this might bug out somehow. // highlighting a field // Option 3 at: