Files
klz-cables.com/.pnpm-store/v10/files/b9/48e57f8f50fa14c2ec826fb933f9499714195c5e14e29b27dfe2881ae9180fdaa87267ec6af2199fa5f4e24507e90e19ae1220e8827de69c394f7cb455c9da
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

68 lines
1.8 KiB
Plaintext

import { hasAutosaveEnabled, hasDraftsEnabled } from '../utilities/getVersionsConfig.js';
import { versionSnapshotField } from './baseFields.js';
export const buildVersionGlobalFields = (config, global, flatten)=>{
const fields = [
{
name: 'version',
type: 'group',
fields: global.fields,
...flatten && {
flattenedFields: global.flattenedFields
}
},
{
name: 'createdAt',
type: 'date',
admin: {
disabled: true
},
index: true
},
{
name: 'updatedAt',
type: 'date',
admin: {
disabled: true
},
index: true
}
];
if (hasDraftsEnabled(global)) {
if (config.localization) {
fields.push(versionSnapshotField);
fields.push({
name: 'publishedLocale',
type: 'select',
admin: {
disableBulkEdit: true,
disabled: true
},
index: true,
options: config.localization.locales.map((locale)=>{
if (typeof locale === 'string') {
return locale;
}
return locale.code;
})
});
}
fields.push({
name: 'latest',
type: 'checkbox',
admin: {
disabled: true
},
index: true
});
if (hasAutosaveEnabled(global)) {
fields.push({
name: 'autosave',
type: 'checkbox',
index: true
});
}
}
return fields;
};
//# sourceMappingURL=buildGlobalFields.js.map