Proposal to allow for different views #1462
Closed
TimHal
started this conversation in
Feature Requests & Ideas
Replies: 2 comments
-
This would be an excellent feature to improve the UX for end-userrs. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This proposal is implemented by #2487 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Following up on the discussion with 'digi' frmo the payload discord here, I want to propose the feature of conditional visibility of collections in the admin dashboard, regardless of a collection's read access.
Use Case
Given a fully public website which consists of a section for blog entries and news articles you'd probably want collections like
BlogEntries
andNewsArticles
both with public read access. However, if there are different kinds of editors they might not be interested to see the other collection in their admin dashboard. The same is true for collections and globals that might be public but really only serve a technical purpose.Proposal
Allow users, depending on their role or some other property, to see a different subsection of collections, regardless of their access controls in an intuitive way.
Implementation
I can think of two ways to achieve this
Enrich the config for collections and globals by an
admin.isHidden
field of typeboolean | function
with a function of the same signature asaccess.read
. The default value istrue
but in the function it is possible to accessreq.user
and show/hide collections from the dashboard at runtime.Implement a payload-wide
views
property in the root configuration. The main idea is to take a subset of the collections/globals and give them a name. This approach would be even more flexible as it could perhaps be possible to switch views at runtime - I attached a mockup for this below.Current Solution
I want to point out that it is possible to achieve these results right now by either (a) swapping in your own admin components, or (b) inspecting the query for read access and check if the
id
field is undefined (as gonza.moiguer kindly pointed out, thank you!). However, I would argue that these solutions do not add to payload's awesome DX and require quite some knowledge and work to implement - whereas the proposed solutions could make things quite fast and easy.Beta Was this translation helpful? Give feedback.
All reactions