Skip to content

Commit

Permalink
Add isCustom field & filter
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed May 28, 2024
1 parent 0069ae8 commit c821e44
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/edit-site/src/components/page-templates/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { useAddedBy } from './hooks';
import {
TEMPLATE_POST_TYPE,
OPERATOR_IS_ANY,
OPERATOR_IS,
LAYOUT_GRID,
LAYOUT_TABLE,
LAYOUT_LIST,
Expand All @@ -62,6 +63,7 @@ const defaultConfigPerViewType = {
mediaField: 'preview',
primaryField: 'title',
columnFields: [ 'description' ],
badgeFields: [ 'isCustom' ],
},
[ LAYOUT_LIST ]: {
primaryField: 'title',
Expand Down Expand Up @@ -339,6 +341,20 @@ export default function PageTemplates() {
operators: [ OPERATOR_IS_ANY ],
},
},
{
header: __( 'Type' ),
id: 'isCustom',
getValue: ( { item } ) => item.is_custom,
render: ( { item } ) =>
item.is_custom ? 'Custom' : undefined,
elements: [
{ value: true, label: 'Custom' },
{ value: false, label: 'Default' },
],
filterBy: {
operators: [ OPERATOR_IS ],
},
},
],
[ authors, view.type ]
);
Expand Down

0 comments on commit c821e44

Please sign in to comment.