Arkisto-Platform / describo-online

https://describo.github.io
GNU General Public License v3.0
7 stars 2 forks source link

[Bug] Filebrowser selects parent folders #44

Closed juriroemer closed 2 years ago

juriroemer commented 2 years ago

I presume this is not intended behavior.

Steps to reproduce:

  1. Have a ressource with at least one folder containing at least one file.
  2. Go to Manage Collection Data Files.
  3. Expand folder in tree, select only the file contained in folder.
  4. A dataset corresponding to the name of the folder, containing the selected file, will be added to the collection.

Expected behavior: Only the selected file will be added to the collection, as it happens with file that are located in the root folder.

This might be related to this Element UI bugreport.

marcolarosa commented 2 years ago

This is not a bug.

The RO Crate spec says that files are referenced by their path. So if you add a file in the path (relative to the root) a/file.txt then it has to be written into the crate as a/file.txt - not just file.txt.

So folders are created as @type Dataset and files as @type File.

See: https://www.researchobject.org/ro-crate/1.1/data-entities.html#file-data-entity

juriroemer commented 2 years ago

I see, thanks for the clarification! I initially noticed this when I tested setting the FileBrowser to always be check-strictly which gave wonky results in openDirectory mode - where the parent folder got selected instead of the folder I intended to select. So I just assumed this would be correlated. Of course check-strictlydoesn't make any sense in openDirectory mode and even if the bug I linked is still there, it doesn't impact Describo.

Cool!