Skip to content

Commit

Permalink
LIMS-595: Change Sample Changers/Containers/Stage to Pucks for i15/i1…
Browse files Browse the repository at this point in the history
…5-1 (xpdf) (#579)

* Change containers to pucks

* Remove shipment.js file

* Remove spaces

* LIMS-595: Fix tooltip, hidden text, and bug with tracking display

---------

Co-authored-by: Shah, Hussain (-,RAL,LSCI) <[email protected]>
Co-authored-by: Mark W <[email protected]>
Co-authored-by: Mark Williams <[email protected]>
  • Loading branch information
4 people authored Jun 25, 2024
1 parent a968b04 commit bdda4f4
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 18 deletions.
1 change: 1 addition & 0 deletions client/src/js/modules/assign/views/assign.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ define(['marionette', 'backbone', 'views/pages',
templateHelpers: function() {
return {
VISIT: this.getOption('visit').toJSON(),
APP_TYPE: app.type,
}
},

Expand Down
8 changes: 7 additions & 1 deletion client/src/js/modules/assign/views/selectvisit.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ define(['marionette', 'templates/assign/selectvisit.html'], function(Marionette,
className: 'content',
childView: VisitView,
childViewContainer: 'ul.visits',
emptyView: EmptyView
emptyView: EmptyView,

templateHelpers: function() {
return {
APP_TYPE: app.type,
}
},

})

Expand Down
16 changes: 11 additions & 5 deletions client/src/js/modules/shipment/views/shipment.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,26 +146,32 @@ define(['marionette',

showDewar: function(did, force) {
if (did == this.lastDewarID && !force) return

this.$el.find('.dewar_name').text(this.dewars.findWhere({ DEWARID: did }).get('CODE'))
if (app.proposal && app.proposal.get('ACTIVE') == '1') this.$el.find('.add_container').html('<a class="button" data-testid="shipment-add-container" href="/containers/add/did/'+did+'"><i class="fa fa-plus"></i> Add Container</a>')
if (app.proposal && app.proposal.get('ACTIVE') == '1') {
if (app.type == "xpdf"){
this.$el.find('.add_container').html('<a class="button" data-testid="shipment-add-container" href="/containers/add/did/'+did+'"><i class="fa fa-plus"></i> Add Puck</a>')
this.$el.find('.add-container-small').prop('title', 'Click to add a puck')
this.$el.find('.add-container-text').text('Add Puck')
} else {
this.$el.find('.add_container').html('<a class="button" data-testid="shipment-add-container" href="/containers/add/did/'+did+'"><i class="fa fa-plus"></i> Add Container</a>')
}
}
this.dewarcontent.dewarID = did
this.dewarcontent.fetch()
this.dewarhistory.id = did
this.dewarhistory.fetch()

var d = this.dewars.findWhere({ DEWARID: did })
if (d && (d.get('TRACKINGNUMBERTOSYNCHROTRON') || d.get('TRACKINGNUMBERTOSYNCHROTRON'))) {
if (d && (d.get('TRACKINGNUMBERTOSYNCHROTRON') || d.get('TRACKINGNUMBERFROMSYNCHROTRON'))) {
this.dewartracking.queryParams.DEWARID = did
this.dewartracking.fetch()

} else {
this.dewartracking.ORIGIN = 'N/A'
this.dewartracking.DESTINATION = 'N/A'
this.dewartracking.reset()

this.lastDewarID = did
}
this.lastDewarID = did
},

refreshDewar: function() {
Expand Down
4 changes: 2 additions & 2 deletions client/src/js/modules/types/xpdf/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ define([], function() {
dc: 'View All Data',
visits: 'Visits',
shipments: 'Shipments',
assign: 'Assign Sample Changers',
containers: 'Sample Changers',
assign: 'Assign Pucks',
containers: 'Pucks',
instances: 'Instances',
xsamples: 'Samples',
phases: 'Phases',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ define([
return ContainersView.extend({
showFilter: false,
showImaging: false,
template: '<div><h1>Pucks</h1><div class="filter type"></div><div class="filter"><ul><li><label><input type="checkbox" name="currentuser" /> My Pucks</label></li></ul></div><div class="wrapper"></div></div>',

columns: [
{ name: 'NAME', label: 'Name', cell: 'string', editable: false },
Expand Down
12 changes: 6 additions & 6 deletions client/src/js/templates/assign/assign.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1>Container Allocation for <%-VISIT.VISIT%> on <%-VISIT.BL%> at <%-VISIT.ST%></h1>
<h1><% if (APP_TYPE == 'xpdf') { %>Puck<% } else { %>Container<% } %> Allocation for <%-VISIT.VISIT%> on <%-VISIT.BL%> at <%-VISIT.ST%></h1>

<p class="help">This page allows you to allocate samples from ISPyB to the beamline sample changer. Drag and drop containers on to the locations on the beamline. Shipments and Dewars can be expanded by clicking on their titles</p>
<p class="help">Uassign containers by dragging them to any shipment listed under "Unassigned Containers". The container will still belong to its original shipment.</p>
<p class="help">This page allows you to allocate samples from ISPyB to the beamline sample changer. Drag and drop <% if (APP_TYPE == 'xpdf') { %>pucks<% } else { %>containers<% } %> on to the locations on the beamline. Shipments and Dewars can be expanded by clicking on their titles</p>
<p class="help">Uassign <% if (APP_TYPE == 'xpdf') { %>pucks<% } else { %>containers<% } %> by dragging them to any shipment listed under "Unassigned <% if (APP_TYPE == 'xpdf') { %>Pucks<% } else { %>Containers<% } %>". The <% if (APP_TYPE == 'xpdf') { %>puck<% } else { %>container<% } %> will still belong to its original shipment.</p>

<p class="ra">
<a href="/dc/visit/<%-VISIT.VISIT%>" class="button"><i class="fa fa-search"></i> Data Collections</a>
Expand All @@ -10,13 +10,13 @@ <h1>Container Allocation for <%-VISIT.VISIT%> on <%-VISIT.BL%> at <%-VISIT.ST%><
<div class="drag_container">

<div class="c_holder">
<h1>Assigned Containers: <?php echo $bl ?> Sample Changer</h1>
<h1>Assigned <% if (APP_TYPE == 'xpdf') { %>Pucks<% } else { %>Containers<% } %>: <?php echo $bl ?> Sample Changer</h1>
<div id="assigned"></div>
</div>

<div class="c_holder">
<div class="r"><a class="button" href="/containers/add/visit/<%-VISIT.VISIT%>" title="Click to create a new container"><i class="fa fa-plus"></i> Add New Container</a></div>
<h1>Unassigned Containers</h1>
<div class="r"><a class="button" href="/containers/add/visit/<%-VISIT.VISIT%>" title="Click to create a new container"><i class="fa fa-plus"></i> Add New <% if (APP_TYPE == 'xpdf') { %>Puck<% } else { %>Container<% } %></a></div>
<h1>Unassigned <% if (APP_TYPE == 'xpdf') { %>Pucks<% } else { %>Containers<% } %></h1>
<div class="page_wrap"></div>
<div id="unassigned"></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/js/templates/assign/selectvisit.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1>Assign Containers: Select a Visit</h1>
<h1>Assign <% if (APP_TYPE == 'xpdf') { %>Pucks<% } else { %>Containers<% } %>: Select a Visit</h1>

<p class="help">Select a visit for which you want to assign samples to the beamline sample changer</p>

Expand Down
2 changes: 1 addition & 1 deletion client/src/js/templates/shipment/dewarlistrow.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<td>
<span class="deactivate"><a class="button button-notext deact" title="Deactivate Dewar"><i class="fa fa-power-off"></i> <span>Deactivate Dewar</span></a></span>
<a class="button button-notext print" title="Click to print dewar contents" href="<%-APIURL%>/pdf/container/did/<%-DEWARID%>/prop/<%-PROP%>"><i class="fa fa-print"></i> <span>Print Dewar Report</span></a>
<a class="button button-notext add" title="Click to add a container" href="/containers/add/did/<%-DEWARID%>"><i class="fa fa-plus"></i> <span>Add Container</span></a>
<a class="button button-notext add add-container-small" title="Click to add a container" href="/containers/add/did/<%-DEWARID%>"><i class="fa fa-plus"></i> <span class="add-container-text">Add Container</span></a>

<% if (STORAGELOCATION != 'stores-out') { %>
<% if (app.options.get("shipping_service_app_url") && EXTERNALSHIPPINGIDFROMSYNCHROTRON) { %>
Expand Down
2 changes: 1 addition & 1 deletion client/src/js/templates/types/xpdf/plan.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h1>Prepare Experiment Plans</h1>
<div class="form">
<ul>
<li>
<span class="label">Stage</span>
<span class="label">Puck</span>
<span class="NAME"><%-NAME%></span>
</li>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1>Container: <span class="NAME"><%-NAME%></span></h1>
<h1>Puck: <span class="NAME"><%-NAME%></span></h1>

<a name="top"></a>
<p class="help">This page shows the contents of the selected box or sample stage. Samples can be added by clicking the position in the table. Or will be, once ContainerId and Position can be changed.</p>
Expand Down

0 comments on commit bdda4f4

Please sign in to comment.