Altinn / altinn-studio

Next generation open source Altinn platform and applications.
https://docs.altinn.studio
BSD 3-Clause "New" or "Revised" License
114 stars 70 forks source link

Force update of preview when updating the datamodel bindings #12863

Closed mlqn closed 4 months ago

mlqn commented 4 months ago

Description

The data model bindings are now memoized in the app-frontend, causing the Preview to no longer update when the bindings change. A hack we already use in several places (https://github.com/Altinn/altinn-studio/pull/12733) is to force Preview to update by unmonting the component using resetQueries instead of invalidateQueries.

This bug was reported by @lassopicasso.

BEFORE

https://github.com/Altinn/altinn-studio/assets/24462611/b0469d57-bd8d-415e-a490-f8d58127e27f

AFTER

https://github.com/Altinn/altinn-studio/assets/24462611/8be033c7-c3ec-41e3-bd26-1423b2d0ffc9

Verification

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.68%. Comparing base (8d5d3b2) to head (b1c83cd).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #12863 +/- ## ========================================== + Coverage 90.67% 90.68% +0.01% ========================================== Files 1369 1369 Lines 19530 19531 +1 Branches 2379 2379 ========================================== + Hits 17709 17712 +3 + Misses 1558 1556 -2 Partials 263 263 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.