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

Unable to select or deselect columns to be displayed in lists #410

Merged
merged 6 commits into from
Nov 28, 2017

Conversation

xispa
Copy link
Member

@xispa xispa commented Nov 25, 2017

Description of the issue/feature this PR addresses

When the user do a right-click in lists header, a popup with the list of available columns for the current view is displayed. An ok symbol appears next to the items their columns are already displayed in the list. By using this popup list, the user can choose which columns must be displayed or not based on his/her preferences (this configuration is stored in a cookie). Nevertheless, the list always display the columns set by default, regardless of the configuration set by the user.
Linked issue: #360 Listing Tables: Columns not selectable/deselectable

Current behavior before PR

Lists always displays the columns set by default, regardless of the configuration set by the user.

Desired behavior after PR is merged

Lists displays the columns the current user selected by making use of the popup for selection/deselection of items.

--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.

self.columns[col]['toggle'] = True
else:
self.columns[col]['toggle'] = False
self.columns[col]['toggle'] = col in toggle_cols
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

:rtype: list of str
"""
# Get the toggle configuration from the cookie
cookie_toggle = self.request.get('toggle_cols', '{}')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be that value in self.request.cookies?

Reminder: We have to consolidate all the different places in the system where cookies get set, because these cookies make caching by Varnish impossible.

@ramonski ramonski merged commit f715f0b into senaite:master Nov 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants