Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Commit

Permalink
Merge pull request #29 from sanger/production
Browse files Browse the repository at this point in the history
Update next release from production
  • Loading branch information
James Glover authored Jun 13, 2016
2 parents dcf952b + 8ebbb10 commit 0f66f76
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
13 changes: 13 additions & 0 deletions app/controllers/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ def stock_plates(search='Find Illumina-C stock plates')
)
end

def my_plates(search = 'Find Illumina-C plates for user')
plate_search = api.search.find(Settings.searches[search])
states = [ 'pending', 'started', 'passed', 'started_fx', 'started_mj', 'qc_complete', 'nx_in_progress']

@search_results = plate_search.all(
IlluminaC::Plate,
:state => states,
:user_uuid => current_user_uuid
)

render :my_plates
end

def create_or_find
params['show-my-plates'] == 'true' ? my_plates : create

Expand Down
9 changes: 9 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,13 @@ def custom_theme
yield 'nonproduction' unless Rails.env == 'production'
end

def details_path(labware)
IlluminaCPipeline::Application.config.details_root+labware.uuid
end

def summary_path(labware)
stock_barcode = labware.stock_plate.barcode.prefix + labware.stock_plate.barcode.number
IlluminaCPipeline::Application.config.summary_root+stock_barcode
end

end
2 changes: 2 additions & 0 deletions app/views/plates/_plate_information.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@
<li><span class="label">Input plate barcode</span> <span class="barcode"><%= useful_barcode(plate.stock_plate.barcode) %></span></li>
<% end %>
<li><span class="label">Created on</span> <%= plate.created_at.to_formatted_s(:date_created) %>
<li><span class="label">More details</span> <%= link_to "Details", details_path(plate) %></li>
<li><span class="label">Summary</span> <%= link_to "Summary", summary_path(plate) %></li>
</ul>
2 changes: 2 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class Application < Rails::Application

config.study_uuid = nil
config.project_uuid = nil
config.details_root = '#'
config.summary_root = '#'

# Allow state_machine to override methods like Object#fail in models
StateMachine::Machine.ignore_method_conflicts = true
Expand Down
7 changes: 5 additions & 2 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@

config.api_connection_options = ActiveSupport::OrderedOptions.new
config.api_connection_options.namespace = 'IlluminaC'
config.api_connection_options.url = 'http://localhost:3000/api/1/'
config.api_connection_options.authorisation = 'development'
config.api_connection_options.url = ENV.fetch('API_URL','http://localhost:3000/api/1/')
config.api_connection_options.authorisation = ENV.fetch('AUTHORISATION_TOKEN','development')

config.details_root = ENV.fetch('DETAILS_ROOT','http://localhost:3000/uuids/')
config.summary_root = ENV.fetch('SUMMARY_ROOT','http://localhost:3000/plate_summaries/')


# Email settings...
Expand Down

0 comments on commit 0f66f76

Please sign in to comment.