Files
klz-cables.com/.pnpm-store/v10/files/32/8be32061ae6c38efb051f1fb73fb4d995f0bf51113a17f305bf5b3bdd2cedccc58b5ff799a3354749207ab2e80a66bc6fdf63b4e0a39ff2c1c6b7a8ff83ba9
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
4.6 KiB
Plaintext

{"version":3,"file":"getColumns.js","names":["flattenTopLevelFields","fieldAffectsData","filterFieldsWithPermissions","getInitialColumns","getColumns","clientConfig","collectionConfig","collectionSlug","columns","i18n","permissions","isPolymorphic","Array","isArray","fields","collection","clientCollectionConfig","collections","find","each","slug","field","fieldPermissions","some","name","push","length","filter","column","keepPresentationalFields","moveSubFieldsToTop","accessor","undefined","admin","useAsTitle","defaultColumns"],"sources":["../../src/utilities/getColumns.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type {\n ClientCollectionConfig,\n ClientConfig,\n ColumnPreference,\n SanitizedPermissions,\n} from 'payload'\n\nimport { flattenTopLevelFields } from 'payload'\nimport { fieldAffectsData } from 'payload/shared'\n\nimport { filterFieldsWithPermissions } from '../providers/TableColumns/buildColumnState/filterFieldsWithPermissions.js'\nimport { getInitialColumns } from '../providers/TableColumns/getInitialColumns.js'\n\nexport const getColumns = ({\n clientConfig,\n collectionConfig,\n collectionSlug,\n columns,\n i18n,\n permissions,\n}: {\n clientConfig: ClientConfig\n collectionConfig?: ClientCollectionConfig\n collectionSlug: string | string[]\n columns: ColumnPreference[]\n i18n: I18nClient\n permissions?: SanitizedPermissions\n}) => {\n const isPolymorphic = Array.isArray(collectionSlug)\n\n const fields = !isPolymorphic ? (collectionConfig?.fields ?? []) : []\n\n if (isPolymorphic) {\n for (const collection of collectionSlug) {\n const clientCollectionConfig = clientConfig.collections.find(\n (each) => each.slug === collection,\n )\n\n for (const field of filterFieldsWithPermissions({\n fieldPermissions: permissions?.collections?.[collection]?.fields || true,\n fields: clientCollectionConfig.fields,\n })) {\n if (fieldAffectsData(field)) {\n if (fields.some((each) => fieldAffectsData(each) && each.name === field.name)) {\n continue\n }\n }\n\n fields.push(field)\n }\n }\n }\n\n return columns?.length\n ? columns?.filter((column) =>\n flattenTopLevelFields(fields, {\n i18n,\n keepPresentationalFields: true,\n moveSubFieldsToTop: true,\n })?.some((field) => {\n const accessor =\n 'accessor' in field ? field.accessor : 'name' in field ? field.name : undefined\n return accessor === column.accessor\n }),\n )\n : getInitialColumns(\n isPolymorphic\n ? fields\n : filterFieldsWithPermissions({\n fieldPermissions:\n typeof collectionSlug === 'string' &&\n permissions?.collections?.[collectionSlug]?.fields\n ? permissions.collections[collectionSlug].fields\n : true,\n fields,\n }),\n collectionConfig?.admin?.useAsTitle,\n isPolymorphic ? [] : collectionConfig?.admin?.defaultColumns,\n )\n}\n"],"mappings":"AAQA,SAASA,qBAAqB,QAAQ;AACtC,SAASC,gBAAgB,QAAQ;AAEjC,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,iBAAiB,QAAQ;AAElC,OAAO,MAAMC,UAAA,GAAaA,CAAC;EACzBC,YAAY;EACZC,gBAAgB;EAChBC,cAAc;EACdC,OAAO;EACPC,IAAI;EACJC;AAAW,CAQZ;EACC,MAAMC,aAAA,GAAgBC,KAAA,CAAMC,OAAO,CAACN,cAAA;EAEpC,MAAMO,MAAA,GAAS,CAACH,aAAA,GAAiBL,gBAAA,EAAkBQ,MAAA,IAAU,EAAE,GAAI,EAAE;EAErE,IAAIH,aAAA,EAAe;IACjB,KAAK,MAAMI,UAAA,IAAcR,cAAA,EAAgB;MACvC,MAAMS,sBAAA,GAAyBX,Y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