Closed romicolman closed 5 days ago
Moving back to the backlog since this involves getting more familiar with the zustand store and I need more time to become familiar with it.
There is a multiSelect
prop that can be passed to the TreeView component but I need more familiarity with the store to continue. I suggest @roll works on this task for now. I will get into tasks like this later on.
@romicolman @guergana I would call it a feature, to be honest.
@roll Can you estimate how much effort this would take? I am thinking of people working on Governments who upload datasets to publish in CKAN and have several files/projects in the ODE. This is key to manage files within the tool.
Note: I replaced the bug label with feature :)
@romicolman I think the size is 1-2 days
Let's go for it! :) Can you guide @guergana to work on this?
@guergana
@romicolman
I think it will require reworking components/Application/store.ts
to support multiple active files (while not breaking the selected file logic). I've updated the Tech Effort to 3 but it might be even 5 as I see it now. Anyway, probably a good issue to get used to Zustand and TreeView
@guergana @romicolman I think it will require reworking
components/Application/store.ts
to support multiple active files (while not breaking the selected file logic). I've updated the Tech Effort to 3 but it might be even 5 as I see it now. Anyway, probably a good issue to get used to Zustand and TreeView
Yeah, I am not sure this is the best issue for me now since I am still more or less onboarding. I might need your help at some point @roll
@guergana Sure! Anyway it's in the backlog for now
@roll / @guergana: I'm moving this issue to Sprint 3, since it requires more in-depth conversations.
@guergana @roll what if we approach this issue without changing the current path
and selected file logic.
I'm proposing:
path
as the main logic for the active file.selectedFiles
that trigger logics of highlighting in the tree view.Create/Update the delete logic to include selectedFiles if exist.
I do not think we need to go for massive refactoring of the current store
to handle "Multiple Active Files" if our goal is to just delete multiple files.
One thing is to have "Multiple Active Files" that can trigger actions like multiple windows, bulk edition, diff, etc. And another thing is to keep track of what the user is selecting in the TreeView and then do something about it (without the hassle of considering all of them "active files").
So, long story short: Why don't we go for "One Active File" but implement "Multiple Selections In Tree View".
MUI already comes with a component to design File Explorers (with multiple selection): https://mui.com/x/react-tree-view/rich-tree-view/customization/#file-explorer
Maybe we can use RichTreeView instead of just TreeView?
@guergana @roll what if we approach this issue without changing the current
path
and selected file logic.I'm proposing:
1. Keep using `path` as the main logic for the active file. 2. Add a new state for `selectedFiles` that trigger logics of highlighting in the tree view. 3. Create/Update the delete logic to include selectedFiles if exist.
I do not think we need to go for massive refactoring of the current
store
to handle "Multiple Active Files" if our goal is to just delete multiple files.One thing is to have "Multiple Active Files" that can trigger actions like multiple windows, bulk edition, diff, etc. And another thing is to keep track of what the user is selecting in the TreeView and then do something about it (without the hassle of considering all of them "active files").
So, long story short: Why don't we go for "One Active File" but implement "Multiple Selections In Tree View".
This aproach worked for me in the end!!! Yei. :100:
MUI already comes with a component to design File Explorers (with multiple selection): https://mui.com/x/react-tree-view/rich-tree-view/customization/#file-explorer
Maybe we can use RichTreeView instead of just TreeView?
@pdelboca we could propose this in a different ticket as an investigation. What do you think? In the Tree view there's also the multiSelect
feature that's activated with a prop. The difficult part here for me was making it work with the current store. So I think the challenge would be the same if we switch to RichTreeView. If you see any other advantages for the change we could go on with the investigation.
@romicolman I can't delete a folder and a file at the same time. can you do it?
I cannot test this on my laptop. Let's have a quick call tomorrow and I'll add a follow-up comment here later.
Problem description
Let's say you add a 5 files to the ODE and you want to delete a couple of them. Right now, you have to do it one by one. It is not possible to select more than one by using Ctrl + Select.
Screen:
Steps to reproduce it
Suggested solution
Allow Ctrl + Select on the tool.