-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat(ui): supports collection scoped folders #12797
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
base: main
Are you sure you want to change the base?
Conversation
… to cards
…ass validation
…e of the new scope
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖
Largest pathsThese visualization shows top 20 largest paths in the bundle.Meta file: packages/next/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js
Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js
DetailsNext to the size is how much the size has increased or decreased compared with the base branch of this PR.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this manually and it looked great!
The test coverage gives me confidence.
I found a few nit-picks in the code.
The only thing other thing not 100% sure on is the name of the new field, "Folder Type". If a user overrides the label on their folders feature, this makes little sense.
breadcrumbsPromise, | ||
documentAndSubfolderPromise, | ||
]) | ||
|
||
return { | ||
breadcrumbs, | ||
documents: documentsAndSubfolders.documents, | ||
subfolders: documentsAndSubfolders.subfolders, | ||
documents: sortDocs({ docs: result.documents, sort }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the kind of thing that I thought the DB adapters would help us with because we are using the join field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is possible, the folders collection and all related document types would need to have a name
field for sort and pagination to work together on the join field. We cannot guarantee that, which reminds me why I think we should query docs separately in the future. This would allow for proper sorting and pagination since each collection would be in charge of their own querying — topic for a later date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we queried them separately then we would also be able to have more sensible tables that can show more than name/createdAt/updatedAt.
I agree with |
As discussed in this RFC, this PR supports collection-scoped folders. You can scope folders to multiple collection types or just one.
This unlocks the possibility to have folders on a per collection instead of always being shared on every collection. You can combine this feature with the
browseByFolder: false
to completely isolate a collection from other collections.Things left to do:
Create a custom react component for the selecting of collectionSlugs to filter out available options based on the current folders parametersfolders-per-collection.mp4