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

fix(next): cannot override tab of default view #11789

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chmielulu
Copy link

What?

TypeScript says that it is possible to modify the tab of the default view however, when you specify the path to the custom component, nothing happens. I fixed it.

How?

If a Component for the tab of the default view is defined in the config, I return that Component instead of DocumentTab

Example Configuration

config.ts

export const MenuGlobal: GlobalConfig = {
  slug: menuSlug,
  fields: [
    {
      name: 'globalText',
      type: 'text',
    },
  ],
  admin: {
    components: {
      views: {
        edit: {
          api: {
            tab: {
              Component: './TestComponent.tsx',
            },
          },
        },
      },
    },
  },
}

./TestComponent.tsx

const TestComponent = () => 'example'

export default TestComponent

Before

Screenshot 2025-03-20 at 08 42 06

After

Screenshot 2025-03-20 at 08 43 06

@chmielulu chmielulu changed the title fix: cannot override tab of default view fix(next): cannot override tab of default view Mar 20, 2025
@jacobsfletch jacobsfletch self-requested a review March 21, 2025 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant