From 061b348880b54daa9b27232a914422622afe3677 Mon Sep 17 00:00:00 2001 From: Miu Razvan Date: Tue, 20 Aug 2024 18:49:07 +0300 Subject: [PATCH 1/2] feat(section): restrict group block option - ref #273963 --- package.json | 2 +- .../manage/Blocks/Group/EditBlockWrapper.jsx | 6 +++--- src/components/manage/Blocks/Group/EditSchema.jsx | 6 +++++- src/index.js | 13 +++++++++++++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 1426bc0..86c7d2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eeacms/volto-group-block", - "version": "7.0.1", + "version": "7.1.0", "description": "volto-group-block: Volto block to be used to group other blocks", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", diff --git a/src/components/manage/Blocks/Group/EditBlockWrapper.jsx b/src/components/manage/Blocks/Group/EditBlockWrapper.jsx index adb3c99..80c174b 100644 --- a/src/components/manage/Blocks/Group/EditBlockWrapper.jsx +++ b/src/components/manage/Blocks/Group/EditBlockWrapper.jsx @@ -133,9 +133,9 @@ class EditBlockWrapper extends React.Component { basic title="Add block" onClick={() => { - this.setState({ - addNewBlockOpened: !this.state.addNewBlockOpened, - }); + this.setState((prevState) => ({ + addNewBlockOpened: !prevState.addNewBlockOpened, + })); }} className="group-block-add-button" > diff --git a/src/components/manage/Blocks/Group/EditSchema.jsx b/src/components/manage/Blocks/Group/EditSchema.jsx index 6f79b84..c436a1e 100644 --- a/src/components/manage/Blocks/Group/EditSchema.jsx +++ b/src/components/manage/Blocks/Group/EditSchema.jsx @@ -4,7 +4,7 @@ const Schema = { { id: 'default', title: 'Default', - fields: ['title', 'as'], + fields: ['title', 'as', 'restrictedBlock'], }, ], properties: { @@ -27,6 +27,10 @@ const Schema = { ['details', 'details'], ], }, + restrictedBlock: { + title: 'Restricted block', + type: 'boolean', + }, }, required: [], }; diff --git a/src/index.js b/src/index.js index 43d5ee9..dd34b40 100644 --- a/src/index.js +++ b/src/index.js @@ -33,6 +33,19 @@ const applyConfig = (config) => { }, }, }; + + if (!config.blocks.blocksConfig.empty) { + config.blocks.blocksConfig.empty = { + id: 'empty', + edit: () => { + return null; + }, + view: () => { + return null; + }, + }; + } + config.blocks.blocksConfig.group = { id: 'group', title: 'Section (Group)', From b9d481d386edf5311be13e7e9e13267d019ee10d Mon Sep 17 00:00:00 2001 From: EEA Jenkins <@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:58:31 +0000 Subject: [PATCH 2/2] Automated release 7.1.0 --- CHANGELOG.md | 39 ++++++--------------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dfe9169..b0c72f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ 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-group-block/compare/7.0.1...7.1.0) - 20 August 2024 + +#### :rocket: New Features + +- feat(section): restrict group block option - ref #273963 [Miu Razvan - [`061b348`](https://github.com/eea/volto-group-block/commit/061b348880b54daa9b27232a914422622afe3677)] + ### [7.0.1](https://github.com/eea/volto-group-block/compare/7.0.0...7.0.1) - 6 August 2024 #### :bug: Bug Fixes @@ -19,9 +25,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`e727ac6`](https://github.com/eea/volto-group-block/commit/e727ac6a8c1882b4e77a08fd0c5bb0a401cd3bdb)] -- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`75c2946`](https://github.com/eea/volto-group-block/commit/75c29460dc6c42bbb799c13a5a6ef2bb8f26ed5a)] -- Add Sonarqube tag using insitu-frontend addons list [EEA Jenkins - [`96f3133`](https://github.com/eea/volto-group-block/commit/96f31335cdda925daf3e5824f0a23121b0c9b3ef)] ### [6.4.0](https://github.com/eea/volto-group-block/compare/6.3.5...6.4.0) - 17 January 2024 #### :rocket: New Features @@ -36,7 +39,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :house: Internal changes -- chore: [JENKINS] Refactor automated testing [valentinab25 - [`616f6eb`](https://github.com/eea/volto-group-block/commit/616f6ebe0385d82a827c6679eabdcf4e92a18c11)] #### :hammer_and_wrench: Others @@ -49,11 +51,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Prettier [kreafox - [`0c5d2d1`](https://github.com/eea/volto-group-block/commit/0c5d2d1a494489663cc97c5dc0f4ad13c4b67c8d)] - test: mock useLocation [kreafox - [`746887f`](https://github.com/eea/volto-group-block/commit/746887fa0e778f2d4cbe86661fc8c38c8a4bafb5)] - test: mock useLocation [kreafox - [`a360401`](https://github.com/eea/volto-group-block/commit/a360401b8ee05e9cb54b253b0e605d0a040c8f78)] -- test: [JENKINS] Use java17 for sonarqube scanner [valentinab25 - [`25030fb`](https://github.com/eea/volto-group-block/commit/25030fbd69108f90df02130e5010e56398941ad2)] -- test: [JENKINS] Run cypress in started frontend container [valentinab25 - [`1517dbb`](https://github.com/eea/volto-group-block/commit/1517dbb81cf9128752d835ae59dc22b251f4b035)] -- test: [JENKINS] Add cpu limit on cypress docker [valentinab25 - [`b0ba5f9`](https://github.com/eea/volto-group-block/commit/b0ba5f9c6d37526411a7a984595ac624401f8ac5)] -- test: [JENKINS] Increase shm-size to cypress docker [valentinab25 - [`8dbdfeb`](https://github.com/eea/volto-group-block/commit/8dbdfeb89fe53c6dc2f476b183a53c9266ab2bdf)] -- test: [JENKINS] Improve cypress time [valentinab25 - [`d0324f4`](https://github.com/eea/volto-group-block/commit/d0324f4aad6d94233ca8ce3645ca5162f39d9834)] ### [6.3.4](https://github.com/eea/volto-group-block/compare/6.3.3...6.3.4) - 22 October 2023 ### [6.3.3](https://github.com/eea/volto-group-block/compare/6.3.2...6.3.3) - 17 October 2023 @@ -101,7 +98,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Release #39 from eea/develop [ichim-david - [`283e1e8`](https://github.com/eea/volto-group-block/commit/283e1e8dd1047415bae054cfd502d1691deaeb59)] - Release 6.3.0 [Alin Voinea - [`3d74bb5`](https://github.com/eea/volto-group-block/commit/3d74bb5342e3882e0ddee1aa8edab7e90949def6)] -- test: Fix eslint and yarn i18n [Alin Voinea - [`763f764`](https://github.com/eea/volto-group-block/commit/763f76448625e05b53a2bde86ca48dda0cb263cb)] - i18n: Add en [Alin Voinea - [`f3385cd`](https://github.com/eea/volto-group-block/commit/f3385cd33bfbe3efe514fd82fd140d17e33051e1)] - test: Update Makefile and docker-compose to align it with Jenkinsfile [valentinab25 - [`3aa996b`](https://github.com/eea/volto-group-block/commit/3aa996b4c115da6f37ca771f07f10d58fbfa33e8)] - fix eslint warnings [nileshgulia1 - [`cfdf2e9`](https://github.com/eea/volto-group-block/commit/cfdf2e900bcc456fa5a24ce7b03859170ad024ba)] @@ -132,7 +128,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :house: Internal changes -- chore: [JENKINS] Deprecate circularity website [valentinab25 - [`ad30e83`](https://github.com/eea/volto-group-block/commit/ad30e832bb869b67dc4e64ed99590b51cb80ab75)] #### :hammer_and_wrench: Others @@ -149,19 +144,12 @@ 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 - [`37ffae5`](https://github.com/eea/volto-group-block/commit/37ffae512967b36af22cbed208a3ec9e1ddc392b)] ## [6.0.0](https://github.com/eea/volto-group-block/compare/5.0.1...6.0.0) - 24 March 2023 #### :hammer_and_wrench: Others - (feat): Possibility to copy/cut/paste blocks within section group block - refs #157469 [dobri1408 - [`e9fc098`](https://github.com/eea/volto-group-block/commit/e9fc09825ba2ae258feb77864491d97d94c585b4)] -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`db4b09a`](https://github.com/eea/volto-group-block/commit/db4b09a6c14a8b271dec0c766886ffbcc3fe205e)] -- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`b8c2bf4`](https://github.com/eea/volto-group-block/commit/b8c2bf471868bb0394b2dbbf75ccb7917a9ef0bf)] -- Add Sonarqube tag using advisory-board-frontend addons list [EEA Jenkins - [`b343119`](https://github.com/eea/volto-group-block/commit/b3431196931fd568476fa8bf6fbc508e086229ae)] - test(Jenkins): Run tests and cypress with latest canary @plone/volto [Alin Voinea - [`2f42e7c`](https://github.com/eea/volto-group-block/commit/2f42e7c19a1da5a9c6a883cb4f101e8fa224ff94)] -- Add Sonarqube tag using cca-frontend addons list [EEA Jenkins - [`73afcc2`](https://github.com/eea/volto-group-block/commit/73afcc2f417797cedaa78cceefb007001d6c2406)] -- yarn 3 [Alin Voinea - [`3c00ccc`](https://github.com/eea/volto-group-block/commit/3c00ccc7110bbf12a4d268182313418fb46b1a5d)] -- Add Sonarqube tag using demo-kitkat-frontend addons list [EEA Jenkins - [`9b9662b`](https://github.com/eea/volto-group-block/commit/9b9662bda1da70ba0c3a7b4b05cebf130ed89e9e)] ### [5.0.1](https://github.com/eea/volto-group-block/compare/5.0.0...5.0.1) - 16 November 2022 #### :nail_care: Enhancements @@ -178,8 +166,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Prepare 5.0.0 release [Miu Razvan - [`88c0ddd`](https://github.com/eea/volto-group-block/commit/88c0ddd569aeda7ee34d1eadea6a087f4e7dc257)] - Update dependencies [Alin Voinea - [`c8405af`](https://github.com/eea/volto-group-block/commit/c8405afb830cdf62e7877bf30b619933519e1d71)] -- Add Sonarqube tag using marine-frontend addons list [EEA Jenkins - [`18e26c6`](https://github.com/eea/volto-group-block/commit/18e26c6939706d572ab8574e9b1826b9abc76314)] -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`8ed6d21`](https://github.com/eea/volto-group-block/commit/8ed6d21d8489911cc4cb471e3f8823c35f4adc50)] ### [4.3.8](https://github.com/eea/volto-group-block/compare/4.3.7...4.3.8) - 26 August 2022 ### [4.3.7](https://github.com/eea/volto-group-block/compare/4.3.6...4.3.7) - 22 August 2022 @@ -192,9 +178,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- Add Sonarqube tag using circularity-frontend addons list [EEA Jenkins - [`4e73f8b`](https://github.com/eea/volto-group-block/commit/4e73f8be3c73559557efadc410cb56abc055d82d)] -- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`3040335`](https://github.com/eea/volto-group-block/commit/3040335002c63b50208c95918413bc958150e7a9)] -- Add Sonarqube tag using eea-website-frontend addons list [EEA Jenkins - [`386f730`](https://github.com/eea/volto-group-block/commit/386f730ed65f73fe1468b9b77351c97fb70edcc5)] ### [4.3.5](https://github.com/eea/volto-group-block/compare/4.3.4...4.3.5) - 4 January 2022 ### [4.3.4](https://github.com/eea/volto-group-block/compare/4.3.3...4.3.4) - 3 January 2022 @@ -203,23 +186,15 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). #### :hammer_and_wrench: Others -- Add Sonarqube tag using freshwater-frontend addons list [EEA Jenkins - [`3e62d79`](https://github.com/eea/volto-group-block/commit/3e62d79a7ed37d10d623bc845d43e1144f8080f7)] ### [4.3.2](https://github.com/eea/volto-group-block/compare/4.3.1...4.3.2) - 10 December 2021 #### :hammer_and_wrench: Others - Refs #142010 - Optimize Volto-addons gitflow pipelines [valentinab25 - [`bc36cf5`](https://github.com/eea/volto-group-block/commit/bc36cf58c39e2b43c2fbf5189df6ddefc1260857)] -- Add Sonarqube tag using industry-frontend addons list [EEA Jenkins - [`8038e78`](https://github.com/eea/volto-group-block/commit/8038e783c1e8ddd71e21f72070fdfa8e7e098993)] -- Add Sonarqube tag using clms-frontend addons list [EEA Jenkins - [`daccdbc`](https://github.com/eea/volto-group-block/commit/daccdbc733e47be7d6536eb67f8f2eea038dc94b)] ### [4.3.1](https://github.com/eea/volto-group-block/compare/4.3.0...4.3.1) - 11 October 2021 #### :hammer_and_wrench: Others -- Add Sonarqube tag using bise-frontend addons list [EEA Jenkins - [`b0092e4`](https://github.com/eea/volto-group-block/commit/b0092e4f78a1a0184e22e32bb9806cd57417dfb2)] -- Add Sonarqube tag using sustainability-frontend addons list [EEA Jenkins - [`ff8889c`](https://github.com/eea/volto-group-block/commit/ff8889cb7b0761b1df43b201984ce40b14e1561b)] -- Add Sonarqube tag using climate-energy-frontend addons list [EEA Jenkins - [`0375c28`](https://github.com/eea/volto-group-block/commit/0375c28ed1ffe9186a4790b454795c0ca8039f72)] -- Add Sonarqube tag using ims-frontend addons list [EEA Jenkins - [`c392190`](https://github.com/eea/volto-group-block/commit/c392190f044f5d9397bd2fb8c3d6a357f84960d0)] -- Add Sonarqube tag using frontend addons list [EEA Jenkins - [`9694501`](https://github.com/eea/volto-group-block/commit/9694501141e6780eba89464d36406e3c93629fd8)] ### [4.3.0](https://github.com/eea/volto-group-block/compare/4.2.3...4.3.0) - 24 June 2021 #### :hammer_and_wrench: Others @@ -335,7 +310,6 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Release 1.0.0 [Alin Voinea - [`b6ef873`](https://github.com/eea/volto-group-block/commit/b6ef873cb6f61e17db66fdd4de1d9d4902a66fc6)] - Update package meta info [Alin Voinea - [`143b7d4`](https://github.com/eea/volto-group-block/commit/143b7d44438d7afa5e346a9d21a85352df4e925f)] - Add Jenkinkins pipeline [Alin Voinea - [`866a4e1`](https://github.com/eea/volto-group-block/commit/866a4e14ea1eb8f5adb01222e576e5ab6dc73a70)] -- yarn prettier [Alin Voinea - [`e3fe0a3`](https://github.com/eea/volto-group-block/commit/e3fe0a36b89878769341b45198d6c9e2f2584d15)] ### [0.1.3](https://github.com/eea/volto-group-block/compare/0.1.2...0.1.3) - 9 November 2020 #### :hammer_and_wrench: Others @@ -375,5 +349,4 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - Render meta block [Alin Voinea - [`0d44560`](https://github.com/eea/volto-group-block/commit/0d4456011ca56454068a54c610250b02df4ccb3b)] - Implement meta block allowedBlocks settings [Alin Voinea - [`f24feb1`](https://github.com/eea/volto-group-block/commit/f24feb1a1751f04841c21c7cd52a517fb02074ba)] - Edit meta block [Alin Voinea - [`236d291`](https://github.com/eea/volto-group-block/commit/236d29156fa835a7aa54eecdb4f120de0d64b271)] -- yarn bootstrap [Alin Voinea - [`e009dfb`](https://github.com/eea/volto-group-block/commit/e009dfb6b9b74d101a6722f0982a5359fc522b6b)] - Initial commit [Alin Voinea - [`6a7b0de`](https://github.com/eea/volto-group-block/commit/6a7b0deb8f873d1462fd6a9c61edfc1562b3aace)]