OBPIH-7269 Add Import Count Widget#5277
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5277 +/- ##
============================================
- Coverage 8.38% 8.31% -0.07%
+ Complexity 996 985 -11
============================================
Files 646 646
Lines 43397 43397
Branches 10535 10535
============================================
- Hits 3637 3607 -30
- Misses 39195 39231 +36
+ Partials 565 559 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| const getFileExtension = (file) => file.name.split('.')?.[1]; | ||
|
|
||
| const validateFileType = (file) => { | ||
| if (allowedExtension === getFileExtension(file)) { |
There was a problem hiding this comment.
since this is a generic component, why not have it work like the FileSelect and allow for multiple possible file extensions? Seems like you could just copy/paste the code from there. It would give us more flexibility in the future
| import useTranslate from 'hooks/useTranslate'; | ||
| import Translate from 'utils/Translate'; | ||
|
|
||
| const ButtonFileSelect = ({ |
There was a problem hiding this comment.
How is this component working differently from the FileSelect one? Is it just that the behaviour is wrapped in a button instead of being directly embedded in the page? If so, what's preventing the ButtonFileSelect from simply wrapping the FileSelect compoment? Why do we need both?
Can you add a screenshot of the widget to the PR description? That would be helpful for visualizing the change.
There was a problem hiding this comment.
Those two components have totally different UI. The FileSelect is a drop zone for files. In that case, you just have a button.
Screencast from 26.05.2025 13:09:18.webm
| import useTranslate from 'hooks/useTranslate'; | ||
| import Translate from 'utils/Translate'; | ||
|
|
||
| const ButtonFileSelect = ({ |
There was a problem hiding this comment.
Since we have different components for "Button" and "Dropzone", then perhaps the other one should be renamed to DropzoneFileSelect too.
No description provided.