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

respect default_page_types in actionmenu if folder_contents #1005

Merged
merged 4 commits into from
Aug 3, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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 mockup/patterns/structure/js/actionmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ define(['underscore', 'translate'], function(_, _t) {
delete result['move-top'];
delete result['move-bottom'];
}
if (model.is_folderish || !app.setDefaultPageUrl) {
if (app.defaultPageTypes.indexOf(model.portal_type) == -1 || !app.setDefaultPageUrl) {
delete result['set-default-page'];
}

Expand Down
10 changes: 9 additions & 1 deletion mockup/patterns/structure/pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ define([
'Blob': '/view'
},

defaultPageTypes: null,
_default_defaultPageTypes: [
'Document',
'Event',
'News Item',
'Collection',
],

collectionConstructor:
'mockup-patterns-structure-url/js/collections/result',

Expand Down Expand Up @@ -187,7 +195,7 @@ define([
May want to consider moving the _default_* values out of the
options object.
*/
var replaceDefaults = ['attributes', 'activeColumns', 'availableColumns', 'buttons', 'typeToViewAction'];
var replaceDefaults = ['attributes', 'activeColumns', 'availableColumns', 'buttons', 'typeToViewAction', 'defaultPageTypes'];
_.each(replaceDefaults, function(idx) {
if (self.options[idx] === null) {
self.options[idx] = self.options['_default_' + idx];
Expand Down
2 changes: 2 additions & 0 deletions news/1005.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Respect default_page_types in actionmenu if folder_contents. Fixes https://github.com/plone/Products.CMFPlone/issues/2700
[pbauer]