Skip to content

fix: remove unsupported path property from default document view configs #12774

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

Merged
merged 6 commits into from
Jun 12, 2025

Conversation

jacobsfletch
Copy link
Member

@jacobsfletch jacobsfletch commented Jun 11, 2025

Customizing the path property on default document views is currently not supported, but the types suggest that it is. You can only provide a path to custom views. This PR ensures that path cannot be set on default views as expected.

For example:

import type { CollectionConfig } from 'payload'

export const MyCollectionConfig: CollectionConfig = {
  // ...
  admin: {
    components: {
      views: {
        edit: {
          default: {
            path: '/' // THIS IS NOT ALLOWED!
          },
          myCustomView: {
            path: '/edit', // THIS IS ALLOWED!
            Component: '/collections/CustomViews3/MyEditView.js#MyEditView',
          },
        },
      },
    },
  },
}

For background context, this was deeply explored in #12701. This is not planned, however, due to performance and maintainability concerns, plus there are alternatives to achieve this.

This PR also fixes and improves various jsdocs, and fixes a typo found in the docs.


@jacobsfletch jacobsfletch changed the title fix: remove unsupported path property from default document view types fix: remove unsupported path property from default document view configs Jun 11, 2025
@jacobsfletch jacobsfletch merged commit f64a0ae into main Jun 12, 2025
77 checks passed
@jacobsfletch jacobsfletch deleted the fix/doc-view-config-types branch June 12, 2025 13:01
Copy link
Contributor

🚀 This is included in version v3.43.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants