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

Renaming AddressComponent -> Address + bugfixes, improvements #1761

Merged
merged 21 commits into from
Jan 31, 2024

Conversation

olemartinorg
Copy link
Contributor

@olemartinorg olemartinorg commented Jan 30, 2024

Description

  • Removing StrictMode in unit tests. The reason everything rendered twice in some unit tests was that I didn't read enough about what StrictMode does, and when I saw that it purposely renders everything twice, it's obviously the cause of this problem. The profiler in the browser detects strict mode and fixes the numbers for us.
  • Adding back some commented-out code in Cypress tests (should have been commented back in when validation was rewritten). Hoping it works. 🙏
  • Extracting out a version compare function I implemented in Implementing an error message when backend version is outdated #1745 (thanks for the suggestion @mikaelrss, the function didn't even work correctly).
  • Rewriting RepeatingGroupContext to use Zustand for the core states. This fixes a whole lot of state-keeping issues that could cause the repeating group 'add button' to disappear. I've tried adding tests for it, but wasn't able to ever reproduce it in Cypress for some reason. Still, with this rewrite it all seems to behave better.
  • Renaming AddressComponent -> Address
  • Slowing down the rate of requests for post places in the Address component (it mistakenly sent a request once for every letter the user typed). Added regression tests.
  • Allowing null values in option lists, as per Support number, boolean and null as AppOption values app-lib-dotnet#417. I also extended the data conversion function to allow for schemas with oneOf and anyOf, as it was useful in the unit-test I wrote.

Related Issue(s)

Verification/QA

  • Manual functionality testing
    • I have tested these changes manually
    • Creator of the original issue (or service owner) has been contacted for manual testing (or will be contacted when released in alpha)
    • No testing done/necessary
  • Automated tests
    • Unit test(s) have been added/updated
    • Cypress E2E test(s) have been added/updated
    • No automatic tests are needed here (no functional changes/additions)
    • I want someone to help me make some tests
  • UU/WCAG (follow these guidelines until we have our own)
    • I have tested with a screen reader/keyboard navigation/automated wcag validator
    • No testing done/necessary (no DOM/visual changes)
    • I want someone to help me perform accessibility testing
  • User documentation @ altinn-studio-docs
    • Has been added/updated
    • No functionality has been changed/added, so no documentation is needed
    • I will do that later/have created an issue
  • Support in Altinn Studio
    • Issue(s) created for support in Studio
    • This change/feature does not require any changes to Altinn Studio
  • Sprint board
    • The original issue (or this PR itself) has been added to the Team Apps project and to the current sprint board
    • I don't have permissions to do that, please help me out
  • Labels
    • I have added a kind/* label to this PR for proper release notes grouping
    • I don't have permissions to add labels, please help me out

Ole Martin Handeland added 10 commits January 25, 2024 11:48
…out what StrictMode does, and when I saw that it purposely renders everything twice, it's obviously the cause of this problem. The profiler in the browser detects strict mode and fixes the numbers for us.
… (+ improving it! I think it was broken as-is)
…state to be a bit out of date, and caused expression lookups to fail on text resources when rows were deleted.
…onent, so that we don't send requests for every keystroke
@olemartinorg olemartinorg added the kind/breaking-change Issue/pull request containing a breaking change label Jan 30, 2024
@olemartinorg olemartinorg changed the title Cleanup after rc1 Renaming AddressComponent -> Address + bugfixes, improvements Jan 30, 2024
Ole Martin Handeland added 9 commits January 30, 2024 15:12
…ntaining this state in the context, but it's easy to just figure it out locally
…up-to-date when rewriting). Simplifying the AddButton component, extracting it out from RepeatingGroupContainer so that it doesn't trash React performance/shadow-DOM.
…and reducing re-renders, making extra sure you cannot add rows twice when using openByDefault
…ossible to add an endless amount of new (empty) rows for repeating groups
@olemartinorg olemartinorg marked this pull request as ready for review January 30, 2024 22:23
Copy link
Contributor

@mikaelrss mikaelrss left a comment

Choose a reason for hiding this comment

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

Good work! 👏 I just have some nitpicky comments 😅

src/features/formData/convertData.ts Outdated Show resolved Hide resolved
src/features/options/castOptionsToStrings.ts Outdated Show resolved Hide resolved
src/utils/versionCompare.ts Show resolved Hide resolved
@olemartinorg olemartinorg merged commit 510e8ff into main Jan 31, 2024
5 of 6 checks passed
@olemartinorg olemartinorg deleted the v4-rc-cleanup branch January 31, 2024 08:07
Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

7 New issues
0 Security Hotspots
80.3% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/breaking-change Issue/pull request containing a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename AddressComponent -> Address
2 participants