Skip to content

Commit 3b2f651

Browse files
committed
Improve styling on MarkShippedWindow
1 parent b3d57d8 commit 3b2f651

1 file changed

Lines changed: 7 additions & 20 deletions

File tree

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

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -247,26 +247,6 @@ Ext4.define('MCC.window.MarkShippedWindow', {
247247
});
248248
}
249249

250-
var shouldAddArrival = !row['Id/MostRecentArrival/MostRecentArrival'] ||
251-
row['Id/MostRecentArrival/MostRecentArrival'] !== Ext4.Date.format(row.effectiveDate, 'Y-m-d') ||
252-
row['Id/MostRecentArrival/mccRequestId'] !== requestId ||
253-
row.Id !== effectiveId;
254-
commands.push({
255-
command: 'insert',
256-
schemaName: 'study',
257-
containerPath: targetFolder,
258-
queryName: 'Arrival',
259-
rows: [{
260-
Id: row.Id,
261-
date: effectiveDate,
262-
source: row.colony,
263-
mccRequestId: requestId,
264-
qcstate: null,
265-
objectId: null,
266-
QCStateLabel: 'Completed'
267-
}]
268-
});
269-
270250
// If going to a new LK folder, we're creating a whole new record:
271251
if (targetFolderId.toUpperCase() !== LABKEY.Security.currentContainer.id.toUpperCase() || effectiveId !== row.Id) {
272252
commands.push({
@@ -332,7 +312,13 @@ Ext4.define('MCC.window.MarkShippedWindow', {
332312
objectId: null
333313
}]
334314
});
315+
}
335316

317+
var shouldAddArrival = !row['Id/MostRecentArrival/MostRecentArrival'] ||
318+
row['Id/MostRecentArrival/MostRecentArrival'] !== Ext4.Date.format(row.effectiveDate, 'Y-m-d') ||
319+
row['Id/MostRecentArrival/mccRequestId'] !== requestId ||
320+
row.Id !== effectiveId;
321+
if (shouldAddArrival) {
336322
// And also add an arrival record. NOTE: set the date after the departure to get status to update properly
337323
var arrivalDate = new Date(effectiveDate).setMinutes(effectiveDate.getMinutes() + 1);
338324
commands.push({
@@ -344,6 +330,7 @@ Ext4.define('MCC.window.MarkShippedWindow', {
344330
Id: effectiveId,
345331
date: arrivalDate,
346332
source: centerName,
333+
mccRequestId: requestId,
347334
QCState: null,
348335
QCStateLabel: 'Completed',
349336
objectId: null

0 commit comments

Comments
 (0)