Skip to content

Commit 06c8b8b

Browse files
committed
Merge branch 'inventory-search' into qa/monkey
2 parents c0d5566 + 77873e1 commit 06c8b8b

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

Diff for: website/client/src/components/inventory/equipment/index.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,8 @@ export default {
410410
const ownedItem = this.flatGear[gearKey];
411411
412412
const isSearched = !searchText
413-
|| ownedItem.text().toLowerCase().indexOf(searchText) !== -1;
413+
|| ownedItem.text().toLowerCase().indexOf(searchText) !== -1
414+
|| ownedItem.notes().toLowerCase().indexOf(searchText) !== -1;
414415
415416
if (ownedItem.klass !== 'base' && isSearched) {
416417
const { type } = ownedItem;

Diff for: website/client/src/components/inventory/items/index.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,10 @@ export default {
338338
if (itemQuantity > 0 && isAllowed) {
339339
const item = contentItems[itemKey];
340340
341-
const isSearched = !searchText || item.text()
342-
.toLowerCase()
343-
.indexOf(searchText) !== -1;
341+
const isSearched = !searchText
342+
|| item.text().toLowerCase().indexOf(searchText) !== -1
343+
|| item.notes().toLowerCase().indexOf(searchText) !== -1;
344+
344345
if (isSearched && item) {
345346
itemsArray.push({
346347
...item,

Diff for: website/client/src/components/inventory/stable/index.vue

+5-3
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ export default {
627627
animals.push({
628628
key: specialKey,
629629
eggKey,
630+
eggName: text(),
630631
potionKey,
631632
name: text(),
632633
canFind,
@@ -657,7 +658,6 @@ export default {
657658
}
658659
659660
this.cachedAnimalList[key] = animals;
660-
661661
return animals;
662662
},
663663
listAnimals (animalGroup, type, hideMissing, sort, searchText) {
@@ -669,8 +669,11 @@ export default {
669669
animals = _filter(animals, a => a.isOwned());
670670
}
671671
672+
// this does not return the yarn pet if user searches for flying carpet
673+
// if yarn is searched, both items appear
672674
if (searchText && searchText !== '') {
673-
animals = _filter(animals, a => a.name.toLowerCase().indexOf(searchText) !== -1);
675+
animals = _filter(animals, a => a.name.toLowerCase().indexOf(searchText) !== -1
676+
|| a.eggName.toLowerCase().indexOf(searchText) !== -1);
674677
}
675678
676679
// 2. Sort
@@ -693,7 +696,6 @@ export default {
693696
}
694697
695698
this.viewOptions[animalGroup.key].animalCount = animals.length;
696-
697699
return animals;
698700
},
699701
countOwnedAnimals (animalGroup, type) {

0 commit comments

Comments
 (0)