From c07236664e1f290180f6f8e0e7c731694503a467 Mon Sep 17 00:00:00 2001 From: dobri1408 <50819975+dobri1408@users.noreply.github.com> Date: Tue, 16 Jul 2024 13:06:16 +0300 Subject: [PATCH 1/4] Show error in metadata section --- .../manage/Blocks/MetadataSection/EditMetadataSection.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/manage/Blocks/MetadataSection/EditMetadataSection.jsx b/src/components/manage/Blocks/MetadataSection/EditMetadataSection.jsx index 432001d..00fff1c 100644 --- a/src/components/manage/Blocks/MetadataSection/EditMetadataSection.jsx +++ b/src/components/manage/Blocks/MetadataSection/EditMetadataSection.jsx @@ -1,9 +1,9 @@ import React from 'react'; import cx from 'classnames'; -import { useSelector } from 'react-redux'; import { BlockDataForm, Field, SidebarPortal } from '@plone/volto/components'; import MetadataSectionSchema from './schema'; import '@eeacms/volto-metadata-block/less/editor.less'; +import { useSelector } from 'react-redux'; const EditMetadataSectionBlock = (props) => { const { @@ -14,6 +14,7 @@ const EditMetadataSectionBlock = (props) => { properties, metadata, onChangeField, + errors, } = props; const schema = useSelector((state) => state?.schema?.schema || {}); let metadata_element = {}; @@ -59,6 +60,7 @@ const EditMetadataSectionBlock = (props) => { }} key={metadata_id} block={block} + error={errors?.[metadata_id]} /> ) ); From 0607cfaba55c37e23da46044bac0931fbd061d25 Mon Sep 17 00:00:00 2001 From: dobri1408 <50819975+dobri1408@users.noreply.github.com> Date: Tue, 16 Jul 2024 13:06:37 +0300 Subject: [PATCH 2/4] Style error in metadata section --- src/less/public.less | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/less/public.less b/src/less/public.less index 086c096..5965b5c 100644 --- a/src/less/public.less +++ b/src/less/public.less @@ -9,3 +9,9 @@ label.metadata.block { font-weight: bold; } + +.block.metadata-section { + .form-error-label { + border: none !important; + } +} From 8505c3cbebbeec0c2ffa232f453ea35dc007a876 Mon Sep 17 00:00:00 2001 From: dobri1408 <50819975+dobri1408@users.noreply.github.com> Date: Tue, 16 Jul 2024 13:09:27 +0300 Subject: [PATCH 3/4] Update EditMetadataSection.jsx --- .../manage/Blocks/MetadataSection/EditMetadataSection.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/manage/Blocks/MetadataSection/EditMetadataSection.jsx b/src/components/manage/Blocks/MetadataSection/EditMetadataSection.jsx index 00fff1c..5121e48 100644 --- a/src/components/manage/Blocks/MetadataSection/EditMetadataSection.jsx +++ b/src/components/manage/Blocks/MetadataSection/EditMetadataSection.jsx @@ -1,9 +1,9 @@ import React from 'react'; import cx from 'classnames'; +import { useSelector } from 'react-redux'; import { BlockDataForm, Field, SidebarPortal } from '@plone/volto/components'; import MetadataSectionSchema from './schema'; import '@eeacms/volto-metadata-block/less/editor.less'; -import { useSelector } from 'react-redux'; const EditMetadataSectionBlock = (props) => { const { From 0dc0b2f0785debb89034d06ceeb8036fe0bca5fa Mon Sep 17 00:00:00 2001 From: dobri1408 <50819975+dobri1408@users.noreply.github.com> Date: Tue, 16 Jul 2024 13:28:45 +0300 Subject: [PATCH 4/4] Update package.json for cy tests --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 494d103..c2e7aa9 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,8 @@ "dotenv": "^16.3.2", "husky": "^8.0.3", "lint-staged": "^14.0.1", - "md5": "^2.3.0" + "md5": "^2.3.0", + "cypress": "13.1.0" }, "lint-staged": { "src/**/*.{js,jsx,ts,tsx,json}": [