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

Add laboratory location to instruments pages. #653

Merged
merged 12 commits into from Jan 12, 2022
Merged

Add laboratory location to instruments pages. #653

merged 12 commits into from Jan 12, 2022

Conversation

ghost
Copy link

@ghost ghost commented Dec 15, 2021

Add:

  • colour-coded background to instruments in graphical list, filterable by lab
  • laboratory location in textual list, instrument page

Resolves: #634

@ghost ghost marked this pull request as ready for review December 22, 2021 10:10
lib/npg/model/instrument_format.pm Outdated Show resolved Hide resolved
Copy link
Contributor

@nerdstrike nerdstrike left a comment

Choose a reason for hiding this comment

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

There are a few more points I'd like you to tidy up, and some subjective code-smells that may be beyond the scope of the current work. Use best judgement especially before replicating older not-best-practices.

lib/npg/model/instrument.pm Outdated Show resolved Hide resolved
lib/npg/model/instrument.pm Outdated Show resolved Hide resolved

if(!$self->{'current_instruments'}) {
my $pkg = 'npg::model::instrument';
my $query = qq(SELECT @{[join q(, ), $pkg->fields()]}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure this query belongs in npg::model::instrument. Defer to @mgcam on whether it's worth sorting out all this query copy-pasting that predates this PR. I'd favour npg::model::instrument($instrument_format, $lab) function with SQL construction based on arguments, unless there's something better in the base package.

Copy link
Member

Choose a reason for hiding this comment

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

I agree. Let's leave this till the very end and assess then. Not sure how much code will need refactoring.

lib/npg/view/instrument.pm Show resolved Hide resolved
t/10-model-instrument_format.t Outdated Show resolved Hide resolved
t/10-model-instrument_format.t Show resolved Hide resolved
lib/npg_tracking/Schema/Result/Instrument.pm Outdated Show resolved Hide resolved
Frinksy and others added 12 commits January 11, 2022 13:35
Softer colours are used.
Following user evaluation, lab legend is added to the instrument
status legend.
Code refactored to create a more direct mapping of lab locations
to colours and to create a single point for lab names listing.
Refactored the code to remove code repetition as requested
by the reviewer. Made the code testable and added unit tests
for the new functionality.
@ghost ghost requested a review from nerdstrike January 11, 2022 16:53
Copy link
Contributor

@nerdstrike nerdstrike left a comment

Choose a reason for hiding this comment

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

I think this resolves all the issues I have raised. The underlying code has some red flags, but that's out of scope. I especially do not like the encapsulation-busting $pkg invocations.

@nerdstrike nerdstrike merged commit f2a8aa0 into wtsi-npg:devel Jan 12, 2022
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.

Different colour background for sequencing machines in different lab locations
3 participants