Compare commits
9 Commits
v3.0.0-bet
...
v3.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a06c06415c | ||
|
|
2dd7e82fdc | ||
|
|
63e04e2ae0 | ||
|
|
e71888a625 | ||
|
|
c5514f1441 | ||
|
|
23e2fe643e | ||
|
|
bdef2f1bc7 | ||
|
|
8f03cd7c78 | ||
|
|
c0092191a6 |
57
.github/ISSUE_TEMPLATE/1.bug_report_v3.yml
vendored
Normal file
57
.github/ISSUE_TEMPLATE/1.bug_report_v3.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
name: Bug Report v3
|
||||
description: Create a bug report for Payload v3 (beta)
|
||||
labels: ['status:needs-triage', 'v3']
|
||||
body:
|
||||
- type: input
|
||||
id: reproduction-link
|
||||
attributes:
|
||||
label: Link to reproduction
|
||||
description: Want us to look into your issue faster? Follow the [reproduction-guide](https://github.com/payloadcms/payload/blob/main/.github/reproduction-guide.md) for more information.
|
||||
validations:
|
||||
required: false
|
||||
- type: input
|
||||
id: version
|
||||
attributes:
|
||||
label: Payload Version
|
||||
description: What version of Payload are you running?
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: node-version
|
||||
attributes:
|
||||
label: Node Version
|
||||
description: What version of Node are you running?
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: nextjs-version
|
||||
attributes:
|
||||
label: Next.js Version
|
||||
description: What version of Next.js are you running?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the Bug
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Reproduction Steps
|
||||
description: Steps to reproduce the behavior, please provide a clear description of how to reproduce the issue, based on the linked minimal reproduction. Screenshots can be provided in the issue body below. If using code blocks, make sure that [syntax highlighting is correct](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting) and double check that the rendered preview is not broken.
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
id: adapters-plugins
|
||||
attributes:
|
||||
label: Adapters and Plugins
|
||||
description: What adapters and plugins are you using if relevant? ie. db-mongodb, db-postgres, storage-vercel-blob, etc.
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: Before submitting the issue, go through the steps you've written down to make sure the steps provided are detailed and clear.
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: Contributors should be able to follow the steps provided in order to reproduce the bug.
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: These steps are used to add integration tests to ensure the same issue does not happen again. Thanks in advance!
|
||||
50
.github/workflows/label-author.yml
vendored
Normal file
50
.github/workflows/label-author.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
name: label-author
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened]
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
debug-context:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: View context attributes
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: console.log(context)
|
||||
|
||||
label-created-by:
|
||||
name: Label pr/issue on opening
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Tag with 'created-by'
|
||||
uses: actions/github-script@v7
|
||||
if: github.event.action == 'opened'
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const type = context.payload.pull_request ? 'pull_request' : 'issue';
|
||||
const association = context.payload[type].author_association;
|
||||
let label = ''
|
||||
if (association === 'MEMBER' || association === 'OWNER') {
|
||||
label = 'created-by: Payload team';
|
||||
} else if (association === 'CONTRIBUTOR') {
|
||||
label = 'created-by: Contributor';
|
||||
}
|
||||
|
||||
if (!label) return;
|
||||
|
||||
github.rest.issues.addLabels({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
labels: [label],
|
||||
});
|
||||
console.log('Added created-by: Payload team label');
|
||||
42
.github/workflows/stale.yml
vendored
Normal file
42
.github/workflows/stale.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
name: stale
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
id: stale
|
||||
with:
|
||||
debug-only: true
|
||||
days-before-stale: 90
|
||||
days-before-close: 7
|
||||
ascending: true
|
||||
operations-per-run: 300
|
||||
|
||||
# Ignore all assigned
|
||||
exempt-all-assignees: true
|
||||
|
||||
# Issues
|
||||
stale-issue-label: 'stale'
|
||||
exempt-issue-labels: 'blocked,must,should,keep,created-by: Payload team'
|
||||
stale-issue-message: >
|
||||
This issue has been marked as stale due to lack of activity. To keep the ticket open, please indicate that it is still relevant in a comment below.
|
||||
close-issue-message: >
|
||||
This issue was automatically closed due to lack of activity.
|
||||
|
||||
# Pull Requests
|
||||
stale-pr-label: 'stale'
|
||||
exempt-pr-labels: 'blocked,must,should,keep,created-by: Payload team'
|
||||
stale-pr-message: >
|
||||
This PR is stale due to lack of activity. To keep the PR open, please indicate that it is still relevant in a comment below.
|
||||
close-pr-message: >
|
||||
This pull request was automatically closed due to lack of activity.
|
||||
|
||||
- name: Print outputs
|
||||
run: echo ${{ format('{0},{1}', toJSON(steps.stale.outputs.staled-issues-prs), toJSON(steps.stale.outputs.closed-issues-prs)) }}
|
||||
@@ -7,4 +7,4 @@ charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
end_of_line = lf
|
||||
max_line_length = null
|
||||
max_line_length = off
|
||||
|
||||
@@ -7,4 +7,4 @@ charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
end_of_line = lf
|
||||
max_line_length = null
|
||||
max_line_length = off
|
||||
|
||||
@@ -7,4 +7,4 @@ charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
end_of_line = lf
|
||||
max_line_length = null
|
||||
max_line_length = off
|
||||
|
||||
@@ -7,4 +7,4 @@ charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
end_of_line = lf
|
||||
max_line_length = null
|
||||
max_line_length = off
|
||||
|
||||
@@ -7,4 +7,4 @@ charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
end_of_line = lf
|
||||
max_line_length = null
|
||||
max_line_length = off
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
"webpack": "^5.78.0",
|
||||
"webpack-bundle-analyzer": "^4.8.0",
|
||||
"webpack-cli": "^4.10.0",
|
||||
"webpack-dev-middleware": "6.0.1",
|
||||
"webpack-dev-middleware": "6.1.2",
|
||||
"webpack-hot-middleware": "^2.25.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -2,9 +2,10 @@ import React, { useRef } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
import useHotkey from '../../../hooks/useHotkey'
|
||||
import { useForm } from '../../forms/Form/context'
|
||||
import { useForm, useFormModified } from '../../forms/Form/context'
|
||||
import FormSubmit from '../../forms/Submit'
|
||||
import { useEditDepth } from '../../utilities/EditDepth'
|
||||
import { useOperation } from '../../utilities/OperationProvider'
|
||||
import RenderCustomComponent from '../../utilities/RenderCustomComponent'
|
||||
|
||||
export type CustomSaveButtonProps = React.ComponentType<
|
||||
@@ -20,17 +21,26 @@ type DefaultSaveButtonProps = {
|
||||
const DefaultSaveButton: React.FC<DefaultSaveButtonProps> = ({ label, save }) => {
|
||||
const ref = useRef<HTMLButtonElement>(null)
|
||||
const editDepth = useEditDepth()
|
||||
const operation = useOperation()
|
||||
const modified = useFormModified()
|
||||
|
||||
const forceDisable = operation === 'update' && !modified
|
||||
|
||||
useHotkey({ cmdCtrlKey: true, editDepth, keyCodes: ['s'] }, (e) => {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
||||
if (forceDisable) {
|
||||
return
|
||||
}
|
||||
|
||||
if (ref?.current) {
|
||||
ref.current.click()
|
||||
}
|
||||
})
|
||||
|
||||
return (
|
||||
<FormSubmit buttonId="action-save" onClick={save} ref={ref} type="button" size="small">
|
||||
<FormSubmit buttonId="action-save" onClick={save} ref={ref} size="small" type="button">
|
||||
{label}
|
||||
</FormSubmit>
|
||||
)
|
||||
|
||||
@@ -8,6 +8,7 @@ import { useConfig } from '../../utilities/Config'
|
||||
import { useDocumentInfo } from '../../utilities/DocumentInfo'
|
||||
import { useEditDepth } from '../../utilities/EditDepth'
|
||||
import { useLocale } from '../../utilities/Locale'
|
||||
import { useOperation } from '../../utilities/OperationProvider'
|
||||
import RenderCustomComponent from '../../utilities/RenderCustomComponent'
|
||||
|
||||
const baseClass = 'save-draft'
|
||||
@@ -31,12 +32,13 @@ const DefaultSaveDraftButton: React.FC<DefaultSaveDraftButtonProps> = ({
|
||||
const editDepth = useEditDepth()
|
||||
|
||||
useHotkey({ cmdCtrlKey: true, editDepth, keyCodes: ['s'] }, (e) => {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
||||
if (disabled) {
|
||||
return
|
||||
}
|
||||
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
if (ref?.current) {
|
||||
ref.current.click()
|
||||
}
|
||||
@@ -68,11 +70,13 @@ export const SaveDraft: React.FC<Props> = ({ CustomComponent }) => {
|
||||
} = useConfig()
|
||||
const { submit } = useForm()
|
||||
const { id, collection, global } = useDocumentInfo()
|
||||
const operation = useOperation()
|
||||
const modified = useFormModified()
|
||||
|
||||
const { code: locale } = useLocale()
|
||||
const { t } = useTranslation('version')
|
||||
|
||||
const canSaveDraft = modified
|
||||
const canSaveDraft = operation === 'update' && modified
|
||||
|
||||
const saveDraft = useCallback(async () => {
|
||||
const search = `?locale=${locale}&depth=0&fallback-locale=null&draft=true`
|
||||
|
||||
@@ -146,13 +146,12 @@ const Relationship: React.FC<Props> = (props) => {
|
||||
|
||||
if (resultsFetched < 10) {
|
||||
const collection = collections.find((coll) => coll.slug === relation)
|
||||
let fieldToSearch = collection?.defaultSort || collection?.admin?.useAsTitle || 'id'
|
||||
if (!searchArg) {
|
||||
if (typeof sortOptions === 'string') {
|
||||
fieldToSearch = sortOptions
|
||||
} else if (sortOptions?.[relation]) {
|
||||
fieldToSearch = sortOptions[relation]
|
||||
}
|
||||
const fieldToSearch = collection?.admin?.useAsTitle || 'id'
|
||||
let fieldToSort = collection?.defaultSort || 'id'
|
||||
if (typeof sortOptions === 'string') {
|
||||
fieldToSort = sortOptions
|
||||
} else if (sortOptions?.[relation]) {
|
||||
fieldToSort = sortOptions[relation]
|
||||
}
|
||||
|
||||
const query: {
|
||||
@@ -164,7 +163,7 @@ const Relationship: React.FC<Props> = (props) => {
|
||||
limit: maxResultsPerRequest,
|
||||
locale,
|
||||
page: lastLoadedPageToUse,
|
||||
sort: fieldToSearch,
|
||||
sort: fieldToSort,
|
||||
where: {
|
||||
and: [
|
||||
{
|
||||
|
||||
17
pnpm-lock.yaml
generated
17
pnpm-lock.yaml
generated
@@ -340,8 +340,8 @@ importers:
|
||||
specifier: ^4.10.0
|
||||
version: 4.10.0(webpack-bundle-analyzer@4.10.2)(webpack@5.91.0)
|
||||
webpack-dev-middleware:
|
||||
specifier: 6.0.1
|
||||
version: 6.0.1(webpack@5.91.0)
|
||||
specifier: 6.1.2
|
||||
version: 6.1.2(webpack@5.91.0)
|
||||
webpack-hot-middleware:
|
||||
specifier: ^2.25.3
|
||||
version: 2.26.1
|
||||
@@ -10461,8 +10461,8 @@ packages:
|
||||
universalify: 2.0.1
|
||||
dev: false
|
||||
|
||||
/fs-monkey@1.0.5:
|
||||
resolution: {integrity: sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew==}
|
||||
/fs-monkey@1.0.6:
|
||||
resolution: {integrity: sha512-b1FMfwetIKymC0eioW7mTywihSQE4oLzQn1dB6rZB5fx/3NpNEdAWeCSMB+60/AeT0TCXsxzAlcYVEFCTAksWg==}
|
||||
dev: false
|
||||
|
||||
/fs.realpath@1.0.0:
|
||||
@@ -13182,7 +13182,7 @@ packages:
|
||||
resolution: {integrity: sha512-UERzLsxzllchadvbPs5aolHh65ISpKpM+ccLbOJ8/vvpBKmAWf+la7dXFy7Mr0ySHbdHrFv5kGFCUHHe6GFEmw==}
|
||||
engines: {node: '>= 4.0.0'}
|
||||
dependencies:
|
||||
fs-monkey: 1.0.5
|
||||
fs-monkey: 1.0.6
|
||||
dev: false
|
||||
|
||||
/memoize-one@6.0.0:
|
||||
@@ -18057,11 +18057,14 @@ packages:
|
||||
webpack-bundle-analyzer: 4.10.2
|
||||
webpack-merge: 5.10.0
|
||||
|
||||
/webpack-dev-middleware@6.0.1(webpack@5.91.0):
|
||||
resolution: {integrity: sha512-PZPZ6jFinmqVPJZbisfggDiC+2EeGZ1ZByyMP5sOFJcPPWSexalISz+cvm+j+oYPT7FIJyxT76esjnw9DhE5sw==}
|
||||
/webpack-dev-middleware@6.1.2(webpack@5.91.0):
|
||||
resolution: {integrity: sha512-Wu+EHmX326YPYUpQLKmKbTyZZJIB8/n6R09pTmB03kJmnMsVPTo9COzHZFr01txwaCAuZvfBJE4ZCHRcKs5JaQ==}
|
||||
engines: {node: '>= 14.15.0'}
|
||||
peerDependencies:
|
||||
webpack: ^5.0.0
|
||||
peerDependenciesMeta:
|
||||
webpack:
|
||||
optional: true
|
||||
dependencies:
|
||||
colorette: 2.0.20
|
||||
memfs: 3.5.3
|
||||
|
||||
@@ -7,4 +7,4 @@ charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
end_of_line = lf
|
||||
max_line_length = null
|
||||
max_line_length = off
|
||||
|
||||
@@ -7,4 +7,4 @@ charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
end_of_line = lf
|
||||
max_line_length = null
|
||||
max_line_length = off
|
||||
|
||||
Reference in New Issue
Block a user