From 250ec43d3822a40cf8ae420b0a0db31afcd4d2a7 Mon Sep 17 00:00:00 2001 From: James Koster Date: Wed, 17 Jan 2024 17:02:15 +0000 Subject: [PATCH 1/4] Templates --- packages/dataviews/src/style.scss | 15 ++++++++- packages/dataviews/src/view-table.js | 9 +++-- .../src/components/page-templates/index.js | 33 +++++++++++-------- .../src/components/page-templates/style.scss | 4 +++ 4 files changed, 44 insertions(+), 17 deletions(-) diff --git a/packages/dataviews/src/style.scss b/packages/dataviews/src/style.scss index 156a901460048..e1f92d94de91d 100644 --- a/packages/dataviews/src/style.scss +++ b/packages/dataviews/src/style.scss @@ -59,6 +59,10 @@ margin: $grid-unit-40 0 $grid-unit-20; } +.dataviews-view-table-wrapper { + overflow-x: scroll; +} + .dataviews-view-table { width: 100%; text-indent: 0; @@ -81,7 +85,12 @@ td, th { padding: $grid-unit-15; - min-width: 160px; + white-space: nowrap; + + @include break-huge() { + min-width: 200px; + } + &[data-field-id="actions"] { text-align: right; } @@ -200,6 +209,10 @@ .dataviews-view-table-header { padding-left: $grid-unit-05; } + + .dataviews-view-table__actions-column { + width: 1%; + } } .dataviews-view-list__primary-field, diff --git a/packages/dataviews/src/view-table.js b/packages/dataviews/src/view-table.js index 8be188bf91c81..361b4091d646f 100644 --- a/packages/dataviews/src/view-table.js +++ b/packages/dataviews/src/view-table.js @@ -437,7 +437,7 @@ function ViewTable( { ); return ( -
+
) ) } { !! actions?.length && ( -
+ { __( 'Actions' ) } @@ -581,7 +584,7 @@ function ViewTable( { ) ) } { !! actions?.length && ( - + item.description, render: ( { item } ) => { - return item.description - ? decodeEntities( item.description ) - : view.type === LAYOUT_TABLE && ( - <> - - - { __( 'No description.' ) } - - - ); + return item.description ? ( + + { decodeEntities( item.description ) } + + ) : ( + view.type === LAYOUT_TABLE && ( + <> + + + { __( 'No description.' ) } + + + ) + ); }, - maxWidth: 200, + maxWidth: 420, + minWidth: 360, + //width: '1%', enableSorting: false, }, { @@ -242,6 +248,7 @@ export default function DataviewsTemplates() { enableHiding: false, type: ENUMERATION_TYPE, elements: authors, + width: '1%', }, ], [ authors, view.type ] diff --git a/packages/edit-site/src/components/page-templates/style.scss b/packages/edit-site/src/components/page-templates/style.scss index ed4484550b48d..9fdca6d15d560 100644 --- a/packages/edit-site/src/components/page-templates/style.scss +++ b/packages/edit-site/src/components/page-templates/style.scss @@ -11,3 +11,7 @@ } } } + +.page-templates-description { + white-space: normal; +} From 9490785faae195ccb08fd8f1d7379d8decd9c865 Mon Sep 17 00:00:00 2001 From: James Koster Date: Wed, 17 Jan 2024 17:07:32 +0000 Subject: [PATCH 2/4] Remove commeent --- packages/edit-site/src/components/page-templates/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/edit-site/src/components/page-templates/index.js b/packages/edit-site/src/components/page-templates/index.js index 7bc8a97813641..f5793c71a8ca0 100644 --- a/packages/edit-site/src/components/page-templates/index.js +++ b/packages/edit-site/src/components/page-templates/index.js @@ -235,7 +235,6 @@ export default function DataviewsTemplates() { }, maxWidth: 420, minWidth: 360, - //width: '1%', enableSorting: false, }, { From 2035a3067b3d81148a5597ba645c5e26ca63a089 Mon Sep 17 00:00:00 2001 From: James Koster Date: Wed, 17 Jan 2024 17:11:52 +0000 Subject: [PATCH 3/4] Proportions --- packages/edit-site/src/components/page-templates/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/edit-site/src/components/page-templates/index.js b/packages/edit-site/src/components/page-templates/index.js index f5793c71a8ca0..ddf4c18a3ce7f 100644 --- a/packages/edit-site/src/components/page-templates/index.js +++ b/packages/edit-site/src/components/page-templates/index.js @@ -233,8 +233,8 @@ export default function DataviewsTemplates() { ) ); }, - maxWidth: 420, - minWidth: 360, + maxWidth: 400, + minWidth: 320, enableSorting: false, }, { From 3be34cf1a858722acacabf07075b836d841ed062 Mon Sep 17 00:00:00 2001 From: ntsekouras Date: Thu, 18 Jan 2024 10:01:34 +0200 Subject: [PATCH 4/4] lint offense --- packages/dataviews/src/style.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dataviews/src/style.scss b/packages/dataviews/src/style.scss index e1f92d94de91d..a87b4a82c1ecd 100644 --- a/packages/dataviews/src/style.scss +++ b/packages/dataviews/src/style.scss @@ -90,7 +90,7 @@ @include break-huge() { min-width: 200px; } - + &[data-field-id="actions"] { text-align: right; }