Skip to content

Commit 253ad1e

Browse files
Core - Base Station - Fixing the display, or rather not displaying, also stored in list for unique single item viewing
1 parent 05ce88b commit 253ad1e

2 files changed

Lines changed: 14 additions & 29 deletions

File tree

software/core/oqm-core-base-station/src/main/resources/META-INF/resources/res/js/obj/item/ItemView.js

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -453,12 +453,16 @@ export class ItemView extends PageUtility {
453453
Getters.StoredItem.getSingleStoredForItem(itemId, async function (stored) {
454454
let promises = [];
455455
let storageLabel = $(`
456-
<h3>
457-
Stored in: <span class="uniqueItemStoredInLabel"></span>
458-
</h3>
459-
<p class="uniqueItemStoredAlsoInContainer">
460-
Also found in: <span class="uniqueItemStoredAlsoInLabel"></span>
461-
</p>`);
456+
<div>
457+
<h3>
458+
Stored in: <span class="uniqueItemStoredInLabel"></span>
459+
</h3>
460+
<p class="uniqueItemStoredAlsoInContainer">
461+
Also found in: <span class="uniqueItemStoredAlsoInLabel"></span>
462+
</p>
463+
</div>
464+
`);
465+
let alsoInLabel = storageLabel.find(".uniqueItemStoredAlsoInLabel");
462466

463467
itemData.storageBlocks.forEach(function (curBlock) {
464468
promises.push(Getters.StorageBlock.getStorageBlockLabel(curBlock, function (labelText) {
@@ -467,7 +471,7 @@ export class ItemView extends PageUtility {
467471
if (curBlock === stored.state.storageBlock) {
468472
storageLabel.find(".uniqueItemStoredInLabel").append(newLink);
469473
} else {
470-
storageLabel.find(".uniqueItemStoredAlsoInLabel").append(newLink);
474+
alsoInLabel.append(newLink);
471475
}
472476
}));
473477
});
@@ -482,9 +486,8 @@ export class ItemView extends PageUtility {
482486
})
483487
);
484488
await Promise.all(promises);
485-
if (storageLabel.find(".uniqueItemStoredAlsoInLabel").children().length === 0) {
486-
// storageLabel.find(".uniqueItemStoredAlsoInContainer").remove();//for some reason this doesn't work ("find" doesn't work)
487-
storageLabel.get(1).remove()
489+
if (alsoInLabel.children().length === 0) {
490+
storageLabel.find(".uniqueItemStoredAlsoInContainer").hide();
488491
}
489492
ItemView.storedSingleContainer.show();
490493
})
@@ -584,24 +587,6 @@ export class ItemView extends PageUtility {
584587

585588
console.log("Setting up view of stored.");
586589

587-
// let numStorageBlocks = itemData.stats.numStored;// Object.keys(itemData.storageBlocks).length;
588-
//TODO:: show storage blocks associated
589-
// if (numStorageBlocks === 0) {
590-
// console.log("None stored.");
591-
// ItemView.storedNonePresentContainer.show();
592-
// //TODO:: if storage blocks present, prompt to edit item to add block(s)
593-
// //TODO:: prompt to add stored item
594-
// } else {
595-
// //TODO:: display right; bulk vs multi vs single display
596-
// console.log(numStorageBlocks + " stored.");
597-
// ItemView.itemViewStoredNum.text(numStorageBlocks);
598-
// ItemView.itemViewStored.show();
599-
//
600-
// ItemView.allStoredSearchFormItemInputName.val(itemData.name);
601-
// ItemView.allStoredSearchFormItemInputId.val(itemId);
602-
// ItemView.allStoredSearchForm.submit();
603-
// }
604-
605590
ItemView.checkoutSearchFormItemNameInput.val(itemData.name);
606591
ItemView.checkoutSearchFormItemIdInput.val(itemId);
607592
ItemView.checkoutSearchForm.submit();

software/core/oqm-core-base-station/src/main/resources/templates/webui/mainWebPageTemplate.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ <h1>{#icons/pageIcon page=page addSpace=true}{/icons/pageIcon} {title}</h1>
286286
<div class="row">
287287
<div class="col-sm-4">
288288
<span class="h5">Open QuarterMaster Base Station</span><br/>
289-
289+
290290
Version <b>{config:['service.version']}</b>,
291291
<a href="{config:['service.gitLink']}" target="_blank">{#icons/github /} Github</a>
292292
<br/>

0 commit comments

Comments
 (0)