mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-04-06 21:13:59 -04:00
filter boxes search currencies, payment details, and extra info
This commit is contained in:
parent
055b7d1376
commit
62a4dcb633
@ -602,10 +602,29 @@ abstract class OfferBookViewModel extends ActivatableViewModel {
|
||||
nextPredicate = nextPredicate.or(offerBookListItem ->
|
||||
offerBookListItem.getOffer().getId().toLowerCase().contains(filterText.toLowerCase()));
|
||||
|
||||
// filter payment method
|
||||
// filter full payment method
|
||||
nextPredicate = nextPredicate.or(offerBookListItem ->
|
||||
Res.get(offerBookListItem.getOffer().getPaymentMethod().getId()).toLowerCase().contains(filterText.toLowerCase()));
|
||||
|
||||
// filter short payment method
|
||||
nextPredicate = nextPredicate.or(offerBookListItem -> {
|
||||
return getPaymentMethod(offerBookListItem).toLowerCase().contains(filterText.toLowerCase());
|
||||
});
|
||||
|
||||
// filter currencies
|
||||
nextPredicate = nextPredicate.or(offerBookListItem -> {
|
||||
return offerBookListItem.getOffer().getCurrencyCode().toLowerCase().contains(filterText.toLowerCase()) ||
|
||||
offerBookListItem.getOffer().getBaseCurrencyCode().toLowerCase().contains(filterText.toLowerCase()) ||
|
||||
CurrencyUtil.getNameAndCode(offerBookListItem.getOffer().getCurrencyCode()).toLowerCase().contains(filterText.toLowerCase()) ||
|
||||
CurrencyUtil.getNameAndCode(offerBookListItem.getOffer().getBaseCurrencyCode()).toLowerCase().contains(filterText.toLowerCase());
|
||||
});
|
||||
|
||||
// filter extra info
|
||||
nextPredicate = nextPredicate.or(offerBookListItem -> {
|
||||
return offerBookListItem.getOffer().getCombinedExtraInfo() != null &&
|
||||
offerBookListItem.getOffer().getCombinedExtraInfo().toLowerCase().contains(filterText.toLowerCase());
|
||||
});
|
||||
|
||||
filteredItems.setPredicate(predicate.and(nextPredicate));
|
||||
} else {
|
||||
filteredItems.setPredicate(predicate);
|
||||
|
@ -248,7 +248,8 @@ public class ContractWindow extends Overlay<ContractWindow> {
|
||||
}
|
||||
|
||||
addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.makerDepositTransactionId"), contract.getMakerDepositTxHash());
|
||||
addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.takerDepositTransactionId"), contract.getTakerDepositTxHash());
|
||||
if (contract.getTakerDepositTxHash() != null)
|
||||
addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.takerDepositTransactionId"), contract.getTakerDepositTxHash());
|
||||
|
||||
if (dispute.getDelayedPayoutTxId() != null)
|
||||
addLabelTxIdTextField(gridPane, ++rowIndex, Res.get("shared.delayedPayoutTxId"), dispute.getDelayedPayoutTxId());
|
||||
|
@ -376,31 +376,34 @@ public class OpenOffersView extends ActivatableViewAndModel<VBox, OpenOffersView
|
||||
return true;
|
||||
|
||||
Offer offer = item.getOpenOffer().getOffer();
|
||||
if (offer.getId().contains(filterString)) {
|
||||
if (offer.getId().toLowerCase().contains(filterString.toLowerCase())) {
|
||||
return true;
|
||||
}
|
||||
if (model.getDate(item).contains(filterString)) {
|
||||
if (model.getDate(item).toLowerCase().contains(filterString.toLowerCase())) {
|
||||
return true;
|
||||
}
|
||||
if (model.getMarketLabel(item).contains(filterString)) {
|
||||
if (model.getMarketLabel(item).toLowerCase().contains(filterString.toLowerCase())) {
|
||||
return true;
|
||||
}
|
||||
if (model.getPrice(item).contains(filterString)) {
|
||||
if (model.getPrice(item).toLowerCase().contains(filterString.toLowerCase())) {
|
||||
return true;
|
||||
}
|
||||
if (model.getPriceDeviation(item).contains(filterString)) {
|
||||
if (model.getPriceDeviation(item).toLowerCase().contains(filterString.toLowerCase())) {
|
||||
return true;
|
||||
}
|
||||
if (model.getPaymentMethod(item).contains(filterString)) {
|
||||
if (model.getPaymentMethod(item).toLowerCase().contains(filterString.toLowerCase())) {
|
||||
return true;
|
||||
}
|
||||
if (model.getVolume(item).contains(filterString)) {
|
||||
if (model.getVolume(item).toLowerCase().contains(filterString.toLowerCase())) {
|
||||
return true;
|
||||
}
|
||||
if (model.getAmount(item).contains(filterString)) {
|
||||
if (model.getAmount(item).toLowerCase().contains(filterString.toLowerCase())) {
|
||||
return true;
|
||||
}
|
||||
if (model.getDirectionLabel(item).contains(filterString)) {
|
||||
if (model.getDirectionLabel(item).toLowerCase().contains(filterString.toLowerCase())) {
|
||||
return true;
|
||||
}
|
||||
if (item.getOffer().getCombinedExtraInfo() != null && item.getOffer().getCombinedExtraInfo().toLowerCase().contains(filterString.toLowerCase())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -83,6 +83,15 @@ public class PendingTradesListItem implements FilterableListItem {
|
||||
if (StringUtils.containsIgnoreCase(getMarketDescription(), filterString)) {
|
||||
return true;
|
||||
}
|
||||
if (StringUtils.containsIgnoreCase(getTrade().getOffer().getCombinedExtraInfo(), filterString)) {
|
||||
return true;
|
||||
}
|
||||
if (getTrade().getBuyer().getPaymentAccountPayload() != null && StringUtils.containsIgnoreCase(getTrade().getBuyer().getPaymentAccountPayload().getPaymentDetails(), filterString)) {
|
||||
return true;
|
||||
}
|
||||
if (getTrade().getSeller().getPaymentAccountPayload() != null && StringUtils.containsIgnoreCase(getTrade().getSeller().getPaymentAccountPayload().getPaymentDetails(), filterString)) {
|
||||
return true;
|
||||
}
|
||||
return StringUtils.containsIgnoreCase(getPriceAsString(), filterString);
|
||||
}
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ public abstract class DisputeView extends ActivatableView<VBox, Void> implements
|
||||
tooltip.setShowDuration(Duration.seconds(10));
|
||||
filterTextField.setTooltip(tooltip);
|
||||
filterTextFieldListener = (observable, oldValue, newValue) -> applyFilteredListPredicate(filterTextField.getText());
|
||||
HBox.setHgrow(filterTextField, Priority.NEVER);
|
||||
HBox.setHgrow(filterTextField, Priority.ALWAYS);
|
||||
|
||||
alertIconLabel = new Label();
|
||||
Text icon = getIconForLabel(MaterialDesignIcon.ALERT_CIRCLE_OUTLINE, "2em", alertIconLabel);
|
||||
|
Loading…
x
Reference in New Issue
Block a user