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

Display the Unit in Profile Analyses Listing #659

Merged
merged 10 commits into from
Feb 15, 2018
Merged

Display the Unit in Profile Analyses Listing #659

merged 10 commits into from
Feb 15, 2018

Conversation

ramonski
Copy link
Contributor

Description of the issue/feature this PR addresses

Linked issue: #656

Also refactored and PEP8'ified AnalysisProfileAnalysesView

Current behavior before PR

Unit is not displayed in Analyses Listing of Profiles

Desired behavior after PR is merged

Unit is displayed in Analyses Listing of Profiles

--
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.

Just a small change re categories sorting

items[x]['allow_edit'] = ['Hidden', ]
items[x]['Hidden'] = ser.get('hidden', obj.getHidden())

self.allow_edit = "LabManager" in roles or "Manager" in roles
self.categories.sort()
Copy link
Member

Choose a reason for hiding this comment

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

I think this self.categories.sort() does nothing here in before_render. Since we don't have an after_render function (that would be nice), the best option would be to add the folderitems function, call super and sort the categories thereafter. Is not elegant, I know, but at least the Analysis Categories will appear sorted alphabetically when "Categorize Analysis Services" is enabled. With this code, the categories will appear in the order the analyses are retrieved (by sortable_title) which is not bad, but is not consistent with the rest.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, thanks, I'll change that

@xispa xispa merged commit d6fbdf2 into master Feb 15, 2018
@xispa xispa deleted the i656 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