altinn-studio icon indicating copy to clipboard operation
altinn-studio copied to clipboard

Chore/8845 upgrade react dnd

Open mijohansen opened this issue 1 year ago • 2 comments

Description

Due to changes to react 18 we are upgrading react-dnd from major version 11 to 16. This change consist of what is closely to a rewrite of several of det components relaying on react-dnd. This area of the code have some large class-components.

The Designview.tsx was rewritten to a functional component and mostly all logic to move around issues was rewritten, the same goes for the draggable components DraggableToolbarItem, DroppableDraggableComponent and DroppableDraggableContainer. These should probably be renamed, but for now changing them in place gives more sense because of continuity.

We moved some easy testable functions out of the components and into separate files, and wrote some, probably not enough tests on these to ensure that they where not broken, mostly for handeling arrays. We also introdused some common interfaces and tried to get typings on as much as possible. A lot of properties are passed around in this area of the code, so some name changes was also needed to make it easier to understand what was happening.

Related Issue(s)

  • #8845
  • #8821

Verification

  • [ ] Your code builds clean without any errors or warnings
  • [x] Manual testing done (required)
  • [x] Relevant automated test added (if you find this hard, leave it and we'll help out)
  • [x] All tests run green

Documentation

  • [ ] User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

mijohansen avatar Aug 31 '22 08:08 mijohansen

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

sonarcloud[bot] avatar Aug 31 '22 19:08 sonarcloud[bot]