Merge pull request #6986 from yonson2023/fix_transferwise

Wise: fix account summary and add copy icon to form.
This commit is contained in:
Alejandro García 2024-02-11 10:04:38 +00:00 committed by GitHub
commit 4c1b1cd161
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 10 deletions

View File

@ -91,8 +91,8 @@ public final class PixAccountPayload extends CountryBasedPaymentAccountPayload {
@Override
public String getPaymentDetailsForTradePopup() {
return (getHolderName().isEmpty() ? "" : Res.getWithCol("payment.account.owner") + " " + getHolderName() + "\n") +
Res.getWithCol("payment.pix.key") + " " + pixKey;
return Res.getWithCol("payment.pix.key") + " " + pixKey + "\n" +
Res.getWithCol("payment.account.owner") + " " + getHolderNameOrPromptIfEmpty();
}
@Override

View File

@ -86,12 +86,13 @@ public final class TransferwiseAccountPayload extends PaymentAccountPayload {
@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.email") + " " + email;
return Res.get(paymentMethodId) + " - " + getPaymentDetailsForTradePopup().replace("\n", ", ");
}
@Override
public String getPaymentDetailsForTradePopup() {
return getPaymentDetails();
return Res.getWithCol("payment.email") + " " + email + "\n" +
Res.getWithCol("payment.account.owner") + " " + getHolderNameOrPromptIfEmpty();
}
@Override

View File

@ -35,6 +35,7 @@ import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon;
import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon;
@ -45,8 +46,8 @@ public class PixForm extends PaymentMethodForm {
PaymentAccountPayload paymentAccountPayload) {
addTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, Res.get("payment.pix.key"),
((PixAccountPayload) paymentAccountPayload).getPixKey(), Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE);
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"),
paymentAccountPayload.getHolderName());
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.owner"),
paymentAccountPayload.getHolderNameOrPromptIfEmpty());
return gridRow;
}

View File

@ -19,6 +19,7 @@ package bisq.desktop.components.paymentmethods;
import bisq.desktop.components.InputTextField;
import bisq.desktop.util.FormBuilder;
import bisq.desktop.util.Layout;
import bisq.desktop.util.validation.TransferwiseValidator;
import bisq.core.account.witness.AccountAgeWitnessService;
@ -36,6 +37,7 @@ import javafx.scene.layout.GridPane;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon;
import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon;
public class TransferwiseForm extends PaymentMethodForm {
private final TransferwiseAccount account;
@ -43,10 +45,10 @@ public class TransferwiseForm extends PaymentMethodForm {
public static int addFormForBuyer(GridPane gridPane, int gridRow,
PaymentAccountPayload paymentAccountPayload) {
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.email"),
((TransferwiseAccountPayload) paymentAccountPayload).getEmail());
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"),
paymentAccountPayload.getHolderName());
addTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, Res.get("payment.email"),
((TransferwiseAccountPayload) paymentAccountPayload).getEmail(), Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE);
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.owner"),
paymentAccountPayload.getHolderNameOrPromptIfEmpty());
return gridRow;
}