Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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] }}
66 changes: 0 additions & 66 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions news/260.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Update Field/Actions listing to work with Plone 6
[petschki]
17 changes: 7 additions & 10 deletions src/collective/easyform/browser/actions_listing.pt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
i18n:domain="plone.schemaeditor"
>
<metal:form metal:use-macro="context/@@ploneform-macros/form">
<metal:description-slot metal:fill-slot="description">
<metal:top-slot metal:fill-slot="formtop">
<input tal:replace="structure context/@@authenticator/authenticator" />
<script type="text/javascript"
tal:attributes="
src context/++resource++schemaeditor.js;
"
></script>
<div class="extraActions">
<a class="pat-modal pat-plone-modal"
id="add-field"
Expand All @@ -19,15 +25,6 @@
</a>

</div>
</metal:description-slot>

<metal:top-slot metal:fill-slot="formtop">
<input tal:replace="structure context/@@authenticator/authenticator" />
<script type="text/javascript"
tal:attributes="
src context/++resource++schemaeditor.js;
"
></script>
</metal:top-slot>

<metal:fields-slot metal:fill-slot="fields">
Expand Down
11 changes: 1 addition & 10 deletions src/collective/easyform/browser/easyform.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
2 changes: 2 additions & 0 deletions src/collective/easyform/browser/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
35 changes: 12 additions & 23 deletions src/collective/easyform/browser/fields_listing.pt
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,31 @@
i18n:domain="plone.schemaeditor"
>
<metal:form metal:use-macro="context/@@ploneform-macros/form">
<metal:description-slot metal:fill-slot="description">
<div class="extraActions">
<a class="pat-modal pat-plone-modal"
<metal:top-slot metal:fill-slot="formtop">
<input tal:replace="structure context/@@authenticator/authenticator" />
<script type="text/javascript"
tal:attributes="
src context/++resource++schemaeditor.js;
"
></script>
<div class="extraActions text-end">
<a class="pat-modal pat-plone-modal btn btn-secondary"
id="add-field"
href="@@add-field"
tal:attributes="
href string:${context/absolute_url}/@@add-field;
"
>
<button style="float: right; display: block;"
i18n:translate="add_new_field_hellip"
>Add new field&hellip;</button>
</a>
>Add new field&hellip;</a>

<a class="pat-modal pat-plone-modal"
<a class="pat-modal pat-plone-modal btn btn-secondary"
id="add-fieldset"
href="@@add-fieldset"
tal:condition="context/enableFieldsets|python:True"
tal:attributes="
href string:${context/absolute_url}/@@add-fieldset;
"
>
<button style="float: right; display: block;"
i18n:translate="add_fieldset_hellip"
>Add new fieldset&hellip;</button>
</a>
>Add new fieldset&hellip;</a>
</div>
</metal:description-slot>

<metal:top-slot metal:fill-slot="formtop">
<input tal:replace="structure context/@@authenticator/authenticator" />
<script type="text/javascript"
tal:attributes="
src context/++resource++schemaeditor.js;
"
></script>
</metal:top-slot>

<metal:fields-slot metal:fill-slot="fields">
Expand Down
1 change: 1 addition & 0 deletions src/collective/easyform/profiles/default/rolemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
name="collective.easyform: Edit TALES Fields"
>
<role name="Manager" />
<role name="Site Administrator" />
</permission>
<permission acquire="True"
name="collective.easyform: Edit Python Fields"
Expand Down
3 changes: 2 additions & 1 deletion src/collective/easyform/profiles/default/types/EasyForm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
>EasyForm</property>
<property name="description"
i18n:translate=""
>EasyForm</property>
>A web-form builder</property>
<property name="icon_expr">string:ui-checks</property>
<property name="global_allow">True</property>
<property name="filter_content_types">False</property>
<property name="allowed_content_types" />
Expand Down
25 changes: 4 additions & 21 deletions tests-5.0.x.cfg
Original file line number Diff line number Diff line change
@@ -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
20 changes: 0 additions & 20 deletions tests-5.1.x.cfg
Original file line number Diff line number Diff line change
@@ -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
39 changes: 0 additions & 39 deletions tests-5.2.x.cfg
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions tests-6.0.x.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[buildout]
extends =
https://raw.githubusercontent.com/collective/buildout.plonetest/master/test-6.0.x.cfg
base.cfg
21 changes: 21 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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