From 5045757a275477ba382551b301998d835741b716 Mon Sep 17 00:00:00 2001 From: EEA Jenkins Date: Thu, 1 Feb 2024 20:06:52 +0200 Subject: [PATCH 01/19] Add Sonarqube tag using insitu-frontend addons list --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7dc9675..78d82b1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,7 @@ pipeline { environment { GIT_NAME = "volto-tabs-block" NAMESPACE = "@eeacms" - SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,biodiversity.europa.eu,www.eea.europa.eu-ims,sustainability.eionet.europa.eu,forest.eea.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,water.europa.eu-marine,climate-adapt.eea.europa.eu,climate-advisory-board.devel4cph.eea.europa.eu,climate-advisory-board.europa.eu,www.eea.europa.eu-en" + SONARQUBE_TAGS = "volto.eea.europa.eu,climate-energy.eea.europa.eu,biodiversity.europa.eu,www.eea.europa.eu-ims,sustainability.eionet.europa.eu,forest.eea.europa.eu,clms.land.copernicus.eu,industry.eea.europa.eu,water.europa.eu-freshwater,demo-www.eea.europa.eu,clmsdemo.devel6cph.eea.europa.eu,water.europa.eu-marine,climate-adapt.eea.europa.eu,climate-advisory-board.devel4cph.eea.europa.eu,climate-advisory-board.europa.eu,www.eea.europa.eu-en,insitu-frontend.eionet.europa.eu" DEPENDENCIES = "@eeacms/volto-block-style" BACKEND_PROFILES = "eea.kitkat:testing" BACKEND_ADDONS = "" From 11acf6ce5afe022ddd30bff42c9a3321d1284da6 Mon Sep 17 00:00:00 2001 From: Razvan Date: Wed, 6 Mar 2024 17:15:26 +0200 Subject: [PATCH 02/19] use DefaultEdit variation for responsive accordion, refs #266327 --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 5ff14d0..a915dc1 100644 --- a/src/index.js +++ b/src/index.js @@ -74,7 +74,7 @@ const applyConfig = (config) => { { id: 'accordion', title: 'Accordion responsive', - edit: AccordionEdit, + edit: DefaultEdit, view: AccordionView, schemaEnhancer: AccordionEdit.schemaEnhancer, transformWidth: 800, From 61b19e8584ff6023320b3671414392ea11449ff0 Mon Sep 17 00:00:00 2001 From: Razvan Date: Wed, 6 Mar 2024 17:36:04 +0200 Subject: [PATCH 03/19] update --- package.json | 4 +- src/components/templates/accordion/Edit.jsx | 214 -------------------- src/index.js | 5 +- 3 files changed, 5 insertions(+), 218 deletions(-) delete mode 100644 src/components/templates/accordion/Edit.jsx diff --git a/package.json b/package.json index 1ef05fd..4608613 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-tabs-block", - "version": "7.0.5", + "version": "7.1.0", "description": "volto-tabs-block: Volto add-on", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", @@ -76,4 +76,4 @@ "cypress:open": "make cypress-open", "prepare": "husky install" } -} +} \ No newline at end of file diff --git a/src/components/templates/accordion/Edit.jsx b/src/components/templates/accordion/Edit.jsx deleted file mode 100644 index 3e85673..0000000 --- a/src/components/templates/accordion/Edit.jsx +++ /dev/null @@ -1,214 +0,0 @@ -import React from 'react'; -import cx from 'classnames'; -import { isEmpty } from 'lodash'; -import { useIntl } from 'react-intl'; -import Tabs from 'react-responsive-tabs'; -import EditBlockWrapper from '@eeacms/volto-tabs-block/components/EditBlockWrapper'; -import { MenuItem } from '@eeacms/volto-tabs-block/components/templates/default/Edit'; -import { emptyBlocksForm } from '@plone/volto/helpers'; -import { Icon } from 'semantic-ui-react'; -import { Icon as VoltoIcon, BlocksForm } from '@plone/volto/components'; -import config from '@plone/volto/registry'; -import { TABS_BLOCK } from '@eeacms/volto-tabs-block/constants'; -import { getParentTabFromHash } from '@eeacms/volto-tabs-block/helpers'; -import noop from 'lodash/noop'; - -import '@eeacms/volto-tabs-block/less/menu.less'; -import { accordionSchemaEnhancer } from '@eeacms/volto-tabs-block/components/templates/accordion/schema'; - -class Tab extends React.Component { - render() { - return this.props.children; - } -} - -const Edit = (props) => { - const intl = useIntl(); - const { - data = {}, - tabsList = [], - tabs = {}, - activeTabIndex = 0, - setActiveTab = noop, - editingTab = null, - activeBlock = null, - activeTab = null, - block = null, - setEditingTab = noop, - multiSelected = [], - manage = false, - metadata = null, - selected = false, - onChangeBlock = noop, - onChangeTabData = noop, - onSelectBlock = noop, - emptyTab = noop, - tabsData = {}, - schema, - } = props; - - const { menuInverted, menuSecondary, menuPointing } = data; - const accordionConfig = config.blocks.blocksConfig[ - TABS_BLOCK - ].variations.filter((v, _i) => v.id === data.variation); - const { icons, semanticIcon, transformWidth = 800 } = - accordionConfig?.[0] || {}; - - const tabsContainer = React.useRef(); - const [mounted, setMounted] = React.useState(false); - const [hashTab, setHashTab] = React.useState(false); - const [initialWidth, setInitialWidth] = React.useState(transformWidth); - - const items = tabsList.map((tab, index) => { - const active = activeTabIndex === index; - - return { - title: ( - <> - {semanticIcon ? ( -
- -
- ) : ( -
- -
- )} - - - ), - content: ( - - { - onChangeBlock(block, { - ...data, - data: { - ...tabsData, - blocks: { - ...tabsData.blocks, - [activeTab]: { - ...(newFormData.blocks_layout.items.length > 0 - ? newFormData - : emptyTab({ - schema: schema?.properties?.data?.schema || {}, - intl, - })), - }, - }, - }, - }); - }} - onSelectBlock={(id, selected, e) => { - const isMultipleSelection = e - ? e.shiftKey || e.ctrlKey || e.metaKey - : false; - onSelectBlock( - id, - activeBlock === id ? false : isMultipleSelection, - e, - ); - setEditingTab(null); - }} - > - {({ draginfo }, editBlock, blockProps) => { - return ( - - {editBlock} - - ); - }} - - - ), - key: tab, - tabClassName: cx('ui button item title', { active }, 'remove-menu'), - panelClassName: cx('ui bottom attached segment tab', { - active, - }), - }; - }); - - React.useEffect(() => { - setMounted(true); - }, []); - React.useEffect(() => { - if (!mounted) return; - const { blockWidth, tabsTotalWidth } = tabsContainer.current?.state || {}; - setInitialWidth( - tabsTotalWidth < blockWidth ? tabsTotalWidth + 1 : blockWidth + 1, - ); - }, [mounted]); - - return ( - { - const { blockWidth } = tabsContainer.current?.state || {}; - const tabWithHash = getParentTabFromHash( - data, - props?.location?.hash.substring(1), - ); - if (tabWithHash === tabsList[activeTabIndex] && !hashTab) { - setHashTab(true); - } else if (blockWidth <= initialWidth) { - setActiveTab(null); - } - }} - tabsWrapperClass={cx( - props?.data?.accordionIconRight ? 'tabs-accordion-icon-right' : '', - 'ui fluid menu tabs-secondary-variant', - 'tabs-accessibility', - data?.theme ? `${data?.theme}` : '', - { - inverted: menuInverted, - }, - { - pointing: menuPointing, - }, - { - secondary: menuSecondary, - }, - )} - showMore={false} - /> - ); -}; - -Edit.schemaEnhancer = accordionSchemaEnhancer; - -export default Edit; diff --git a/src/index.js b/src/index.js index a915dc1..827e57a 100644 --- a/src/index.js +++ b/src/index.js @@ -3,7 +3,6 @@ import { defineMessages } from 'react-intl'; import { DefaultEdit, DefaultView, - AccordionEdit, AccordionView, HorizontalResponsiveEdit, HorizontalResponsiveView, @@ -14,6 +13,8 @@ import { TabsView, blockSchema, } from '@eeacms/volto-tabs-block/components'; +import { accordionSchemaEnhancer } from '@eeacms/volto-tabs-block/components/templates/accordion/schema'; + import { TABS_BLOCK } from './constants'; import { TabsWidget } from './widgets'; @@ -76,7 +77,7 @@ const applyConfig = (config) => { title: 'Accordion responsive', edit: DefaultEdit, view: AccordionView, - schemaEnhancer: AccordionEdit.schemaEnhancer, + schemaEnhancer: accordionSchemaEnhancer, transformWidth: 800, icons: { closed: rightSVG, From 24323cc0e0c674697fddac62df22c646785ec41b Mon Sep 17 00:00:00 2001 From: Claudia Ifrim Date: Wed, 6 Mar 2024 18:07:44 +0200 Subject: [PATCH 04/19] fix: remove AccordionEdit import form index --- package.json | 2 +- src/components/templates/accordion/index.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 4608613..d91d057 100644 --- a/package.json +++ b/package.json @@ -76,4 +76,4 @@ "cypress:open": "make cypress-open", "prepare": "husky install" } -} \ No newline at end of file +} diff --git a/src/components/templates/accordion/index.js b/src/components/templates/accordion/index.js index acda1c8..a163c5a 100644 --- a/src/components/templates/accordion/index.js +++ b/src/components/templates/accordion/index.js @@ -1,4 +1,3 @@ -import AccordionEdit from './Edit'; import AccordionView from './View'; -export { AccordionEdit, AccordionView }; +export { AccordionView }; From 33691768899e7f91d2cd15319dbe3ebe66cf1513 Mon Sep 17 00:00:00 2001 From: David Ichim Date: Wed, 6 Mar 2024 18:17:08 +0200 Subject: [PATCH 05/19] Update react-slick version to 0.30.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d91d057..d9e6878 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@eeacms/volto-anchors": "*", "@eeacms/volto-block-style": "*", "react-responsive-tabs": "4.4.3", - "react-slick": "^0.24.0", + "react-slick": "^0.30.1", "slick-carousel": "^1.8.1" }, "devDependencies": { From 6fe2bb46de04c9c2c0115d3fc97caf9ea5952b6e Mon Sep 17 00:00:00 2001 From: Razvan Date: Wed, 6 Mar 2024 18:21:57 +0200 Subject: [PATCH 06/19] fix cypress --- cypress/e2e/01-block-tabs.cy.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/cypress/e2e/01-block-tabs.cy.js b/cypress/e2e/01-block-tabs.cy.js index 11fa6e7..f5d91c2 100644 --- a/cypress/e2e/01-block-tabs.cy.js +++ b/cypress/e2e/01-block-tabs.cy.js @@ -204,8 +204,6 @@ describe('Blocks Tests', () => { cy.get('.tabs-block').contains('Tab 1').dblclick().type('Tab 1 edited'); - cy.get('.field-wrapper-accordionIconRight .checkbox').click(); - // Add new tab cy.get('.tabs-block .addition-button').click(); cy.get('.tabs-block').contains('Tab 3').dblclick().type('Tab 3 edited'); From f735d8446c770db1ac933f1450d2dce4f5ace7fb Mon Sep 17 00:00:00 2001 From: EEA Jenkins <@users.noreply.github.com> Date: Wed, 6 Mar 2024 16:32:37 +0000 Subject: [PATCH 07/19] Automated release 7.1.0 --- CHANGELOG.md | 39 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a99c662..2401931 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +### [7.1.0](https://github.com/eea/volto-tabs-block/compare/7.0.5...7.1.0) - 6 March 2024 + +#### :bug: Bug Fixes + +- fix: remove AccordionEdit import form index [Claudia Ifrim - [`24323cc`](https://github.com/eea/volto-tabs-block/commit/24323cc0e0c674697fddac62df22c646785ec41b)] + +#### :hammer_and_wrench: Others + +- fix cypress [Razvan - [`6fe2bb4`](https://github.com/eea/volto-tabs-block/commit/6fe2bb46de04c9c2c0115d3fc97caf9ea5952b6e)] +- Update react-slick version to 0.30.1 [David Ichim - [`3369176`](https://github.com/eea/volto-tabs-block/commit/33691768899e7f91d2cd15319dbe3ebe66cf1513)] +- update [Razvan - [`61b19e8`](https://github.com/eea/volto-tabs-block/commit/61b19e8584ff6023320b3671414392ea11449ff0)] +- use DefaultEdit variation for responsive accordion, refs #266327 [Razvan - [`11acf6c`](https://github.com/eea/volto-tabs-block/commit/11acf6ce5afe022ddd30bff42c9a3321d1284da6)] ### [7.0.5](https://github.com/eea/volto-tabs-block/compare/7.0.4...7.0.5) - 10 December 2023 #### :rocket: New Features @@ -35,8 +47,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`3b87d12`](https://github.com/eea/volto-tabs-block/commit/3b87d12df4d01031231b15eb4196f6ff6937706b)] -- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`f5f3430`](https://github.com/eea/volto-tabs-block/commit/f5f343024b45bb0206e0169cce6dd0e8472b6795)] ### [7.0.1](https://github.com/eea/volto-tabs-block/compare/7.0.0...7.0.1) - 9 November 2023 #### :bug: Bug Fixes @@ -46,14 +56,10 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`bd6ffd4`](https://github.com/eea/volto-tabs-block/commit/bd6ffd42a00a2d77ff59545d9adaab7a45361446)] -- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`d481e25`](https://github.com/eea/volto-tabs-block/commit/d481e25c4d61d7ff6ea11ff75c99fbdd730ecd82)] -- test: [JENKINS] Improve cypress time [valentinab25 - [`6c39efc`](https://github.com/eea/volto-tabs-block/commit/6c39efcc30bddfebb6c61f8a8cd714f61828ec69)] ## [7.0.0](https://github.com/eea/volto-tabs-block/compare/6.0.3...7.0.0) - 31 October 2023 #### :house: Internal changes -- chore: [JENKINS] Refactor automated testing [valentinab25 - [`f2e3d39`](https://github.com/eea/volto-tabs-block/commit/f2e3d3973c026f0331b82e0f691ec9bdc5899672)] #### :hammer_and_wrench: Others @@ -266,7 +272,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :house: Internal changes -- chore: [JENKINS] Deprecate circularity website [valentinab25 - [`820aaa9`](https://github.com/eea/volto-tabs-block/commit/820aaa963e978a893a23b77f694bb011f3d768c1)] #### :hammer_and_wrench: Others @@ -357,7 +362,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`52bc1b0`](https://github.com/eea/volto-tabs-block/commit/52bc1b0fbd4611173b8ca9dc2cf4033b31474420)] ## [4.0.0](https://github.com/eea/volto-tabs-block/compare/3.0.1...4.0.0) - 10 March 2023 #### :house: Internal changes @@ -368,13 +372,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others - Release 4.0.0 [Alin Voinea - [`8fc4cc9`](https://github.com/eea/volto-tabs-block/commit/8fc4cc9d8dc71e623e6586b95871cb3b98dc385f)] -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`22d5bdc`](https://github.com/eea/volto-tabs-block/commit/22d5bdc1b3579cc46c73ce855041ca09154eb502)] -- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`fde4324`](https://github.com/eea/volto-tabs-block/commit/fde4324f962cde8e8de0d76a44bee4b67d216bf8)] -- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`9175e47`](https://github.com/eea/volto-tabs-block/commit/9175e470d793edc63b62a99940aed25dd45f3713)] - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`3348950`](https://github.com/eea/volto-tabs-block/commit/334895036f8e367281abb35a20879c32dfbfc292)] -- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`39bfb39`](https://github.com/eea/volto-tabs-block/commit/39bfb39fa6e8483e639491ff998293e758ac6384)] -- yarn 3 [Alin Voinea - [`7e98df5`](https://github.com/eea/volto-tabs-block/commit/7e98df59669d71945be461e86e282b913538b805)] -- Add Sonarqube tag using demo-kitkat-frontend addons list [EEA Jenkins - [`079d7a4`](https://github.com/eea/volto-tabs-block/commit/079d7a43480e92fe280a9372399ff2d4d28537ae)] ### [3.0.1](https://github.com/eea/volto-tabs-block/compare/3.0.0...3.0.1) - 16 November 2022 #### :hammer_and_wrench: Others @@ -398,9 +396,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`a00e419`](https://github.com/eea/volto-tabs-block/commit/a00e419aef4c82a25f277f5e25e3d512c7838264)] - lint fix [David Ichim - [`c0a898c`](https://github.com/eea/volto-tabs-block/commit/c0a898c54461478baed2ac2f149ae580d4c89aeb)] -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`3b284e6`](https://github.com/eea/volto-tabs-block/commit/3b284e65e0eafa9b5ad8c92b4cb77628ffcc8103)] ### [2.2.0](https://github.com/eea/volto-tabs-block/compare/2.1.0...2.2.0) - 25 August 2022 #### :hammer_and_wrench: Others @@ -416,7 +412,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Release 2.1.0 [Alin Voinea - [`3cdfa30`](https://github.com/eea/volto-tabs-block/commit/3cdfa30d4d03d864be8ad63f0648b4717298734a)] - Squashed commit of the following: [Alin Voinea - [`ca241f5`](https://github.com/eea/volto-tabs-block/commit/ca241f56a96817679a1948154e2a8cc0e17b96fe)] -- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`68ea5a6`](https://github.com/eea/volto-tabs-block/commit/68ea5a6b971fc36840cf5716a04f68316b229b2b)] ### [2.0.2](https://github.com/eea/volto-tabs-block/compare/2.0.1...2.0.2) - 16 June 2022 ### [2.0.1](https://github.com/eea/volto-tabs-block/compare/2.0.0...2.0.1) - 10 June 2022 @@ -460,8 +455,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Let theme addon to set default values for default template schema [Miu Razvan - [`55f148d`](https://github.com/eea/volto-tabs-block/commit/55f148d1a95417f8a0b55681ce250acde8463c1c)] - Render pane as container if tabs-block has full-width class [Miu Razvan - [`bbffb96`](https://github.com/eea/volto-tabs-block/commit/bbffb96b908476ddee447af3ce79bafb1a12f9a8)] - Refactor default template [Miu Razvan - [`58eff52`](https://github.com/eea/volto-tabs-block/commit/58eff5281adb08a5f8fe6d21fd43330252012277)] -- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`72a6735`](https://github.com/eea/volto-tabs-block/commit/72a6735cbbc0e7d57b4bb7ea83fea9becc317018)] -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`e928da1`](https://github.com/eea/volto-tabs-block/commit/e928da1df7e4680bd4be9b5d46406800d721b8c5)] ### [1.2.12](https://github.com/eea/volto-tabs-block/compare/1.2.11...1.2.12) - 21 January 2022 ### [1.2.11](https://github.com/eea/volto-tabs-block/compare/1.2.10...1.2.11) - 4 January 2022 @@ -476,17 +469,11 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`cd2e2ac`](https://github.com/eea/volto-tabs-block/commit/cd2e2ac1d127bfc688ecf16e17734603ab727a34)] ### [1.2.8](https://github.com/eea/volto-tabs-block/compare/1.2.7...1.2.8) - 10 December 2021 #### :hammer_and_wrench: Others - Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`d10c0b3`](https://github.com/eea/volto-tabs-block/commit/d10c0b3d35d25c530d19eebde38dfe5da8fda01b)] -- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`1a7187f`](https://github.com/eea/volto-tabs-block/commit/1a7187f10b2bd9e1307dabf51823f63ccd766864)] -- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`72a7550`](https://github.com/eea/volto-tabs-block/commit/72a755025b38e1d8dd7fe206273a70585e4b9ac8)] -- Add Sonarqube tag using forests-frontend addons list [EEA Jenkins - [`022b277`](https://github.com/eea/volto-tabs-block/commit/022b2779a5d7fd7217c2d8a559eafab0bd86ce23)] -- Add Sonarqube tag using sustainability-frontend addons list [EEA Jenkins - [`84c9bea`](https://github.com/eea/volto-tabs-block/commit/84c9bea7a0aba2fe9ef9713e7131de6da6e0bcce)] -- Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`020aa97`](https://github.com/eea/volto-tabs-block/commit/020aa97bc70a643ea3857566c5a1dc3a5200c2be)] ### [1.2.7](https://github.com/eea/volto-tabs-block/compare/1.2.6...1.2.7) - 27 August 2021 #### :hammer_and_wrench: Others @@ -503,8 +490,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Move less import in View instead of Edit [Tiberiu Ichim - [`84aeff0`](https://github.com/eea/volto-tabs-block/commit/84aeff04a980076f54687c546691d37b6e790478)] - gitignore tweaks [Tiberiu Ichim - [`f4c993d`](https://github.com/eea/volto-tabs-block/commit/f4c993d004b126f08f16651ab9460546fa9e9cad)] -- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`865906a`](https://github.com/eea/volto-tabs-block/commit/865906a0deb261d44cc23e26bfd2d1dd0e319640)] -- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`5383861`](https://github.com/eea/volto-tabs-block/commit/538386100adbc868e693c1c2a5ba13461307ffee)] - Style update [razvanMiu - [`323aaaf`](https://github.com/eea/volto-tabs-block/commit/323aaafcad01d8fdf0e713a1fc254ae9fe319f43)] - Fix 'scroll to' feature on carousel [razvanMiu - [`16c6a08`](https://github.com/eea/volto-tabs-block/commit/16c6a08f6db687542ea38e07a92b265e592f6173)] - Better accesibility [razvanMiu - [`3511611`](https://github.com/eea/volto-tabs-block/commit/351161197270a4807f01d85a7055cbaadae72f8e)] From ceb8ab7fd216d369ed487a7fe63aec876e2c4624 Mon Sep 17 00:00:00 2001 From: David Ichim Date: Wed, 6 Mar 2024 21:37:17 +0200 Subject: [PATCH 08/19] Revert "update" This reverts commit 61b19e8584ff6023320b3671414392ea11449ff0. --- package.json | 2 +- src/components/templates/accordion/Edit.jsx | 214 ++++++++++++++++++++ src/index.js | 5 +- 3 files changed, 217 insertions(+), 4 deletions(-) create mode 100644 src/components/templates/accordion/Edit.jsx diff --git a/package.json b/package.json index d9e6878..c268cdd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-tabs-block", - "version": "7.1.0", + "version": "7.0.5", "description": "volto-tabs-block: Volto add-on", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", diff --git a/src/components/templates/accordion/Edit.jsx b/src/components/templates/accordion/Edit.jsx new file mode 100644 index 0000000..3e85673 --- /dev/null +++ b/src/components/templates/accordion/Edit.jsx @@ -0,0 +1,214 @@ +import React from 'react'; +import cx from 'classnames'; +import { isEmpty } from 'lodash'; +import { useIntl } from 'react-intl'; +import Tabs from 'react-responsive-tabs'; +import EditBlockWrapper from '@eeacms/volto-tabs-block/components/EditBlockWrapper'; +import { MenuItem } from '@eeacms/volto-tabs-block/components/templates/default/Edit'; +import { emptyBlocksForm } from '@plone/volto/helpers'; +import { Icon } from 'semantic-ui-react'; +import { Icon as VoltoIcon, BlocksForm } from '@plone/volto/components'; +import config from '@plone/volto/registry'; +import { TABS_BLOCK } from '@eeacms/volto-tabs-block/constants'; +import { getParentTabFromHash } from '@eeacms/volto-tabs-block/helpers'; +import noop from 'lodash/noop'; + +import '@eeacms/volto-tabs-block/less/menu.less'; +import { accordionSchemaEnhancer } from '@eeacms/volto-tabs-block/components/templates/accordion/schema'; + +class Tab extends React.Component { + render() { + return this.props.children; + } +} + +const Edit = (props) => { + const intl = useIntl(); + const { + data = {}, + tabsList = [], + tabs = {}, + activeTabIndex = 0, + setActiveTab = noop, + editingTab = null, + activeBlock = null, + activeTab = null, + block = null, + setEditingTab = noop, + multiSelected = [], + manage = false, + metadata = null, + selected = false, + onChangeBlock = noop, + onChangeTabData = noop, + onSelectBlock = noop, + emptyTab = noop, + tabsData = {}, + schema, + } = props; + + const { menuInverted, menuSecondary, menuPointing } = data; + const accordionConfig = config.blocks.blocksConfig[ + TABS_BLOCK + ].variations.filter((v, _i) => v.id === data.variation); + const { icons, semanticIcon, transformWidth = 800 } = + accordionConfig?.[0] || {}; + + const tabsContainer = React.useRef(); + const [mounted, setMounted] = React.useState(false); + const [hashTab, setHashTab] = React.useState(false); + const [initialWidth, setInitialWidth] = React.useState(transformWidth); + + const items = tabsList.map((tab, index) => { + const active = activeTabIndex === index; + + return { + title: ( + <> + {semanticIcon ? ( +
+ +
+ ) : ( +
+ +
+ )} + + + ), + content: ( + + { + onChangeBlock(block, { + ...data, + data: { + ...tabsData, + blocks: { + ...tabsData.blocks, + [activeTab]: { + ...(newFormData.blocks_layout.items.length > 0 + ? newFormData + : emptyTab({ + schema: schema?.properties?.data?.schema || {}, + intl, + })), + }, + }, + }, + }); + }} + onSelectBlock={(id, selected, e) => { + const isMultipleSelection = e + ? e.shiftKey || e.ctrlKey || e.metaKey + : false; + onSelectBlock( + id, + activeBlock === id ? false : isMultipleSelection, + e, + ); + setEditingTab(null); + }} + > + {({ draginfo }, editBlock, blockProps) => { + return ( + + {editBlock} + + ); + }} + + + ), + key: tab, + tabClassName: cx('ui button item title', { active }, 'remove-menu'), + panelClassName: cx('ui bottom attached segment tab', { + active, + }), + }; + }); + + React.useEffect(() => { + setMounted(true); + }, []); + React.useEffect(() => { + if (!mounted) return; + const { blockWidth, tabsTotalWidth } = tabsContainer.current?.state || {}; + setInitialWidth( + tabsTotalWidth < blockWidth ? tabsTotalWidth + 1 : blockWidth + 1, + ); + }, [mounted]); + + return ( + { + const { blockWidth } = tabsContainer.current?.state || {}; + const tabWithHash = getParentTabFromHash( + data, + props?.location?.hash.substring(1), + ); + if (tabWithHash === tabsList[activeTabIndex] && !hashTab) { + setHashTab(true); + } else if (blockWidth <= initialWidth) { + setActiveTab(null); + } + }} + tabsWrapperClass={cx( + props?.data?.accordionIconRight ? 'tabs-accordion-icon-right' : '', + 'ui fluid menu tabs-secondary-variant', + 'tabs-accessibility', + data?.theme ? `${data?.theme}` : '', + { + inverted: menuInverted, + }, + { + pointing: menuPointing, + }, + { + secondary: menuSecondary, + }, + )} + showMore={false} + /> + ); +}; + +Edit.schemaEnhancer = accordionSchemaEnhancer; + +export default Edit; diff --git a/src/index.js b/src/index.js index 827e57a..a915dc1 100644 --- a/src/index.js +++ b/src/index.js @@ -3,6 +3,7 @@ import { defineMessages } from 'react-intl'; import { DefaultEdit, DefaultView, + AccordionEdit, AccordionView, HorizontalResponsiveEdit, HorizontalResponsiveView, @@ -13,8 +14,6 @@ import { TabsView, blockSchema, } from '@eeacms/volto-tabs-block/components'; -import { accordionSchemaEnhancer } from '@eeacms/volto-tabs-block/components/templates/accordion/schema'; - import { TABS_BLOCK } from './constants'; import { TabsWidget } from './widgets'; @@ -77,7 +76,7 @@ const applyConfig = (config) => { title: 'Accordion responsive', edit: DefaultEdit, view: AccordionView, - schemaEnhancer: accordionSchemaEnhancer, + schemaEnhancer: AccordionEdit.schemaEnhancer, transformWidth: 800, icons: { closed: rightSVG, From 7ed5f4e61ab1747ede5641138119c47d8b3dd6c1 Mon Sep 17 00:00:00 2001 From: David Ichim Date: Wed, 6 Mar 2024 21:47:44 +0200 Subject: [PATCH 09/19] change(tabs): use default edit for accordion tab edit - Within AccordionEdit inherit the default Edit adding only extra options classes coming from the form data - modified Default tabs text to be inside a span within the tab link instead of a p tag. --- src/components/templates/accordion/Edit.jsx | 221 ++------------------ src/components/templates/accordion/View.jsx | 7 +- src/components/templates/accordion/index.js | 3 +- src/components/templates/default/Edit.jsx | 8 +- src/components/templates/default/View.jsx | 2 +- src/index.js | 3 +- src/less/menu.less | 4 +- 7 files changed, 33 insertions(+), 215 deletions(-) diff --git a/src/components/templates/accordion/Edit.jsx b/src/components/templates/accordion/Edit.jsx index 3e85673..7efef81 100644 --- a/src/components/templates/accordion/Edit.jsx +++ b/src/components/templates/accordion/Edit.jsx @@ -1,214 +1,25 @@ -import React from 'react'; -import cx from 'classnames'; -import { isEmpty } from 'lodash'; -import { useIntl } from 'react-intl'; -import Tabs from 'react-responsive-tabs'; -import EditBlockWrapper from '@eeacms/volto-tabs-block/components/EditBlockWrapper'; -import { MenuItem } from '@eeacms/volto-tabs-block/components/templates/default/Edit'; -import { emptyBlocksForm } from '@plone/volto/helpers'; -import { Icon } from 'semantic-ui-react'; -import { Icon as VoltoIcon, BlocksForm } from '@plone/volto/components'; -import config from '@plone/volto/registry'; -import { TABS_BLOCK } from '@eeacms/volto-tabs-block/constants'; -import { getParentTabFromHash } from '@eeacms/volto-tabs-block/helpers'; -import noop from 'lodash/noop'; - -import '@eeacms/volto-tabs-block/less/menu.less'; +import Edit from '@eeacms/volto-tabs-block/components/templates/default/Edit'; import { accordionSchemaEnhancer } from '@eeacms/volto-tabs-block/components/templates/accordion/schema'; +import cx from 'classnames'; -class Tab extends React.Component { - render() { - return this.props.children; - } -} - -const Edit = (props) => { - const intl = useIntl(); - const { - data = {}, - tabsList = [], - tabs = {}, - activeTabIndex = 0, - setActiveTab = noop, - editingTab = null, - activeBlock = null, - activeTab = null, - block = null, - setEditingTab = noop, - multiSelected = [], - manage = false, - metadata = null, - selected = false, - onChangeBlock = noop, - onChangeTabData = noop, - onSelectBlock = noop, - emptyTab = noop, - tabsData = {}, - schema, - } = props; - - const { menuInverted, menuSecondary, menuPointing } = data; - const accordionConfig = config.blocks.blocksConfig[ - TABS_BLOCK - ].variations.filter((v, _i) => v.id === data.variation); - const { icons, semanticIcon, transformWidth = 800 } = - accordionConfig?.[0] || {}; - - const tabsContainer = React.useRef(); - const [mounted, setMounted] = React.useState(false); - const [hashTab, setHashTab] = React.useState(false); - const [initialWidth, setInitialWidth] = React.useState(transformWidth); - - const items = tabsList.map((tab, index) => { - const active = activeTabIndex === index; - - return { - title: ( - <> - {semanticIcon ? ( -
- -
- ) : ( -
- -
- )} - - - ), - content: ( - - { - onChangeBlock(block, { - ...data, - data: { - ...tabsData, - blocks: { - ...tabsData.blocks, - [activeTab]: { - ...(newFormData.blocks_layout.items.length > 0 - ? newFormData - : emptyTab({ - schema: schema?.properties?.data?.schema || {}, - intl, - })), - }, - }, - }, - }); - }} - onSelectBlock={(id, selected, e) => { - const isMultipleSelection = e - ? e.shiftKey || e.ctrlKey || e.metaKey - : false; - onSelectBlock( - id, - activeBlock === id ? false : isMultipleSelection, - e, - ); - setEditingTab(null); - }} - > - {({ draginfo }, editBlock, blockProps) => { - return ( - - {editBlock} - - ); - }} - - - ), - key: tab, - tabClassName: cx('ui button item title', { active }, 'remove-menu'), - panelClassName: cx('ui bottom attached segment tab', { - active, - }), - }; - }); - - React.useEffect(() => { - setMounted(true); - }, []); - React.useEffect(() => { - if (!mounted) return; - const { blockWidth, tabsTotalWidth } = tabsContainer.current?.state || {}; - setInitialWidth( - tabsTotalWidth < blockWidth ? tabsTotalWidth + 1 : blockWidth + 1, - ); - }, [mounted]); - +const AccordionEdit = (props) => { return ( - { - const { blockWidth } = tabsContainer.current?.state || {}; - const tabWithHash = getParentTabFromHash( - data, - props?.location?.hash.substring(1), - ); - if (tabWithHash === tabsList[activeTabIndex] && !hashTab) { - setHashTab(true); - } else if (blockWidth <= initialWidth) { - setActiveTab(null); - } + { + return cx(data?.theme ? `${data?.theme}` : '', { + RRT__tabs: true, + 'tabs-accordion-icon-right': data.accordionIconRight, + 'tabs-accessibility': true, + inverted: data.menuInverted, + pointing: data.menuPointing, + }); }} - tabsWrapperClass={cx( - props?.data?.accordionIconRight ? 'tabs-accordion-icon-right' : '', - 'ui fluid menu tabs-secondary-variant', - 'tabs-accessibility', - data?.theme ? `${data?.theme}` : '', - { - inverted: menuInverted, - }, - { - pointing: menuPointing, - }, - { - secondary: menuSecondary, - }, - )} - showMore={false} /> ); }; -Edit.schemaEnhancer = accordionSchemaEnhancer; +AccordionEdit.schemaEnhancer = accordionSchemaEnhancer; -export default Edit; +export default AccordionEdit; diff --git a/src/components/templates/accordion/View.jsx b/src/components/templates/accordion/View.jsx index 779081a..5da61d6 100644 --- a/src/components/templates/accordion/View.jsx +++ b/src/components/templates/accordion/View.jsx @@ -42,8 +42,11 @@ const View = (props) => { const accordionConfig = config.blocks.blocksConfig[ TABS_BLOCK ].variations.filter((v, _i) => v.id === data.variation); - const { icons, semanticIcon, transformWidth = 800 } = - accordionConfig?.[0] || {}; + const { + icons, + semanticIcon, + transformWidth = 800, + } = accordionConfig?.[0] || {}; const tabsContainer = React.useRef(); const [mounted, setMounted] = React.useState(false); diff --git a/src/components/templates/accordion/index.js b/src/components/templates/accordion/index.js index a163c5a..e306839 100644 --- a/src/components/templates/accordion/index.js +++ b/src/components/templates/accordion/index.js @@ -1,3 +1,4 @@ import AccordionView from './View'; +import AccordionEdit from './Edit'; -export { AccordionView }; +export { AccordionView, AccordionEdit }; diff --git a/src/components/templates/default/Edit.jsx b/src/components/templates/default/Edit.jsx index 9778db6..25993d3 100644 --- a/src/components/templates/default/Edit.jsx +++ b/src/components/templates/default/Edit.jsx @@ -202,6 +202,8 @@ const Edit = (props) => { onSelectBlock = noop, setEditingTab = noop, schema, + skipColorOption = false, + customTabsClass = '', } = props; const menuPosition = getMenuPosition(data); const { @@ -304,16 +306,15 @@ const Edit = (props) => { }, }; }); - return ( <> { menuPosition.direction === 'top' ? 'border-bottom' : '', menuPosition.direction === 'bottom' ? 'border-top' : '', { container: isContainer }, + props.addTabsOptions ? props.addTabsOptions(data) : '', ), }} menuPosition={menuPosition.direction} diff --git a/src/components/templates/default/View.jsx b/src/components/templates/default/View.jsx index d803e14..2e4e08c 100644 --- a/src/components/templates/default/View.jsx +++ b/src/components/templates/default/View.jsx @@ -143,7 +143,7 @@ const MenuItem = (props) => { ) : ( <> {tabIndex} -

{tabTitle}

+ {tabTitle} )} diff --git a/src/index.js b/src/index.js index a915dc1..67a074e 100644 --- a/src/index.js +++ b/src/index.js @@ -14,6 +14,7 @@ import { TabsView, blockSchema, } from '@eeacms/volto-tabs-block/components'; + import { TABS_BLOCK } from './constants'; import { TabsWidget } from './widgets'; @@ -74,7 +75,7 @@ const applyConfig = (config) => { { id: 'accordion', title: 'Accordion responsive', - edit: DefaultEdit, + edit: AccordionEdit, view: AccordionView, schemaEnhancer: AccordionEdit.schemaEnhancer, transformWidth: 800, diff --git a/src/less/menu.less b/src/less/menu.less index 66ab7a4..573959a 100644 --- a/src/less/menu.less +++ b/src/less/menu.less @@ -21,7 +21,7 @@ border-width: 0 0 4px 0; } - .ui.secondary.inverted.menu .active.item:not(.remove-margin) { + .ui.secondary.inverted.menu .active.item { background-color: @menuItemInvertedActiveBackgroundColor !important; } @@ -43,7 +43,7 @@ cursor: pointer; } - .ui.menu:not(.inverted, .pointing) .active.item:not(.remove-margin) { + .ui.menu:not(.inverted, .pointing) .active.item { background-color: @menuItemActiveBackgroundColor; } From 0520da7ad50e7be1d62d574308d4acc5a858a401 Mon Sep 17 00:00:00 2001 From: eea-jenkins Date: Wed, 6 Mar 2024 20:51:54 +0100 Subject: [PATCH 10/19] style: Automated code fix --- src/components/templates/accordion/View.jsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/templates/accordion/View.jsx b/src/components/templates/accordion/View.jsx index 5da61d6..779081a 100644 --- a/src/components/templates/accordion/View.jsx +++ b/src/components/templates/accordion/View.jsx @@ -42,11 +42,8 @@ const View = (props) => { const accordionConfig = config.blocks.blocksConfig[ TABS_BLOCK ].variations.filter((v, _i) => v.id === data.variation); - const { - icons, - semanticIcon, - transformWidth = 800, - } = accordionConfig?.[0] || {}; + const { icons, semanticIcon, transformWidth = 800 } = + accordionConfig?.[0] || {}; const tabsContainer = React.useRef(); const [mounted, setMounted] = React.useState(false); From dd53ee84f4bb97b55d5d26e0447cff2f07268afc Mon Sep 17 00:00:00 2001 From: David Ichim Date: Wed, 6 Mar 2024 21:56:30 +0200 Subject: [PATCH 11/19] Fixed call to stylelint within MakeFile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index efbf2fb..2984fa5 100644 --- a/Makefile +++ b/Makefile @@ -98,7 +98,7 @@ test-update: ## Update jest tests snapshots .PHONY: stylelint stylelint: ## Stylelint - $(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}' + $(NODE_MODULES)/.bin/stylelint --allow-empty-input 'src/**/*.{css,less}' .PHONY: stylelint-overrides stylelint-overrides: @@ -106,7 +106,7 @@ stylelint-overrides: .PHONY: stylelint-fix stylelint-fix: ## Fix stylelint - $(NODE_MODULES)/stylelint/bin/stylelint.js --allow-empty-input 'src/**/*.{css,less}' --fix + $(NODE_MODULES)/.bin/stylelint --allow-empty-input 'src/**/*.{css,less}' --fix $(NODE_MODULES)/.bin/stylelint --custom-syntax less --allow-empty-input 'theme/**/*.overrides' 'src/**/*.overrides' --fix .PHONY: prettier From f6182d142b790b2256e24ad7ed49e8904ec73aa8 Mon Sep 17 00:00:00 2001 From: David Ichim Date: Wed, 6 Mar 2024 21:57:40 +0200 Subject: [PATCH 12/19] Prettier and stylelint --- src/components/templates/carousel/HorizontalView.jsx | 5 ++--- src/less/carousel.less | 8 +++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/templates/carousel/HorizontalView.jsx b/src/components/templates/carousel/HorizontalView.jsx index 8701546..033815a 100644 --- a/src/components/templates/carousel/HorizontalView.jsx +++ b/src/components/templates/carousel/HorizontalView.jsx @@ -135,9 +135,8 @@ const View = (props) => { }, [activeTab]); React.useEffect(() => { if (!slider.current?.innerSlider?.list) return; - let inaccessibleElements = slider.current.innerSlider.list.querySelectorAll( - '.slick-slide', - ); + let inaccessibleElements = + slider.current.innerSlider.list.querySelectorAll('.slick-slide'); for (let element of inaccessibleElements) { element.setAttribute('tabindex', '0'); element.setAttribute('aria-hidden', 'false'); diff --git a/src/less/carousel.less b/src/less/carousel.less index 417227c..6213c29 100644 --- a/src/less/carousel.less +++ b/src/less/carousel.less @@ -154,8 +154,8 @@ left: 0; width: 100%; height: 2px; - background-color: @lightColor; border-radius: 2px; + background-color: @lightColor; opacity: 1; transform: translateY(-50%); } @@ -180,8 +180,8 @@ width: @dotsSize; height: @dotsSize; padding: 0; - background-color: @lightColor; border-radius: 100%; + background-color: @lightColor; color: @lightColor; &::before { @@ -304,7 +304,9 @@ } @media only screen and (max-width: @largestMobileScreen + @largestMobileScreenOffset) { - body:not(.has-toolbar):not(.has-sidebar):not(.has-toolbar-collapsed):not(.has-sidebar-collapsed), + body:not(.has-toolbar):not(.has-sidebar):not(.has-toolbar-collapsed):not( + .has-sidebar-collapsed + ), body.has-toolbar-collapsed:not(.has-sidebar):not(.has-sidebar-collapsed), body.has-toolbar:not(.has-sidebar):not(.has-sidebar-collapsed) { .tabs-block { From e37f2d4c26a9ff72ffb09263caa96c55e3161551 Mon Sep 17 00:00:00 2001 From: eea-jenkins Date: Wed, 6 Mar 2024 21:01:18 +0100 Subject: [PATCH 13/19] style: Automated code fix --- src/components/templates/carousel/HorizontalView.jsx | 5 +++-- src/less/carousel.less | 8 +++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/templates/carousel/HorizontalView.jsx b/src/components/templates/carousel/HorizontalView.jsx index 033815a..8701546 100644 --- a/src/components/templates/carousel/HorizontalView.jsx +++ b/src/components/templates/carousel/HorizontalView.jsx @@ -135,8 +135,9 @@ const View = (props) => { }, [activeTab]); React.useEffect(() => { if (!slider.current?.innerSlider?.list) return; - let inaccessibleElements = - slider.current.innerSlider.list.querySelectorAll('.slick-slide'); + let inaccessibleElements = slider.current.innerSlider.list.querySelectorAll( + '.slick-slide', + ); for (let element of inaccessibleElements) { element.setAttribute('tabindex', '0'); element.setAttribute('aria-hidden', 'false'); diff --git a/src/less/carousel.less b/src/less/carousel.less index 6213c29..417227c 100644 --- a/src/less/carousel.less +++ b/src/less/carousel.less @@ -154,8 +154,8 @@ left: 0; width: 100%; height: 2px; - border-radius: 2px; background-color: @lightColor; + border-radius: 2px; opacity: 1; transform: translateY(-50%); } @@ -180,8 +180,8 @@ width: @dotsSize; height: @dotsSize; padding: 0; - border-radius: 100%; background-color: @lightColor; + border-radius: 100%; color: @lightColor; &::before { @@ -304,9 +304,7 @@ } @media only screen and (max-width: @largestMobileScreen + @largestMobileScreenOffset) { - body:not(.has-toolbar):not(.has-sidebar):not(.has-toolbar-collapsed):not( - .has-sidebar-collapsed - ), + body:not(.has-toolbar):not(.has-sidebar):not(.has-toolbar-collapsed):not(.has-sidebar-collapsed), body.has-toolbar-collapsed:not(.has-sidebar):not(.has-sidebar-collapsed), body.has-toolbar:not(.has-sidebar):not(.has-sidebar-collapsed) { .tabs-block { From a675429308f6d9a2b39e101396e7a5b195982f30 Mon Sep 17 00:00:00 2001 From: David Ichim Date: Wed, 6 Mar 2024 22:09:48 +0200 Subject: [PATCH 14/19] Bump package version to 7.5 from 7.0.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c268cdd..e24dfe8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-tabs-block", - "version": "7.0.5", + "version": "7.5.0", "description": "volto-tabs-block: Volto add-on", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", From 4209573f6ab25019814902ec38685f908958f6a7 Mon Sep 17 00:00:00 2001 From: Claudia Ifrim Date: Wed, 6 Mar 2024 23:09:16 +0200 Subject: [PATCH 15/19] fix: update 'Add Tabs default template' cypress test - Default tabs text to be inside a span within the tab link instead of a p tag --- cypress/e2e/01-block-tabs.cy.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/01-block-tabs.cy.js b/cypress/e2e/01-block-tabs.cy.js index f5d91c2..4fe4b1c 100644 --- a/cypress/e2e/01-block-tabs.cy.js +++ b/cypress/e2e/01-block-tabs.cy.js @@ -74,11 +74,15 @@ describe('Blocks Tests', () => { // then the page view should contain our changes cy.contains('Tabs block default template'); - cy.get('.tabs-block p').contains('Tab 2').parent().focus().type('{enter}'); + cy.get('.tabs-block span.menu-item-text') + .contains('Tab 2') + .parent() + .focus() + .type('{enter}'); cy.contains('Oxygen'); - cy.get('.tabs-block p').contains('Tab 1').click(); + cy.get('.tabs-block span.menu-item-text').contains('Tab 1').click(); cy.contains('Hydrogen'); }); From 54d726b3eeab42f2936c31e0f2b7941f6c66ef45 Mon Sep 17 00:00:00 2001 From: EEA Jenkins <@users.noreply.github.com> Date: Wed, 6 Mar 2024 21:20:54 +0000 Subject: [PATCH 16/19] Automated release 7.5.0 --- CHANGELOG.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2401931..5e4b923 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,14 +4,28 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). -### [7.1.0](https://github.com/eea/volto-tabs-block/compare/7.0.5...7.1.0) - 6 March 2024 +### [7.5.0](https://github.com/eea/volto-tabs-block/compare/7.0.5...7.5.0) - 6 March 2024 #### :bug: Bug Fixes +- fix: update 'Add Tabs default template' cypress test - Default tabs text to be inside a span within the tab link instead of a p tag [Claudia Ifrim - [`4209573`](https://github.com/eea/volto-tabs-block/commit/4209573f6ab25019814902ec38685f908958f6a7)] - fix: remove AccordionEdit import form index [Claudia Ifrim - [`24323cc`](https://github.com/eea/volto-tabs-block/commit/24323cc0e0c674697fddac62df22c646785ec41b)] +#### :nail_care: Enhancements + +- change(tabs): use default edit for accordion tab edit [David Ichim - [`7ed5f4e`](https://github.com/eea/volto-tabs-block/commit/7ed5f4e61ab1747ede5641138119c47d8b3dd6c1)] + +#### :house: Internal changes + +- style: Automated code fix [eea-jenkins - [`e37f2d4`](https://github.com/eea/volto-tabs-block/commit/e37f2d4c26a9ff72ffb09263caa96c55e3161551)] +- style: Automated code fix [eea-jenkins - [`0520da7`](https://github.com/eea/volto-tabs-block/commit/0520da7ad50e7be1d62d574308d4acc5a858a401)] + #### :hammer_and_wrench: Others +- Bump package version to 7.5 from 7.0.5 [David Ichim - [`a675429`](https://github.com/eea/volto-tabs-block/commit/a675429308f6d9a2b39e101396e7a5b195982f30)] +- Prettier and stylelint [David Ichim - [`f6182d1`](https://github.com/eea/volto-tabs-block/commit/f6182d142b790b2256e24ad7ed49e8904ec73aa8)] +- Fixed call to stylelint within MakeFile [David Ichim - [`dd53ee8`](https://github.com/eea/volto-tabs-block/commit/dd53ee84f4bb97b55d5d26e0447cff2f07268afc)] +- Revert "update" [David Ichim - [`ceb8ab7`](https://github.com/eea/volto-tabs-block/commit/ceb8ab7fd216d369ed487a7fe63aec876e2c4624)] - fix cypress [Razvan - [`6fe2bb4`](https://github.com/eea/volto-tabs-block/commit/6fe2bb46de04c9c2c0115d3fc97caf9ea5952b6e)] - Update react-slick version to 0.30.1 [David Ichim - [`3369176`](https://github.com/eea/volto-tabs-block/commit/33691768899e7f91d2cd15319dbe3ebe66cf1513)] - update [Razvan - [`61b19e8`](https://github.com/eea/volto-tabs-block/commit/61b19e8584ff6023320b3671414392ea11449ff0)] From 5aa798140654b4b6e3487c082483640432eddd65 Mon Sep 17 00:00:00 2001 From: David Ichim Date: Thu, 7 Mar 2024 09:14:39 +0200 Subject: [PATCH 17/19] breaking(tabs): menu-item-text markup is now span instead of p tag - Semantic UI React tab has the content directly inside the a tag, there is no need to have a paragraph with the text inside the tab link --- cypress/e2e/01-block-tabs.cy.js | 4 ++-- src/components/templates/default/Edit.jsx | 2 +- src/components/templates/default/View.jsx | 2 +- src/components/templates/horizontal-responsive/Edit.jsx | 8 +++++--- src/components/templates/horizontal-responsive/View.jsx | 6 ++++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/cypress/e2e/01-block-tabs.cy.js b/cypress/e2e/01-block-tabs.cy.js index 4fe4b1c..41b6c77 100644 --- a/cypress/e2e/01-block-tabs.cy.js +++ b/cypress/e2e/01-block-tabs.cy.js @@ -74,7 +74,7 @@ describe('Blocks Tests', () => { // then the page view should contain our changes cy.contains('Tabs block default template'); - cy.get('.tabs-block span.menu-item-text') + cy.get('.tabs-block .menu-item-text') .contains('Tab 2') .parent() .focus() @@ -82,7 +82,7 @@ describe('Blocks Tests', () => { cy.contains('Oxygen'); - cy.get('.tabs-block span.menu-item-text').contains('Tab 1').click(); + cy.get('.tabs-block .menu-item-text').contains('Tab 1').click(); cy.contains('Hydrogen'); }); diff --git a/src/components/templates/default/Edit.jsx b/src/components/templates/default/Edit.jsx index 25993d3..d96d690 100644 --- a/src/components/templates/default/Edit.jsx +++ b/src/components/templates/default/Edit.jsx @@ -170,7 +170,7 @@ export const MenuItem = (props) => { }} className="remove-margin addition-button" > -

+

+ + ) : ( diff --git a/src/components/templates/default/View.jsx b/src/components/templates/default/View.jsx index 2e4e08c..3e4aa92 100644 --- a/src/components/templates/default/View.jsx +++ b/src/components/templates/default/View.jsx @@ -66,7 +66,7 @@ export const AssetTab = ({ props, tabIndex, tabTitle }) => { {!hideTitle && (
{tabIndex} -

{tabTitle}

+ {tabTitle}
)} diff --git a/src/components/templates/horizontal-responsive/Edit.jsx b/src/components/templates/horizontal-responsive/Edit.jsx index 06a2caf..d789d5b 100644 --- a/src/components/templates/horizontal-responsive/Edit.jsx +++ b/src/components/templates/horizontal-responsive/Edit.jsx @@ -134,9 +134,9 @@ const MenuItem = (props) => { {tabIndex} -

+ {title || defaultTitle} -

+ )} @@ -270,7 +270,9 @@ const MenuWrapper = (props) => { }} > {underlineIndex + 1} -

{title || defaultTitle}

+ + {title || defaultTitle} + ); })} diff --git a/src/components/templates/horizontal-responsive/View.jsx b/src/components/templates/horizontal-responsive/View.jsx index 0444826..028886c 100644 --- a/src/components/templates/horizontal-responsive/View.jsx +++ b/src/components/templates/horizontal-responsive/View.jsx @@ -88,7 +88,7 @@ const MenuItem = (props) => { }} > {tabIndex} -

{title || defaultTitle}

+ {title || defaultTitle} ); @@ -169,7 +169,9 @@ const MenuWrapper = (props) => { }} > {underlineIndex + 1} -

{title || defaultTitle}

+ + {title || defaultTitle} + ); })} From 9a45825f80162f734872786fd0fe9359dd57ad9f Mon Sep 17 00:00:00 2001 From: David Ichim Date: Thu, 7 Mar 2024 09:21:33 +0200 Subject: [PATCH 18/19] fix(tests): after change from p tag to reference the .menu-item-text class - this way the tag can be anything as long as the class remains --- cypress/e2e/01-block-tabs.cy.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/01-block-tabs.cy.js b/cypress/e2e/01-block-tabs.cy.js index 41b6c77..13fbcbe 100644 --- a/cypress/e2e/01-block-tabs.cy.js +++ b/cypress/e2e/01-block-tabs.cy.js @@ -169,10 +169,14 @@ describe('Blocks Tests', () => { cy.get('.tabs-block .horizontal-responsive.tabs').should('exist'); cy.contains('Horizontal First Item'); - cy.get('.tabs-block p').contains('Tab 2').parent().focus().type('{enter}'); + cy.get('.tabs-block .menu-item-text') + .contains('Tab 2') + .parent() + .focus() + .type('{enter}'); cy.contains('Horizontal Second Item'); - cy.get('.tabs-block p').contains('Tab 1').click(); + cy.get('.tabs-block .menu-item-text').contains('Tab 1').click(); cy.contains('Horizontal First Item'); }); From a4cb7fc33d86fefe537cd69220d3bd5282a10ac3 Mon Sep 17 00:00:00 2001 From: EEA Jenkins <@users.noreply.github.com> Date: Thu, 7 Mar 2024 07:31:43 +0000 Subject: [PATCH 19/19] Automated release 7.5.0 --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e4b923..58e802c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,15 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). -### [7.5.0](https://github.com/eea/volto-tabs-block/compare/7.0.5...7.5.0) - 6 March 2024 +### [7.5.0](https://github.com/eea/volto-tabs-block/compare/7.0.5...7.5.0) - 7 March 2024 + +#### :boom: Breaking Change + +- breaking(tabs): menu-item-text markup is now span instead of p tag [David Ichim - [`5aa7981`](https://github.com/eea/volto-tabs-block/commit/5aa798140654b4b6e3487c082483640432eddd65)] #### :bug: Bug Fixes +- fix(tests): after change from p tag to reference the .menu-item-text class [David Ichim - [`9a45825`](https://github.com/eea/volto-tabs-block/commit/9a45825f80162f734872786fd0fe9359dd57ad9f)] - fix: update 'Add Tabs default template' cypress test - Default tabs text to be inside a span within the tab link instead of a p tag [Claudia Ifrim - [`4209573`](https://github.com/eea/volto-tabs-block/commit/4209573f6ab25019814902ec38685f908958f6a7)] - fix: remove AccordionEdit import form index [Claudia Ifrim - [`24323cc`](https://github.com/eea/volto-tabs-block/commit/24323cc0e0c674697fddac62df22c646785ec41b)]