Compare commits

..

22 Commits

Author SHA1 Message Date
Elliot DeNolf
f8ec6a7490 chore(release): payload/2.32.3 [skip ci] 2025-05-08 11:17:10 -07:00
Kapil Barad
5ecee3f6f6 fix(upload): ensure only image files are read for preview (#9562)
### What?
Ensure only image files are read for preview.

### Why?
Upon uploading larger files, it crashes the browser as it's reading the
whole file for preview.

Fixes #9559

Co-authored-by: Kapil Barad <>
2025-05-08 13:26:07 +01:00
Patrik
a09fefaed7 fix: filter state resetting when removing previous condition in WhereBuilder (#12262)
### What?

This PR fixes an issue in the `WhereBuilder` component where removing a
previous filter condition would cause remaining conditions to reset
their `operator` and `value`.

The problem was that the `Condition` components were keyed only by their
index, causing React to incorrectly reuse component instances when the
condition list changed. This led to stale or mismatched internal state
after a filter was removed.

The fix updates the key for each `Condition` to be based on a
combination of field `name`, `operator`, and `indexes`. This ensures the
components are correctly recreated when necessary and that the selected
`field`, `operator`, and `value` persist properly across updates.
2025-05-01 10:37:51 -04:00
Elliot DeNolf
e97606a91b chore: update changelog 2025-03-14 14:21:31 -04:00
Elliot DeNolf
fde64094ac chore(release): plugin-stripe/0.0.19 [skip ci] 2025-03-14 14:02:07 -04:00
Elliot DeNolf
1b1d690874 chore(release): plugin-sentry/0.0.8 [skip ci] 2025-03-14 14:01:55 -04:00
Elliot DeNolf
09d715ff38 chore(release): plugin-relationship-object-ids/0.0.6 [skip ci] 2025-03-14 14:01:46 -04:00
Elliot DeNolf
db51b4c5ab chore(release): plugin-cloud-storage/1.2.2 [skip ci] 2025-03-14 14:01:37 -04:00
Elliot DeNolf
0ec5e096f3 chore(release): plugin-cloud/3.0.4 [skip ci] 2025-03-14 14:01:23 -04:00
Elliot DeNolf
c3f80aaa4b chore(release): db-mongodb/1.7.5 [skip ci] 2025-03-14 14:01:10 -04:00
Elliot DeNolf
2ba5cae83e chore(release): bundler-webpack/1.0.9 [skip ci] 2025-03-14 14:01:00 -04:00
Elliot DeNolf
c2120c06bb chore(release): bundler-vite/0.1.9 [skip ci] 2025-03-14 14:00:36 -04:00
Elliot DeNolf
9c6ab39bf4 chore(release): payload/2.32.2 [skip ci] 2025-03-14 13:58:58 -04:00
Elliot DeNolf
965d3d8d47 chore: run audit fix on high severity (#11705)
`pnpm audit --audit-level high --fix`
2025-03-14 13:56:03 -04:00
Elliot DeNolf
34ce21c1f8 chore(release): plugin-stripe/0.0.18 [skip ci] 2025-03-14 13:53:06 -04:00
Elliot DeNolf
ca6725b4ec chore(release): plugin-sentry/0.0.7 [skip ci] 2025-03-14 13:52:48 -04:00
Elliot DeNolf
a54fc12189 chore(release): plugin-relationship-object-ids/0.0.5 [skip ci] 2025-03-14 13:52:31 -04:00
Elliot DeNolf
cfe0fdf3f6 chore(release): plugin-cloud-storage/1.2.1 [skip ci] 2025-03-14 13:52:18 -04:00
Elliot DeNolf
2e2013602d chore(release): plugin-cloud/3.0.3 [skip ci] 2025-03-14 13:51:53 -04:00
Elliot DeNolf
9f17391475 chore(release): db-mongodb/1.7.4 [skip ci] 2025-03-14 13:51:39 -04:00
Elliot DeNolf
cd12963296 chore(release): bundler-webpack/1.0.8 [skip ci] 2025-03-14 13:51:26 -04:00
Elliot DeNolf
165442028c chore(release): bundler-vite/0.1.8 [skip ci] 2025-03-14 13:50:58 -04:00
15 changed files with 504 additions and 621 deletions

View File

@@ -1,6 +1,18 @@
## [2.32.1](https://github.com/payloadcms/payload/compare/v2.32.0...v2.32.1) (2025-03-14)
## [2.32.3](https://github.com/payloadcms/payload/compare/v2.32.2...v2.32.3) (2025-05-08)
Bumps dependencies ([#11702](https://github.com/payloadcms/payload/pull/11702)) ([#11705](https://github.com/payloadcms/payload/pull/11705))
### Bug Fixes
* filter state resetting when removing previous condition in WhereBuilder ([#12262](https://github.com/payloadcms/payload/issues/12262)) ([a09fefa](https://github.com/payloadcms/payload/commit/a09fefaed746ff945d16f41647f1fdb32200e35e))
* **upload:** ensure only image files are read for preview ([#9562](https://github.com/payloadcms/payload/issues/9562)) ([5ecee3f](https://github.com/payloadcms/payload/commit/5ecee3f6f6cbaec06a0b48ca251a25c2993e8451)), closes [#9559](https://github.com/payloadcms/payload/issues/9559)
## [2.32.2](https://github.com/payloadcms/payload/compare/v2.32.1...v2.32.2) (2025-03-14)
- Bumps dependencies ([#11702](https://github.com/payloadcms/payload/pull/11702)) ([#11705](https://github.com/payloadcms/payload/pull/11705))
### Bug Fixes
* remove collapsible label prefix from the FieldSelect dropdown component ([#10760](https://github.com/payloadcms/payload/issues/10760)) ([a5e6ea5](https://github.com/payloadcms/payload/commit/a5e6ea57373591ec90f452ad61b376f72f9ce304)), closes [#10757](https://github.com/payloadcms/payload/issues/10757)
### Bug Fixes

View File

@@ -116,7 +116,26 @@
"dotenv": "$dotenv",
"drizzle-orm": "$drizzle-orm",
"ts-node": "$ts-node",
"typescript": "$typescript"
"typescript": "$typescript",
"braces@<3.0.3": "^3.0.3",
"ws@>=8.0.0 <8.17.1": "^8.17.1",
"ws@>=7.0.0 <7.5.10": "^7.5.10",
"micromatch@<4.0.8": "^4.0.8",
"vite@>=4.0.0 <4.5.4": "^4.5.4",
"vite@>=4.0.0 <=4.5.3": "^4.5.4",
"rollup@>=3.0.0 <3.29.5": "^3.29.5",
"@sentry/browser@<7.119.1": "^7.119.1",
"send@<0.19.0": "^0.19.0",
"serve-static@<1.16.0": "^1.16.0",
"cross-spawn@<6.0.6": "^6.0.6",
"cross-spawn@>=7.0.0 <7.0.5": "^7.0.5",
"nanoid@<3.3.8": "^3.3.8",
"path-to-regexp@>=0.2.0 <1.9.0": "^1.9.0",
"esbuild@<=0.24.2": "^0.25.0",
"vite@<=4.5.5": "^4.5.6",
"prismjs@<1.30.0": "^1.30.0",
"@babel/runtime@<7.26.10": "^7.26.10",
"@babel/helpers@<7.26.10": "^7.26.10"
}
},
"engines": {

View File

@@ -1,6 +1,6 @@
{
"name": "@payloadcms/bundler-vite",
"version": "0.1.7",
"version": "0.1.9",
"description": "The officially supported Vite bundler adapter for Payload",
"repository": {
"type": "git",

View File

@@ -1,6 +1,6 @@
{
"name": "@payloadcms/bundler-webpack",
"version": "1.0.7",
"version": "1.0.9",
"description": "The officially supported Webpack bundler adapter for Payload",
"repository": {
"type": "git",

View File

@@ -1,6 +1,6 @@
{
"name": "@payloadcms/db-mongodb",
"version": "1.7.3",
"version": "1.7.5",
"description": "The officially supported MongoDB database adapter for Payload",
"repository": {
"type": "git",

View File

@@ -1,6 +1,6 @@
{
"name": "payload",
"version": "2.32.1",
"version": "2.32.3",
"description": "Node, React and MongoDB Headless CMS and Application Framework",
"license": "MIT",
"main": "./dist/index.js",

View File

@@ -122,7 +122,7 @@ const Condition: React.FC<Props> = (props) => {
onChange: setInternalValue,
operator: operatorValue,
options: valueOptions,
value: internalValue,
value: internalValue ?? '',
}}
/>
</div>

View File

@@ -273,19 +273,26 @@ const WhereBuilder: React.FC<Props> = (props) => {
{orIndex !== 0 && <div className={`${baseClass}__label`}>{t('or')}</div>}
<ul className={`${baseClass}__and-filters`}>
{Array.isArray(or?.and) &&
or.and.map((_, andIndex) => (
<li key={andIndex}>
{andIndex !== 0 && <div className={`${baseClass}__label`}>{t('and')}</div>}
<Condition
andIndex={andIndex}
dispatch={dispatchConditions}
fields={reducedFields}
key={andIndex}
orIndex={orIndex}
value={conditions[orIndex].and[andIndex]}
/>
</li>
))}
or.and.map((_, andIndex) => {
const condition = conditions[orIndex].and[andIndex]
const fieldName = Object.keys(condition)[0]
const operator = Object.keys(condition?.[fieldName] || {})?.[0]
return (
<li key={andIndex}>
{andIndex !== 0 && (
<div className={`${baseClass}__label`}>{t('and')}</div>
)}
<Condition
andIndex={andIndex}
dispatch={dispatchConditions}
fields={reducedFields}
key={`${fieldName}-${operator}-${andIndex}-${orIndex}`}
orIndex={orIndex}
value={condition}
/>
</li>
)
})}
</ul>
</li>
))}

View File

@@ -74,7 +74,7 @@ export const Upload: React.FC<Props> = (props) => {
const handleFileChange = useCallback(
(newFile: File) => {
if (newFile instanceof File) {
if (newFile instanceof File && isImage(newFile.type)) {
const fileReader = new FileReader()
fileReader.onload = (e) => {
const imgSrc = e.target?.result

View File

@@ -1,7 +1,7 @@
{
"name": "@payloadcms/plugin-cloud-storage",
"description": "The official cloud storage plugin for Payload CMS",
"version": "1.2.0",
"version": "1.2.2",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",

View File

@@ -1,7 +1,7 @@
{
"name": "@payloadcms/plugin-cloud",
"description": "The official Payload Cloud plugin",
"version": "3.0.2",
"version": "3.0.4",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",

View File

@@ -1,6 +1,6 @@
{
"name": "@payloadcms/plugin-relationship-object-ids",
"version": "0.0.4",
"version": "0.0.6",
"homepage:": "https://payloadcms.com",
"repository": {
"type": "git",

View File

@@ -1,6 +1,6 @@
{
"name": "@payloadcms/plugin-sentry",
"version": "0.0.6",
"version": "0.0.8",
"homepage:": "https://payloadcms.com",
"repository": {
"type": "git",

View File

@@ -1,6 +1,6 @@
{
"name": "@payloadcms/plugin-stripe",
"version": "0.0.17",
"version": "0.0.19",
"homepage:": "https://payloadcms.com",
"repository": {
"type": "git",

1033
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff