From c3ab61074c9c6529a525539b67f90a424cecfe0a Mon Sep 17 00:00:00 2001 From: Peter Mathis Date: Wed, 20 Jan 2021 10:17:28 +0100 Subject: [PATCH 1/7] move schemaeditor buttons --- news/260.feature | 2 ++ .../easyform/browser/actions_listing.pt | 17 +++++++---------- .../easyform/browser/fields_listing.pt | 17 +++++++---------- 3 files changed, 16 insertions(+), 20 deletions(-) create mode 100644 news/260.feature diff --git a/news/260.feature b/news/260.feature new file mode 100644 index 00000000..c725d736 --- /dev/null +++ b/news/260.feature @@ -0,0 +1,2 @@ +Update Field/Actions listing to work with Plone 6 +[petschki] \ No newline at end of file diff --git a/src/collective/easyform/browser/actions_listing.pt b/src/collective/easyform/browser/actions_listing.pt index ebefced1..8b7fba6c 100644 --- a/src/collective/easyform/browser/actions_listing.pt +++ b/src/collective/easyform/browser/actions_listing.pt @@ -4,7 +4,13 @@ i18n:domain="plone.schemaeditor" > - + + + - - - - - diff --git a/src/collective/easyform/browser/fields_listing.pt b/src/collective/easyform/browser/fields_listing.pt index 4f8aa39e..a249a35b 100644 --- a/src/collective/easyform/browser/fields_listing.pt +++ b/src/collective/easyform/browser/fields_listing.pt @@ -5,7 +5,13 @@ i18n:domain="plone.schemaeditor" > - + + + - - - - - From d5c50c308043f72c40d28dd87ed7cb2b1952680d Mon Sep 17 00:00:00 2001 From: Peter Mathis Date: Wed, 20 Jan 2021 11:01:29 +0100 Subject: [PATCH 2/7] bootstrap classes --- .../easyform/browser/fields_listing.pt | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/collective/easyform/browser/fields_listing.pt b/src/collective/easyform/browser/fields_listing.pt index a249a35b..58192fdb 100644 --- a/src/collective/easyform/browser/fields_listing.pt +++ b/src/collective/easyform/browser/fields_listing.pt @@ -12,31 +12,23 @@ src context/++resource++schemaeditor.js; " > -
- + - - + >Add new field… - - - + >Add new fieldset…
From 4861da73ce2938cec615c33195086cf0fb748bac Mon Sep 17 00:00:00 2001 From: Philip Bauer Date: Tue, 20 Jul 2021 17:35:02 +0200 Subject: [PATCH 3/7] fix manual editing of xml schema --- src/collective/easyform/browser/fields.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/collective/easyform/browser/fields.py b/src/collective/easyform/browser/fields.py index efe0dd03..49fd6b13 100644 --- a/src/collective/easyform/browser/fields.py +++ b/src/collective/easyform/browser/fields.py @@ -17,6 +17,7 @@ from plone.schemaeditor.browser.schema.traversal import SchemaContext from plone.supermodel import loadString from plone.supermodel.parser import SupermodelParseError +from Products.CMFPlone.utils import safe_bytes from Products.Five import BrowserView from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from z3c.form import button @@ -158,6 +159,7 @@ def __call__(self): parser = etree.XMLParser(resolve_entities=False, remove_pis=True) # Is it valid XML? try: + source = safe_bytes(source) root = etree.fromstring(source, parser=parser) except etree.XMLSyntaxError as e: return dumps( From aa29b41ebcb339d8b1e0ea747f7b0e632df8b57d Mon Sep 17 00:00:00 2001 From: Peter Mathis Date: Wed, 3 Nov 2021 11:44:27 +0100 Subject: [PATCH 4/7] use github actions for testing --- .github/worklows/test.yml | 50 +++++++++++++++++++++++++++++ .travis.yml | 66 --------------------------------------- tests-5.0.x.cfg | 25 +++------------ tests-5.1.x.cfg | 20 ------------ tests-5.2.x.cfg | 39 ----------------------- tests-6.0.x.cfg | 4 +++ tox.ini | 21 +++++++++++++ 7 files changed, 79 insertions(+), 146 deletions(-) create mode 100644 .github/worklows/test.yml delete mode 100644 .travis.yml create mode 100644 tests-6.0.x.cfg create mode 100644 tox.ini diff --git a/.github/worklows/test.yml b/.github/worklows/test.yml new file mode 100644 index 00000000..a580e001 --- /dev/null +++ b/.github/worklows/test.yml @@ -0,0 +1,50 @@ +name: tests + +on: + push: + branches: [ main ] + pull_request: + # Allow to run this workflow manually from the Actions tab + workflow_dispatch: +jobs: + build: + strategy: + matrix: + config: + # [Python version, tox env] + - ["2.7", "plone50-py27"] + - ["2.7", "plone51-py27"] + - ["2.7", "plone52-py27"] + - ["3.6", "plone52-py36"] + - ["3.7", "plone52-py37"] + - ["3.8", "plone52-py38"] + - ["3.7", "plone60-py37"] + - ["3.8", "plone60-py38"] + - ["3.9", "plone60-py39"] + runs-on: ubuntu-latest + name: ${{ matrix.config[1] }} + steps: + - uses: actions/checkout@v2 + - name: Install lxml dev libraries + # Needed to avoid error on Plone 5.0. + # Error: Please make sure the libxml2 and libxslt development packages are installed. + run: sudo apt-get install libxml2-dev libxslt1-dev + if: matrix.config[1] == 'plone50-py27' + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.config[0] }} + - name: Pip cache + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }} + restore-keys: | + ${{ runner.os }}-pip-${{ matrix.config[0] }}- + ${{ runner.os }}-pip- + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install tox + - name: Test + run: tox -e ${{ matrix.config[1] }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 78c862fb..00000000 --- a/.travis.yml +++ /dev/null @@ -1,66 +0,0 @@ -language: python -sudo: false -addons: - apt: - sources: - - google-chrome -jobs: - include: - - python: "2.7" - env: PLONE_VERSION=5.0.x - - python: "2.7" - env: PLONE_VERSION=5.1.x - - python: "2.7" - env: PLONE_VERSION=5.2.x - - python: "3.6" - env: PLONE_VERSION=5.2.x - - python: "3.7" - env: PLONE_VERSION=5.2.x - dist: xenial - sudo: true - - python: "3.8" - env: PLONE_VERSION=5.2.x - dist: bionic - sudo: true - -cache: - pip: true - directories: - - eggs - - downloads - - buildout-cache - - $HOME/buildout-cache -before_install: -# install chrome webdriver - - mkdir webdriver; - wget https://github.com/mozilla/geckodriver/releases/download/v0.20.0/geckodriver-v0.20.0-linux64.tar.gz; - tar -xzf geckodriver-v0.20.0-linux64.tar.gz -C webdriver; - wget https://chromedriver.storage.googleapis.com/2.40/chromedriver_linux64.zip; - unzip chromedriver_linux64.zip -d webdriver; - export PATH=$PATH:$(pwd)/webdriver; - - mkdir -p $HOME/buildout-cache/{eggs,downloads} - - mkdir $HOME/.buildout - - echo "[buildout]" > $HOME/.buildout/default.cfg - - echo "download-cache = $HOME/buildout-cache/downloads" >> $HOME/.buildout/default.cfg - - echo "eggs-directory = $HOME/buildout-cache/eggs" >> $HOME/.buildout/default.cfg - - pip install zc.buildout - - cp tests-$PLONE_VERSION.cfg buildout.cfg -install: - - buildout -N annotate - - buildout -N - - pip install zest.pocompile - - pocompile src - # force this - - sudo -E apt-get -yq --no-install-suggests --no-install-recommends $(travis_apt_get_options) --allow-unauthenticated install google-chrome-stable -before_script: - - 'export DISPLAY=:99.0' - - Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & - - sleep 3 -script: -# Run code-analysis, except on Python 3.6, which mysteriously fails to find zc.buildout. - - python --version 2> /dev/stdout | grep '2.7\|3.6' || bin/code-analysis - - bin/test --all $TEST_OPTIONS -after_success: - - bin/createcoverage -t '--all $TEST_OPTIONS' - - pip install -q coveralls - - coveralls diff --git a/tests-5.0.x.cfg b/tests-5.0.x.cfg index d22f66af..0031db8b 100644 --- a/tests-5.0.x.cfg +++ b/tests-5.0.x.cfg @@ -1,27 +1,10 @@ [buildout] extends = https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-5.0.x.cfg - https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg - https://raw.githubusercontent.com/plone/plone.app.robotframework/master/versions.cfg base.cfg -parts += - createcoverage - -parts -= - code-analysis - -package-name = collective.easyform -package-extras = [test,downloadxlsx] -test-eggs = - [versions] -setuptools = -zc.buildout = -coverage = >=3.7 -plone.app.mosaic = -plone.app.robotframework = 1.5.0 -plone.formwidget.recaptcha = 2.1.0 -pycodestyle = 2.5.0 -flake8 = 3.7.9 -openpyxl = 2.6.3 +# Maybe just a problem with 3.3.0 on Maurits' Mac: +Pillow = 3.3.3 +# plone.restapi now requires 'plone.schema>=1.2.1', but Plone 5.0 pins it to 1.1.0. +plone.schema = 1.2.1 diff --git a/tests-5.1.x.cfg b/tests-5.1.x.cfg index 1d369cae..5f673624 100644 --- a/tests-5.1.x.cfg +++ b/tests-5.1.x.cfg @@ -1,25 +1,5 @@ [buildout] extends = https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-5.1.x.cfg - https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg - https://raw.githubusercontent.com/plone/plone.app.robotframework/master/versions.cfg base.cfg -parts += - createcoverage - -parts -= - code-analysis - -package-name = collective.easyform -package-extras = [test,ploneformgen,downloadxlsx] -test-eggs = - -[versions] -setuptools = -zc.buildout = -coverage = >=3.7 -plone.app.mosaic = -plone.app.robotframework = 1.5.0 -plone.formwidget.recaptcha = 2.1.0 -openpyxl = 2.6.3 diff --git a/tests-5.2.x.cfg b/tests-5.2.x.cfg index 9f45cb5d..6950a3aa 100644 --- a/tests-5.2.x.cfg +++ b/tests-5.2.x.cfg @@ -1,43 +1,4 @@ [buildout] extends = https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-5.2.x.cfg - https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg - https://raw.githubusercontent.com/plone/plone.app.robotframework/master/versions.cfg base.cfg - -parts += - createcoverage - -package-name = collective.easyform -package-extras = [test,recaptcha,downloadxlsx] -test-eggs = - -# Python3 compatibility for plone.formwidget.z3cform is not released -extensions += - mr.developer -sources = sources -sources-dir = share -auto-checkout += - plone.formwidget.recaptcha - -[versions] -setuptools = -zc.buildout = -coverage = >=3.7 -plone.app.mosaic = -plone.app.robotframework = 1.5.0 -openpyxl = 2.6.3 -# check-manifest = 0.45 requires 'build' 0.1.0. -# This requires a newer 'pep517' than is pinned by Plone, -# and on Python 2.7 a newer virtualenv than is pinned by Plone. -check-manifest = 0.44 - -[versions:python27] -check-manifest = 0.41 - -[sources] -plone.formwidget.recaptcha = git ${remotes:plone}/plone.formwidget.recaptcha.git pushurl=${remotes:plone_push}/plone.formwidget.recaptcha.git - -[remotes] -plone = https://github.com/plone -plone_push = git@github.com:plone diff --git a/tests-6.0.x.cfg b/tests-6.0.x.cfg new file mode 100644 index 00000000..3d9a6274 --- /dev/null +++ b/tests-6.0.x.cfg @@ -0,0 +1,4 @@ +[buildout] +extends = + https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-6.0.x.cfg + base.cfg diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..05a58d65 --- /dev/null +++ b/tox.ini @@ -0,0 +1,21 @@ +[tox] +minversion = 3.18 +envlist = + plone50-py27 + plone51-py27 + plone52-py{27,36,37,38} + plone60-py{37,38,39} + +[testenv] +# We do not install with pip, but with buildout: +usedevelop = false +skip_install = true +deps = + -r requirements.txt +commands_pre = + plone50: {envbindir}/buildout -Nc {toxinidir}/tests-5.0.x.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test + plone51: {envbindir}/buildout -Nc {toxinidir}/tests-5.1.x.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test + plone52: {envbindir}/buildout -Nc {toxinidir}/tests-5.2.x.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test + plone60: {envbindir}/buildout -Nc {toxinidir}/tests-6.0.x.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test +commands = + {envbindir}/test From 9456bc564b6dadfbb2161a0e8b3b4e94baf7006c Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Tue, 23 Nov 2021 23:41:14 +0100 Subject: [PATCH 5/7] fix icon --- src/collective/easyform/browser/easyform.css | 11 +---------- .../easyform/profiles/default/types/EasyForm.xml | 3 ++- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/collective/easyform/browser/easyform.css b/src/collective/easyform/browser/easyform.css index 48a50ad0..73c0e53e 100644 --- a/src/collective/easyform/browser/easyform.css +++ b/src/collective/easyform/browser/easyform.css @@ -2,7 +2,7 @@ background: #eee; padding: 1em 1em 1px 1em; margin: 0.5em 0; - -moz-border-radius: 0.5em; + border-radius: 0.5em; position: relative; border: solid 2px #ccc; } @@ -50,15 +50,6 @@ border-top: none; } -.contenttype-easyform.contenttype-easyform::before { - font-family: 'Glyphicons Halflings'; - content: '\e028'; - top: 2px; -} - -.icon-easyform-view.toolbar-menu-icon::before { - content: '\e807'; -} body.portaltype-easyform div.crud-form tbody label { display: none; } \ No newline at end of file diff --git a/src/collective/easyform/profiles/default/types/EasyForm.xml b/src/collective/easyform/profiles/default/types/EasyForm.xml index 51920d0f..1dec01e1 100644 --- a/src/collective/easyform/profiles/default/types/EasyForm.xml +++ b/src/collective/easyform/profiles/default/types/EasyForm.xml @@ -9,7 +9,8 @@ >EasyForm EasyForm + >A web-form builder + string:ui-checks True False From 2784df6352e20f3928ead9e3ac6d6c843208524f Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Tue, 23 Nov 2021 23:52:34 +0100 Subject: [PATCH 6/7] typo in path prevent action to run --- .github/{worklows => workflows}/test.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{worklows => workflows}/test.yml (100%) diff --git a/.github/worklows/test.yml b/.github/workflows/test.yml similarity index 100% rename from .github/worklows/test.yml rename to .github/workflows/test.yml From bd16df2e10245ccd3749a54ae362990dd4a6a03a Mon Sep 17 00:00:00 2001 From: Yuri Date: Thu, 2 Dec 2021 10:44:09 +0100 Subject: [PATCH 7/7] Update rolemap.xml tales fields are useful to rewrite the sender. Until there's no such option in Default, better to give this power to Site Administrators. I know this can be risky, so this is just a first try to solve the issue --- src/collective/easyform/profiles/default/rolemap.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/collective/easyform/profiles/default/rolemap.xml b/src/collective/easyform/profiles/default/rolemap.xml index 2ecbe21d..96793f33 100644 --- a/src/collective/easyform/profiles/default/rolemap.xml +++ b/src/collective/easyform/profiles/default/rolemap.xml @@ -32,6 +32,7 @@ name="collective.easyform: Edit TALES Fields" > +