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

Give server rowIndex for validateRow trigger #682

Merged
merged 4 commits into from
Nov 23, 2022
Merged

Conversation

bjosttveit
Copy link
Member

@bjosttveit bjosttveit commented Nov 21, 2022

Description

  • When using triggers=["validateRow"] the rowIndex will now be sent to the server for validations. Docs have been updated to reflect this.
  • No longer filters out server-validations not related to the current row on validateRow. This was the behaviour only a few days ago, and has been changed back since it is totally legitimate to add validation errors outside of the current group row. The developer is now expected to use the rowIndex in servervalidations to deal with this if necessary. Not really a breaking change, as the validateRow trigger is basically brand new.
  • Previously, the group validation trigger would not dispatch an update to validations unless there were new errors present. This was a problem because the server could send back validations that had been fixed, and they would not be updated if there were no new errors. This has been changed so that it always dispatches an update to validations. Also should not be a breaking change, since dispatching no new errors should not make a difference, and no existing tests failed 🤷

Related Issue(s)

Verification

  • Manual testing
    • I have tested these changes manually
    • Creator of the original issue (or service owner) has been contacted for manual testing
    • No testing done/necessary
  • Automated tests
    • Unit test(s) have been added
    • Cypress E2E test(s) have been added
    • No automatic tests are needed here
    • I want someone to help me make some tests
  • User documentation @ altinn-studio-docs
    • No changes/updates needed
  • Changes/additions to component properties
    • Changes are reflected in both layout/index.ts and layout.schema.v1.json, and these are all backwards-compatible
    • No changes made
  • 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

@ivarne
Copy link
Member

ivarne commented Nov 21, 2022

Can’t there be multiple row indexes? Like in a nested group?

@bjosttveit
Copy link
Member Author

Can’t there be multiple row indexes? Like in a nested group?

Right, I suppose you do need the parent's row-index as well if a nested group has the trigger

@bjosttveit bjosttveit marked this pull request as draft November 21, 2022 14:26
@bjosttveit bjosttveit marked this pull request as ready for review November 22, 2022 13:39
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@bjosttveit bjosttveit merged commit b12cbe6 into main Nov 23, 2022
@bjosttveit bjosttveit deleted the validate-row-server branch November 23, 2022 08:00
@bjosttveit bjosttveit added the kind/product-feature Pull requests containing new features label Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/product-feature Pull requests containing new features
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants