Files
klz-cables.com/.pnpm-store/v10/files/80/a77c32cbf33fde9fea0e1e96df9618080a0b66fee4c2dd65890cd894a0fb477681e3fc8b784fe2e8a368f7637cc1b3a2c4fa831f6815154da9d545eb815db3
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

88 lines
2.2 KiB
Plaintext

import { jsx as _jsx } from "react/jsx-runtime";
import { SortColumn } from '@payloadcms/ui';
import { hasDraftsEnabled } from 'payload/shared';
import React from 'react';
import { AutosaveCell } from './cells/AutosaveCell/index.js';
import { CreatedAtCell } from './cells/CreatedAt/index.js';
import { IDCell } from './cells/ID/index.js';
export const buildVersionColumns = ({
collectionConfig,
CreatedAtCellOverride,
currentlyPublishedVersion,
docID,
docs,
globalConfig,
i18n: {
t
},
isTrashed,
latestDraftVersion
}) => {
const entityConfig = collectionConfig || globalConfig;
const CreatedAtCellComponent = CreatedAtCellOverride ?? CreatedAtCell;
const columns = [{
accessor: 'updatedAt',
active: true,
field: {
name: '',
type: 'date'
},
Heading: /*#__PURE__*/_jsx(SortColumn, {
Label: t('general:updatedAt'),
name: "updatedAt"
}),
renderedCells: docs.map((doc, i) => {
return /*#__PURE__*/_jsx(CreatedAtCellComponent, {
collectionSlug: collectionConfig?.slug,
docID: docID,
globalSlug: globalConfig?.slug,
isTrashed: isTrashed,
rowData: {
id: doc.id,
updatedAt: doc.updatedAt
}
}, i);
})
}, {
accessor: 'id',
active: true,
field: {
name: '',
type: 'text'
},
Heading: /*#__PURE__*/_jsx(SortColumn, {
disable: true,
Label: t('version:versionID'),
name: "id"
}),
renderedCells: docs.map((doc, i) => {
return /*#__PURE__*/_jsx(IDCell, {
id: doc.id
}, i);
})
}];
if (hasDraftsEnabled(entityConfig)) {
columns.push({
accessor: '_status',
active: true,
field: {
name: '',
type: 'checkbox'
},
Heading: /*#__PURE__*/_jsx(SortColumn, {
disable: true,
Label: t('version:status'),
name: "status"
}),
renderedCells: docs.map((doc, i) => {
return /*#__PURE__*/_jsx(AutosaveCell, {
currentlyPublishedVersion: currentlyPublishedVersion,
latestDraftVersion: latestDraftVersion,
rowData: doc
}, i);
})
});
}
return columns;
};
//# sourceMappingURL=buildColumns.js.map