Skip to content

Commit

Permalink
Remove unused enableSessionItem
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown committed Aug 25, 2022
1 parent ab79beb commit fa011bf
Show file tree
Hide file tree
Showing 40 changed files with 2 additions and 45 deletions.
1 change: 0 additions & 1 deletion examples/assets-local/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/assets-s3/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/auth/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/basic/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/blog/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/custom-admin-ui-logo/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/custom-admin-ui-navigation/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/custom-admin-ui-pages/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/custom-field-view/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/custom-field/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/custom-session-validation/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/default-values/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/document-field/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/ecommerce/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/embedded-nextjs/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/extend-graphql-schema-graphql-ts/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/extend-graphql-schema-nexus/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/extend-graphql-schema/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/extend-graphql-subscriptions/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/graphql-api-endpoint/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/json/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/rest-api/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/roles/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/task-manager/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/testing/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/virtual-field/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion examples/with-auth/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
3 changes: 1 addition & 2 deletions packages/auth/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ export function createAuth<ListTypeInfo extends BaseListTypeInfo>({
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)
Expand Down Expand Up @@ -324,7 +323,7 @@ export function createAuth<ListTypeInfo extends BaseListTypeInfo>({
// 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,
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/admin-ui/admin-meta-graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export const staticAdminMetaQuery = gql`
adminMeta {
__typename
enableSignout
enableSessionItem
lists {
__typename
key
Expand Down Expand Up @@ -69,7 +68,6 @@ export type StaticAdminMetaQuery = {
adminMeta: {
__typename: 'KeystoneAdminMeta';
enableSignout: boolean;
enableSessionItem: boolean;
lists: Array<{
__typename: 'KeystoneAdminUIListMeta';
key: string;
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/admin-ui/system/adminMetaSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ const adminMeta = graphql.object<AdminMetaRootVal>()({
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))),
}),
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/admin-ui/system/createAdminMeta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ export function createAdminMeta(
config: KeystoneConfig,
initialisedLists: Record<string, InitialisedList>
) {
const { ui, lists, session } = config;
const { lists, session } = config;
const adminMetaRoot: AdminMetaRootVal = {
enableSessionItem: ui?.enableSessionItem || false,
enableSignout: session !== undefined,
listsByKey: {},
lists: [],
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/admin-ui/utils/useAdminMeta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/types/admin-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export type ListMeta = {

export type AdminMeta = {
enableSignout: boolean;
enableSessionItem: boolean;
lists: { [list: string]: ListMeta };
};

Expand Down Expand Up @@ -202,7 +201,6 @@ export type ListMetaRootVal = {

export type AdminMetaRootVal = {
enableSignout: boolean;
enableSessionItem: boolean;
lists: Array<ListMetaRootVal>;
listsByKey: Record<string, ListMetaRootVal>;
views: string[];
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/types/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ export type DatabaseConfig<TypeInfo extends BaseKeystoneTypeInfo> = {
export type AdminUIConfig<TypeInfo extends BaseKeystoneTypeInfo> = {
/** 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<TypeInfo>) => MaybePromise<boolean>;
/** An array of page routes that can be accessed without passing the isAccessAllowed check */
Expand Down
1 change: 0 additions & 1 deletion tests/api-tests/admin-meta.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ test(
__typename: 'KeystoneMeta',
adminMeta: {
__typename: 'KeystoneAdminMeta',
enableSessionItem: false,
enableSignout: false,
lists: [
{
Expand Down
1 change: 0 additions & 1 deletion tests/sandbox/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion tests/test-projects/basic/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion tests/test-projects/crud-notifications/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down
1 change: 0 additions & 1 deletion tests/test-projects/live-reloading/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ type KeystoneMeta {

type KeystoneAdminMeta {
enableSignout: Boolean!
enableSessionItem: Boolean!
lists: [KeystoneAdminUIListMeta!]!
list(key: String!): KeystoneAdminUIListMeta
}
Expand Down

0 comments on commit fa011bf

Please sign in to comment.