Skip to content

Commit

Permalink
Merge pull request #389 from antolinos/issue_388
Browse files Browse the repository at this point in the history
This ugly bug was introduced when refactoring.  It fixes #388
  • Loading branch information
antolinos authored Apr 10, 2018
2 parents 62fedec + a4b2091 commit 685591b
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 50 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function(grunt) {
concat : {
prod : {
files : {
'min/ispyb-client.js' : [ "js/ispyb-client/**/*js", "js/core/**/*js" ],
'min/ispyb-client.js' : [ "js/ispyb-client/**/*js" ],
'min/exi.js' : [ "js/dust/**/*js", "js/core/**/*js" ],
'min/exi.mx.js' : [ "js/mx/**/*js" ],
'min/exi.saxs.js' : [ "js/saxs/**/*js" ],
Expand Down
57 changes: 32 additions & 25 deletions js/core/view/shipping/parcelgrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,28 +132,27 @@ ParcelGrid.prototype.load = function(shipment,hasExportedData,samples,withoutCol
this.dewars.sort(function(a, b) {
return a.dewarId - b.dewarId;
});

/** Button Export PDF view */

$("#" + this.id + "-label").html("Content (" + this.dewars.length + " Parcels - " + nSamples + " Samples - " + nMeasured + " Measured)");
$("#" + this.id + "-add-button").removeClass("disabled");
$("#" + this.id + "-add-button").unbind('click').click(function(sender){
_this.edit();
});
if (nSamples > 0) {
this.disableExportButton();
$("#" + this.id + "-export").removeClass("disabled");
$("#" + this.id + "-export").unbind('click').click(function(sender){
var exportForm = new ExportPDFForm();
exportForm.load(_this.shipment);
exportForm.show();
});
}


this.fillTab("content", this.dewars);

var html = "";
dust.render("parcel.grid.template",{id : this.id, shippingId: _this.shipment.shippingId},function (err,out){
$('#' + _this.id).html(out);
_this.fillTab("content", _this.dewars);
_this.attachCallBackAfterRender();
/** Button Add Parcel */

_this.displayContentLabel(_this.dewars, nSamples, nMeasured, _this.currentReimbursedDewars, _this.maxReimbursedDewars);
/** Add Pacel button */
$("#" + _this.id + "-add-button").removeClass("disabled");
$("#" + _this.id + "-add-button").unbind('click').click(function(sender){
_this.edit();
});
/** Disable import from csv button */
this.attachCallBackAfterRender();

/** Disable import from csv button */
if (_this.shipment){
if (_this.shipment.shippingStatus){
if (_this.shipment.shippingStatus == "processing"){
Expand All @@ -164,9 +163,7 @@ ParcelGrid.prototype.load = function(shipment,hasExportedData,samples,withoutCol
}
}
}
})



};

ParcelGrid.prototype.fillTab = function (tabName, dewars) {
Expand Down Expand Up @@ -254,14 +251,24 @@ ParcelGrid.prototype.edit = function(dewar) {
window.show();
};

ParcelGrid.prototype.getPanel = function() {
ParcelGrid.prototype.getPanel = function() {

var html = "";

dust.render("parcel.grid.template",{id : this.id},function (err,out){
html = out;
})

this.panel = Ext.create('Ext.panel.Panel', {
layout : 'fit',
layout : 'fit',
// cls : 'overflowed',
items : {

html : '<div id="' + this.id + '"></div>',
// cls : 'border-grid',
html : '<div id="' + this.id + '">' + html + '</div>',
// width : this.width,
autoScroll:false,
autoHeight :true,
autoHeight :true,
// maxHeight: this.height,
padding : this.padding
}
});
Expand Down
22 changes: 10 additions & 12 deletions js/core/widget/parcelpanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ function ParcelPanel(args) {

ParcelPanel.prototype.load = function(dewar, shipment, samples, withoutCollection) {
var _this = this;
this.dewar = dewar;
this.oldDewar = dewar;
this.dewar = dewar;
this.dewar.index = this.index;
this.shipment = shipment;

Expand All @@ -74,12 +73,12 @@ ParcelPanel.prototype.load = function(dewar, shipment, samples, withoutCollectio

/** Loading the template **/
var html = "";
dust.render("parcel.panel.template", {id : this.id, dewar : this.dewar}, function(err, out){
dust.render("parcel.panel.template", {id : this.id, dewar : this.dewar}, function(err, out){
html = out;
});

/** Setting click listeners **/
$('#' + this.id).html(html);
/** Setting click listeners **/
$('#' + this.id).hide().html(html).fadeIn("fast");
this.panel.doLayout();

if (this.shippingStatus != "processing"){
Expand All @@ -92,7 +91,7 @@ ParcelPanel.prototype.load = function(dewar, shipment, samples, withoutCollectio
$("#" + this.id + "-edit-button").click(function () {
_this.showCaseForm();
});
//debugger

if (this.maxReimb > 0 || this.dewar.isReimbursed) {
$("#" + this.id + "-euro-button").removeClass("disabled");
$("#" + this.id + "-euro-button").click(function () {
Expand All @@ -110,6 +109,7 @@ ParcelPanel.prototype.load = function(dewar, shipment, samples, withoutCollectio
return;
});


this.containersPanel = Ext.create('Ext.panel.Panel', {
id : this.id + "-containers-panel",
// layout : 'fit',
Expand Down Expand Up @@ -299,7 +299,7 @@ ParcelPanel.prototype.addContainerToDewar = function(containerVO) {

EXI.getDataAdapter({onSuccess : onSuccess}).saxs.stockSolution.saveStockSolution(stockSolution);
} else {
var onSuccess = function(sender, container){
var onSuccess = function(sender, container){
container.code = containerVO.code;
container.containerStatus = _this.dewar.dewarStatus;
container.sampleChangerLocation = _this.dewar.storageLocation;
Expand All @@ -317,8 +317,7 @@ ParcelPanel.prototype.addContainerToDewar = function(containerVO) {
var onError = function(sender,error) {
EXI.setError(error.responseText);
_this.renderPucks(_this.dewar);
};

};
EXI.getDataAdapter({onSuccess : onSaveSuccess, onError : onError}).proposal.shipping.saveContainer(_this.shippingId, _this.dewar.dewarId, container.containerId, container);
};

Expand Down Expand Up @@ -432,7 +431,7 @@ ParcelPanel.prototype.showAddContainerForm = function() {
/** Opens a window with the cas form **/
var addContainerForm = new AddContainerForm();

addContainerForm.onSave.attach(function(sender,container){
addContainerForm.onSave.attach(function(sender,container){
_this.addContainerToDewar(container);
window.close();
})
Expand Down Expand Up @@ -463,8 +462,7 @@ ParcelPanel.prototype.getPanel = function() {
items : [{
html : '<div id="' + this.id + '"></div>',
autoScroll : false,
padding : this.padding,
// width : this.width,
padding : this.padding,
layout : 'fit',
}]
});
Expand Down
7 changes: 1 addition & 6 deletions mx/dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

<!-- bower:js -->
<script src="../bower_components/jquery/dist/jquery.js"></script>
<script src="../bower_components/zeroclipboard/dist/ZeroClipboard.js"></script>
<script src="../bower_components/moment/moment.js"></script>
<script src="../bower_components/numbro/numbro.js"></script>
<script src="../bower_components/pikaday/pikaday.js"></script>
<script src="../bower_components/handsontable/dist/handsontable.js"></script>
<script src="../bower_components/jquery-lazy/jquery.lazy.min.js"></script>
Expand All @@ -49,7 +49,6 @@
<script src="../bower_components/notifyjs/dist/notify.js"></script>
<script src="../bower_components/bootstrap-multiselect/dist/js/bootstrap-multiselect.js"></script>
<script src="../bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
<script src="../bower_components/file-saver/FileSaver.js"></script>
<script src="../bower_components/html-docx-js/dist/html-docx.js"></script>
<!-- endbower -->

Expand All @@ -67,11 +66,7 @@
<script src="../bower_components/exi-ui-utils/js/string.js"></script>


<<<<<<< HEAD
<!-- ISPYB-JS-API -->
=======
<!-- ISPYB-JS-API -->
>>>>>>> d0a71ca005f4a954e736b05f15b1c427e603ba8f
<script src="../js/ispyb-client/dataadapter.js"></script>
<script src="../js/ispyb-client/em/a_emdataadaptergroup.js"></script>
<script src="../js/ispyb-client/em/emdataadapterfactory.js"></script>
Expand Down
3 changes: 1 addition & 2 deletions saxs/dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@

<!-- bower:js -->
<script src="../bower_components/jquery/dist/jquery.js"></script>
<script src="../bower_components/zeroclipboard/dist/ZeroClipboard.js"></script>
<script src="../bower_components/moment/moment.js"></script>
<script src="../bower_components/numbro/numbro.js"></script>
<script src="../bower_components/pikaday/pikaday.js"></script>
<script src="../bower_components/handsontable/dist/handsontable.js"></script>
<script src="../bower_components/jquery-lazy/jquery.lazy.min.js"></script>
Expand All @@ -52,7 +52,6 @@
<script src="../bower_components/notifyjs/dist/notify.js"></script>
<script src="../bower_components/bootstrap-multiselect/dist/js/bootstrap-multiselect.js"></script>
<script src="../bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
<script src="../bower_components/file-saver/FileSaver.js"></script>
<script src="../bower_components/html-docx-js/dist/html-docx.js"></script>
<!-- endbower -->

Expand Down
3 changes: 1 addition & 2 deletions test/dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@

<!-- bower:js -->
<script src="../bower_components/jquery/dist/jquery.js"></script>
<script src="../bower_components/zeroclipboard/dist/ZeroClipboard.js"></script>
<script src="../bower_components/moment/moment.js"></script>
<script src="../bower_components/numbro/numbro.js"></script>
<script src="../bower_components/pikaday/pikaday.js"></script>
<script src="../bower_components/handsontable/dist/handsontable.js"></script>
<script src="../bower_components/jquery-lazy/jquery.lazy.min.js"></script>
Expand All @@ -52,7 +52,6 @@
<script src="../bower_components/notifyjs/dist/notify.js"></script>
<script src="../bower_components/bootstrap-multiselect/dist/js/bootstrap-multiselect.js"></script>
<script src="../bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
<script src="../bower_components/file-saver/FileSaver.js"></script>
<script src="../bower_components/html-docx-js/dist/html-docx.js"></script>
<!-- endbower -->

Expand Down
3 changes: 1 addition & 2 deletions tracking/dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

<!-- bower:js -->
<script src="../bower_components/jquery/dist/jquery.js"></script>
<script src="../bower_components/zeroclipboard/dist/ZeroClipboard.js"></script>
<script src="../bower_components/moment/moment.js"></script>
<script src="../bower_components/numbro/numbro.js"></script>
<script src="../bower_components/pikaday/pikaday.js"></script>
<script src="../bower_components/handsontable/dist/handsontable.js"></script>
<script src="../bower_components/jquery-lazy/jquery.lazy.min.js"></script>
Expand All @@ -49,7 +49,6 @@
<script src="../bower_components/notifyjs/dist/notify.js"></script>
<script src="../bower_components/bootstrap-multiselect/dist/js/bootstrap-multiselect.js"></script>
<script src="../bower_components/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
<script src="../bower_components/file-saver/FileSaver.js"></script>
<script src="../bower_components/html-docx-js/dist/html-docx.js"></script>
<!-- endbower -->

Expand Down

0 comments on commit 685591b

Please sign in to comment.