Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 12 additions & 15 deletions mcc/resources/web/mcc/window/MarkShippedWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ Ext4.define('MCC.window.MarkShippedWindow', {
html: 'This will: <br>1) Mark the selected animals as shipped from this center<br>2) Enter a new demographics record in the selected study<br>3) Preserve the MCC ID for each animal.',
border: false,
style: 'padding-bottom: 10px;'
},{
xtype: 'ldk-integerfield',
fieldLabel: 'Request ID',
itemId: 'requestId',
allowBlank: false
},{
xtype: 'datefield',
fieldLabel: 'Effective Date',
Expand Down Expand Up @@ -71,9 +76,9 @@ Ext4.define('MCC.window.MarkShippedWindow', {
containerPath: ctx.MCCInternalDataContainer,
schemaName: 'core',
queryName: 'containers',
columns: 'EntityId,Name,Parent,Path',
columns: 'EntityId,title,Parent,Path',
containerFilter: 'CurrentAndSubfolders',
sort: 'Name',
sort: 'title',
autoLoad: true,
listeners: {
load: function(store) {
Expand Down Expand Up @@ -111,10 +116,6 @@ Ext4.define('MCC.window.MarkShippedWindow', {
xtype: 'displayfield',
value: 'Animal ID',
width: 150
},{
xtype: 'displayfield',
value: 'Request ID',
width: 150
},{
xtype: 'displayfield',
value: 'Keep Existing ID?',
Expand All @@ -129,11 +130,6 @@ Ext4.define('MCC.window.MarkShippedWindow', {
fields = fields.concat([{
xtype: 'displayfield',
value: animalId,
},{
xtype: 'ldk-integerfield',
minValue: 1,
itemId: 'requestId-' + animalId,
allowBlank: true
},{
xtype: 'checkbox',
itemId: 'usePreviousId-' + animalId,
Expand All @@ -158,7 +154,7 @@ Ext4.define('MCC.window.MarkShippedWindow', {
return {
layout: {
type: 'table',
columns: 4
columns: 3
},
width: 600,
border: false,
Expand All @@ -183,12 +179,13 @@ Ext4.define('MCC.window.MarkShippedWindow', {

var win = btn.up('window');
var lsids = win.rowIds;
var requestId = win.down('#requestId').getValue();
var effectiveDate = win.down('#effectiveDate').getValue();
var centerName = win.down('#centerName').getValue();
var targetFolder = win.down('#targetFolder').getValue();

if (!effectiveDate || !centerName || !targetFolder) {
Ext4.Msg.alert('Error', 'Must provide date, center name, and target folder');
if (!requestId || !effectiveDate || !centerName || !targetFolder) {
Ext4.Msg.alert('Error', 'Must provide request Id, date, center name, and target folder');
return;
}

Expand Down Expand Up @@ -250,6 +247,7 @@ Ext4.define('MCC.window.MarkShippedWindow', {
},

doSave: function(win, results, preexistingIdsInTargetFolder){
var requestId = win.down('#requestId').getValue();
var effectiveDate = win.down('#effectiveDate').getValue();
var centerName = win.down('#centerName').getValue();
var targetFolder = win.down('#targetFolder').getValue();
Expand All @@ -259,7 +257,6 @@ Ext4.define('MCC.window.MarkShippedWindow', {
var hadError = false;
Ext4.Array.forEach(results.rows, function(row){
var effectiveId = win.down('#usePreviousId-' + row.Id).getValue() ? row.Id : win.down('#newId-' + row.Id).getValue();
var requestId = win.down('#requestId-' + row.Id).getValue();
// This should be checked above, although perhaps case sensitivity could get involved:
LDK.Assert.assertNotEmpty('Missing effective ID after query', effectiveId);

Expand Down
1 change: 1 addition & 0 deletions mcc/test/src/org/labkey/test/tests/mcc/MccTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ private void testAnimalImportAndTransfer() throws Exception
sleep(100);

Ext4ComboRef.getForLabel(this, "Target Folder").setComboByDisplayValue("Other");
Ext4FieldRef.getForLabel(this, "Request ID").setValue(12345);
waitAndClick(Ext4Helper.Locators.ext4Button("Submit"));

// This should fail initially:
Expand Down
Loading