chore: bump nextjs dependencies to ^14.2 (#5820)
fix(plugin-seo): overriding existing endpoints
This commit is contained in:
@@ -5,7 +5,8 @@ import { expect, test } from '@playwright/test'
|
||||
import path from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
import type { ReadOnlyCollection, RestrictedVersion } from './payload-types.js'
|
||||
import type { PayloadTestSDK } from '../helpers/sdk/index.js'
|
||||
import type { Config, ReadOnlyCollection, RestrictedVersion } from './payload-types.js'
|
||||
|
||||
import {
|
||||
closeNav,
|
||||
@@ -17,7 +18,7 @@ import {
|
||||
saveDocAndAssert,
|
||||
} from '../helpers.js'
|
||||
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
|
||||
import { initPayloadE2E } from '../helpers/initPayloadE2E.js'
|
||||
import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js'
|
||||
import { POLL_TOPASS_TIMEOUT } from '../playwright.config.js'
|
||||
import {
|
||||
docLevelAccessSlug,
|
||||
@@ -40,7 +41,7 @@ const dirname = path.dirname(filename)
|
||||
*/
|
||||
|
||||
const { beforeAll, describe } = test
|
||||
let payload: Payload
|
||||
let payload: PayloadTestSDK<Config>
|
||||
describe('access control', () => {
|
||||
let page: Page
|
||||
let url: AdminUrlUtil
|
||||
@@ -50,7 +51,7 @@ describe('access control', () => {
|
||||
let serverURL: string
|
||||
|
||||
beforeAll(async ({ browser }) => {
|
||||
;({ payload, serverURL } = await initPayloadE2E({ dirname }))
|
||||
;({ payload, serverURL } = await initPayloadE2ENoConfig<Config>({ dirname }))
|
||||
|
||||
url = new AdminUrlUtil(serverURL, slug)
|
||||
restrictedUrl = new AdminUrlUtil(serverURL, restrictedSlug)
|
||||
|
||||
@@ -6,8 +6,10 @@ import path from 'path'
|
||||
import { wait } from 'payload/utilities'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
import type { PayloadTestSDK } from '../helpers/sdk/index.js'
|
||||
import type {
|
||||
FieldsRelationship as CollectionWithRelationships,
|
||||
Config,
|
||||
RelationOne,
|
||||
RelationRestricted,
|
||||
RelationTwo,
|
||||
@@ -23,7 +25,7 @@ import {
|
||||
saveDocAndAssert,
|
||||
} from '../helpers.js'
|
||||
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
|
||||
import { initPayloadE2E } from '../helpers/initPayloadE2E.js'
|
||||
import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js'
|
||||
import {
|
||||
relationFalseFilterOptionSlug,
|
||||
relationOneSlug,
|
||||
@@ -34,12 +36,13 @@ import {
|
||||
relationWithTitleSlug,
|
||||
slug,
|
||||
} from './collectionSlugs.js'
|
||||
|
||||
const filename = fileURLToPath(import.meta.url)
|
||||
const dirname = path.dirname(filename)
|
||||
|
||||
const { beforeAll, beforeEach, describe } = test
|
||||
|
||||
let payload: Payload
|
||||
let payload: PayloadTestSDK<Config>
|
||||
|
||||
describe('fields - relationship', () => {
|
||||
let url: AdminUrlUtil
|
||||
@@ -54,7 +57,7 @@ describe('fields - relationship', () => {
|
||||
let serverURL: string
|
||||
|
||||
beforeAll(async ({ browser }) => {
|
||||
;({ payload, serverURL } = await initPayloadE2E({ dirname }))
|
||||
;({ payload, serverURL } = await initPayloadE2ENoConfig<Config>({ dirname }))
|
||||
|
||||
url = new AdminUrlUtil(serverURL, slug)
|
||||
|
||||
|
||||
@@ -1,29 +1,30 @@
|
||||
import type { SerializedBlockNode, SerializedLinkNode } from '@payloadcms/richtext-lexical'
|
||||
import type { Page } from '@playwright/test'
|
||||
import type { PayloadTestSDK } from 'helpers/sdk/index.js'
|
||||
import type { SerializedEditorState, SerializedParagraphNode, SerializedTextNode } from 'lexical'
|
||||
import type { Payload } from 'payload'
|
||||
|
||||
import { expect, test } from '@playwright/test'
|
||||
import { initPayloadE2ENoConfig } from 'helpers/initPayloadE2ENoConfig.js'
|
||||
import { reInitializeDB } from 'helpers/reInit.js'
|
||||
import path from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
import type { LexicalField } from '../../payload-types.js'
|
||||
import type { Config, LexicalField } from '../../payload-types.js'
|
||||
|
||||
import { initPageConsoleErrorCatch, saveDocAndAssert } from '../../../helpers.js'
|
||||
import { AdminUrlUtil } from '../../../helpers/adminUrlUtil.js'
|
||||
import { initPayloadE2E } from '../../../helpers/initPayloadE2E.js'
|
||||
import { RESTClient } from '../../../helpers/rest.js'
|
||||
import { POLL_TOPASS_TIMEOUT } from '../../../playwright.config.js'
|
||||
import { clearAndSeedEverything } from '../../seed.js'
|
||||
import { lexicalFieldsSlug } from '../../slugs.js'
|
||||
import { lexicalDocData } from './data.js'
|
||||
|
||||
const filename = fileURLToPath(import.meta.url)
|
||||
const currentFolder = path.dirname(filename)
|
||||
const dirname = path.resolve(currentFolder, '../../')
|
||||
|
||||
const { beforeAll, beforeEach, describe } = test
|
||||
|
||||
let payload: Payload
|
||||
let payload: PayloadTestSDK<Config>
|
||||
let client: RESTClient
|
||||
let page: Page
|
||||
let serverURL: string
|
||||
@@ -49,7 +50,7 @@ async function navigateToLexicalFields(navigateToListView: boolean = true) {
|
||||
describe('lexical', () => {
|
||||
beforeAll(async ({ browser }) => {
|
||||
process.env.SEED_IN_CONFIG_ONINIT = 'false' // Makes it so the payload config onInit seed is not run. Otherwise, the seed would be run unnecessarily twice for the initial test run - once for beforeEach and once for onInit
|
||||
;({ payload, serverURL } = await initPayloadE2E({ dirname }))
|
||||
;({ payload, serverURL } = await initPayloadE2ENoConfig({ dirname }))
|
||||
|
||||
const context = await browser.newContext()
|
||||
page = await context.newPage()
|
||||
@@ -57,7 +58,12 @@ describe('lexical', () => {
|
||||
initPageConsoleErrorCatch(page)
|
||||
})
|
||||
beforeEach(async () => {
|
||||
await clearAndSeedEverything(payload)
|
||||
await reInitializeDB({
|
||||
serverURL,
|
||||
snapshotKey: 'fieldsLexicalTest',
|
||||
uploadsDir: path.resolve(dirname, '../Upload/uploads'),
|
||||
})
|
||||
|
||||
if (client) {
|
||||
await client.logout()
|
||||
}
|
||||
|
||||
@@ -4,12 +4,11 @@ import { expect, test } from '@playwright/test'
|
||||
import path from 'path'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
import type { Page as PayloadPage } from './payload-types.js'
|
||||
import type { Config, Page as PayloadPage } from './payload-types.js'
|
||||
|
||||
import { ensureAutoLoginAndCompilationIsDone, initPageConsoleErrorCatch } from '../helpers.js'
|
||||
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
|
||||
import { initPayloadE2E } from '../helpers/initPayloadE2E.js'
|
||||
|
||||
import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js'
|
||||
const filename = fileURLToPath(import.meta.url)
|
||||
const dirname = path.dirname(filename)
|
||||
|
||||
@@ -23,7 +22,7 @@ let childId: string
|
||||
|
||||
describe('Nested Docs Plugin', () => {
|
||||
beforeAll(async ({ browser }) => {
|
||||
const { serverURL, payload } = await initPayloadE2E({ dirname })
|
||||
const { serverURL, payload } = await initPayloadE2ENoConfig<Config>({ dirname })
|
||||
url = new AdminUrlUtil(serverURL, 'pages')
|
||||
const context = await browser.newContext()
|
||||
page = await context.newPage()
|
||||
|
||||
@@ -1,9 +1,115 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* This file was automatically generated by Payload.
|
||||
* DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,
|
||||
* and re-run `payload generate:types` to regenerate this file.
|
||||
*/
|
||||
|
||||
export interface Config {
|
||||
collections: {
|
||||
pages: Page
|
||||
categories: Category
|
||||
users: User
|
||||
'payload-preferences': PayloadPreference
|
||||
'payload-migrations': PayloadMigration
|
||||
}
|
||||
globals: {}
|
||||
locale: 'en' | 'es' | 'de'
|
||||
user: User & {
|
||||
collection: 'users'
|
||||
}
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "pages".
|
||||
*/
|
||||
export interface Page {
|
||||
id: string
|
||||
parent?: string
|
||||
title: string
|
||||
slug: string
|
||||
_status?: 'draft' | 'published'
|
||||
title?: string
|
||||
fullTitle?: string | null
|
||||
parent?: (string | null) | Page
|
||||
breadcrumbs?:
|
||||
| {
|
||||
doc?: (string | null) | Page
|
||||
url?: string | null
|
||||
label?: string | null
|
||||
id?: string | null
|
||||
}[]
|
||||
| null
|
||||
updatedAt: string
|
||||
createdAt: string
|
||||
_status?: ('draft' | 'published') | null
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "categories".
|
||||
*/
|
||||
export interface Category {
|
||||
id: string
|
||||
name: string
|
||||
categorization?:
|
||||
| {
|
||||
doc?: (string | null) | Category
|
||||
url?: string | null
|
||||
label?: string | null
|
||||
test?: string | null
|
||||
id?: string | null
|
||||
}[]
|
||||
| null
|
||||
owner?: (string | null) | Category
|
||||
updatedAt: string
|
||||
createdAt: string
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "users".
|
||||
*/
|
||||
export interface User {
|
||||
id: string
|
||||
updatedAt: string
|
||||
createdAt: string
|
||||
email: string
|
||||
resetPasswordToken?: string | null
|
||||
resetPasswordExpiration?: string | null
|
||||
salt?: string | null
|
||||
hash?: string | null
|
||||
loginAttempts?: number | null
|
||||
lockUntil?: string | null
|
||||
password?: string | null
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "payload-preferences".
|
||||
*/
|
||||
export interface PayloadPreference {
|
||||
id: string
|
||||
user: {
|
||||
relationTo: 'users'
|
||||
value: string | User
|
||||
}
|
||||
key?: string | null
|
||||
value?:
|
||||
| {
|
||||
[k: string]: unknown
|
||||
}
|
||||
| unknown[]
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| null
|
||||
updatedAt: string
|
||||
createdAt: string
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "payload-migrations".
|
||||
*/
|
||||
export interface PayloadMigration {
|
||||
id: string
|
||||
name?: string | null
|
||||
batch?: number | null
|
||||
updatedAt: string
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
@@ -41,10 +41,6 @@ export default buildConfigWithDefaults({
|
||||
await seed(payload)
|
||||
},
|
||||
plugins: [
|
||||
seo({
|
||||
collections: ['users'],
|
||||
tabbedUI: true,
|
||||
}),
|
||||
seo({
|
||||
collections: ['pages'],
|
||||
fieldOverrides: {
|
||||
|
||||
@@ -5,11 +5,11 @@ import path from 'path'
|
||||
import { getFileByPath } from 'payload/uploads'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
import type { Page as PayloadPage } from './payload-types.js'
|
||||
import type { Config, Page as PayloadPage } from './payload-types.js'
|
||||
|
||||
import { ensureAutoLoginAndCompilationIsDone, initPageConsoleErrorCatch } from '../helpers.js'
|
||||
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
|
||||
import { initPayloadE2E } from '../helpers/initPayloadE2E.js'
|
||||
import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js'
|
||||
import { mediaSlug } from './shared.js'
|
||||
|
||||
const filename = fileURLToPath(import.meta.url)
|
||||
@@ -23,7 +23,7 @@ let id: string
|
||||
|
||||
describe('SEO Plugin', () => {
|
||||
beforeAll(async ({ browser }) => {
|
||||
const { serverURL, payload } = await initPayloadE2E({ dirname })
|
||||
const { serverURL, payload } = await initPayloadE2ENoConfig<Config>({ dirname })
|
||||
url = new AdminUrlUtil(serverURL, 'pages')
|
||||
|
||||
const context = await browser.newContext()
|
||||
|
||||
@@ -6,7 +6,8 @@ import path from 'path'
|
||||
import { wait } from 'payload/utilities'
|
||||
import { fileURLToPath } from 'url'
|
||||
|
||||
import type { Media } from './payload-types.js'
|
||||
import type { PayloadTestSDK } from '../helpers/sdk/index.js'
|
||||
import type { Config, Media } from './payload-types.js'
|
||||
|
||||
import {
|
||||
ensureAutoLoginAndCompilationIsDone,
|
||||
@@ -15,7 +16,7 @@ import {
|
||||
saveDocAndAssert,
|
||||
} from '../helpers.js'
|
||||
import { AdminUrlUtil } from '../helpers/adminUrlUtil.js'
|
||||
import { initPayloadE2E } from '../helpers/initPayloadE2E.js'
|
||||
import { initPayloadE2ENoConfig } from '../helpers/initPayloadE2ENoConfig.js'
|
||||
import { RESTClient } from '../helpers/rest.js'
|
||||
import {
|
||||
adminThumbnailFunctionSlug,
|
||||
@@ -29,7 +30,7 @@ const dirname = path.dirname(filename)
|
||||
|
||||
const { beforeAll, describe } = test
|
||||
|
||||
let payload: Payload
|
||||
let payload: PayloadTestSDK<Config>
|
||||
let client: RESTClient
|
||||
let serverURL: string
|
||||
let mediaURL: AdminUrlUtil
|
||||
@@ -44,7 +45,7 @@ describe('uploads', () => {
|
||||
let audioDoc: Media
|
||||
|
||||
beforeAll(async ({ browser }) => {
|
||||
;({ payload, serverURL } = await initPayloadE2E({ dirname }))
|
||||
;({ payload, serverURL } = await initPayloadE2ENoConfig<Config>({ dirname }))
|
||||
client = new RESTClient(null, { defaultSlug: 'users', serverURL })
|
||||
await client.login()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user