-
Notifications
You must be signed in to change notification settings - Fork 70
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
Conversation
… in AltinnAppGitRepository.
Added tests for Utils file.
… with current logic
Move variable in tests
Codecov ReportAttention: Patch coverage is
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. |
There was a problem hiding this 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?
...packages/ux-editor/src/components/config/editModal/EditOptions/EditCodeList/EditCodeList.tsx
Show resolved
Hide resolved
...packages/ux-editor/src/components/config/editModal/EditOptions/EditCodeList/EditCodeList.tsx
Outdated
Show resolved
Hide resolved
...packages/ux-editor/src/components/config/editModal/EditOptions/EditCodeList/EditCodeList.tsx
Outdated
Show resolved
Hide resolved
...packages/ux-editor/src/components/config/editModal/EditOptions/EditCodeList/EditCodeList.tsx
Outdated
Show resolved
Hide resolved
...es/ux-editor/src/components/config/editModal/EditOptions/EditCodeList/useValidateFileName.ts
Outdated
Show resolved
Hide resolved
...ges/ux-editor/src/components/config/editModal/EditOptions/EditCodeList/EditCodeList.test.tsx
Outdated
Show resolved
Hide resolved
...packages/ux-editor/src/components/config/editModal/EditOptions/EditCodeList/EditCodeList.tsx
Outdated
Show resolved
Hide resolved
...packages/ux-editor/src/components/config/editModal/EditOptions/EditCodeList/EditCodeList.tsx
Outdated
Show resolved
Hide resolved
...packages/ux-editor/src/components/config/editModal/EditOptions/EditCodeList/EditCodeList.tsx
Outdated
Show resolved
Hide resolved
...-editor/src/components/config/editModal/EditOptions/EditCodeList/useValidateFileName.test.ts
Outdated
Show resolved
Hide resolved
…act hook into EditCodeList.tsx
- 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.
There was a problem hiding this 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.
frontend/packages/ux-editor/src/hooks/mutations/useAddOptionMutation.test.ts
Outdated
Show resolved
Hide resolved
...packages/ux-editor/src/components/config/editModal/EditOptions/EditCodeList/EditCodeList.tsx
Outdated
Show resolved
Hide resolved
...packages/ux-editor/src/components/config/editModal/EditOptions/EditCodeList/EditCodeList.tsx
Outdated
Show resolved
Hide resolved
...packages/ux-editor/src/components/config/editModal/EditOptions/EditCodeList/EditCodeList.tsx
Outdated
Show resolved
Hide resolved
...itor/src/components/config/editModal/EditOptions/EditCodeList/Utils/validateFileNameUtils.ts
Outdated
Show resolved
Hide resolved
...packages/ux-editor/src/components/config/editModal/EditOptions/EditCodeList/EditCodeList.tsx
Outdated
Show resolved
Hide resolved
- Refactor EditCodeList.tsx - Edit Language - Rename useAddOptionMutation.test.ts -> useAddOptionListMutation.test.ts
File cannot be falsy as `StudioFileUploader.tsx` has a check before running onSubmit.
There was a problem hiding this 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.
...packages/ux-editor/src/components/config/editModal/EditOptions/EditCodeList/EditCodeList.tsx
Outdated
Show resolved
Hide resolved
...packages/ux-editor/src/components/config/editModal/EditOptions/EditCodeList/EditCodeList.tsx
Outdated
Show resolved
Hide resolved
...packages/ux-editor/src/components/config/editModal/EditOptions/EditCodeList/EditCodeList.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pent! 😄
Testet OK
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
Documentation