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

Allow to edit Profiles in Samples for pre verified/published states #1657

Merged
merged 11 commits into from
Oct 13, 2020

Conversation

ramonski
Copy link
Contributor

Description of the issue/feature this PR addresses

This PR allows to edit analysis profiles inside samples view.

Note: Adding a profile will add all contained samples, but removing a profile will retain added ones.

Current behavior before PR

Analysis profiles could be only added during sample registration (Add form)

Desired behavior after PR is merged

Analysis profiles can be added/removed in the sample view when the sample is in a non verified/published state.

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

Cool!. Would you mind to add a doctest to
a) ensure the function setProfiles works properly (added analyses vs existing) and
b) when a profile is applied to a sample in "to_be_verified" status, the sample transitions back to "sample_received"

setup.runImportStepFromProfile(profile, "typeinfo")
setup.runImportStepFromProfile(profile, "workflow")
Copy link
Member

Choose a reason for hiding this comment

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

You still need to keep setup.runImportStepFromProfile(profile, "workflow") because of #1620: workflow definitions for InterpretationTemplate and InterpretationTemplates are located in senaite.core profile.

"to_be_sampled",
"sample_received",
"attachment_due",
"to_be_verified"
Copy link
Member

Choose a reason for hiding this comment

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

You missed a comma here, so the role mappings update do not apply to samples that are in "to_be_verified" or in "to_be_preserved" statuses.

@xispa xispa merged commit dc3d218 into 2.x Oct 13, 2020
@xispa xispa deleted the edit-profiles-in-samples branch October 13, 2020 14:23
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