Files
klz-cables.com/.pnpm-store/v10/files/2e/393ed1a6a14c76ab8ce8961df36494174f5a37a33587552870f267cec5020177e2f05e78727bc2fbc5ec0b5c8edb3ee779391b1646e3847c54b0501ddaa97b
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

1 line
2.7 KiB
Plaintext

{"version":3,"file":"index.js","names":["toWords","React","transformWhereToNaturalLanguage","where","or","length","and","orQuery","andQuery","key","Object","keys","operator","value","Array","isArray","map","val","join","QueryPresetsWhereCell","cellData","_jsx"],"sources":["../../../../../src/elements/QueryPresets/cells/WhereCell/index.tsx"],"sourcesContent":["import type { DefaultCellComponentProps, Where } from 'payload'\n\nimport { toWords } from 'payload/shared'\nimport React from 'react'\n\n/** @todo: improve this */\nconst transformWhereToNaturalLanguage = (where: Where): string => {\n if (where.or && where.or.length > 0 && where.or[0].and && where.or[0].and.length > 0) {\n const orQuery = where.or[0]\n const andQuery = orQuery?.and?.[0]\n\n if (!andQuery || typeof andQuery !== 'object') {\n return 'No where query'\n }\n\n const key = Object.keys(andQuery)[0]\n\n if (!key || !andQuery[key] || typeof andQuery[key] !== 'object') {\n return 'No where query'\n }\n\n const operator = Object.keys(andQuery[key])[0]\n const value = andQuery[key][operator]\n\n if (typeof value === 'string') {\n return `${toWords(key)} ${operator} ${toWords(value)}`\n } else if (Array.isArray(value)) {\n return `${toWords(key)} ${operator} ${value.map((val) => toWords(val)).join(' or ')}`\n }\n }\n\n return ''\n}\n\nexport const QueryPresetsWhereCell: React.FC<DefaultCellComponentProps> = ({ cellData }) => {\n return <div>{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