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

Y24-481 - Study setup page changes #4541

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

BenTopping
Copy link
Contributor

@BenTopping BenTopping commented Dec 3, 2024

Closes #4534

Changes proposed in this pull request

  • Updated questions and dropdown options as specified in the linked story.

Instructions for Reviewers

Please pull down and confirm the question and options now visible match those required in the story.

One thing to note - previous studies with answers for 'What is the reason for preventing data release' and 'Reason for delaying release' will need to update these fields if they are edited to pass the new validation options.

Copy link

codecov bot commented Dec 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.30%. Comparing base (e2a9a3c) to head (dacc290).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4541      +/-   ##
===========================================
+ Coverage    89.29%   89.30%   +0.01%     
===========================================
  Files         1406     1406              
  Lines        30010    30022      +12     
===========================================
+ Hits         26797    26811      +14     
+ Misses        3213     3211       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…in edit form to fail validation by default when editing an old study
app/models/study.rb Show resolved Hide resolved
config/locales/metadata/en.yml Show resolved Hide resolved
config/locales/metadata/en.yml Show resolved Hide resolved
@BenTopping BenTopping requested a review from harrietc52 January 6, 2025 13:16
Copy link
Contributor

@harrietc52 harrietc52 left a comment

Choose a reason for hiding this comment

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

Minor comment re the code; code looks good otherwise.

But I think it would be worth discussing how to handle the Edit Study page though. Left some thoughts below.

And as discussed, would you mind keeping in Liz Cook in the loop about the final version of the Study setup questions for her Google Form

config/locales/metadata/en.yml Show resolved Hide resolved
@harrietc52 harrietc52 self-requested a review January 7, 2025 11:20
@harrietc52
Copy link
Contributor

One thing to note - previous studies sample metadata validation will fail because their data release values aren't in the current accepted values. This should only be an issue for editing existing studies in which they will need to update their data release agreements to match current standards. We could get around this by skipping validation if it has an existing value and adding existing values to the various dropdown in the edit page but not sure if thats sensible.

A few things regarding this:

  • Would this prevent all existing Studies to be edited? If that is the case, I don’t think this is something we can release knowing that it breaks the ability to edit any Study.
  • Is it only the Data Release Agreement validation that is not backwards compatible, or is it anything else?
  • If we are choosing to not be backwards compatible, then maybe we should get it touch with a user per Study asking them to update the breaking field, or let us know what to update it too and we can.
  • The users could check/ test on Training if that data matching production
  • It could also be added as a release note when letting the users know the story has been deployed to Production, stating it will not allow an existing Study to be Edited until the Data Release Agreement etc etc has been updated.
  • Would it be possible to add a note to the top of the Edit Study page, saying “If you are getting an error it is because your Data Release Agreement does not match the current standard etc, please get in contact with ….”

Happy to discuss further.

Copy link
Contributor

@harrietc52 harrietc52 left a comment

Choose a reason for hiding this comment

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

Code looks all good, just left a comment regarding the handling of the Study Edit page

@harrietc52 harrietc52 self-requested a review January 7, 2025 11:21
@BenTopping
Copy link
Contributor Author

I forgot to update that PR description, I have got around a few of the issues but yes its a little bit tricky to balance. We have to validate against the new data release agreement and we cant backfill. The current setup keeps the old data release data present but uneditable and if a user needs to edit a study they will need to update the data release to current standards. I think this is something to ask Liz.

A few things regarding this:

  • Would this prevent all existing Studies to be edited? If that is the case, I don’t think this is something we can release knowing that it breaks the ability to edit any Study.

Its not broken as such, they can be edited but they may need to update their data release values to match the current standard.

  • Is it only the Data Release Agreement validation that is not backwards compatible, or is it anything else?

Yes information around data release agreement. E.G. They won't be able to edit the old fields that have been removed, such as data delay approval.

  • If we are choosing to not be backwards compatible, then maybe we should get it touch with a user per Study asking them to update the breaking field, or let us know what to update it too and we can.

The studies are still valid, just when they go to edit it they may need to update their release data.

  • The users could check/ test on Training if that data matching production
  • It could also be added as a release note when letting the users know the story has been deployed to Production, stating it will not allow an existing Study to be Edited until the Data Release Agreement etc etc has been updated.

Good idea 👍

  • Would it be possible to add a note to the top of the Edit Study page, saying “If you are getting an error it is because your Data Release Agreement does not match the current standard etc, please get in contact with ….”

Happy to discuss further.

@KatyTaylor
Copy link
Contributor

I haven't really looked at this PR (can do if you'd like me to) but I just had a thought - there are 2 study edit pages in SS - the normal one and the admin one.

e.g. https://uat.sequencescape.psd.sanger.ac.uk/studies/5895/edit and https://uat.sequencescape.psd.sanger.ac.uk/admin/studies (search for the study)

I think they share code, but have behaved differently in the past, which has caused problems.

Just checking whether you're aware of them both, and whether you've tested your changes on both.

Thanks

@BenTopping
Copy link
Contributor Author

I haven't really looked at this PR (can do if you'd like me to) but I just had a thought - there are 2 study edit pages in SS - the normal one and the admin one.

e.g. https://uat.sequencescape.psd.sanger.ac.uk/studies/5895/edit and https://uat.sequencescape.psd.sanger.ac.uk/admin/studies (search for the study)

I think they share code, but have behaved differently in the past, which has caused problems.

Just checking whether you're aware of them both, and whether you've tested your changes on both.

Thanks

Ah interesting. I didn't know that. I'll have a look into the admin one and check the behaviour 👍

Copy link
Member

@yoldas yoldas left a comment

Choose a reason for hiding this comment

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

I have several questions about backward compatibility and the "Other" options.

app/views/shared/metadata/edit/_study.html.erb Outdated Show resolved Hide resolved
app/models/study.rb Show resolved Hide resolved
app/models/study.rb Outdated Show resolved Hide resolved
app/views/shared/metadata/edit/_study.html.erb Outdated Show resolved Hide resolved
app/models/study.rb Show resolved Hide resolved
app/views/shared/metadata/edit/_study.html.erb Outdated Show resolved Hide resolved
@yoldas
Copy link
Member

yoldas commented Jan 7, 2025

Note: I would like to mention that radio to textbox conversion is supported by the sample_metadata schema as the fields are defined as varchar(255). The longest strings in the options fit as well.

Copy link
Member

@yoldas yoldas left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for responses to the comments.

@BenTopping BenTopping requested a review from yoldas January 8, 2025 13:56
<%
group.change_select_options_for(:data_release_delay_reason, when: :data_release_study_type_id, values: {
DataReleaseStudyType.assay_types.map(&:id) => [ '' ] + Study::DATA_RELEASE_DELAY_REASONS_ASSAY,
DataReleaseStudyType.non_assay_types.map(&:id) => [ '' ] + Study::DATA_RELEASE_DELAY_REASONS_STANDARD
DataReleaseStudyType.assay_types.map(&:id) => [ '' ] + study.data_release_delay_options(assay_option: true),
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need to keep the empty option?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm not sure. These empty options were already here, I guess its for a similar reason I added them elsewhere - to force a user selection.

DataReleaseStudyType.assay_types.map(&:id) => [ '' ] + Study::DATA_RELEASE_DELAY_REASONS_ASSAY,
DataReleaseStudyType.non_assay_types.map(&:id) => [ '' ] + Study::DATA_RELEASE_DELAY_REASONS_STANDARD
DataReleaseStudyType.assay_types.map(&:id) => [ '' ] + study.data_release_delay_options(assay_option: true),
DataReleaseStudyType.non_assay_types.map(&:id) => [ '' ] + study.data_release_delay_options
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need to keep the empty option?

Copy link
Member

@yoldas yoldas left a comment

Choose a reason for hiding this comment

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

Looks good. Allows keeping the existing value.

I have questions about whether we still need to keep the empty string option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Y24-481 - Sequence Scape Study Setup Page to Accomodate Updates to the Sanger Data Sharing Policy
4 participants