Skip to content

Commit

Permalink
Custom/Not custom template
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed May 30, 2024
1 parent 1a776f2 commit 895214a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/edit-site/src/components/page-templates/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ const defaultConfigPerViewType = {
mediaField: 'preview',
primaryField: 'title',
columnFields: [ 'description' ],
badgeFields: [ 'isCustom' ],
},
[ LAYOUT_LIST ]: {
primaryField: 'title',
Expand All @@ -82,8 +81,7 @@ const DEFAULT_VIEW = {
},
// All fields are visible by default, so it's
// better to keep track of the hidden ones.
hiddenFields: [ 'preview' ],
// hiddenFields: [ 'preview', 'postTypes' ],
hiddenFields: [ 'preview', 'postTypes', 'isCustom' ],
layout: defaultConfigPerViewType[ LAYOUT_GRID ],
filters: [],
};
Expand Down Expand Up @@ -206,6 +204,9 @@ const TEMPLATE_TO_POST_TYPE = {
'single-post': [ 'post' ],
};

const CUSTOM_TEMPLATE = __( 'Custom' );
const NOT_CUSTOM_TEMPLATE = __( 'Not custom' );

export default function PageTemplates() {
const { params } = useLocation();
const { activeView = 'all', layout } = params;
Expand Down Expand Up @@ -388,12 +389,12 @@ export default function PageTemplates() {
{
header: __( 'Type' ),
id: 'isCustom',
getValue: ( { item } ) => item.is_custom,
getValue: ( { item } ) => !! item.is_custom,
render: ( { item } ) =>
item.is_custom ? 'Custom' : undefined,
!! item.is_custom ? CUSTOM_TEMPLATE : NOT_CUSTOM_TEMPLATE,
elements: [
{ value: true, label: 'Custom' },
{ value: false, label: 'Default' },
{ value: true, label: CUSTOM_TEMPLATE },
{ value: false, label: NOT_CUSTOM_TEMPLATE },
],
filterBy: {
operators: [ OPERATOR_IS ],
Expand Down

0 comments on commit 895214a

Please sign in to comment.