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

Rename data type to "organization" to match data in store #959

Merged
merged 1 commit into from
Mar 1, 2023

Conversation

mariepauline
Copy link
Contributor

Description

Different spelling of type organization causes the data to be inaccessible in code. In the store "organization" is used and this PR renames every instance of the word to this.

Redux store:
image

This is just a suggestion, but I thought it was better to provide a fix than to just create an issue.

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
  • Changes/additions to component properties
    • Changes are reflected in both src/layout/layout.d.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
    • I don't have permissions to do that, please help me out
    • Not relevant
  • 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

@olemartinorg olemartinorg added the community-contribution-❤️ Pull request from developers outside the Altinn teams. label Feb 27, 2023
@olemartinorg
Copy link
Contributor

@mariepauline
Hi, and thanks for the contribution! 🙏 I checked one of the renamed locations, and in the applicationmetadata.json file, we set partyTypedAllowed.organisation (not organization) so this PR would seemingly break that functionality when we're loading the file from existing apps. Maybe you could limit the PR to just rename the places affected, and/or describe the problem you're having? Thanks again!

@mariepauline
Copy link
Contributor Author

@olemartinorg Yes, I can look into limiting the changes :)

The problem is when trying to access data about organization from state.
image
organisation on IParty becomes undefined currently, since it is called organization in the store. I haven't dived too much into where the mismatch happens but a rename seems to fix it.
image

The naming of organisation was set 3 years ago, so maybe there is another way to change it to make it work? I guess the only thing that's important is that it is the same all over

@mariepauline
Copy link
Contributor Author

I see that in order for just making this work, it's possible to just change in IParty (and where it is used), but then there is a mismatch in the repo so it is not a very good long term solution.
image

@olemartinorg
Copy link
Contributor

The problem is when trying to access data about organization from state

This is the first time I'm hearing of someone relying on our internal state! 🤔 We have no stability guarantees on that (on the contrary, it's pretty much guaranteed to change). I'd love to hear more about what you are working on, and in what way you're building on our baseline app frontend. 😊 If the redux state is something we should take care to keep somewhat backwards stable as a contract to your project(s), that could affect our roadmap/backlog, as we have concrete suggestions to change it (see #345).

it's possible to just change in IParty (and where it is used), but then there is a mismatch in the repo so it is not a very good long term solution

If by mismatch, you mean that it's spelled differently different places, I think we'll just have to live with that. We should be careful when rolling out backwards incompatible changes, and I don't think uniform spelling is a good enough justification for that. I agree that changing the property name in IParty should be good enough for this specific issue. 🙏

@mariepauline
Copy link
Contributor Author

@olemartinorg Well, we're not really 😅 I'm just playing around with the code to see how we can start on our app for Brønnøysundregistrene. So a meeting where we can present our case would be great! 😄
I just found the problem and we thought we could flag it, but we are not blocked by it so it is no rush for us to have it fixed.

@olemartinorg
Copy link
Contributor

I see! Looking forward to hear more about your project. 🤩

As for this issue, if you reduce the change to renaming the property in IParty, I'll gladly approve it and merge it into main. 😁 Thanks for finding this problem and figuring it out!

@olemartinorg
Copy link
Contributor

@mariepauline I'm marking this as draft for now. Go ahead and mark it ready for review if you get around to it again, or let me know if you want to close it.

@mariepauline mariepauline force-pushed the bug/org-spelling-error branch from 297a4d4 to 1a3ed44 Compare February 28, 2023 14:22
@mariepauline mariepauline marked this pull request as ready for review February 28, 2023 14:58
@mariepauline
Copy link
Contributor Author

@olemartinorg I have now changed only IParty and tested it as well as I could

@olemartinorg olemartinorg merged commit 14341a8 into Altinn:main Mar 1, 2023
@olemartinorg olemartinorg added the kind/bug Something isn't working label Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution-❤️ Pull request from developers outside the Altinn teams. kind/bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants