Skip to content
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

Add folder support to File Library #228

Closed
benhaynes opened this issue Apr 20, 2018 · 12 comments

Comments

@benhaynes
Copy link
Member

commented Apr 20, 2018

  1. Folders should always be displayed at the top, BEFORE files.

  2. We need to add the header bar to this listing page (same height as tabular). This would show the folder breadcrumb and a "Add Folder" button.

  3. Folders should have the ability to be renamed – maybe they have a edit button on the card/tile for now (we can add right-click context menus later).

  4. When dragging a file/folder onto it, it should switch to the OPEN folder icon.

directus 7 file library

@benhaynes benhaynes added this to the 7.0 (Lepus Arcticus) milestone Apr 20, 2018

@rijkvanzanten rijkvanzanten removed this from the 7.0 (Lepus Arcticus) milestone Apr 20, 2018

@rijkvanzanten rijkvanzanten added this to To do in v7.0.0-alpha.2 Apr 23, 2018

@benhaynes benhaynes moved this from To do to Corner of Hope in v7.0.0-alpha.2 Apr 24, 2018

@benhaynes benhaynes added this to To do in v7.0.0-alpha.3 Apr 30, 2018

@rijkvanzanten rijkvanzanten moved this from To do to In progress in v7.0.0-alpha.3 May 1, 2018

@rijkvanzanten rijkvanzanten moved this from In progress to To do in v7.0.0-alpha.3 May 1, 2018

@benhaynes benhaynes removed this from To do in v7.0.0-alpha.3 May 1, 2018

@dur41d

This comment has been minimized.

Copy link

commented Nov 30, 2018

Any update on this?

@benhaynes

This comment has been minimized.

Copy link
Member Author

commented Nov 30, 2018

It's on the roadmap as a priority but there's no ETA set. We'd love a PR from the community, otherwise we'll probably have it in late December or January.

@nstCactus

This comment has been minimized.

Copy link
Contributor

commented Jan 3, 2019

It would also be nice to have an option to the single file & multiple files interfaces to restrict it to a specific folder.

@benhaynes

This comment has been minimized.

Copy link
Member Author

commented Jan 3, 2019

Ohh, I like that @nstCactus! Perhaps two options:

default folder — Root by default, but can be updated to others
change foldertrue by default, but can be turned off to "lock" the interface to the default folder

@stale

This comment has been minimized.

Copy link

commented Mar 4, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 4, 2019

@benhaynes benhaynes removed the stale label Mar 4, 2019

@andriipol

This comment has been minimized.

Copy link

commented Apr 18, 2019

Hello, everybody, any updates on this issue?

@benhaynes

This comment has been minimized.

Copy link
Member Author

commented Apr 18, 2019

The API already supports this — so that main thing we're missing is: supporting drag-and-drop on the Tiles Layout (needed to drag files/folders into folders). We have a bit of a feature-freeze (internally)while we do some refactors, ports, and stability improvements... so this would need to be a community PR to get it done in the next few months.

We like this library for supporting dragging: http://interactjs.io/ ... maybe someone wants to take a stab at this? We have designs but need someone who can get a clean implementation here:

https://github.com/directus/app/tree/master/src/layouts/cards

@benhaynes benhaynes unpinned this issue Apr 21, 2019

@justrealmilk

This comment has been minimized.

Copy link
Contributor

commented May 5, 2019

I was about to open an issue for exactly this! Then thought I should check for others as it's not exactly a crazy new idea.

@rijkvanzanten rijkvanzanten added this to Proposed in Feature Requests via automation May 20, 2019

@rijkvanzanten

This comment has been minimized.

Copy link
Member

commented May 20, 2019

To achieve better clarity/visibility, we are now tracking feature requests within the Feature Request project board.

This issue being closed does not mean it's not being considered.

@Nitwel

This comment has been minimized.

Copy link
Member

commented May 27, 2019

Hey, when this is supported by the api side already, lets get things started!
I'm 💯 % looking into adding this feature and would like to work on it.

@rijkvanzanten could we talk about the implementation of this, this midday/afternoon?

@rijkvanzanten

This comment has been minimized.

Copy link
Member

commented May 28, 2019

Hey @Nitwel

There already exists a directus_folders collection so all the work that needs to be done to support this is in the application. Each file would point to a folder in directus_folders. Another question right now is: should every (user) collection support folders? @benhaynes thoughts?

@benhaynes

This comment has been minimized.

Copy link
Member Author

commented May 28, 2019

I think that this feature of grouping/nesting should be allowed for any collection, but that only directus_files should be using directus_folders.

However, if you wanted to add groups to other collections that should be possible too with the following configuration:

  • grouping collection — the collection that is used for grouping, eg directus_folders
  • grouping parent field — the FK field in the grouping collection, eg directus_folders.parent
  • grouping key field — the FK field in the target collection, eg directus_files.folder

Folders for Custom Collections

By creating projects and project_folders collections you should be able to group things deeply nested just like Files.

M2O Grouping

These folders are basically M2Os, so that should work too. To group a projects collection by an existing clients collection by choosing the clients collection and the field that stores the foreign key: projects.client. Additionally, you should be able to include a clients.parent field that lets you nest sub-projects (same as nested File Folders).

Self-Referential

Again, just another example of the same thing. If you had a collection that could refer to itself you could configure it to allow nesting. For example you might have labels with labels.parent. Given this model you could relate an item to itself... but we'd need a way to differentiate clicking on the item to open its Item Detail vs clicking an item to open its nested grouping. This is not important and can come later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
7 participants
You can’t perform that action at this time.