Skip to content

fix!: changes casing of admin views config to reflect types - #7643

Merged
jacobsfletch merged 1 commit into
beta-nextfrom
fix/view-casing
Aug 13, 2024
Merged

jacobsfletch merged 1 commit into
beta-nextfrom
fix/view-casing

Conversation

@jacobsfletch

@jacobsfletch jacobsfletch commented Aug 13, 2024 •

Copy link
Copy Markdown
Member

Description

Custom views and tabs are now fully config objects, no longer accepting raw components on their root keys as the capital casing might suggest. To better reflect this change semantically, these keys are now lowercase to indicate they are in fact config objects and never components themselves. Similar to the change made to view tabs here: c4c5cee

Breaking change:

Old:

// collection.ts
{
  // ...
  admin: {
    views: {
      Edit: {
        Default: MyDefaultView,
        CustomView: {
          // ...
          Tab: MyCustomTab
        }
      },
      List: MyListView
    }
  }
}

New:

// collection.ts
{
  // ...
  admin: {
    views: {
      edit: {
        default: {
          Component: 'path-to-my-default-view'
        },
        customView: {
          // ...
          tab: {
            Component: 'path-to-my-custom-tab'
          }
        }
      },
      list: {
        Component: 'path-to-my-custom-view'
      }
    }
  }
}
  • I have read and understand the CONTRIBUTING.md document in this repository.

@jacobsfletch jacobsfletch changed the title fix!: changes casing of admin views to reflect types fix!: changes casing of admin views config to reflect types Aug 13, 2024
@jacobsfletch
jacobsfletch merged commit 7205153 into beta-next Aug 13, 2024
@jacobsfletch
jacobsfletch deleted the fix/view-casing branch August 13, 2024 04:21
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.

1 participant