Files
klz-cables.com/.pnpm-store/v10/files/bb/687dd749f73a636768c888e0ff841fdb835d729aab4a4f8586faa1a5d63c9f738feee2163e33a87b8c0ccd66384321f1602f6dcad7659dfb9a8bfae6542192
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
3.6 KiB
Plaintext

{"version":3,"sources":["../../src/versions/buildCollectionFields.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../collections/config/types.js'\nimport type { SanitizedConfig } from '../config/types.js'\nimport type { Field, FlattenedField } from '../fields/config/types.js'\n\nimport { hasAutosaveEnabled, hasDraftsEnabled } from '../utilities/getVersionsConfig.js'\nimport { versionSnapshotField } from './baseFields.js'\n\nexport const buildVersionCollectionFields = <T extends boolean = false>(\n config: SanitizedConfig,\n collection: SanitizedCollectionConfig,\n flatten?: T,\n): true extends T ? FlattenedField[] : Field[] => {\n const fields: FlattenedField[] = [\n {\n name: 'parent',\n type: 'relationship',\n index: true,\n relationTo: collection.slug,\n },\n {\n name: 'version',\n type: 'group',\n fields: collection.fields.filter((field) => !('name' in field) || field.name !== 'id'),\n ...(flatten && {\n flattenedFields: collection.flattenedFields.filter((each) => each.name !== 'id'),\n })!,\n },\n {\n name: 'createdAt',\n type: 'date',\n admin: {\n disabled: true,\n },\n index: true,\n },\n {\n name: 'updatedAt',\n type: 'date',\n admin: {\n disabled: true,\n },\n index: true,\n },\n ]\n\n if (hasDraftsEnabled(collection)) {\n if (config.localization) {\n fields.push(versionSnapshotField)\n\n fields.push({\n name: 'publishedLocale',\n type: 'select',\n admin: {\n disableBulkEdit: true,\n disabled: true,\n },\n index: true,\n options: config.localization.locales.map((locale) => {\n if (typeof locale === 'string') {\n return locale\n }\n\n return locale.code\n }),\n })\n }\n\n fields.push({\n name: 'latest',\n type: 'checkbox',\n admin: {\n disabled: true,\n },\n index: true,\n })\n\n if (hasAutosaveEnabled(collection)) {\n fields.push({\n name: 'autosave',\n type: 'checkbox',\n index: true,\n })\n }\n }\n\n return fields as true extends T ? FlattenedField[] : Field[]\n}\n"],"names":["hasAutosaveEnabled","hasDraftsEnabled","versionSnapshotField","buildVersionCollectionFields","config","collection","flatten","fields","name","type","index","relationTo","slug","filter","field","flattenedFields","each","admin","disabled","localization","push","disableBulkEdit","options","locales","map","locale","code"],"mappings":"AAIA,SAASA,kBAAkB,EAAEC,gBAAgB,QAAQ,oCAAmC;AACxF,SAASC,oBAAoB,QAAQ,kBAAiB;AAEtD,OAAO,MAAMC,+BAA+B,CAC1CC,QACAC,YACAC;IAEA,MAAMC,SAA2B;QAC/B;YACEC,MAAM;YACNC,MAAM;YACNC,OAAO;YACPC,YAAYN,WAAWO,IAAI;QAC7B;QACA;YACEJ,MAAM;YACNC,MAAM;YACNF,QAAQF,WAAWE,MAAM,CAACM,MAAM,CAAC,CAACC,QAAU,CAAE,CAAA,UAAUA,KAAI,KAAMA,MAAMN,IAAI,KAAK;YACjF,GAAIF,WAAW;gBACbS,iBAAiBV,WAAWU,eAAe,CAACF,MAAM,CAAC,CAACG,OAASA,KAAKR,IAAI,KAAK;YAC7E,CAAC;QACH;QACA;YACEA,MAAM;YACNC,MAAM;YACNQ,OAAO;gBACLC,UAAU;YACZ;YACAR,OAAO;QACT;QACA;YACEF,MAAM;YACNC,MAAM;YACNQ,OAAO;gBACLC,UAAU;YACZ;YACAR,OAAO;QACT;KACD;IAED,IAAIT,iBAAiBI,aAAa;QAChC,IAAID,OAAOe,YAAY,EAAE;YACvBZ,OAAOa,IAAI,CAAClB;YAEZK,OAAOa,IAAI,CAAC;gBACVZ,MAAM;gBACNC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