From 9e8099b344c71899939090e5f053f3ee94fe462a Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Thu, 5 Dec 2024 16:06:55 +0100 Subject: [PATCH] Updates per design review --- .../dataviews-view-config/index.tsx | 75 ++++++++++++------- .../dataviews-view-config/style.scss | 15 ++-- 2 files changed, 55 insertions(+), 35 deletions(-) diff --git a/packages/dataviews/src/components/dataviews-view-config/index.tsx b/packages/dataviews/src/components/dataviews-view-config/index.tsx index b6040b1315ffe..28e48525ffa73 100644 --- a/packages/dataviews/src/components/dataviews-view-config/index.tsx +++ b/packages/dataviews/src/components/dataviews-view-config/index.tsx @@ -23,10 +23,18 @@ import { __experimentalText as Text, privateApis as componentsPrivateApis, BaseControl, + Icon, } from '@wordpress/components'; import { __, _x, sprintf } from '@wordpress/i18n'; import { memo, useContext, useMemo } from '@wordpress/element'; -import { chevronDown, chevronUp, cog, seen, unseen } from '@wordpress/icons'; +import { + chevronDown, + chevronUp, + cog, + seen, + unseen, + lock, +} from '@wordpress/icons'; import warning from '@wordpress/warning'; import { useInstanceId } from '@wordpress/compose'; @@ -237,6 +245,7 @@ function FieldItem( { isVisible, isFirst, isLast, + canMove = true, onToggleVisibility, onMoveUp, onMoveDown, @@ -245,6 +254,7 @@ function FieldItem( { isVisible: boolean; isFirst?: boolean; isLast?: boolean; + canMove?: boolean; onToggleVisibility?: () => void; onMoveUp?: () => void; onMoveDown?: () => void; @@ -268,38 +278,54 @@ function FieldItem( { - { field.label } + + { ! canMove && ! field.enableHiding && ( + + ) } + + + { field.label } + - { onMoveUp && onMoveDown && isVisible && ( + { isVisible && ( <>