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

Redone HPLC form #4

Open
wants to merge 95 commits into
base: saxs_newWebService
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
8573760
put puckForm as a new page instead of a window, add new column at con…
Nov 16, 2016
2f9c6e7
created class crystalFormView
Nov 16, 2016
5c2a829
Shipping tab: edit in new window, create the electric density view, a…
Nov 17, 2016
e89d8c9
Generalize shipment part 1
Nov 21, 2016
9f831bb
- Generalize shipment 2
Nov 21, 2016
779b339
changing shippingForm
Nov 21, 2016
83ec9c4
change header in shipment view
Nov 22, 2016
10c2ad5
working on shipment edit form
Nov 22, 2016
e59c77b
working on shipment save
Nov 22, 2016
56ed979
checkout
Nov 22, 2016
3836a99
parcel panel view
Nov 22, 2016
42a3703
show container panel on the new template
Nov 22, 2016
bf3ad2d
Working on the grid in the shipment
Nov 23, 2016
86f44c2
fix issues when loading the parcel panels
Nov 23, 2016
96dbf77
Change view of parcel panels
Nov 25, 2016
eee1f1a
how to add stock solutions
Nov 25, 2016
29d9381
add stock solutions
Nov 25, 2016
ebbbf21
updating stock solution when adding to dewar
Nov 28, 2016
e32ed00
Add stockSolutionContainer and remove
Dec 1, 2016
0202b2d
min
Dec 1, 2016
c881b86
>>
Dec 1, 2016
9e4c80d
change warning and error rows background when selected
Dec 1, 2016
66391fb
add stock solution
Dec 5, 2016
b93f62d
fix issue when containerId of row is null
Dec 6, 2016
a6fdcb2
disable container type combo box when datacollection
Dec 6, 2016
180c3f5
fix issue drawing puck on datacollection view
Dec 7, 2016
89336e2
check if containerId is null
Dec 8, 2016
1466c67
merging
Dec 8, 2016
0d46842
merge complete
Dec 8, 2016
4637731
change sampleChanger according to the row selected
Dec 12, 2016
bd8377c
mergins
Dec 12, 2016
ef5ab00
Merge branch 'master' of https://github.com/antolinos/EXI into mx_121216
Dec 12, 2016
5abc5ae
Changes:
Dec 16, 2016
6c56a95
min
Dec 16, 2016
9f3e9ec
add middle alin table class
Dec 16, 2016
35f7443
min
Dec 19, 2016
eaf2282
min
Dec 19, 2016
4c11e4d
set cell values by spaceGroup
Dec 20, 2016
6536fc5
min
Dec 21, 2016
6643dde
working on primary data view almost done
Dec 21, 2016
4a7cccf
min
Dec 21, 2016
7b761bf
Redone HTLC form
Dec 21, 2016
d048aab
data reduction
Dec 21, 2016
453250f
narrow frame grid
Dec 21, 2016
06e062b
updating and creating crystal
Dec 22, 2016
21e2073
making plates work
Dec 22, 2016
4d3a1af
plates are drawn but the grid is not filled
Dec 22, 2016
f968065
click event from grid
Dec 22, 2016
dc60305
plates working
Dec 22, 2016
75fb2ee
Sessiongrid filters by beamline in config
Dec 22, 2016
1f44c6e
Merged
Dec 22, 2016
cf434cc
Preparing release 0.9.8
Dec 22, 2016
1d2a4b9
merging
Dec 22, 2016
0a8b577
merging ended
Dec 22, 2016
171c091
disable Shipment
Dec 22, 2016
77600b5
Config changes
Dec 22, 2016
04b33ce
persist notifyjs
Dec 22, 2016
28cea99
Preparing release 0.9.8
Dec 22, 2016
50040a4
Version 0.9.8
Dec 22, 2016
ff7a586
click listeners in plates
Jan 4, 2017
630ff04
enable shipment
Jan 4, 2017
d464219
notify not working
Jan 4, 2017
ea397bb
notify-js removed
Jan 4, 2017
39b5838
Complicated shipping
Jan 11, 2017
f8a692e
Fix legend, add unload SC button
Jan 11, 2017
9426951
different spreadsheet for Other, set the most recent crystalGroup whe…
Jan 11, 2017
05448e8
Changes on primary data main view
Jan 11, 2017
93ad287
Fix issues when selecting acronym. Don
Jan 11, 2017
8719b3c
Fix some problem when rendering the containers in a parcel
Jan 12, 2017
24a35c6
Tracking version of EXI
Jan 12, 2017
19c5d98
Tracking version of EXI
Jan 12, 2017
a775b54
Merge branch 'mx_simplifyShipment' of https://github.com/sergiogf93/E…
Jan 12, 2017
f7d369b
Merge of new shipment
Jan 12, 2017
1493935
fix tooltip for pucks
Jan 12, 2017
910f632
Merge branch 'DEV' of https://github.com/antolinos/EXI into test_pull
Jan 12, 2017
a94ebe7
working on shipping
Jan 13, 2017
824750b
fixed problem when filtering beamlines
Jan 17, 2017
1ff2741
labContacts view, menu dropdown, ...
Jan 18, 2017
1f41ef7
Added abinitio grid and removed tabs from primary data viewer
Jan 19, 2017
41cc459
working on frames problem
Jan 19, 2017
0f95fb2
pull
Jan 19, 2017
fcb548e
fix frames problem
Jan 19, 2017
8df9192
merged
Jan 19, 2017
5cf754f
Remove test classes and some work on the click listeners in the plate…
Jan 19, 2017
983de47
merging
Jan 23, 2017
34ad334
min
Jan 23, 2017
2ba4a65
start scatter viewer
Jan 24, 2017
f6e3e47
Changes in shipment, including the autoincrementing sample names; min…
Jan 27, 2017
7c3077f
prepare experiment show if sessionId
Jan 27, 2017
3b4be09
Merge pull request #1 from sergiogf93/details
antolinos Jan 27, 2017
6ed945b
Prepare experiment is disabled
Jan 27, 2017
538fd10
Merge branch 'DEV' of https://github.com/antolinos/EXI into DEV
Jan 27, 2017
0bc38bf
Shipments on Prepare experiment are shown even if there is not sessio…
Jan 27, 2017
ba5a82d
Added title to html page
Jan 27, 2017
ffa51da
Preparing the test version alpha
Jan 27, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add stockSolutionContainer and remove
  • Loading branch information
GONZALEZ Sergio authored and GONZALEZ Sergio committed Dec 1, 2016
commit e32ed00d35dca2f9e5bbf33fca839d373633de52
60 changes: 35 additions & 25 deletions js/core/widget/containerparcelpanel.js
Original file line number Diff line number Diff line change
@@ -11,17 +11,18 @@ function ContainerParcelPanel(args) {
this.containerId = 0;
this.shippingId = 0;
this.withoutCollection = true;
this.code = "";
this.type = "Puck";
this.data = {puckType : "Unipuck",
mainRadius : this.height*0.9/2,
xMargin : this.width/2 - this.height*0.9/2,
yMargin : 2.5,
yMargin : 2.5,
code : "",
enableMouseOver : true,
enableClick : true,
enableMainClick : true
enableMainClick : true,
};
this.width = 2*this.data.mainRadius + 20;
this.container = new ContainerWidget(this.data);

if (args != null) {
if (args.height != null) {
@@ -41,7 +42,7 @@ function ContainerParcelPanel(args) {
this.shippingId = args.shippingId;
}
if (args.code != null) {
this.code = args.code;
this.data.code = args.code;
}
if (args.type != null) {
this.type = args.type;
@@ -54,7 +55,6 @@ function ContainerParcelPanel(args) {
}

this.onContainerRemoved = new Event(this);
this.onContainerSaved = new Event(this);

};

@@ -69,10 +69,13 @@ ContainerParcelPanel.prototype.getPanel = function () {
this.container = new ContainerWidget(this.data);
if (this.type == "Puck"){
this.container = new PuckWidgetContainer(this.data);
} else if (this.type == "StockSolution") {
this.data.stockSolutionId = this.containerId;
this.container= new StockSolutionContainer(this.data);
}

this.container.onClick.attach(function (sender, id) {
var code = _this.code;
var code = _this.data.code;
if (code == "") {
code = "-";
}
@@ -91,7 +94,11 @@ ContainerParcelPanel.prototype.getPanel = function () {
fn: function(buttonValue, inputText, showConfig) {
switch (buttonValue) {
case "yes":
location.href = "#/shipping/" + _this.shippingId + "/containerId/" + _this.containerId + "/edit";
if (_this.type == "StockSolution") {
location.href = "#/stocksolution/" + _this.containerId + "/main";
} else {
location.href = "#/shipping/" + _this.shippingId + "/containerId/" + _this.containerId + "/edit";
}
break;
case "no":
_this.removeButtonClicked();
@@ -119,14 +126,14 @@ ContainerParcelPanel.prototype.getPanel = function () {
]
});

this.panel.on('boxready', function() {
$("#" + _this.id + "-edit-button").click(function () {
location.href = "#/shipping/" + _this.shippingId + "/containerId/" + _this.containerId + "/edit";
});
$("#" + _this.id + "-remove-button").click(function(){
_this.removeButtonClicked();
});
});
// this.panel.on('boxready', function() {
// $("#" + _this.id + "-edit-button").click(function () {
// location.href = "#/shipping/" + _this.shippingId + "/containerId/" + _this.containerId + "/edit";
// });
// $("#" + _this.id + "-remove-button").click(function(){
// _this.removeButtonClicked();
// });
// });

return this.panel;
};
@@ -158,15 +165,18 @@ ContainerParcelPanel.prototype.load = function (samples) {
* @return
*/
ContainerParcelPanel.prototype.removePuck = function() {
var _this = this;
this.panel.setLoading();
var onSuccess = function(sender, data){
_this.panel.setLoading(false);
_this.onContainerRemoved.notify(_this.containerId);
};
var containerId = this.containerId;
EXI.getDataAdapter({onSuccess: onSuccess}).proposal.shipping.removeContainerById(containerId,containerId,containerId );

this.panel.setLoading();
if (this.type == "StockSolution") {
this.onContainerRemoved.notify(this.containerId);
} else {
var _this = this;
var onSuccess = function(sender, data){
_this.panel.setLoading(false);
_this.onContainerRemoved.notify(_this.containerId);
};
var containerId = this.containerId;
EXI.getDataAdapter({onSuccess: onSuccess}).proposal.shipping.removeContainerById(containerId,containerId,containerId );
}
};

ContainerParcelPanel.prototype.removeButtonClicked = function () {
@@ -178,7 +188,7 @@ ContainerParcelPanel.prototype.removeButtonClicked = function () {
}
Ext.MessageBox.show({
title:'Remove',
msg: 'Removing a puck from this parcel will remove also its content. <br />Are you sure you want to continue?',
msg: 'Removing a container from this parcel will remove also its content. <br />Are you sure you want to continue?',
buttons: Ext.MessageBox.YESNO,
fn: showResult,
animateTarget: 'mb4',
45 changes: 34 additions & 11 deletions js/core/widget/parcelpanel.js
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ function ParcelPanel(args) {
this.containersParcelWidth = 2*this.containersPanelHeight*0.9/2 + 20;
// this.containersParcelWidth = 2*this.containersPanelHeight*0.2 + 20;
this.shippingId = 0;
this.containersPanel = null;

this.isSaveButtonHidden = false;
this.isHidden = false;
@@ -112,9 +113,10 @@ ParcelPanel.prototype.renderPucks = function (dewar) {
if (dewar.containerVOs != null){

this.containersPanel.removeAll();
var stockSolutions = EXI.proposalManager.getStockSolutionsByDewarId(dewar.dewarId);

var maxNumberForRow = Math.floor(this.containersPanel.width/this.containersParcelWidth);
var rows = Math.ceil(this.dewar.containerVOs.length/maxNumberForRow);
var rows = Math.ceil((this.dewar.containerVOs.length + stockSolutions.length)/maxNumberForRow);
var containerRows = [];
for (var i = 0 ; i < rows ; i++) {
var containerRow = Ext.create('Ext.panel.Panel', {
@@ -142,21 +144,34 @@ ParcelPanel.prototype.renderPucks = function (dewar) {
_.remove(_this.dewar.containerVOs, {containerId: containerId});
_this.renderPucks(_this.dewar);
});
containerParcelPanel.onContainerSaved.attach(function (sender, containerVO) {
_.remove(_this.dewar.containerVOs, {containerId: containerVO.containerId});
_this.dewar.containerVOs.push(containerVO);
_this.load(_this.dewar);
});
containerPanelsMap[container.containerId] = containerParcelPanel;
containerIds.push(container.containerId);

containerRows[Math.floor(i/maxNumberForRow)].insert(containerParcelPanel.getPanel());
}

/** */
var stockSolutions = EXI.proposalManager.getStockSolutionsByDewarId(dewar.dewarId);
for (var i = 0; i< stockSolutions.length; i++){
console.log(stockSolutions[i]);
var containerParcelPanel = new ContainerParcelPanel({type : "StockSolution", height : this.containersPanelHeight/rows, width : this.containersParcelWidth,containerId : stockSolutions[i].stockSolutionId, shippingId : this.shippingId, code : stockSolutions[i].name});
containerPanelsMap[stockSolutions[i].boxId] = containerParcelPanel;
containerIds.push(stockSolutions[i].boxId);
containerParcelPanel.onContainerRemoved.attach(function (sender, stockSolutionId) {
var stockSolution = EXI.proposalManager.getStockSolutionById(stockSolutionId);
stockSolution.boxId = null;

var onSuccess = function(sender, container){

EXI.proposalManager.onActiveProposalChanged.attach(function(){
_this.renderPucks(_this.dewar);
});

EXI.proposalManager.get(true);

};

EXI.getDataAdapter({onSuccess : onSuccess}).saxs.stockSolution.saveStockSolution(stockSolution);
});

containerRows[Math.floor((i + dewar.containerVOs.length)/maxNumberForRow)].insert(containerParcelPanel.getPanel());
}

if (!_.isEmpty(containerPanelsMap)) {
@@ -191,14 +206,20 @@ ParcelPanel.prototype.renderPucks = function (dewar) {
*/
ParcelPanel.prototype.addContainerToDewar = function(containerVO) {
var _this = this;

this.containersPanel.setLoading();
if (containerVO.containerType == "STOCK SOLUTION"){
var stockSolution = EXI.proposalManager.getStockSolutionById(containerVO.data.stockSolutionId);
stockSolution.boxId = this.dewar.dewarId;
stockSolution.name = containerVO.code;

var onSuccess = function(sender, container){


EXI.proposalManager.onActiveProposalChanged.attach(function(){
_this.containersPanel.setLoading(false);
_this.renderPucks(_this.dewar);
});

EXI.proposalManager.get(true);
};

EXI.getDataAdapter({onSuccess : onSuccess}).saxs.stockSolution.saveStockSolution(stockSolution);
@@ -208,9 +229,11 @@ ParcelPanel.prototype.addContainerToDewar = function(containerVO) {
_this.dewar.containerVOs.push(container);

var onSaveSuccess = function (sender) {
_this.containersPanel.setLoading(false);
_this.renderPucks(_this.dewar);
}
var onError = function(sender,error) {
_this.containersPanel.setLoading(false);
EXI.setError(error.responseText);
_this.renderPucks(_this.dewar);
};
108 changes: 108 additions & 0 deletions js/core/widget/stocksolutioncontainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
function StockSolutionContainer(args) {
this.id = BUI.id();

this.templateData = {
id : this.id,
xmargin : 0,
ymargin : 0,
mainRadius : 50,
width : 100,
height : 100,
r : 20,
enableMainClick : false,
code : "",
enableClick : false
};

this.stockSolutionId = 0;
this.samples = null;

if (args){
if (args.xMargin){
this.templateData.xMargin = args.xMargin;
}
if (args.yMargin){
this.templateData.yMargin = args.yMargin;
}
if (args.enableMainClick != null){
this.templateData.enableMainClick = args.enableMainClick;
}
if (args.mainRadius){
this.templateData.mainRadius = args.mainRadius;
this.templateData.width = 2*args.mainRadius;
this.templateData.height = 2*args.mainRadius;
this.templateData.r = args.mainRadius/5;
}
if (args.code) {
this.templateData.code = args.code;
}
if (args.enableClick != null) {
this.templateData.enableClick = args.enableClick;
}
if (args.stockSolutionId) {
this.stockSolutionId = args.stockSolutionId;
var stockSolution = EXI.proposalManager.getStockSolutionById(this.stockSolutionId);
this.templateData.macromoleculeAcronym = EXI.proposalManager.getMacromoleculeById(stockSolution.macromoleculeId).acronym;
this.templateData.buffer = EXI.proposalManager.getBufferById(stockSolution.bufferId).acronym;
}
}

this.onClick = new Event(this);
};

StockSolutionContainer.prototype.getPanel = function () {

var _this = this;

this.panel = Ext.create('Ext.panel.Panel', {
id: this.id + "-container",
x: this.templateData.xMargin,
y: this.templateData.yMargin,
width : this.templateData.width + 1,
height : this.templateData.height + 1,
// cls:'border-grid',
frame: false,
border: false,
bodyStyle: 'background:transparent;',
cls : 'border-grid',

items : [
{
html : this.getHTML(),
width : this.templateData.width + 1,
height : this.templateData.height + 1
}
],

});

this.panel.on('boxready', function() {
if(_this.templateData.enableMainClick) {
$("#" + _this.id).unbind('click').click(function(sender){
_this.onClick.notify(sender.target.id);
});
}
});

return this.panel;

};

StockSolutionContainer.prototype.loadSamples = function (samples) {
this.samples = samples;
if (samples){
if (samples.length > 0){
this.containerId = samples[0].Container_containerId;
}
}
};

StockSolutionContainer.prototype.getHTML = function (samples) {
var html = "";
dust.render("stock.solution.container.template", this.templateData, function(err, out){
html = out;
});

return html;
};

2 changes: 1 addition & 1 deletion js/core/widget/stocksolutionsgrid.js
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ StockSolutionsGrid.prototype.load = function (stockSolutions) {
var data = [];
for (var i=0 ; i < stockSolutions.length ; i++) {
data.push({
acronym : stockSolutions[i].name,
acronym : EXI.proposalManager.getMacromoleculeById(stockSolutions[i].macromoleculeId).acronym,
buffer : EXI.proposalManager.getBufferById(stockSolutions[i].bufferId).acronym,
concentration : stockSolutions[i].concentration,
volume : stockSolutions[i].volume,
Loading