-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Upload whole folders, preserving the nested structure with FileSelector #2189
Comments
I think I might need some help. I can get the folder structure with
This works fine, but when I declare
, as ssuggested here: facebook/react#3468 (comment), the folder selector stays activated in the final HTML, regardless, whether If I declare it like so:
the folder selector never appears, even when present in the markdown command chain. I initially tried to set the property to a boolean, but it seems this does not work with React, as it never appears. A workaround I could picture would be the creation of a separate uploader, but this seems overkill to me. |
Ok, I think I got it handled now. It seems I can make a string argument disappear by giving it nothing (like not even None). |
webkitdirectory is supposed to be a boolean |
Yes it is supposed to be like that, but React will not accept it as such. Believe me, I've tried, and I don't know whether I missed something, but others have seemingly failed as well: facebook/react#3468 (comment) |
you can do it like this for now
|
…ders (#2206) * Added webkitdirectory to FileSelector * Added webkitdirectory to factory + testing output in file uploader * Added webkitdirectory to viselelments.json * Build files * Extended InputHTML Attributes to include webkitdirectory * Extended InputHTML Attributes to include webkitdirectory * Package locks * Added webkitRealtivePath to saved blob properties * Handle webkitdirectory correctly as a string * Added test for webkitdirectory support * Addressed linting: E501 + W292 * Addressed failing jest test. * Changed naming scheme; Used directory to cirumvent naming limitations of React's attribute naming; Adjusted tests for addition of other attributes. * Added comments to __upload_files() in gui.py; Simplified checks in __upload_files (addresses linter C901) . * Edited styling of CONTRIBUTING.md for better readability and clarity in execution. * Normed path * Changed naming Scheme; Added integration of other directory attributes and changed attribute to boolean. * Added mandatory case information for python to CONTRIBUTING.md * Fixed testing caseing. * Addressed stylistic errors: "W291 [*] Trailing whitespace"; "E711 Comparison to `None` should be `cond is None`"; "W293 [*] Blank line contains whitespace" * Removed unnecessary ignore * Deleted unnecessary package-lock * Restored original package.json in frontend/taipy * Added test for folder upload. * Check whether the final directory is a child of the root upload directory. * Fixed check for upload staying inplace; removed print from test * Changed path testing to string testing. * Addressed linter errors. * Addressed C901 `__upload_files` is too complex (19 > 18) * Changed unnecessary files to match latest origin commit 37b924f05aba1c814c75098c8ec1750a74e3770 * Changed naming of select_folder to selection_type * Fixed spelling error; Removed default setting of property; Accounted for different input casing; --------- Co-authored-by: Fred Lefévère-Laoide <[email protected]> Co-authored-by: JosuaCarl <[email protected]>
Description
When I want to process MS data, some manufacturers provide the output as folders, with which I want my application to interact. I can however not upload folders as a whole with the file_selector. This limits my ability to integrate my pipeline.
Solution Proposed
Impact of Solution
The ability to exclude subfolders (for example via a regular expression or glob) could be important for use cases that want to upload parts of projects.
Additional Context
The folder structure is defined here:
https://github.com/Avaiga/taipy/blob/26e11259c7bce1e04d050460d91323805f4498c9/taipy/gui/gui.py#L1010C1-L1011C4
The FileSelector is implemented here:
taipy/frontend/taipy-gui/src/components/Taipy/FileSelector.tsx
Lines 61 to 73 in a131486
and the HTML Element is defined here:
https://github.com/Avaiga/taipy/blob/a131486fbe938acff9de2b0b3961158117b37458/frontend/taipy-gui/src/components/Taipy/FileSelector.tsx#L189C1-L199C13
Acceptance Criteria
Code of Conduct
The text was updated successfully, but these errors were encountered: