diff --git a/examples/assets-local/schema.graphql b/examples/assets-local/schema.graphql index 8decd12c11e..556ef1afc7d 100644 --- a/examples/assets-local/schema.graphql +++ b/examples/assets-local/schema.graphql @@ -295,7 +295,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/assets-s3/schema.graphql b/examples/assets-s3/schema.graphql index 8decd12c11e..556ef1afc7d 100644 --- a/examples/assets-s3/schema.graphql +++ b/examples/assets-s3/schema.graphql @@ -295,7 +295,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/auth/schema.graphql b/examples/auth/schema.graphql index 2c642a9c1de..ada8f01c270 100644 --- a/examples/auth/schema.graphql +++ b/examples/auth/schema.graphql @@ -173,7 +173,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/basic/schema.graphql b/examples/basic/schema.graphql index c40d8061a73..02a92c6e8ef 100644 --- a/examples/basic/schema.graphql +++ b/examples/basic/schema.graphql @@ -464,7 +464,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/blog/schema.graphql b/examples/blog/schema.graphql index fa745a088a2..56c9a8346b7 100644 --- a/examples/blog/schema.graphql +++ b/examples/blog/schema.graphql @@ -254,7 +254,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/custom-admin-ui-logo/schema.graphql b/examples/custom-admin-ui-logo/schema.graphql index f08c268a245..efadb988493 100644 --- a/examples/custom-admin-ui-logo/schema.graphql +++ b/examples/custom-admin-ui-logo/schema.graphql @@ -254,7 +254,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/custom-admin-ui-navigation/schema.graphql b/examples/custom-admin-ui-navigation/schema.graphql index f08c268a245..efadb988493 100644 --- a/examples/custom-admin-ui-navigation/schema.graphql +++ b/examples/custom-admin-ui-navigation/schema.graphql @@ -254,7 +254,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/custom-admin-ui-pages/schema.graphql b/examples/custom-admin-ui-pages/schema.graphql index f08c268a245..efadb988493 100644 --- a/examples/custom-admin-ui-pages/schema.graphql +++ b/examples/custom-admin-ui-pages/schema.graphql @@ -254,7 +254,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/custom-field-view/schema.graphql b/examples/custom-field-view/schema.graphql index 40a47c8c98e..bc43bf68380 100644 --- a/examples/custom-field-view/schema.graphql +++ b/examples/custom-field-view/schema.graphql @@ -257,7 +257,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/custom-field/schema.graphql b/examples/custom-field/schema.graphql index 288e1d9718d..b29bdbd9dbe 100644 --- a/examples/custom-field/schema.graphql +++ b/examples/custom-field/schema.graphql @@ -134,7 +134,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/custom-session-validation/schema.graphql b/examples/custom-session-validation/schema.graphql index 4196e302715..67d0c9561b5 100644 --- a/examples/custom-session-validation/schema.graphql +++ b/examples/custom-session-validation/schema.graphql @@ -302,7 +302,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/default-values/schema.graphql b/examples/default-values/schema.graphql index f08c268a245..efadb988493 100644 --- a/examples/default-values/schema.graphql +++ b/examples/default-values/schema.graphql @@ -254,7 +254,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/document-field/schema.graphql b/examples/document-field/schema.graphql index 0cff4143735..568b32b887d 100644 --- a/examples/document-field/schema.graphql +++ b/examples/document-field/schema.graphql @@ -269,7 +269,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/ecommerce/schema.graphql b/examples/ecommerce/schema.graphql index d025b3f701b..17fc4bf3b4d 100644 --- a/examples/ecommerce/schema.graphql +++ b/examples/ecommerce/schema.graphql @@ -934,7 +934,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/embedded-nextjs/schema.graphql b/examples/embedded-nextjs/schema.graphql index 3fe12f593f8..17d38a07270 100644 --- a/examples/embedded-nextjs/schema.graphql +++ b/examples/embedded-nextjs/schema.graphql @@ -125,7 +125,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/extend-graphql-schema-graphql-ts/schema.graphql b/examples/extend-graphql-schema-graphql-ts/schema.graphql index 6ea09673e35..c482db5706a 100644 --- a/examples/extend-graphql-schema-graphql-ts/schema.graphql +++ b/examples/extend-graphql-schema-graphql-ts/schema.graphql @@ -263,7 +263,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/extend-graphql-schema-nexus/schema.graphql b/examples/extend-graphql-schema-nexus/schema.graphql index 6bac91ee68f..ba6b2c7ccd7 100644 --- a/examples/extend-graphql-schema-nexus/schema.graphql +++ b/examples/extend-graphql-schema-nexus/schema.graphql @@ -256,7 +256,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/extend-graphql-schema/schema.graphql b/examples/extend-graphql-schema/schema.graphql index 0eb83c0ce89..0e32f017093 100644 --- a/examples/extend-graphql-schema/schema.graphql +++ b/examples/extend-graphql-schema/schema.graphql @@ -278,7 +278,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/extend-graphql-subscriptions/schema.graphql b/examples/extend-graphql-subscriptions/schema.graphql index e8b5e73090c..01ca972f1da 100644 --- a/examples/extend-graphql-subscriptions/schema.graphql +++ b/examples/extend-graphql-subscriptions/schema.graphql @@ -259,7 +259,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/graphql-api-endpoint/schema.graphql b/examples/graphql-api-endpoint/schema.graphql index b72398fac21..ecdbeb3a039 100644 --- a/examples/graphql-api-endpoint/schema.graphql +++ b/examples/graphql-api-endpoint/schema.graphql @@ -408,7 +408,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/json/schema.graphql b/examples/json/schema.graphql index 4b694081849..d7657e0cd03 100644 --- a/examples/json/schema.graphql +++ b/examples/json/schema.graphql @@ -223,7 +223,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/rest-api/schema.graphql b/examples/rest-api/schema.graphql index 718c49a6852..c8d677b4b54 100644 --- a/examples/rest-api/schema.graphql +++ b/examples/rest-api/schema.graphql @@ -255,7 +255,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/roles/schema.graphql b/examples/roles/schema.graphql index 33004260bc3..834e02a6371 100644 --- a/examples/roles/schema.graphql +++ b/examples/roles/schema.graphql @@ -387,7 +387,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/task-manager/schema.graphql b/examples/task-manager/schema.graphql index 718c49a6852..c8d677b4b54 100644 --- a/examples/task-manager/schema.graphql +++ b/examples/task-manager/schema.graphql @@ -255,7 +255,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/testing/schema.graphql b/examples/testing/schema.graphql index 0200449e8ac..dff319e3e1c 100644 --- a/examples/testing/schema.graphql +++ b/examples/testing/schema.graphql @@ -297,7 +297,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/virtual-field/schema.graphql b/examples/virtual-field/schema.graphql index 914486ebffc..a2c6e4874b4 100644 --- a/examples/virtual-field/schema.graphql +++ b/examples/virtual-field/schema.graphql @@ -265,7 +265,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/examples/with-auth/schema.graphql b/examples/with-auth/schema.graphql index 0200449e8ac..dff319e3e1c 100644 --- a/examples/with-auth/schema.graphql +++ b/examples/with-auth/schema.graphql @@ -297,7 +297,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/packages/auth/src/index.ts b/packages/auth/src/index.ts index f2c9b4b364f..6045b81bceb 100644 --- a/packages/auth/src/index.ts +++ b/packages/auth/src/index.ts @@ -275,7 +275,6 @@ export function createAuth({ getAdditionalFiles: [...(keystoneConfig.ui?.getAdditionalFiles || []), getAdditionalFiles], pageMiddleware: async args => (await pageMiddleware(args)) ?? keystoneConfig?.ui?.pageMiddleware?.(args), - enableSessionItem: true, isAccessAllowed: async (context: KeystoneContext) => { // Allow access to the adminMeta data from the /init path to correctly render that page // even if the user isn't logged in (which should always be the case if they're seeing /init) @@ -324,7 +323,7 @@ export function createAuth({ // In the future we may want to return the following so that developers can // roll their own. This is pending a review of the use cases this might be // appropriate for, along with documentation and testing. - // ui: { enableSessionItem: true, pageMiddleware, getAdditionalFiles, publicPages }, + // ui: { pageMiddleware, getAdditionalFiles, publicPages }, // fields, // extendGraphqlSchema, // validateConfig, diff --git a/packages/core/src/admin-ui/admin-meta-graphql.ts b/packages/core/src/admin-ui/admin-meta-graphql.ts index 1af45d980be..0d83fe9593c 100644 --- a/packages/core/src/admin-ui/admin-meta-graphql.ts +++ b/packages/core/src/admin-ui/admin-meta-graphql.ts @@ -8,7 +8,6 @@ export const staticAdminMetaQuery = gql` adminMeta { __typename enableSignout - enableSessionItem lists { __typename key @@ -69,7 +68,6 @@ export type StaticAdminMetaQuery = { adminMeta: { __typename: 'KeystoneAdminMeta'; enableSignout: boolean; - enableSessionItem: boolean; lists: Array<{ __typename: 'KeystoneAdminUIListMeta'; key: string; diff --git a/packages/core/src/admin-ui/system/adminMetaSchema.ts b/packages/core/src/admin-ui/system/adminMetaSchema.ts index a26a1a2d749..738ea54b472 100644 --- a/packages/core/src/admin-ui/system/adminMetaSchema.ts +++ b/packages/core/src/admin-ui/system/adminMetaSchema.ts @@ -168,7 +168,6 @@ const adminMeta = graphql.object()({ name: 'KeystoneAdminMeta', fields: { enableSignout: graphql.field({ type: graphql.nonNull(graphql.Boolean) }), - enableSessionItem: graphql.field({ type: graphql.nonNull(graphql.Boolean) }), lists: graphql.field({ type: graphql.nonNull(graphql.list(graphql.nonNull(KeystoneAdminUIListMeta))), }), diff --git a/packages/core/src/admin-ui/system/createAdminMeta.ts b/packages/core/src/admin-ui/system/createAdminMeta.ts index 13d142ddd85..e260c76b290 100644 --- a/packages/core/src/admin-ui/system/createAdminMeta.ts +++ b/packages/core/src/admin-ui/system/createAdminMeta.ts @@ -17,9 +17,8 @@ export function createAdminMeta( config: KeystoneConfig, initialisedLists: Record ) { - const { ui, lists, session } = config; + const { lists, session } = config; const adminMetaRoot: AdminMetaRootVal = { - enableSessionItem: ui?.enableSessionItem || false, enableSignout: session !== undefined, listsByKey: {}, lists: [], diff --git a/packages/core/src/admin-ui/utils/useAdminMeta.tsx b/packages/core/src/admin-ui/utils/useAdminMeta.tsx index 4a7395b2b74..4b8d58185bb 100644 --- a/packages/core/src/admin-ui/utils/useAdminMeta.tsx +++ b/packages/core/src/admin-ui/utils/useAdminMeta.tsx @@ -64,7 +64,6 @@ export function useAdminMeta(adminMetaHash: string, fieldViews: FieldViews) { ? adminMetaFromLocalStorage : data.keystone.adminMeta; const runtimeAdminMeta: AdminMeta = { - enableSessionItem: adminMeta.enableSessionItem, enableSignout: adminMeta.enableSignout, lists: {}, }; diff --git a/packages/core/src/scripts/tests/fixtures/basic-project/schema.graphql b/packages/core/src/scripts/tests/fixtures/basic-project/schema.graphql index adb58354e37..5d252fc2224 100644 --- a/packages/core/src/scripts/tests/fixtures/basic-project/schema.graphql +++ b/packages/core/src/scripts/tests/fixtures/basic-project/schema.graphql @@ -115,7 +115,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/packages/core/src/types/admin-meta.ts b/packages/core/src/types/admin-meta.ts index 668ea8160cc..4e4d01428e3 100644 --- a/packages/core/src/types/admin-meta.ts +++ b/packages/core/src/types/admin-meta.ts @@ -111,7 +111,6 @@ export type ListMeta = { export type AdminMeta = { enableSignout: boolean; - enableSessionItem: boolean; lists: { [list: string]: ListMeta }; }; @@ -202,7 +201,6 @@ export type ListMetaRootVal = { export type AdminMetaRootVal = { enableSignout: boolean; - enableSessionItem: boolean; lists: Array; listsByKey: Record; views: string[]; diff --git a/packages/core/src/types/config/index.ts b/packages/core/src/types/config/index.ts index 57af080953b..1cb688da37c 100644 --- a/packages/core/src/types/config/index.ts +++ b/packages/core/src/types/config/index.ts @@ -139,8 +139,6 @@ export type DatabaseConfig = { export type AdminUIConfig = { /** Completely disables the Admin UI */ isDisabled?: boolean; - /** Enables certain functionality in the Admin UI that expects the session to be an item */ - enableSessionItem?: boolean; /** A function that can be run to validate that the current session should have access to the Admin UI */ isAccessAllowed?: (context: KeystoneContext) => MaybePromise; /** An array of page routes that can be accessed without passing the isAccessAllowed check */ diff --git a/tests/api-tests/admin-meta.test.ts b/tests/api-tests/admin-meta.test.ts index 10b7ccc782e..cd5e7d07ea0 100644 --- a/tests/api-tests/admin-meta.test.ts +++ b/tests/api-tests/admin-meta.test.ts @@ -37,7 +37,6 @@ test( __typename: 'KeystoneMeta', adminMeta: { __typename: 'KeystoneAdminMeta', - enableSessionItem: false, enableSignout: false, lists: [ { diff --git a/tests/sandbox/schema.graphql b/tests/sandbox/schema.graphql index e975cce7966..29b089f1f86 100644 --- a/tests/sandbox/schema.graphql +++ b/tests/sandbox/schema.graphql @@ -537,7 +537,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/tests/test-projects/basic/schema.graphql b/tests/test-projects/basic/schema.graphql index 9580f9c8f77..1804b572dff 100644 --- a/tests/test-projects/basic/schema.graphql +++ b/tests/test-projects/basic/schema.graphql @@ -311,7 +311,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/tests/test-projects/crud-notifications/schema.graphql b/tests/test-projects/crud-notifications/schema.graphql index f08c268a245..efadb988493 100644 --- a/tests/test-projects/crud-notifications/schema.graphql +++ b/tests/test-projects/crud-notifications/schema.graphql @@ -254,7 +254,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta } diff --git a/tests/test-projects/live-reloading/schema.graphql b/tests/test-projects/live-reloading/schema.graphql index 96eb5317028..968a2f5584c 100644 --- a/tests/test-projects/live-reloading/schema.graphql +++ b/tests/test-projects/live-reloading/schema.graphql @@ -119,7 +119,6 @@ type KeystoneMeta { type KeystoneAdminMeta { enableSignout: Boolean! - enableSessionItem: Boolean! lists: [KeystoneAdminUIListMeta!]! list(key: String!): KeystoneAdminUIListMeta }