Skip to content

Commit

Permalink
Adding schema and improving tests to make it p5 compatible (#10)
Browse files Browse the repository at this point in the history
* Adding schema and improving tests to make it p5 compiatable

* Add template for mail action

* Do not allow failures under Plone 5 anymore

* Do not allow failures under Plone 5 anymore

Fix 4.x tests and backward compatibility.

Fix robot import failure in Plone 5 tests, and some flake fixes.

Fix conditional zcml import for plone 4 and 5.

Use integration instead of functional testing layer.  No difference.

Fix tests for Plone 5.

Fix tests for Plone 4.  Fix some flake8 issues.

Fix some flake8 issues.

Fix some flake8 issues.

Fix another syntax error in tests.

Fix isort issues.

* Clean up
  • Loading branch information
prakharjoshi authored and hvelarde committed Oct 27, 2016
1 parent ea4002f commit 813c1d3
Show file tree
Hide file tree
Showing 20 changed files with 652 additions and 266 deletions.
8 changes: 1 addition & 7 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
[report]
omit =
/home/*/.buildout/eggs/*
/usr/*
bin/test
buildout-cache/eggs/*
eggs/*
parts/*
include = collective/contentrules/mailtogroup/*
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ cache:
directories:
- eggs
env:
- PLONE_VERSION=4.2
- PLONE_VERSION=4.3
- PLONE_VERSION=5.0
- PLONE_VERSION=5.1
matrix:
allow_failures:
- env: PLONE_VERSION=5.0
fast_finish: true
install:
- sed -ie "s#4.3.x.cfg#$PLONE_VERSION.x.cfg#" buildout.cfg
- sed -ie "s#5.0.x.cfg#$PLONE_VERSION.x.cfg#" buildout.cfg
- python bootstrap.py
- bin/buildout annotate
- bin/buildout
Expand Down
7 changes: 5 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
Changelog
=========

1.5.1 (unreleased)
1.6 (unreleased)
-------------------

- Drop support for Plone 4.0 and Plone 4.1.
- Add support for Plone 5.0 and 5.1. On Plone 5.x we use z3c.form instead of formlib.
[fulv]

- Drop support for Plone 4.0, Plone 4.1 and Plone 4.2.
Package may work, but we are no longer testing against these versions as Python 2.6 is no longer supported on code analysis.
[hvelarde]

Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include *.rst
graft collective
graft docs
include *.rst
global-exclude *.pyc
18 changes: 3 additions & 15 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,22 @@ Installation
============

Add collective.contentrules.mailtogroup to your buildout as an egg or
from source. No (generic setup) installation is necessary, the action is
from source. No (generic setup) installation is necessary, the action is
registered using ZCML. So do add the package to the zcml slug list of your
[instance] section.

Usage
=====

Go to the Plone Control Panel, select Content Rules and add a new Rule.
Go to the Plone Control Panel, select Content Rules and add a new Rule.
Under 'actions' you now have a new option: Send email to groups and users.

When searching for users and groups make sure you press the search button. Don't
hit enter. Search results for these items are only shown when you press search.

UberMultiSelectionWidget
========================
This content rule uses the UberMultiSelectionWidget from plone.app.form. This
widget is broken in version 1.1.7 of plone.app.form. Plone 3.3.4 has this version.

As of version 1.1.8 the widget is working again. To use the correct version pin
down plone.app.form:

[versions]
...
plone.app.form = 1.1.8

Credits
=======

Most of this package is directly copies from the plone.app.contenttules.mail
action. The package collective.contentrules.mailtolocalrole was also used as
action. The package collective.contentrules.mailtolocalrole was also used as
an example.
4 changes: 2 additions & 2 deletions buildout.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[buildout]
extends =
https://raw.github.com/collective/buildout.plonetest/master/test-4.3.x.cfg
https://raw.github.com/collective/buildout.plonetest/master/test-5.0.x.cfg
https://raw.github.com/collective/buildout.plonetest/master/qa.cfg

package-name = collective.contentrules.mailtogroup
Expand All @@ -17,7 +17,7 @@ parts +=
recipe = plone.recipe.codeanalysis[recommended]
directory = ${buildout:directory}/collective/contentrules/mailtogroup
clean-lines = True
flake8-ignore = E501
flake8-ignore = E501,P001,T000
multiprocessing = True
pre-commit-hook = True
return-status-codes = False
Expand Down
5 changes: 1 addition & 4 deletions collective/contentrules/mailtogroup/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# -*- coding: UTF-8 -*-
from zope.i18nmessageid import MessageFactory

mailtogroupMessageFactory = MessageFactory('collective.contentrules.mailtogroup')


def initialize(context):
"""Intializer called when used as a Zope 2 product."""
2 changes: 1 addition & 1 deletion collective/contentrules/mailtogroup/actions/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#
# -*- coding: UTF-8 -*-
11 changes: 6 additions & 5 deletions collective/contentrules/mailtogroup/actions/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@

<include package="plone.contentrules" />
<include package="plone.contentrules" file="meta.zcml" />

<include package="plone.app.contentrules" />
<include package="plone.principalsource" />

<!-- Email action definition -->
<adapter factory=".mail.MailActionExecutor" />

<browser:page
for="plone.app.contentrules.browser.interfaces.IRuleActionAdding"
name="plone.actions.MailGroup"
class=".mail.MailGroupAddForm"
class=".mail.MailGroupAddFormView"
permission="plone.app.contentrules.ManageContentRules"
/>

<browser:page
for="collective.contentrules.mailtogroup.actions.mail.IMailGroupAction"
name="edit"
class=".mail.MailGroupEditForm"
class=".mail.MailGroupEditFormView"
permission="plone.app.contentrules.ManageContentRules"
/>

Expand All @@ -31,11 +32,11 @@
title="Send email to groups and members"
description="Send an email on the triggering object."
for="*"
event="zope.component.interfaces.IObjectEvent"
event="*"
addview="plone.actions.MailGroup"
editview="edit"
schema=".mail.IMailGroupAction"
factory=".mail.MailGroupAction"
/>

</configure>
</configure>
Loading

0 comments on commit 813c1d3

Please sign in to comment.