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

Merged
merged 43 commits into from
Oct 22, 2024

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

Attention: Patch coverage is 95.31250% with 3 lines in your changes missing coverage. Please review.

Project coverage is 95.29%. Comparing base (5c1e97e) to head (a853e5f).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...ditModal/EditOptions/EditCodeList/EditCodeList.tsx 91.42% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13763      +/-   ##
==========================================
- Coverage   95.30%   95.29%   -0.01%     
==========================================
  Files        1652     1653       +1     
  Lines       21980    22024      +44     
  Branches     2585     2589       +4     
==========================================
+ Hits        20947    20988      +41     
- Misses        787      790       +3     
  Partials      246      246              

☔ 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.
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!

- Added a more specific error message when upload fails.
Copy link
Contributor

@ErlingHauan ErlingHauan left a comment

Choose a reason for hiding this comment

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

Pent! 😄
Testet OK

@ErlingHauan ErlingHauan merged commit 4333644 into main Oct 22, 2024
16 checks passed
@ErlingHauan ErlingHauan deleted the feature/codelist-configuration branch October 22, 2024 12:38
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