Skip to content

Commit

Permalink
FEATURE: "disabled" preset option (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaip authored Nov 21, 2020
1 parent f8c1639 commit 7c3d5f0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Configuration/Settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Neos:
# # If now `newNodeType` is defined, then the nodetype selection dialog would be shown
# newNodeType: 'Your.Namespace:News'
# disablePagination: false
# # Disable this preset for non-admins
# disabled: '${!Security.hasRole("Neos.Neos:Administrator")}'
## Example without pagination
# newsWithoutPagination:
# label: News
Expand Down
3 changes: 3 additions & 0 deletions Resources/Private/FlatNav/src/makeFlatNavContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ const makeFlatNavContainer = OriginalPageTree => {
if (!preset) {
return null;
}
if (preset.disabled) {
return null;
}
const fetchNodes = this.makeFetchNodes(presetName)
const resetNodes = this.makeResetNodes(presetName, fetchNodes)
const debouncedFetchNodes = debounce(fetchNodes, 400);
Expand Down
3 changes: 3 additions & 0 deletions Resources/Public/JavaScript/FlatNav/Plugin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Resources/Public/JavaScript/FlatNav/Plugin.js.map

Large diffs are not rendered by default.

0 comments on commit 7c3d5f0

Please sign in to comment.