Skip to content

Commit

Permalink
Add opt-out (all closed by default) setting option, add documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh committed May 11, 2023
1 parent aa0f3a6 commit 1913e02
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/source/configuration/settings-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ additionalToolbarComponents
}}
</Plug>
```
blockSettingsTabFieldsetsInitialStateOpen
A Boolean, `true` by default.
The fieldsets in the blocks settings tab start by default as non-collapsed (opened), you can decide to have them collapsed (closed) by default setting this to `false`.
```


Expand Down
6 changes: 5 additions & 1 deletion src/components/manage/Form/InlineForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import { applySchemaDefaults } from '@plone/volto/helpers';
import upSVG from '@plone/volto/icons/up-key.svg';
import downSVG from '@plone/volto/icons/down-key.svg';

import config from '@plone/volto/registry';

const messages = defineMessages({
editValues: {
id: 'Edit values',
Expand Down Expand Up @@ -80,7 +82,9 @@ const InlineForm = (props) => {
inlineFormFieldsetsState({
name: block,
fielsetList: other,
initialState: arrayRange(0, other.length - 1, 1),
initialState: config.settings.blockSettingsTabFieldsetsInitialStateOpen
? arrayRange(0, other.length - 1, 1)
: [],
}),
);

Expand Down
1 change: 1 addition & 0 deletions src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ let config = {
hashLinkSmoothScroll: false,
styleClassNameExtenders,
querystringSearchGet: false,
blockSettingsTabFieldsetsInitialStateOpen: true,
},
experimental: {
addBlockButton: {
Expand Down
1 change: 1 addition & 0 deletions test-setup-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ config.set('settings', {
viewableInBrowserObjects: [],
styleClassNameConverters,
styleClassNameExtenders,
blockSettingsTabFieldsetsInitialStateOpen: true,
});
config.set('blocks', {
blocksConfig: {
Expand Down

0 comments on commit 1913e02

Please sign in to comment.