Files
payloadcms/test/admin/slugs.ts
Paul 01ccbd48b0 feat!: custom views are now public by default and fixed some issues with notFound page (#8820)
This PR aims to fix a few issues with the notFound page and custom views
so it matches v2 behaviour:
- Non authorised users should always be redirected to the login page
regardless if not found or valid URL
- Previously notFound would render for non users too potentially
exposing valid but protected routes and creating a confusing workflow as
the UI was being rendered as well
- Custom views are now public by default
- in our `admin` test suite, the `/admin/public-custom-view` is
accessible to non users but
`/admin/public-custom-view/protected-nested-view` is not unless the
checkbox is true in the Settings global, there's e2e coverage for this
- Fixes https://github.com/payloadcms/payload/issues/8716
2024-10-30 11:29:29 -06:00

52 lines
1.8 KiB
TypeScript

export const usersCollectionSlug = 'users'
export const customViews1CollectionSlug = 'custom-views-one'
export const customViews2CollectionSlug = 'custom-views-two'
export const geoCollectionSlug = 'geo'
export const postsCollectionSlug = 'posts'
export const group1Collection1Slug = 'group-one-collection-ones'
export const group1Collection2Slug = 'group-one-collection-twos'
export const group2Collection1Slug = 'group-two-collection-ones'
export const group2Collection2Slug = 'group-two-collection-twos'
export const hiddenCollectionSlug = 'hidden-collection'
export const noApiViewCollectionSlug = 'collection-no-api-view'
export const disableDuplicateSlug = 'disable-duplicate'
export const uploadCollectionSlug = 'uploads'
export const customFieldsSlug = 'custom-fields'
export const collectionSlugs = [
usersCollectionSlug,
customViews1CollectionSlug,
customViews2CollectionSlug,
geoCollectionSlug,
postsCollectionSlug,
group1Collection1Slug,
group1Collection2Slug,
group2Collection1Slug,
group2Collection2Slug,
hiddenCollectionSlug,
noApiViewCollectionSlug,
customFieldsSlug,
disableDuplicateSlug,
]
export const customGlobalViews1GlobalSlug = 'custom-global-views-one'
export const customGlobalViews2GlobalSlug = 'custom-global-views-two'
export const globalSlug = 'global'
export const group1GlobalSlug = 'group-globals-one'
export const group2GlobalSlug = 'group-globals-two'
export const hiddenGlobalSlug = 'hidden-global'
export const settingsGlobalSlug = 'settings'
export const noApiViewGlobalSlug = 'global-no-api-view'
export const globalSlugs = [
customGlobalViews1GlobalSlug,
customGlobalViews2GlobalSlug,
globalSlug,
group1GlobalSlug,
group2GlobalSlug,
hiddenGlobalSlug,
noApiViewGlobalSlug,
]
export const customIdCollectionSlug = 'customId'
export const customIdCollectionId = '111111111111111111111111'