Skip to content

Conversation

@StephenHulme
Copy link
Contributor

@StephenHulme StephenHulme commented Jan 26, 2026

Closes #5417

Merges into #5486

See #5500 for a related accessioning permissions issue that was discovered as part of this work.

Changes proposed in this pull request

Provides vital feedback on the accession-ability of studies and samples.

  • Adds a Study Accessioning tab, which provides clear feedback to the user (and developers) about which studies can and can't be accessioned and why
  • Hide Accession all samples link if user is not permitted to accession
  • Replace AccessioningDisabledError with accessioning_enabled?
  • Fix fresh_sevice_link typo
  • Adds and integrates accessioning helper functions:
    • accessioning_enabled? - a single, global accessioning-enabled check, same as configatron.accession_samples
    • permitted_to_accession? - an explicit check for user permission to accession, same as can?(:accession, object)
    • Study#samples_accessionable? - does a study meet eligibility criteria for accessioning samples
    • Sample#should_be_accessioned? - does a sample meet eligibility criteria for being accessioned

Screenshots

Screenshot 2026-01-26 at 15 28 36 Screenshot 2026-01-26 at 09 43 36 Screenshot 2026-01-27 at 15 02 43

Instructions for Reviewers

[All PRs] - Confirm PR template filled
[Feature Branches] - Review code
[Production Merges to main]
    - Check story numbers included
    - Check for debug code
    - Check version

@StephenHulme StephenHulme self-assigned this Jan 26, 2026
@StephenHulme StephenHulme added UX Improves user experience Accessioning Epic in technical roadmap June 2025, relating to improving the accessioning code. labels Jan 26, 2026
@StephenHulme StephenHulme changed the title Y26-021 - Add study accessioning checklist Y25-286 - Add study accessioning checklist Jan 26, 2026
Copy link
Member

@andrewsparkes andrewsparkes 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 other than the minor comment about double negatives.
I think it needs changing as it's confusing to understand.

<% if @study.study_metadata.strategy_not_applicable? %>
<%= bad_icon %> Study release strategy is <strong><%= Study::DATA_RELEASE_STRATEGY_NOT_APPLICABLE.humanize %></strong> - <%= link_to('Change release strategy', edit_study_path(@study)) if can?(:edit, @study) %>
<% else %>
<%= good_icon %> Study release strategy is not <%= Study::DATA_RELEASE_STRATEGY_NOT_APPLICABLE.humanize %> <%= tag.strong { "(#{@study.study_metadata.data_release_strategy.humanize})" } %>
Copy link
Member

Choose a reason for hiding this comment

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

Noticed in the screenshots there were double negatives. Like 'is not Not applicable' and 'is not Never'.
Consider different wording?

Copy link
Member

Choose a reason for hiding this comment

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

maybe 'cannot be' instead of 'is not'?

Copy link
Member

Choose a reason for hiding this comment

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

or 'should not be'
still not great for clarity, anyway you get my point

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 suggestion, thanks.
I've changed the wording to focus on what the current study settings are, rather than what they are not.

@StephenHulme
Copy link
Contributor Author

Thanks for the suggestions @andrewsparkes I've updated the wording and formatting as below:

Happy study:
Screenshot 2026-01-30 at 09 59 10

Sad study without user permissions:
Screenshot 2026-01-30 at 10 03 39

Sad study with user permissions:
Screenshot 2026-01-30 at 10 04 58


def dac_accession
@study = Study.find(params[:id])

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need an accessioning_enabled guard clause?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added and refactored


def policy_accession
@study = Study.find(params[:id])

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need an accessioning_enabled guard clause?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yip, added and refactored

end

def fresh_sevice_link
def fresh_service_link
Copy link
Contributor

Choose a reason for hiding this comment

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

😄

@StephenHulme
Copy link
Contributor Author

I've made some small UX changes, including updating the warning message on @neilsycamore's request:

image

@andrewsparkes and @BenTopping would you please take another look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Accessioning Epic in technical roadmap June 2025, relating to improving the accessioning code. UX Improves user experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants