Skip to content

Commit

Permalink
feat: Auto-hide description field for list view in template dataview …
Browse files Browse the repository at this point in the history
…page

Signed-off-by: Souptik Datta <souptikdatta2001@gmail.com>
  • Loading branch information
Souptik2001 committed May 26, 2024
1 parent 278810c commit c96ee99
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/edit-site/src/components/page-templates/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ export default function PageTemplates() {
return {
...DEFAULT_VIEW,
type: usedType,
hiddenFields:
LAYOUT_LIST === usedType
? [ ...DEFAULT_VIEW.hiddenFields, 'description' ]
: DEFAULT_VIEW.hiddenFields,
layout: defaultConfigPerViewType[ usedType ],
filters:
activeView !== 'all'
Expand Down Expand Up @@ -335,6 +339,10 @@ export default function PageTemplates() {
if ( newView.type !== view.type ) {
newView = {
...newView,
hiddenFields:
LAYOUT_LIST === newView.type
? [ ...newView.hiddenFields, 'description' ]
: newView.hiddenFields,
layout: {
...defaultConfigPerViewType[ newView.type ],
},
Expand Down

0 comments on commit c96ee99

Please sign in to comment.