Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-8793

BoudingBox values of states with icons and tooltip boxes are wrong

    XMLWordPrintable

Details

    • False
    • None
    • False
    • ---
    • ---
    • 2023 Week 09-11 (from Feb 27)

    Description

      The boudingBox values of states with icons and tooltip boxes are wrong.

      The method that calculates the group boundingBox iterates over all  elements in the group in order to calculate the final boundaries of an element. In this specific case the tooltip box is being added to the group although it is not visible until the user hoovers an icon. It is affecting the boundingBox calculations because the tooltip is part of the group and takes part in the calculations. 

      One possible solution is to refactor the tooltip box to be created on demand, so it could be created and destroyed dynamically and wouldn't affect the boundingBox calculations. 

       

      The issue was identified in failing test: https://github.com/kiegroup/kie-tools/blob/main/packages/vscode-extension-serverless-workflow-editor/it-tests/serverless-workflow-editor-extension-diagram-navigation.test.ts. The test is failing because of wrong dimensions of the state recovered through Canvas API. The test calculates the center of the node and then clicks to select it finally it asserts if the the cursor moves to the right line and column.

      Example

      Consider the workflow applicant-request-decision.sw.json  and a state with icons and tooltips.

      • Actual values:
        • Dimensions: [574.5078125, 90]
      • The expected values the state should be:
        • Dimensions: [250, 90]

      How to test:

      • Open a diagram and then the Developer tools of the browser
      • From the console tab select the "editorFrame" to have direct access to js canvas API object
      • From the console get the node uuids with canvas.getNodeIds()
      • Make sure the right node was picked with canvas.getWiresShape('uuid').setBackgroundColor("green") and then call draw canvas.draw()
      • Get the dimensions of the node with canvas.getDimensions('uuid')

      Acceptance criteria

      The Canvas API returns correct dimensions.

      Do not skip this test: https://github.com/kiegroup/kie-tools/pull/1505/files#diff-8692dd61479415223a34ee29e7a7e850e37b0285f018bad2883b77fe83bd6d47R46

       

      Attachments

        Issue Links

          Activity

            People

              kgaevski@redhat.com Kirill Gaevskii
              lterifaj@redhat.com Lubomir Terifaj
              Lubomir Terifaj Lubomir Terifaj
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: