DesignView not re-rendering after converting a newly added layout to PDF (without currently implemented hack) #13679
Labels
area/ui-editor
Area: Related to the designer tool for assembling app UI in Altinn Studio.
kind/bug
Used when there is a defect / something is not working as it should.
status/ready-for-specification
Status: Used for issues that are ready for functional decription og detailed design.
status/triage
Description of the bug
In the component
DesignView
in ux-editor we are now referring touseFormLayoutSettingsQuery
twice, where the first reference is unused, in order to force a re-render of theDesignView
, which are listing the layouts in the current layout set.This hack should actually not have any effect since the two references are listening to the same useState inside tanStackQuery, but for some reason it works.
This bug-issue involves removing the hack and figure out how we can ensure the correct behaviour of re-rendering DesignView after converting a newly added layout to a PDF without needing to force the re-render by a user-trigger. (e.g. clicking a page accordion in DesignView)
Video:
In the video you see how the behaviour is when the hack is present, and how the behaviour is when the hack is removed.
Skjermopptak.2024-10-02.kl.08.26.38.mov
Additional information
The issue arised in this PR
Steps To Reproduce
useFormLayoutSettingsQuery
inDesignView.tsx
(currently located here)PDF
accordion in the config-panelDesignView
panel is not re-rendering even though the button text in the PDF accordion for the particular page has been updated (you can also check the cache or local changes to confirm thatSettings.json
has been updated)DesignView
panel and see that the component re-rendersAdditional Information
No response
The text was updated successfully, but these errors were encountered: