@plone-collective/volto-polls
v3.0.0-alpha.1
Published
Online polls support for Plone and Volto.
Readme
collective.polls (@plone-collective/volto-polls)
A content type, workflow, and Volto block for conducting online polls in Plone, for anonymous and logged-in users.
This is the Volto frontend add-on.
Its Plone backend is collective.polls, and a site needs both.
Features
- The poll view. The view of the
collective.polls.pollcontent type: the vote form while the visitor can vote, the results otherwise. - The Poll block. Shows the latest open poll of the site section, the latest closed one when none is open, or a poll the editor picks. It also works inside a Grid.
- Single or multiple choice. Radio buttons or checkboxes, under the poll's legend or a default one, in the poll's order or a random one.
- Results as bars, a pie, or numbers. Each chart comes with a table for assistive technology.
- An options widget. Editors add, remove, and reorder a poll's options, and each option keeps its id, so its votes stay with it.
- Translations in Catalan, Czech, German, Spanish, Finnish, French, Dutch, Brazilian Portuguese, and Traditional Chinese.
Customizing
The add-on registers its pieces in the component registry, so a project can replace them without shadowing files.
| Name | Dependencies | Is |
| --- | --- | --- |
| Poll | -- | The poll itself, used by both the view and the block. |
| PollResultsGraph | bar, pie, or numbers | The chart for one kind of results. |
Documentation
Read the documentation at collective.github.io/collective.polls.
Installation
This add-on requires Volto 19.
Add @plone-collective/volto-polls to your project.
pnpm add @plone-collective/volto-pollsThen list it in the addons of your volto.config.js.
const addons = ['@plone-collective/volto-polls'];Test installation
Visit http://localhost:3000/ in a browser, log in, and add a Poll.
Development
The development of this add-on is done in isolation using pnpm workspaces, the latest mrs-developer, and other Volto core improvements.
For these reasons, it only works with pnpm and Volto 19.
Prerequisites ✅
- An operating system that runs all the requirements mentioned.
- nvm
- Node.js and pnpm 24
- Make
- Git
- Docker (optional)
Installation 🔧
Clone this repository, then change your working directory.
git clone [email protected]:collective/collective.polls.git cd collective.polls/frontendInstall this code base.
make install
Make convenience commands
Run make help to list the available Make commands.
Start developing
Start the backend.
make backend-docker-startIn a separate terminal session, start the frontend.
make startLint code
Run ESlint, Prettier, and Stylelint in analyze mode.
make lintFormat code
Run ESlint, Prettier, and Stylelint in fix mode.
make formatType check
Run the TypeScript compiler without emitting files.
make typechecki18n
Extract the i18n messages to locales.
make i18nUnit tests
Run the unit tests once.
make ci-testmake test runs them in watch mode instead, and never returns.
Storybook
Build Storybook, or start it while you work.
make storybook-build
make storybook-startRun Cypress tests
Run each of these steps in separate terminal sessions.
In the first session, start the frontend in development mode.
make acceptance-frontend-dev-startIn the second session, start the backend acceptance server.
make acceptance-backend-startIn the third session, start the Cypress interactive test runner.
make acceptance-testLicense
The project is licensed under the MIT license.
