Skip to content

Commit 55d7f1e

Browse files
authored
Change entry pattern of MCC Request ID (#213)
1 parent ced3f6f commit 55d7f1e

2 files changed

Lines changed: 13 additions & 15 deletions

File tree

mcc/resources/web/mcc/window/MarkShippedWindow.js

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ Ext4.define('MCC.window.MarkShippedWindow', {
3232
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.',
3333
border: false,
3434
style: 'padding-bottom: 10px;'
35+
},{
36+
xtype: 'ldk-integerfield',
37+
fieldLabel: 'Request ID',
38+
itemId: 'requestId',
39+
allowBlank: false
3540
},{
3641
xtype: 'datefield',
3742
fieldLabel: 'Effective Date',
@@ -71,9 +76,9 @@ Ext4.define('MCC.window.MarkShippedWindow', {
7176
containerPath: ctx.MCCInternalDataContainer,
7277
schemaName: 'core',
7378
queryName: 'containers',
74-
columns: 'EntityId,Name,Parent,Path',
79+
columns: 'EntityId,title,Parent,Path',
7580
containerFilter: 'CurrentAndSubfolders',
76-
sort: 'Name',
81+
sort: 'title',
7782
autoLoad: true,
7883
listeners: {
7984
load: function(store) {
@@ -111,10 +116,6 @@ Ext4.define('MCC.window.MarkShippedWindow', {
111116
xtype: 'displayfield',
112117
value: 'Animal ID',
113118
width: 150
114-
},{
115-
xtype: 'displayfield',
116-
value: 'Request ID',
117-
width: 150
118119
},{
119120
xtype: 'displayfield',
120121
value: 'Keep Existing ID?',
@@ -129,11 +130,6 @@ Ext4.define('MCC.window.MarkShippedWindow', {
129130
fields = fields.concat([{
130131
xtype: 'displayfield',
131132
value: animalId,
132-
},{
133-
xtype: 'ldk-integerfield',
134-
minValue: 1,
135-
itemId: 'requestId-' + animalId,
136-
allowBlank: true
137133
},{
138134
xtype: 'checkbox',
139135
itemId: 'usePreviousId-' + animalId,
@@ -158,7 +154,7 @@ Ext4.define('MCC.window.MarkShippedWindow', {
158154
return {
159155
layout: {
160156
type: 'table',
161-
columns: 4
157+
columns: 3
162158
},
163159
width: 600,
164160
border: false,
@@ -183,12 +179,13 @@ Ext4.define('MCC.window.MarkShippedWindow', {
183179

184180
var win = btn.up('window');
185181
var lsids = win.rowIds;
182+
var requestId = win.down('#requestId').getValue();
186183
var effectiveDate = win.down('#effectiveDate').getValue();
187184
var centerName = win.down('#centerName').getValue();
188185
var targetFolder = win.down('#targetFolder').getValue();
189186

190-
if (!effectiveDate || !centerName || !targetFolder) {
191-
Ext4.Msg.alert('Error', 'Must provide date, center name, and target folder');
187+
if (!requestId || !effectiveDate || !centerName || !targetFolder) {
188+
Ext4.Msg.alert('Error', 'Must provide request Id, date, center name, and target folder');
192189
return;
193190
}
194191

@@ -250,6 +247,7 @@ Ext4.define('MCC.window.MarkShippedWindow', {
250247
},
251248

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

mcc/test/src/org/labkey/test/tests/mcc/MccTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ private void testAnimalImportAndTransfer() throws Exception
122122
sleep(100);
123123

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

127128
// This should fail initially:

0 commit comments

Comments
 (0)