Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DesignView not re-rendering after converting a newly added layout to PDF (without currently implemented hack) #13679

Open
standeren opened this issue Oct 2, 2024 · 0 comments
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

Comments

@standeren
Copy link
Contributor

standeren commented Oct 2, 2024

Description of the bug

In the component DesignView in ux-editor we are now referring to useFormLayoutSettingsQuery twice, where the first reference is unused, in order to force a re-render of the DesignView, 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

  1. Remove the additional reference to useFormLayoutSettingsQuery in DesignView.tsx (currently located here)
  2. Add a new page
  3. Click the PDF accordion in the config-panel
  4. Convert the current page to a PDF
  5. See that the pages in the DesignView 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 that Settings.json has been updated)
  6. Click on another page in the DesignView panel and see that the component re-renders

Additional Information

No response

@standeren standeren added kind/bug Used when there is a defect / something is not working as it should. status/triage area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. status/ready-for-specification Status: Used for issues that are ready for functional decription og detailed design. labels Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
Status: No status
Development

No branches or pull requests

1 participant