From 3f7b054b762652da908c8ec6196706c28c2a34c0 Mon Sep 17 00:00:00 2001 From: Tishasoumya-02 Date: Mon, 12 Aug 2024 17:11:11 +0530 Subject: [PATCH] Remove storybook tests and replace /news --- news/4959.feature | 1 - packages/volto/news/4959.feature | 1 + .../manage/Blocks/LeadImage/Edit.jsx | 4 +- .../manage/Blocks/LeadImage/Edit.stories.jsx | 73 ------------------- .../Blocks/LeadImage/LeadImage.stories.jsx | 72 ------------------ 5 files changed, 3 insertions(+), 148 deletions(-) delete mode 100644 news/4959.feature create mode 100644 packages/volto/news/4959.feature delete mode 100644 packages/volto/src/components/manage/Blocks/LeadImage/Edit.stories.jsx delete mode 100644 packages/volto/src/components/manage/Blocks/LeadImage/LeadImage.stories.jsx diff --git a/news/4959.feature b/news/4959.feature deleted file mode 100644 index 202c8b4c7d..0000000000 --- a/news/4959.feature +++ /dev/null @@ -1 +0,0 @@ -Refactor Blocks/LeadImage/Edit component -@Tishasoumya-02 \ No newline at end of file diff --git a/packages/volto/news/4959.feature b/packages/volto/news/4959.feature new file mode 100644 index 0000000000..81e63b0f64 --- /dev/null +++ b/packages/volto/news/4959.feature @@ -0,0 +1 @@ +Refactor Blocks/LeadImage/Edit component from class to functional component. @Tishasoumya-02 \ No newline at end of file diff --git a/packages/volto/src/components/manage/Blocks/LeadImage/Edit.jsx b/packages/volto/src/components/manage/Blocks/LeadImage/Edit.jsx index 0ed8779e2c..7c49e50c33 100644 --- a/packages/volto/src/components/manage/Blocks/LeadImage/Edit.jsx +++ b/packages/volto/src/components/manage/Blocks/LeadImage/Edit.jsx @@ -68,8 +68,8 @@ const Edit = React.memo((props) => { return data.align === 'full' || data.align === 'center' ? '100vw' : data.align === 'left' || data.align === 'right' - ? '50vw' - : undefined; + ? '50vw' + : undefined; }} alt={altText} /> diff --git a/packages/volto/src/components/manage/Blocks/LeadImage/Edit.stories.jsx b/packages/volto/src/components/manage/Blocks/LeadImage/Edit.stories.jsx deleted file mode 100644 index 5fb0441c0a..0000000000 --- a/packages/volto/src/components/manage/Blocks/LeadImage/Edit.stories.jsx +++ /dev/null @@ -1,73 +0,0 @@ -import { injectIntl } from 'react-intl'; -import React from 'react'; -import LeadImageComponent from './Edit'; -import { RealStoreWrapper as Wrapper } from '@plone/volto/storybook'; - -const IntlLeadImageComponent = injectIntl(LeadImageComponent); - -function StoryComponent(args) { - return ( - -
- {}} - onChangeField={() => {}} - index={1} - openObjectBrowser={() => {}} - /> - - ); -} - -export const LeadImage = StoryComponent.bind({}); -LeadImage.args = { - image: { - download: - 'https://plone.org/news-and-events/news/2023/plone-6-0-1-released/@@images/image/preview', - }, -}; -export default { - title: 'Public components/LeadImage/LeadImage', - component: LeadImage, - decorators: [ - (Story) => ( -
- -
- ), - ], - argTypes: {}, -}; diff --git a/packages/volto/src/components/manage/Blocks/LeadImage/LeadImage.stories.jsx b/packages/volto/src/components/manage/Blocks/LeadImage/LeadImage.stories.jsx deleted file mode 100644 index 63a65fbdb4..0000000000 --- a/packages/volto/src/components/manage/Blocks/LeadImage/LeadImage.stories.jsx +++ /dev/null @@ -1,72 +0,0 @@ -import { injectIntl } from 'react-intl'; -import React from 'react'; -import LeadImageSidebarComponent from './LeadImageSidebar'; -import { RealStoreWrapper as Wrapper } from '@plone/volto/storybook'; -import { action } from '@storybook/addon-actions'; - -const IntlLeadImageSidebarComponent = injectIntl(LeadImageSidebarComponent); - -function StoryComponent(args) { - return ( - -
- {}} - onChangeField={() => {}} - /> - - ); -} - -export const LeadImageSidebar = StoryComponent.bind({}); - -LeadImageSidebar.args = { - image_caption: 'Plone 6', - image: { - download: - 'https://plone.org/news-and-events/news/2023/plone-6-0-1-released/@@images/image/preview', - }, -}; - -export default { - title: 'Public components/LeadImage/LeadImageSidebar', - component: LeadImageSidebar, - - decorators: [ - (Story) => ( -
- -
- ), - ], - - argTypes: {}, -};