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

Enable autoPlay as opt-in. Documentation. #48

Merged
merged 6 commits into from
Mar 7, 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
2 changes: 1 addition & 1 deletion .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push]
env:
ADDON_NAME: "@kitconcept/volto-slider-block"
ADDON_PATH: "volto-slider-block"
VOLTO_VERSION: "17.6.0"
VOLTO_VERSION: "17.15.3"

jobs:

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RESET=`tput sgr0`
YELLOW=`tput setaf 3`

PLONE_VERSION=6
VOLTO_VERSION=17.7.0
VOLTO_VERSION=17.15.3

ADDON_NAME='@kitconcept/volto-slider-block'
ADDON_PATH='volto-slider-block'
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ yarn start

Go to http://localhost:3000, login, create a new page. The slider block will show up in the Volto blocks chooser.

## Configuration options

### `enableAutoPlay`

This enables the autoplay controls in the block's settings.

```js
config.blocks.blocksConfig.slider.enableAutoPlay = true;
```

## Upgrade Guide

### `volto-slider-block` 6.0.0
Expand Down
2 changes: 2 additions & 0 deletions acceptance/cypress/tests/block.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ context('Block Acceptance Tests', () => {
cy.get(
'.objectbrowser-field[aria-labelledby="fieldset-default-field-label-href-0-slides-1"] button[aria-label="Open object browser"]',
).click();
cy.wait(1000);
cy.get('aside .breadcrumbs svg.home-icon').click();
cy.findByLabelText('Select My Page').dblclick();

Expand Down Expand Up @@ -87,6 +88,7 @@ context('Block Acceptance Tests', () => {
cy.get(
'.objectbrowser-field[aria-labelledby="fieldset-default-field-label-href-0-slides-1"] button[aria-label="Open object browser"]',
).click();
cy.wait(1000);
cy.get('aside .breadcrumbs svg.home-icon').click();
cy.findByLabelText('Select My Page').dblclick();

Expand Down
1 change: 1 addition & 0 deletions news/48.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enable autoPlay as opt-in. Documentation @sneridagh
14 changes: 9 additions & 5 deletions src/components/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,15 @@ export const SliderSchema = (props) =>
title: 'Default',
fields: ['slides'],
},
{
id: 'autoplay',
title: props.intl.formatMessage(messages.Autoplay),
fields: ['autoplayEnabled', 'autoplayDelay', 'autoplayJump'],
},
...(config.blocks.blocksConfig.slider.enableAutoPlay
? [
{
id: 'autoplay',
title: props.intl.formatMessage(messages.Autoplay),
fields: ['autoplayEnabled', 'autoplayDelay', 'autoplayJump'],
},
]
: []),
],
properties: {
slides: {
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const applyConfig = (config) => {
mostUsed: true,
sidebarTab: 1,
dataAdapter: SliderBlockDataAdapter,
enableAutoPlay: false,
};
return config;
};
Expand Down
Loading