Skip to content

Feedback mechanism integration for volto.

License

GPL-2.0, Unknown licenses found

Licenses found

GPL-2.0
LICENSE.GPL
Unknown
LICENSE.rst
Notifications You must be signed in to change notification settings

RedTurtle/collective.feedback

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest Version Egg Status Supported - Python Versions License

collective.feedback

Feedback mechanism integration for volto.

Users can add vote and a comment to every page on the site.

Bot protection

This product use collective.honeypot to prevent bot submissions.

You just need to set two environment variables:

  • EXTRA_PROTECTED_ACTIONS feedback-add
  • HONEYPOT_FIELD xxx

xxx should be a field name that bot should compile.

If you get hacked, you could simply change that variable.

Permissions

There are two new specific permission:

  • collective.feedback.ManageFeedbacks (collective.feedback: Manage Feedbacks) Allows to reset data (by default Manager and Site Administrator).
  • collective.feedback.AccessFeedbacks (collective.feedback: Access Feedbacks) Allows users to list feedbacks on contents where they have that permission (by default Editor, Manager and Site Administrator)

Feedbacks catalog

Reviews are stored inside an internal catalog (based on souper.plone).

You can access/edit data through restapi routes (see below) or through a Plone utility:

from zope.component import getUtility
from collective.feedback.interfaces import ICollectiveFeedbackStore

tool = getUtility(ICollectiveFeedbackStore)

Add a vote

  • Method add
  • Parameters: data (dictionary with parameters)
  • Response: unique-id of new record

data should be a dictionary with the following parameters:

  • uid [required]: the uid of the Plone content
  • vote [required]: the vote
  • answer: a custom string, like a comment
  • title: the title of the Plone content
  • comment: an optional comment

Others parameters will be ignored.

Search reviews

  • Method search
  • Parameters: query (dictionary with parameters), sort_index (default=date), reverse (default=False)
  • Response: a list of results

query is a dictionary of indexes where perform the search.

Right now data is not indexed so search filters does not work. You only need to call search method to get all data.

List update

PATCH

This endpoint allows update feedbacks by list. By now you can only change "read" property

Example:

curl http://localhost:8080/Plone/@feedback-list \
    -X PATCH \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{
        "101010101": {"read": true},
    }'

Installation

Install collective.feedback by adding it to your buildout:

[buildout]

...

eggs =
    collective.feedback

and then running bin/buildout

Contribute

Compatibility

This product has been tested on Plone 6

Authors

This product was developed by RedTurtle Technology team.

RedTurtle Technology Site

About

Feedback mechanism integration for volto.

Resources

License

GPL-2.0, Unknown licenses found

Licenses found

GPL-2.0
LICENSE.GPL
Unknown
LICENSE.rst

Stars

Watchers

Forks

Packages

No packages published