Skip to content

Commit

Permalink
chore: roll back PR #2396
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikrut committed Mar 27, 2023
1 parent 4bb0bdc commit 0ca5851
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/admin/components/elements/TableColumns/buildColumns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ const buildColumns = ({
columns: Pick<Column, 'accessor' | 'active'>[],
cellProps: Partial<CellProps>[]
}): Column[] => {
const filteredFields = collection.fields.filter((field) => fieldIsPresentationalOnly(field) || !field.admin?.hidden);

// sort the fields to the order of activeColumns
const sortedFields = flattenFields(filteredFields, true).sort((a, b) => {
const sortedFields = flattenFields(collection.fields, true).sort((a, b) => {
const aIndex = columns.findIndex((column) => column.accessor === a.name);
const bIndex = columns.findIndex((column) => column.accessor === b.name);
if (aIndex === -1 && bIndex === -1) return 0;
Expand Down
5 changes: 3 additions & 2 deletions src/admin/components/views/collections/List/formatFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Field, fieldAffectsData, fieldIsPresentationalOnly } from '../../../../
const formatFields = (config: SanitizedCollectionConfig, t: TFunction): Field[] => {
const hasID = config.fields.findIndex((field) => fieldAffectsData(field) && field.name === 'id') > -1;
const fields: Field[] = config.fields.reduce((formatted, field) => {
if (!fieldIsPresentationalOnly(field) && (field.hidden === true || field.admin?.hidden === true || field.admin?.disabled === true)) {
if (!fieldIsPresentationalOnly(field) && (field.hidden === true || field?.admin?.disabled === true)) {
return formatted;
}

Expand All @@ -32,7 +32,8 @@ const formatFields = (config: SanitizedCollectionConfig, t: TFunction): Field[]
admin: {
disableBulkEdit: true,
},
}, {
},
{
name: 'updatedAt',
label: t('general:updatedAt'),
type: 'date',
Expand Down

0 comments on commit 0ca5851

Please sign in to comment.