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

use empty array for layouts if not yet loaded when changing layoutset #11340

Merged
merged 6 commits into from
Oct 26, 2023

Conversation

standeren
Copy link
Contributor

@standeren standeren commented Oct 11, 2023

Description

Related Issue(s)

  • #{issue number}

Verification

Documentation

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

@standeren standeren changed the title Set forlayouts only when designview is ready Set formlayouts only when designview is ready Oct 11, 2023
@github-actions github-actions bot added area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. solution/studio/designer Issues related to the Altinn Studio Designer solution. labels Oct 11, 2023
@standeren standeren force-pushed the fix-default-non-selected-layout-set branch 3 times, most recently from 84b3f7e to d10bc79 Compare October 12, 2023 15:12
@standeren standeren changed the title Set formlayouts only when designview is ready use empty array for layouts if not yet loaded when changing layoutset Oct 12, 2023
@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (d69852b) 82.82% compared to head (524c97f) 82.86%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #11340      +/-   ##
==========================================
+ Coverage   82.82%   82.86%   +0.03%     
==========================================
  Files         838      840       +2     
  Lines       12626    12626              
  Branches     1691     1689       -2     
==========================================
+ Hits        10458    10463       +5     
+ Misses       1906     1901       -5     
  Partials      262      262              
Files Coverage Δ
...tend/packages/shared/src/hooks/useEventListener.ts 100.00% <100.00%> (ø)
...ntend/packages/shared/src/hooks/useLocalStorage.ts 100.00% <100.00%> (ø)
.../shared/src/providers/PreviewConnectionContext.tsx 88.23% <100.00%> (ø)
frontend/packages/shared/src/utils/webStorage.ts 78.57% <ø> (ø)
frontend/packages/ux-editor/src/AppContext.ts 100.00% <100.00%> (ø)
frontend/packages/ux-editor/src/SubApp.tsx 100.00% <100.00%> (ø)
...or/src/components/Elements/LayoutSetsContainer.tsx 95.00% <100.00%> (-5.00%) ⬇️
...tor/src/components/FormComponent/FormComponent.tsx 95.12% <100.00%> (-0.12%) ⬇️
...kages/ux-editor/src/components/Preview/Preview.tsx 86.36% <100.00%> (ø)
...editor/src/components/config/EditFormContainer.tsx 73.07% <100.00%> (+0.34%) ⬆️
... and 17 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@standeren standeren force-pushed the fix-default-non-selected-layout-set branch 2 times, most recently from 1d12ad1 to 84c2988 Compare October 19, 2023 12:20
@standeren standeren marked this pull request as ready for review October 19, 2023 12:21
@standeren standeren force-pushed the fix-default-non-selected-layout-set branch 3 times, most recently from c40fc7a to ab61786 Compare October 19, 2023 12:57
@github-actions github-actions bot added the quality/testing Tests that are missing, needs to be created or could be improved. label Oct 19, 2023
@standeren standeren force-pushed the fix-default-non-selected-layout-set branch 2 times, most recently from e8d00dd to 4816a5d Compare October 20, 2023 10:59
@standeren standeren force-pushed the fix-default-non-selected-layout-set branch 5 times, most recently from 1c9bf28 to ef9b271 Compare October 22, 2023 11:57
@standeren standeren self-assigned this Oct 22, 2023
@TomasEng TomasEng assigned TomasEng and unassigned standeren Oct 24, 2023
@TomasEng TomasEng self-requested a review October 24, 2023 07:14
Copy link
Contributor

@TomasEng TomasEng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mye bra opprydning her! Det hadde vært fint om vi kunne laget en test på event-lytteren. Dette er en algoritme som vi bruker flere steder, så jeg forslår at vi gjør det til en egen hook, som i designsystemet: https://github.com/digdir/designsystem/blob/main/packages/react/src/hooks/useEventListener.ts

@TomasEng TomasEng assigned standeren and TomasEng and unassigned TomasEng Oct 24, 2023
Copy link
Contributor

@TomasEng TomasEng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Veldig bra! Får du kjørt Cypress-testene lokalt? Det er endringer i mange filer her, så det hadde vært fint å verifisere at det ikke brekker noe.
Enhetstester har du fikset så langt det lar seg gjøre, så punktet om automatisert test kan du krysse av for 🙂

@standeren standeren force-pushed the fix-default-non-selected-layout-set branch from 5e328f3 to 524c97f Compare October 26, 2023 10:39
@standeren standeren merged commit 3ea9103 into master Oct 26, 2023
15 checks passed
@standeren standeren deleted the fix-default-non-selected-layout-set branch October 26, 2023 10:58
nkylstad pushed a commit that referenced this pull request Nov 1, 2023
…#11340)

* Set layouts as empty array if not loaded yet

* Move selected layout set to global ux-editor context

* fix tests

* Add tests

* Move MapIformLayoutsToLayouts outside of comopnent

* Filter out eventlistener on window from useLocalStorage hook to separate useReactiveLocalStorage hook
nkylstad pushed a commit that referenced this pull request Nov 5, 2023
…#11340)

* Set layouts as empty array if not loaded yet

* Move selected layout set to global ux-editor context

* fix tests

* Add tests

* Move MapIformLayoutsToLayouts outside of comopnent

* Filter out eventlistener on window from useLocalStorage hook to separate useReactiveLocalStorage hook
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. quality/testing Tests that are missing, needs to be created or could be improved. solution/studio/designer Issues related to the Altinn Studio Designer solution.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants