Skip to content

When we change the view of an LRF, we can no longer back to the block view #7984

@wesleybl

Description

@wesleybl

Describe the bug
When we try to change the view of an LRF, the following options appear: Summary view, Tabular view, and Album view. If we change to any of these options, the corresponding view is displayed. However, none of these views display the blocks. And we don't have an option that displays the blocks. So we can no longer display the blocks.

To Reproduce
Steps to reproduce the behavior:

  1. Add two available languages ​​to the portal.
  2. Install plone.app.multilingual.
  3. In an LFR (for example en), click the three dots in the sidebar.
  4. In View, change to Tabular view.
  5. You'll see that you can no longer display the blocks. No available view displays the blocks.

Expected behavior
The "View" option should not be displayed for LRF. Or there should be an option that displays the blocks.

Screenshots

Image

Software (please complete the following information):

  • OS: Ubuntu
  • Browser Chrome
  • Volto Version 18
  • Plone Version 6.1
  • Plone REST API Version 9

Additional context
This happens because LRF has folder_listing as the default view:

https://github.com/plone/plone.app.multilingual/blob/master/src/plone/app/multilingual/profiles/default/types/LRF.xml#L22

But the DisplaySelect component filters the options that are displayed in View:

const layoutOptions = layouts
.filter(
(layout) =>
Object.keys(config.views.contentTypesViews).includes(layout) ||
Object.keys(config.views.layoutViews).includes(layout),
)

Since we don't have folder_listing in config.views.layoutViews:

export const layoutViews = {
document_view: DefaultView,
summary_view: SummaryView,
tabular_view: TabularView,
listing_view: ListingView,
link_redirect_view: LinkView,
album_view: AlbumView,
};

folder_listing is not displayed. And even if it were displayed, it wouldn't make much sense for it to display blocks. So, the best solution is also not to display the option to select a view in LRF.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions