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

Unpublished filter for AR listing view and display according to the setup #666

Merged
merged 15 commits into from
Feb 16, 2018

Conversation

ramonski
Copy link
Contributor

Description of the issue/feature this PR addresses

This PR introduces an "unpublished" filter button for the AR listing view.

Furthermore, it displays filter buttons according to the setup (see: #575)

Current behavior before PR

  • Not possible to filter unpublished ARs
  • Listing displayed all filter buttons, no matter if the corresponding setting was enabled in the setup

Desired behavior after PR is merged

-Possible to filter unpublished ARs

  • Listing displays filter buttons according to the setting in the setup

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

Copy link
Member

@xispa xispa left a comment

Choose a reason for hiding this comment

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

Thanks!, only two small and not important comments. Nevertheless, remember to update CHANGES.rst

self.contentFilter = {
"sort_on": "created",
"sort_order": "descending",
"path": {"query": "/", "depth": 2},
Copy link
Member

Choose a reason for hiding this comment

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

Not important, but path is not required, cause the catalog to search against only contains objects from AnalysisRequest portal type. Also, self.contentFilter is overrided in derived classes like client.analysisrequests and path is correctly set there:

https://github.com/senaite/senaite.core/blob/master/bika/lims/browser/client/views/analysisrequests.py#L21-L23

so they wouldn't be affected

# remove `rejected` filter
if not setup.getRejectionReasons():
self.review_states = filter(
lambda x: x.get("id") != "rejected", self.review_states)
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for removing these filters, but remember this should be done in a separate PR :P

@xispa xispa merged commit ea9286c into master Feb 16, 2018
@xispa xispa deleted the ar-listing-filtering branch April 25, 2018 18:46
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