Skip to content

Commit

Permalink
Merge pull request #371 from plone/pa-discussion-coreaddon
Browse files Browse the repository at this point in the history
move plone.allowdiscussion behavior to plone.app.discussion
  • Loading branch information
mauritsvanrees authored Sep 2, 2024
2 parents 719411d + be543ca commit 3790860
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 152 deletions.
3 changes: 3 additions & 0 deletions news/371.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
`plone.app.discussion` is now a core addon.
The `plone.discussion` behavior class was moved over there.
[@jensens]
8 changes: 0 additions & 8 deletions plone/app/dexterity/behaviors/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,6 @@
provides=".nextprevious.INextPreviousToggle"
/>

<!--Allow discussion -->
<plone:behavior
name="plone.allowdiscussion"
title="Allow discussion"
description="Allow discussion on this item"
provides=".discussion.IAllowDiscussion"
/>

<adapter factory=".nextprevious.NextPreviousToggle" />

<adapter
Expand Down
40 changes: 4 additions & 36 deletions plone/app/dexterity/behaviors/discussion.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,7 @@
from plone.app.dexterity import _
from plone.autoform import directives
from plone.autoform.interfaces import IFormFieldProvider
from plone.supermodel import model
from z3c.form.interfaces import IAddForm
from z3c.form.interfaces import IEditForm
from zope import schema
from zope.interface import provider
from zope.schema.vocabulary import SimpleTerm
from zope.schema.vocabulary import SimpleVocabulary
from zope.deferredimport import deprecated


options = SimpleVocabulary(
[
SimpleTerm(value=True, title=_("Yes")),
SimpleTerm(value=False, title=_("No")),
]
deprecated(
"IAllowDiscussion import from here is deprecated. Import from plone.app.discussion.behaviors instead (will be removed in Plone 7)",
IAllowDiscussion="plone.app.discussion.behaviors:IAllowDiscussion",
)


@provider(IFormFieldProvider)
class IAllowDiscussion(model.Schema):
model.fieldset(
"settings",
label=_("Settings"),
fields=["allow_discussion"],
)

allow_discussion = schema.Choice(
title=_("Allow discussion"),
description=_("Allow discussion for this content object."),
vocabulary=options,
required=False,
default=None,
)

directives.omitted("allow_discussion")
directives.no_omit(IEditForm, "allow_discussion")
directives.no_omit(IAddForm, "allow_discussion")
106 changes: 0 additions & 106 deletions plone/app/dexterity/tests/discussion.txt

This file was deleted.

1 change: 0 additions & 1 deletion plone/app/dexterity/tests/test_doctests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


tests = (
"discussion.txt",
"editing.rst",
"metadata.txt",
"nextprevious.txt",
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
"test": [
"plone.app.robotframework",
"plone.app.testing",
"plone.app.discussion",
"plone.i18n",
"plone.testing",
"robotsuite",
Expand Down

0 comments on commit 3790860

Please sign in to comment.