Skip to content

Commit

Permalink
Merge pre-release/2024-r2.4 into master (#789)
Browse files Browse the repository at this point in the history
* LIMS-1204: Remove log area from top of active visits (#735)

* LIMS-1204: Remove log area from the top of active visits

* LIMS-1204: Remove dclog.js

---------

Co-authored-by: Mark Williams <[email protected]>

* ULIMS-50: Shipping service incoming shipment redirect (#731)

* LIMS-1113: Redirect to shipping-service on dispatch

* LIMS-1113: Fix typos in shipping service URLs

* LIMS-1113: Change text on submit button if redirecting

* LIMS-1113: Fix shipment request requests for Dewars with no pucks/samples

* LIMS-1113: Don't redirect for international shipments

* LIMS-1113: Tweak logic for international shipments

* LIMS-1113: Propagate shipping service error codes to client

* LIMS-1113: Link to shipping service from shipping page

* LIMS-1113: Restore commented code

* LIMS-1113: Include Dewar data in dispatch error log

* LIMS-1113: Apply GdF suggestions

* LIMS-1113: Update config_sample.php

* LIMS-1113: Limit redirects to supported countries

* LIMS-1113: Add supported country dropdown to dispatch from

* ULIMS-50: Redirect to shipping service to book incoming shipments

* Update client/src/js/modules/shipment/views/createawb.js

Co-authored-by: Guilherme Francisco <[email protected]>

* Update client/src/js/modules/shipment/views/createawb.js

Co-authored-by: Guilherme Francisco <[email protected]>

* Update api/src/Page/Shipment.php

Co-authored-by: Guilherme Francisco <[email protected]>

* Update api/src/Page/Shipment.php

Co-authored-by: Guilherme Francisco <[email protected]>

* ULIMS-50: Add better error messages, make hidden fields not required

* ULIMS-50: Update description and date validation in dispatch model

* Restore EM menu in dropdown (#766) (#767)

* Merge master into prerelease (#773)

* Restore EM menu in dropdown (#766)

* Pre release/2024 r2.2 (#770)

* LIMS-1201: Amend name of XPDF capillary crystal to use user acronym (#738)

Co-authored-by: Mark Williams <[email protected]>

* LIMS-1256: Remove validation from Local Contact field (#756)

Co-authored-by: Mark Williams <[email protected]>

* LIMS-667: Make the Requested Imager a required field if a plate is being created (#733)

Co-authored-by: Mark Williams <[email protected]>

* LIMS-1261: Fix the grid scan heat maps on the VMXi container view (#744)

Co-authored-by: Mark Williams <[email protected]>

* LIMS-1289: Fix sample and pdb count on protens page (#753)

Co-authored-by: Mark Williams <[email protected]>

---------

Co-authored-by: Mark Williams <[email protected]>

* Pre release/2024 r2.3 (#772)

* LIMS-1207: Move Calendar link to top left

* LIMS-1207: Move Migrate link to Lab Contacts page

* LIMS-1207: Re-order menu, remove Assign Containers

* LIMS-1201: Amend name of XPDF capillary crystal to use user acronym (#738)

Co-authored-by: Mark Williams <[email protected]>

* LIMS-1256: Remove validation from Local Contact field (#756)

Co-authored-by: Mark Williams <[email protected]>

* LIMS-667: Make the Requested Imager a required field if a plate is being created (#733)

Co-authored-by: Mark Williams <[email protected]>

* LIMS-1261: Fix the grid scan heat maps on the VMXi container view (#744)

Co-authored-by: Mark Williams <[email protected]>

* LIMS-1289: Fix sample and pdb count on protens page (#753)

Co-authored-by: Mark Williams <[email protected]>

* LIMS-1304: Correct the order of before and after snapshots

* LIMS-1304: Update to fix typo

Co-authored-by: Mark W <[email protected]>

* LIMS-1235: Queries for implicit samples and DCs in project time out (#758)

Co-authored-by: Mark Williams <[email protected]>

* LIMS-1200: CSV file upload ignores first sample (#737)

* LIMS-1200: CSV file upload ignores first sample

* LIMS-1200: Fix bug uploading csv with one sample

---------

Co-authored-by: Mark Williams <[email protected]>

* LIMS-1174: Handle blank proposal on visits page (#740)

Co-authored-by: Mark Williams <[email protected]>

* LIMS-44: Speed up visit query (#759)

Co-authored-by: Mark Williams <[email protected]>

* LIMS-1059: Add visit column to shipments list (#742)

Co-authored-by: Mark Williams <[email protected]>

* Restore EM menu in dropdown (#766) (#768)

* Add 2.2a changes to 2.3 (#771)

* Restore EM menu in dropdown (#766)

* Pre release/2024 r2.2 (#770)

* LIMS-1201: Amend name of XPDF capillary crystal to use user acronym (#738)

Co-authored-by: Mark Williams <[email protected]>

* LIMS-1256: Remove validation from Local Contact field (#756)

Co-authored-by: Mark Williams <[email protected]>

* LIMS-667: Make the Requested Imager a required field if a plate is being created (#733)

Co-authored-by: Mark Williams <[email protected]>

* LIMS-1261: Fix the grid scan heat maps on the VMXi container view (#744)

Co-authored-by: Mark Williams <[email protected]>

* LIMS-1289: Fix sample and pdb count on protens page (#753)

Co-authored-by: Mark Williams <[email protected]>

---------

Co-authored-by: Mark Williams <[email protected]>

---------

Co-authored-by: Guilherme Francisco <[email protected]>
Co-authored-by: Mark Williams <[email protected]>

---------

Co-authored-by: Mark Williams <[email protected]>
Co-authored-by: Dominic Oram <[email protected]>
Co-authored-by: Guilherme Francisco <[email protected]>

---------

Co-authored-by: Guilherme Francisco <[email protected]>
Co-authored-by: Mark Williams <[email protected]>
Co-authored-by: Dominic Oram <[email protected]>

---------

Co-authored-by: Guilherme Francisco <[email protected]>
Co-authored-by: Mark W <[email protected]>
Co-authored-by: Mark Williams <[email protected]>
Co-authored-by: Dominic Oram <[email protected]>

* LIMS-1331: Send all dispatch requests to Goods Handling unless international via DHL for BI/MX (#779)

Co-authored-by: Mark W <[email protected]>

* LIMS-1206: Remove stacked usage bar chart from visit page (#743)

* LIMS-1206: Remove stacked usage bar chart from visit page

* Remove no longer used modules/stats/views/stack.js

---------

Co-authored-by: Mark Williams <[email protected]>

* LIMS-1203: Remove hidden temporary button to 'Use facility account' (#741)

Co-authored-by: Mark Williams <[email protected]>

* LIMS-1342: Show regular create AWB form if shipping redirect not enabled (#780)

* LIMS-1342: Show regular create AWB form if shipping redirect not enabled

* LIMS-1342: hide extra country dropdown if shipping service redirect not enabled

* LIMS-1342: Json encode any error responses

* LIMS-1342: define shipping service url even any redirect in use

* LIMS-1342: Dont assume https

* LIMS-1342: Only show 1 country select dropdown

* LIMS-1342: Simplify logic a little

* LIMS-1342: Same fixes for dewar dispatch

* LIMS-1342: Show correct button if country changes

---------

Co-authored-by: Mark Williams <[email protected]>

---------

Co-authored-by: Mark Williams <[email protected]>
Co-authored-by: Matthew Pritchard <[email protected]>
Co-authored-by: Guilherme Francisco <[email protected]>
Co-authored-by: Dominic Oram <[email protected]>
Co-authored-by: James Hall <[email protected]>
  • Loading branch information
6 people authored Jun 24, 2024
1 parent 040db3b commit c4455df
Show file tree
Hide file tree
Showing 23 changed files with 615 additions and 344 deletions.
30 changes: 30 additions & 0 deletions api/assets/emails/html/dewar-dispatch-lite.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<h1 style="font-size: 16px; font-weight: normal; border-bottom: 1px solid #000; margin: 1%; margin-bottom: 1.5%">Dewar ready to leave diamond</h1>

<div class="inset" style="margin: 1%; padding: 1%; margin-bottom: 2%; border-radius: 5px; background: #82d180">
Goods Handling, please arrange dispatch of the following Dewar.
</div>

<table class="details" style="background: #f4f4f4; margin: 1%">
<tbody>
<tr>
<td style="padding: 1.5%; font-weight: bold">Proposal</td>
<td><?php echo $data['prop'] ?></td>
</tr>
<tr>
<td style="padding: 1.5%; font-weight: bold">Air Waybill</td>
<td><a href="<?php echo $data['AWBURL']; ?>"><?php echo $data['AWBURL']; ?></a></td>
</tr>
<tr>
<td style="padding: 1.5%; font-weight: bold">Dewar Facility Code</td>
<td><?php echo $data['FACILITYCODE'] ?></td>
</tr>
<tr>
<td style="padding: 1.5%; font-weight: bold">Dewar Barcode</td>
<td><?php echo $data['BARCODE'] ?></td>
</tr>
<tr>
<td style="padding: 1.5%; font-weight: bold">Current Location</td>
<td><?php echo $data['LOCATION'] ?></td>
</tr>
</tbody>
</table>
3 changes: 2 additions & 1 deletion api/config_sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@
$dhl_acc_import = '12345678';

$dhl_terms = '/path/to/terms.html';
$dhl_link = 'http://link/to/dhl/instructions';
// N = Domestic Express, P = Worldwide Express
$dhl_service = 'N';
// Non dom service (eu)
Expand All @@ -264,6 +263,8 @@
# Shipping service details
$use_shipping_service = null;
$use_shipping_service_incoming_shipments = null;
$use_shipping_service_redirect = null;
$use_shipping_service_redirect_incoming_shipments = null;
$shipping_service_api_url = null;
$shipping_service_api_user = null;
$shipping_service_api_password = null;
Expand Down
8 changes: 5 additions & 3 deletions api/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ function setupApplication($mode): Slim
$app->get('/options', function () use ($app) {
global $motd, $authentication_type, $cas_url, $cas_sso, $sso_url, $package_description,
$facility_courier_countries, $facility_courier_countries_nde,
$dhl_enable, $dhl_link, $scale_grid, $scale_grid_end_date, $preset_proposal, $timezone,
$valid_components, $enabled_container_types, $ifsummary, $synchweb_version, $redirects;
$dhl_enable, $scale_grid, $scale_grid_end_date, $preset_proposal, $timezone,
$valid_components, $enabled_container_types, $ifsummary, $synchweb_version, $redirects,
$shipping_service_app_url, $use_shipping_service_redirect, $use_shipping_service_redirect_incoming_shipments;
$app->contentType('application/json');
$options = $app->container['options'];
$app->response()->body(json_encode(array(
Expand All @@ -83,7 +84,6 @@ function setupApplication($mode): Slim
'facility_courier_countries' => $facility_courier_countries,
'facility_courier_countries_nde' => $facility_courier_countries_nde,
'dhl_enable' => $dhl_enable,
'dhl_link' => $dhl_link,
'scale_grid' => $scale_grid,
'scale_grid_end_date' => $scale_grid_end_date,
'preset_proposal' => $preset_proposal,
Expand All @@ -92,6 +92,8 @@ function setupApplication($mode): Slim
'enabled_container_types' => $enabled_container_types,
'ifsummary' => $ifsummary,
'synchweb_version' => $synchweb_version,
'shipping_service_app_url' => $use_shipping_service_redirect || $use_shipping_service_redirect_incoming_shipments ? $shipping_service_app_url : null,
'shipping_service_app_url_incoming' => $use_shipping_service_redirect_incoming_shipments ? $shipping_service_app_url : null,
'redirects' => $redirects
)));
});
Expand Down
272 changes: 240 additions & 32 deletions api/src/Page/Shipment.php

Large diffs are not rendered by default.

19 changes: 18 additions & 1 deletion api/src/Shipment/ShippingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,16 @@ function _send_request($url, $type, $data, $expected_status_code)
break;
}
$response = json_decode(curl_exec($ch), TRUE);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); // Will be 0 if request itself fails
curl_close($ch);
if ($status_code != $expected_status_code) {
error_log(
"Shipping service unexpected status code." . PHP_EOL .
"Request: $type $url" . PHP_EOL .
"Status code: $status_code" . PHP_EOL .
"Response: " . json_encode($response) . PHP_EOL .
"Request data:" . json_encode($data)
);
throw new \Exception(json_encode(array('status' => $status_code, 'content' => $response)));
}
return $response;
Expand Down Expand Up @@ -151,4 +158,14 @@ function get_awb_pdf_url($shipment_id)
{
return $this->shipping_app_url . '/shipments/' . $shipment_id . '/awb';
}

function create_shipment_request($shipment_request_data)
{
return $this->_send_request(
$this->shipping_api_url . '/shipment_requests/',
"POST",
$shipment_request_data,
201
);
}
}
11 changes: 4 additions & 7 deletions client/src/css/partials/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
.content {
padding-bottom: 1%;

.nopadding {
padding-bottom: 0%;
}

& > h1 {
padding: 10px 0;
margin-bottom: 15px;
Expand Down Expand Up @@ -1506,13 +1510,6 @@ div.status {
}
}

.status.three {
.webcam {
@mixin cols 3,0,0.5%;
float: left;
}
}

.oav {
display: block;
margin: auto;
Expand Down
17 changes: 1 addition & 16 deletions client/src/js/modules/dc/datacollections.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ define(['marionette',

'modules/dc/dclist',
'modules/dc/views/samplechanger',
'modules/dc/views/dclog',
'views/status',

'views/search',
'views/filter',

'modules/stats/views/stack',

'views/dialog',
'modules/dc/views/queuebuilder',
'modules/proposal/views/users',
Expand All @@ -21,7 +17,7 @@ define(['marionette',
'templates/dc/dclist.html',
],
function(Marionette, Pages, DCListView,
SampleChanger, DCLogView, StatusView, Search, Filter, StackView, DialogView, QueueBuilderView, UserView, DewarsView,
SampleChanger, StatusView, Search, Filter, DialogView, QueueBuilderView, UserView, DewarsView,
ReprocessOverview,
template) {

Expand All @@ -40,7 +36,6 @@ function(Marionette, Pages, DCListView,
search: '.srch',
type: '.type',
sc: '.sc',
log: '.lg',
status: '.st',
use: '.usage',
},
Expand Down Expand Up @@ -146,20 +141,10 @@ function(Marionette, Pages, DCListView,
this.type.show(this.ty)
}

if (this.options.params.visit) {
this.use.show(new StackView({ visit: this.options.params.visit }))
}

if (this.model && this.model.get('ACTIVE') == 1) {
// Sample changer
console.log('get sc', this.getOption('sampleChanger'))
if (this.getOption('sampleChanger') && this.options.params.visit && !app.mobile()) this.sc.show(new SampleChanger({ visit: this.options.params.visit, dcs: this.collection, bl: this.model.get('BL') }))

// Log View
this.log.show(new DCLogView({ collection: this.collection }))

// Status Display

}

if (this.model && this.model.get('CAMS') == 1) {
Expand Down
40 changes: 0 additions & 40 deletions client/src/js/modules/dc/views/dclog.js

This file was deleted.

26 changes: 15 additions & 11 deletions client/src/js/modules/shipment/models/dispatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,24 @@ define(['backbone'], function(Backbone) {
},

VISIT: {
required: true,
required: function() {
return this.visitRequired
},
pattern: 'visit',
},

GIVENNAME: {
required: true,
required: function () {return this.dispatchDetailsRequired},
pattern: 'wwdash',
},

FAMILYNAME: {
required: true,
required: function () {return this.dispatchDetailsRequired},
pattern: 'wwdash',
},

PHONENUMBER: {
required: true,
required: function () {return this.dispatchDetailsRequired},
},

EMAILADDRESS: {
Expand All @@ -40,26 +42,26 @@ define(['backbone'], function(Backbone) {
},

LABNAME: {
required: true,
required: function () {return this.dispatchDetailsRequired},
pattern: 'wwsdash',
},

ADDRESS: {
required: true
required: function () {return this.dispatchDetailsRequired}
},

CITY: {
required: true
required: function () {return this.dispatchDetailsRequired}
},

POSTCODE: {
required: function() {
return this.postCodeRequired
return this.postCodeRequired && this.dispatchDetailsRequired
}
},

COUNTRY: {
required: true,
required: function () {return this.dispatchDetailsRequired},
pattern: 'country',
fn: function (value, attr, state) {
if (value === null) {
Expand All @@ -70,12 +72,12 @@ define(['backbone'], function(Backbone) {


DESCRIPTION: {
required: true,
required: function () {return this.dispatchDetailsRequired},
},

DELIVERYAGENT_SHIPPINGDATE: {
pattern: 'edate',
required: true,
required: function () {return this.dispatchDetailsRequired},
},


Expand All @@ -99,8 +101,10 @@ define(['backbone'], function(Backbone) {

},

dispatchDetailsRequired: true,
courierDetailsRequired: false, // We want to set this default to false unless 'DELIVERYAGENT_AGENTCODE' has a value in the shipment model
postCodeRequired: false,
visitRequired: true,
})

})
Loading

0 comments on commit c4455df

Please sign in to comment.