Skip to content

Commit

Permalink
Fix list.ui.hide* functionality (#9217)
Browse files Browse the repository at this point in the history
Co-authored by Tommi Virtanen <tv@eagain.net>
  • Loading branch information
dcousens authored Jul 17, 2024
1 parent 3fdc7d4 commit 5ee45ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/fix-hide-ui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@keystone-6/core': patch
---

Fix `list.ui.hide*` defaulting to false when GraphQL is omitted
8 changes: 2 additions & 6 deletions packages/core/src/lib/create-admin-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,8 @@ export function createAdminMeta (
// TODO: probably remove this
itemQueryName: listKey,
listQueryName: list.graphql.namePlural, // TODO: remove
hideCreate: normalizeMaybeSessionFunction(
list.graphql.isEnabled.create ? listConfig.ui?.hideCreate ?? false : false
),
hideDelete: normalizeMaybeSessionFunction(
list.graphql.isEnabled.delete ? listConfig.ui?.hideDelete ?? false : false
),
hideCreate: normalizeMaybeSessionFunction(listConfig.ui?.hideCreate ?? !list.graphql.isEnabled.create),
hideDelete: normalizeMaybeSessionFunction(listConfig.ui?.hideDelete ?? !list.graphql.isEnabled.delete),
isHidden: normalizeMaybeSessionFunction(listConfig.ui?.isHidden ?? false),
}

Expand Down

0 comments on commit 5ee45ae

Please sign in to comment.