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

feat: "Upload codelist" functionality in component config #13763

Open
wants to merge 40 commits into
base: main
Choose a base branch
from

Conversation

Konrad-Simso
Copy link
Contributor

Description

Added upload button in for uploading code lists in the component config,
and added a POST route to the backend.

I made the decission to accept trailing commas in uploaded files, as the JsonSerializer takes care of them if specified to do so.

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)

Documentation

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

@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. quality/testing Tests that are missing, needs to be created or could be improved. backend frontend labels Oct 10, 2024
@Konrad-Simso Konrad-Simso linked an issue Oct 10, 2024 that may be closed by this pull request
2 tasks
Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.28%. Comparing base (2f17f0a) to head (34cbb40).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13763   +/-   ##
=======================================
  Coverage   95.27%   95.28%           
=======================================
  Files        1635     1636    +1     
  Lines       21828    21869   +41     
  Branches     2567     2570    +3     
=======================================
+ Hits        20796    20837   +41     
  Misses        787      787           
  Partials      245      245           

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

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.

Dette er en veldig god start. Jeg har noen kommentarer som først og fremst gjelder generelle kodeprinsipper. Her er hovedpunktene:

  • Se på navngivning (jeg har noen forslag)
  • Funksjonalitet som ikke er avhengig av hooks trenger heller ikke å være definert i hooks
  • Del opp funskjonene slik at de ikke gjør flere ting på én gang
  • Fjern oppskriften for opplasting av kodeliste i Gitea - denne trenger vi ikke nå som det kan gjøres direkte i Studio

@standeren, kan du ta en kikk på backendkoden?

- add try catch logic in backend to return correct response to frontend.
- Edit validation logic in frontend for valid file name.
- Select uploaded file on success
- try catch all exceptions and return error message.
- Validation for options after being deserialized.
- Rename in queriesMock.ts.
- Reformat foreach and if into where statement.
- Adjust padding on link
- Edit nativeSelect size to small.
- Removed test as the content/alert has been removed in a prior commit.
- Removed test-id from tests as it also has been removed from the current solution.
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.

Dette ble mye bedre nå som vi har refaktorert filopplastingskomponenten. Jeg tenker at vi fortsatt bør jobbe litt med valideringensfunksjonaliteten. Jeg tror også at det er på høy tid å dele opp EditCodeList i mindre komponenter, for den har mange forskjellige betingelser den må håndtere.

@github-actions github-actions bot added the area/data-modeling Area: Related to data models - e.g. create, edit, use data models. label Oct 16, 2024
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.

Nå begynner dette å bli veldig bra! EditCodeList ble mye ryddigere nå. Har bare noen siste små forslag.

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.

Utmerket arbeid!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/data-modeling Area: Related to data models - e.g. create, edit, use data models. area/ui-editor Area: Related to the designer tool for assembling app UI in Altinn Studio. backend frontend 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. team/studio-domain1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Upload codelist" functionality in component config
3 participants