Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move plone.allowdiscussion behavior to plone.app.discussion #371

Merged
merged 8 commits into from
Sep 2, 2024
Merged
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
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