Hide method and instrument columns in analysis listing when not required #1951
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the issue/feature this PR addresses
User can define the methods and instruments that can be "used" for a given analysis service. In such case, methods and instruments are populated for selection later in listings for the analyst to choose the desired values.
This Pull Request makes the columns "Method" and "Instrument" to only be rendered in analyses listing when at least one of the analyses requires the introduction of either method or analysis. The columns are also rendered when at least one of the analyses has a value assigned for any of the two fields.
Current behavior before PR
Columns "Method" and "Instrument" are always displayed in analyses listing, regardless of their suitability
Desired behavior after PR is merged
Columns "Method" and "Instrument" are only displayed in analyses listing when at least one of the analyses listed requires them to be displayed
--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.