Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve navigation structure #6135

Merged
merged 35 commits into from Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
98f355d
Adapt navigational structure and offerbook handling to buy and sell d…
ripcurlx Apr 1, 2022
875e5f4
Adapt offer book chart view to new navigational structure
ripcurlx Apr 1, 2022
5781e3b
Add payment account filtering for remaining payment methods
ripcurlx Apr 1, 2022
810a29b
Add missing payment account filtering
ripcurlx Apr 1, 2022
e3ceb80
Show all payment methods
ripcurlx Apr 1, 2022
924e92a
Adapt take offer process to new navigation structure
ripcurlx Apr 4, 2022
a8189d7
Adapt create offer process to new navigation structure
ripcurlx Apr 6, 2022
497158a
Fix rebase errors with master
ripcurlx Apr 7, 2022
33725c2
Adapt navigation labels back to currency code
ripcurlx Apr 8, 2022
b70d102
Fix BSQ swap labels
ripcurlx Apr 8, 2022
98285da
Move OfferViewUtil
ripcurlx Apr 11, 2022
b734420
Fix navigation to specific offer book view
ripcurlx Apr 11, 2022
5b67766
Properly rename main navigation
ripcurlx Apr 11, 2022
1712f74
Use BSQ Swap as default when BSQ offer is created
ripcurlx Apr 11, 2022
492ff35
Adapt amount and volume description for take offer
ripcurlx Apr 11, 2022
63ea054
Adapt amount and volume description for create offer
ripcurlx Apr 11, 2022
9a3ed33
Use Offer.isFiat helper method
ripcurlx Apr 11, 2022
542cc4d
Remove close button duplication in DetailsWindows
ripcurlx Apr 11, 2022
098ece2
Only show BSQ accounts
ripcurlx Apr 11, 2022
2055cc5
Fix wrong check to show BSQ swap as default for create offer
ripcurlx Apr 11, 2022
fce247c
Fix a couple of issues regarding default currencies
ripcurlx Apr 13, 2022
348d147
Fix broken option for BSQ Altcoin and BSQ Altcoin Instant
ripcurlx Apr 19, 2022
e43bad1
Fix offer count for Altcoins
ripcurlx Apr 19, 2022
d41235c
Fix storage of crypto screen currency
ripcurlx Apr 19, 2022
be16166
Fix sorting issue for Altcoins
ripcurlx Apr 20, 2022
7ecd159
Fix BSQ swap create offer handling (again)
ripcurlx Apr 20, 2022
108255b
Move supported currencies into payment accounts
ripcurlx Apr 20, 2022
e43a8ae
Fix handling of preferred currency
ripcurlx Apr 20, 2022
0894037
Add safeguard for already stored crypto currencies in preferences by …
ripcurlx Apr 20, 2022
89926d1
Improve help icon
ripcurlx Apr 20, 2022
3ce374e
Unify tab handling
ripcurlx Apr 21, 2022
2233f73
Fix Codacy complaints
ripcurlx Apr 21, 2022
4ce861a
Add create and take offer title
ripcurlx Apr 22, 2022
4447435
Switch to open offers after creating a new offer
ripcurlx Apr 22, 2022
7ad2dd0
Set preferred currency as top altcoin
ripcurlx Apr 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
61 changes: 30 additions & 31 deletions core/src/main/java/bisq/core/payment/PaymentAccountUtil.java
Expand Up @@ -19,7 +19,6 @@

import bisq.core.account.witness.AccountAgeWitnessService;
import bisq.core.locale.Country;
import bisq.core.locale.CurrencyUtil;
import bisq.core.locale.TradeCurrency;
import bisq.core.offer.Offer;
import bisq.core.payment.payload.PaymentAccountPayload;
Expand Down Expand Up @@ -141,76 +140,76 @@ public static List<TradeCurrency> getTradeCurrencies(PaymentMethod paymentMethod
case STRIKE_ID:
return getAllStrikeCurrencies();
case TIKKIE_ID:
return CurrencyUtil.getAllTikkieIdCurrencies();
return getAllTikkieIdCurrencies();
case ALI_PAY_ID:
return CurrencyUtil.getAllAliPayAccountCurrencies();
return getAllAliPayAccountCurrencies();
case NEQUI_ID:
return CurrencyUtil.getAllNequiCurrencies();
return getAllNequiCurrencies();
case IMPS_ID:
case NEFT_ID:
case PAYTM_ID:
case RTGS_ID:
case UPI_ID:
return CurrencyUtil.getAllIfscBankCurrencies();
return getAllIfscBankCurrencies();
case BIZUM_ID:
return CurrencyUtil.getAllBizumCurrencies();
return getAllBizumCurrencies();
case MONEY_BEAM_ID:
return CurrencyUtil.getAllMoneyBeamCurrencies();
return getAllMoneyBeamCurrencies();
case PIX_ID:
return CurrencyUtil.getAllPixCurrencies();
return getAllPixCurrencies();
case SATISPAY_ID:
return CurrencyUtil.getAllSatispayCurrencies();
return getAllSatispayCurrencies();
case CHASE_QUICK_PAY_ID:
return CurrencyUtil.getAllChaseQuickPayCurrencies();
return getAllChaseQuickPayCurrencies();
case US_POSTAL_MONEY_ORDER_ID:
return CurrencyUtil.getAllUSPostalMoneyOrderCurrencies();
return getAllUSPostalMoneyOrderCurrencies();
case VENMO_ID:
return CurrencyUtil.getAllVenmoCurrencies();
return getAllVenmoCurrencies();
case JAPAN_BANK_ID:
return CurrencyUtil.getAllJapanBankCurrencies();
return getAllJapanBankCurrencies();
case WECHAT_PAY_ID:
return CurrencyUtil.getAllWeChatPayCurrencies();
return getAllWeChatPayCurrencies();
case CLEAR_X_CHANGE_ID:
return CurrencyUtil.getAllClearXchangeCurrencies();
return getAllClearXchangeCurrencies();
case AUSTRALIA_PAYID_ID:
return CurrencyUtil.getAllAustraliaPayidCurrencies();
return getAllAustraliaPayidCurrencies();
case PERFECT_MONEY_ID:
return CurrencyUtil.getAllPerfectMoneyCurrencies();
return getAllPerfectMoneyCurrencies();
case HAL_CASH_ID:
return CurrencyUtil.getAllHalCashCurrencies();
return getAllHalCashCurrencies();
case SWISH_ID:
return CurrencyUtil.getAllSwishCurrencies();
return getAllSwishCurrencies();
case CASH_APP_ID:
return CurrencyUtil.getAllCashAppCurrencies();
return getAllCashAppCurrencies();
case POPMONEY_ID:
return CurrencyUtil.getAllPopmoneyCurrencies();
return getAllPopmoneyCurrencies();
case PROMPT_PAY_ID:
return CurrencyUtil.getAllPromptPayCurrencies();
return getAllPromptPayCurrencies();
case SEPA_ID:
case SEPA_INSTANT_ID:
return CurrencyUtil.getAllSEPACurrencies();
return getAllSEPACurrencies();
case CASH_BY_MAIL_ID:
case F2F_ID:
case NATIONAL_BANK_ID:
case SAME_BANK_ID:
case SPECIFIC_BANKS_ID:
case CASH_DEPOSIT_ID:
case WESTERN_UNION_ID:
return CurrencyUtil.getAllFiatCurrencies();
return getAllFiatCurrencies();
case FASTER_PAYMENTS_ID:
return CurrencyUtil.getAllFasterPaymentCurrencies();
return getAllFasterPaymentCurrencies();
case DOMESTIC_WIRE_TRANSFER_ID:
return CurrencyUtil.getAllDomesticWireTransferCurrencies();
return getAllDomesticWireTransferCurrencies();
case ACH_TRANSFER_ID:
return CurrencyUtil.getAllACHTransferCurrencies();
return getAllACHTransferCurrencies();
case CELPAY_ID:
return CurrencyUtil.getAllCelPayCurrencies();
return getAllCelPayCurrencies();
case MONESE_ID:
return CurrencyUtil.getAllMoneseCurrencies();
return getAllMoneseCurrencies();
case TRANSFERWISE_USD_ID:
return CurrencyUtil.getAllTransferwiseUSDCurrencies();
return getAllTransferwiseUSDCurrencies();
case VERSE_ID:
return CurrencyUtil.getAllVerseCurrencies();
return getAllVerseCurrencies();
default:
return Collections.emptyList();
}
Expand Down
Expand Up @@ -32,6 +32,7 @@
import bisq.core.payment.payload.PaymentMethod;
import bisq.core.provider.price.PriceFeedService;
import bisq.core.trade.ClosedTradableManager;
import bisq.core.trade.bsq_swap.BsqSwapTradeManager;
import bisq.core.user.Preferences;
import bisq.core.user.User;
import bisq.core.util.FormattingUtils;
Expand Down Expand Up @@ -65,14 +66,16 @@ public BsqOfferBookViewModel(User user,
P2PService p2PService,
PriceFeedService priceFeedService,
ClosedTradableManager closedTradableManager,
BsqSwapTradeManager bsqSwapTradeManager,
AccountAgeWitnessService accountAgeWitnessService,
Navigation navigation,
PriceUtil priceUtil,
OfferFilterService offerFilterService,
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter btcFormatter,
BsqFormatter bsqFormatter,
BsqWalletService bsqWalletService, CoreApi coreApi) {
super(user, openOfferManager, offerBook, preferences, walletsSetup, p2PService, priceFeedService, closedTradableManager, accountAgeWitnessService, navigation, priceUtil, offerFilterService, btcFormatter, bsqFormatter, bsqWalletService, coreApi);
BsqWalletService bsqWalletService,
CoreApi coreApi) {
super(user, openOfferManager, offerBook, preferences, walletsSetup, p2PService, priceFeedService, closedTradableManager, bsqSwapTradeManager, accountAgeWitnessService, navigation, priceUtil, offerFilterService, btcFormatter, bsqFormatter, bsqWalletService, coreApi);
}

@Override
Expand Down
Expand Up @@ -36,6 +36,7 @@
import bisq.core.payment.payload.PaymentMethod;
import bisq.core.provider.price.PriceFeedService;
import bisq.core.trade.ClosedTradableManager;
import bisq.core.trade.bsq_swap.BsqSwapTradeManager;
import bisq.core.user.Preferences;
import bisq.core.user.User;
import bisq.core.util.FormattingUtils;
Expand Down Expand Up @@ -66,14 +67,15 @@ public BtcOfferBookViewModel(User user,
P2PService p2PService,
PriceFeedService priceFeedService,
ClosedTradableManager closedTradableManager,
BsqSwapTradeManager bsqSwapTradeManager,
AccountAgeWitnessService accountAgeWitnessService,
Navigation navigation,
PriceUtil priceUtil,
OfferFilterService offerFilterService,
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter btcFormatter,
BsqFormatter bsqFormatter,
BsqWalletService bsqWalletService, CoreApi coreApi) {
super(user, openOfferManager, offerBook, preferences, walletsSetup, p2PService, priceFeedService, closedTradableManager, accountAgeWitnessService, navigation, priceUtil, offerFilterService, btcFormatter, bsqFormatter, bsqWalletService, coreApi);
super(user, openOfferManager, offerBook, preferences, walletsSetup, p2PService, priceFeedService, closedTradableManager, bsqSwapTradeManager, accountAgeWitnessService, navigation, priceUtil, offerFilterService, btcFormatter, bsqFormatter, bsqWalletService, coreApi);
}

@Override
Expand Down
Expand Up @@ -34,6 +34,7 @@
import bisq.core.payment.payload.PaymentMethod;
import bisq.core.provider.price.PriceFeedService;
import bisq.core.trade.ClosedTradableManager;
import bisq.core.trade.bsq_swap.BsqSwapTradeManager;
import bisq.core.user.Preferences;
import bisq.core.user.User;
import bisq.core.util.FormattingUtils;
Expand Down Expand Up @@ -68,14 +69,15 @@ public OtherOfferBookViewModel(User user,
P2PService p2PService,
PriceFeedService priceFeedService,
ClosedTradableManager closedTradableManager,
BsqSwapTradeManager bsqSwapTradeManager,
AccountAgeWitnessService accountAgeWitnessService,
Navigation navigation,
PriceUtil priceUtil,
OfferFilterService offerFilterService,
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter btcFormatter,
BsqFormatter bsqFormatter,
BsqWalletService bsqWalletService, CoreApi coreApi) {
super(user, openOfferManager, offerBook, preferences, walletsSetup, p2PService, priceFeedService, closedTradableManager, accountAgeWitnessService, navigation, priceUtil, offerFilterService, btcFormatter, bsqFormatter, bsqWalletService, coreApi);
super(user, openOfferManager, offerBook, preferences, walletsSetup, p2PService, priceFeedService, closedTradableManager, bsqSwapTradeManager, accountAgeWitnessService, navigation, priceUtil, offerFilterService, btcFormatter, bsqFormatter, bsqWalletService, coreApi);
}

@Override
Expand Down
Expand Up @@ -32,6 +32,7 @@
import bisq.core.payment.payload.PaymentMethod;
import bisq.core.provider.price.PriceFeedService;
import bisq.core.trade.ClosedTradableManager;
import bisq.core.trade.bsq_swap.BsqSwapTradeManager;
import bisq.core.user.Preferences;
import bisq.core.user.User;
import bisq.core.util.FormattingUtils;
Expand Down Expand Up @@ -64,6 +65,7 @@ public TopAltcoinOfferBookViewModel(User user,
P2PService p2PService,
PriceFeedService priceFeedService,
ClosedTradableManager closedTradableManager,
BsqSwapTradeManager bsqSwapTradeManager,
AccountAgeWitnessService accountAgeWitnessService,
Navigation navigation,
PriceUtil priceUtil,
Expand All @@ -72,7 +74,7 @@ public TopAltcoinOfferBookViewModel(User user,
BsqFormatter bsqFormatter,
BsqWalletService bsqWalletService,
CoreApi coreApi) {
super(user, openOfferManager, offerBook, preferences, walletsSetup, p2PService, priceFeedService, closedTradableManager, accountAgeWitnessService, navigation, priceUtil, offerFilterService, btcFormatter, bsqFormatter, bsqWalletService, coreApi);
super(user, openOfferManager, offerBook, preferences, walletsSetup, p2PService, priceFeedService, closedTradableManager, bsqSwapTradeManager, accountAgeWitnessService, navigation, priceUtil, offerFilterService, btcFormatter, bsqFormatter, bsqWalletService, coreApi);
}

@Override
Expand Down
Expand Up @@ -239,7 +239,7 @@ public void testMaxCharactersForAmountWithNoOffers() {
when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems);

final OfferBookViewModel model = new BtcOfferBookViewModel(null, null, offerBook, empty, null, null, null,
null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
assertEquals(0, model.maxPlacesForAmount.intValue());
}

Expand All @@ -253,7 +253,7 @@ public void testMaxCharactersForAmount() {
when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems);

final OfferBookViewModel model = new BtcOfferBookViewModel(null, openOfferManager, offerBook, empty, null, null, null,
null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
model.activate();

assertEquals(6, model.maxPlacesForAmount.intValue());
Expand All @@ -271,7 +271,7 @@ public void testMaxCharactersForAmountRange() {
when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems);

final OfferBookViewModel model = new BtcOfferBookViewModel(null, openOfferManager, offerBook, empty, null, null, null,
null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
model.activate();

assertEquals(15, model.maxPlacesForAmount.intValue());
Expand All @@ -290,7 +290,7 @@ public void testMaxCharactersForVolumeWithNoOffers() {
when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems);

final OfferBookViewModel model = new BtcOfferBookViewModel(null, null, offerBook, empty, null, null, null,
null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
assertEquals(0, model.maxPlacesForVolume.intValue());
}

Expand All @@ -304,7 +304,7 @@ public void testMaxCharactersForVolume() {
when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems);

final OfferBookViewModel model = new BtcOfferBookViewModel(null, openOfferManager, offerBook, empty, null, null, null,
null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
model.activate();

assertEquals(5, model.maxPlacesForVolume.intValue());
Expand All @@ -322,7 +322,7 @@ public void testMaxCharactersForVolumeRange() {
when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems);

final OfferBookViewModel model = new BtcOfferBookViewModel(null, openOfferManager, offerBook, empty, null, null, null,
null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
model.activate();

assertEquals(9, model.maxPlacesForVolume.intValue());
Expand All @@ -341,7 +341,7 @@ public void testMaxCharactersForPriceWithNoOffers() {
when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems);

final OfferBookViewModel model = new BtcOfferBookViewModel(null, null, offerBook, empty, null, null, null,
null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
assertEquals(0, model.maxPlacesForPrice.intValue());
}

Expand All @@ -355,7 +355,7 @@ public void testMaxCharactersForPrice() {
when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems);

final OfferBookViewModel model = new BtcOfferBookViewModel(null, openOfferManager, offerBook, empty, null, null, null,
null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
model.activate();

assertEquals(7, model.maxPlacesForPrice.intValue());
Expand All @@ -373,7 +373,7 @@ public void testMaxCharactersForPriceDistanceWithNoOffers() {
when(offerBook.getOfferBookListItems()).thenReturn(offerBookListItems);

final OfferBookViewModel model = new BtcOfferBookViewModel(null, null, offerBook, empty, null, null, null,
null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
assertEquals(0, model.maxPlacesForMarketPriceMargin.intValue());
}

Expand Down Expand Up @@ -408,7 +408,7 @@ public void testMaxCharactersForPriceDistance() {
offerBookListItems.addAll(item1, item2);

final OfferBookViewModel model = new BtcOfferBookViewModel(null, openOfferManager, offerBook, empty, null, null, priceFeedService,
null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
model.activate();

assertEquals(8, model.maxPlacesForMarketPriceMargin.intValue()); //" (1.97%)"
Expand All @@ -429,7 +429,7 @@ public void testGetPrice() {
when(priceFeedService.getMarketPrice(anyString())).thenReturn(new MarketPrice("USD", 12684.0450, Instant.now().getEpochSecond(), true));

final OfferBookViewModel model = new BtcOfferBookViewModel(null, openOfferManager, offerBook, empty, null, null, null,
null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);
null, null, null, null, getPriceUtil(), null, coinFormatter, new BsqFormatter(), null, null);

final OfferBookListItem item = make(btcBuyItem.but(
with(useMarketBasedPrice, true),
Expand Down