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 warnings #2866

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,31 @@ private void applyQuoteSideMinMaxRange(Monetary minRangeValue, Monetary maxRange
amountComponent.setRightMarkerQuoteSideValue(reputationBasedQuoteSideAmount);
amountComponent.setQuoteSideAmount(reputationBasedQuoteSideAmount);
String formattedAmount = AmountFormatter.formatAmountWithCode(reputationBasedQuoteSideAmount);
model.getAmountLimitInfoOverlayInfo().set(Res.get("bisqEasy.takeOffer.amount.buyer.limitInfo.overlay.info", sellersReputationScore, formattedAmount) + "\n\n");
if (reputationBasedQuoteSideAmount.isLessThan(minRangeValue)) {
// Min amount not covered by security from reputation score
model.getAmountLimitInfo().set(Res.get("bisqEasy.takeOffer.amount.buyer.limitInfo.tooHighMin", sellersReputationScore));
model.getAmountLimitInfoAmount().set("");

if (sellersReputationScore <= MIN_REPUTAION_SCORE) {
if (reputationBasedQuoteSideAmount.isLessThan(minRangeValue)) {
// Min amount not covered by security from reputation score
model.getAmountLimitInfo().set(Res.get("bisqEasy.takeOffer.amount.buyer.limitInfo.minAmountNotCovered", sellersReputationScore));
model.getAmountLimitInfoAmount().set("");
model.getAmountLimitInfoOverlayInfo().set(Res.get("bisqEasy.takeOffer.amount.buyer.limitInfo.tooHighMin.overlay.info", sellersReputationScore, formattedAmount) + "\n\n");
} else {
// Max amount not covered by security from reputation score
model.getAmountLimitInfo().set(Res.get("bisqEasy.takeOffer.amount.buyer.limitInfo.tooHighMax", sellersReputationScore));
model.getAmountLimitInfoAmount().set(Res.get("bisqEasy.takeOffer.amount.buyer.limitInfoAmount", formattedAmount));
model.getAmountLimitInfoOverlayInfo().set(Res.get("bisqEasy.takeOffer.amount.buyer.limitInfo.tooHighMax.overlay.info", sellersReputationScore, formattedAmount) + "\n\n");
}
} else {
// Max amount not covered by security from reputation score
model.getAmountLimitInfo().set(Res.get("bisqEasy.takeOffer.amount.buyer.limitInfo.tooHighMax", sellersReputationScore));
model.getAmountLimitInfoAmount().set(Res.get("bisqEasy.takeOffer.amount.buyer.limitInfoAmount", formattedAmount));
if (reputationBasedQuoteSideAmount.isLessThan(minRangeValue)) {
// Min amount not covered by security from reputation score
model.getAmountLimitInfo().set(Res.get("bisqEasy.takeOffer.amount.buyer.limitInfo.minAmountNotCovered", sellersReputationScore));
model.getAmountLimitInfoAmount().set("");
model.getAmountLimitInfoOverlayInfo().set(Res.get("bisqEasy.takeOffer.amount.buyer.limitInfo.tooHighMin.overlay.info", sellersReputationScore, formattedAmount) + "\n\n");
} else {
// Max amount not covered by security from reputation score
model.getAmountLimitInfo().set(Res.get("bisqEasy.takeOffer.amount.buyer.limitInfo.minAmountCovered", sellersReputationScore));
model.getAmountLimitInfoAmount().set(Res.get("bisqEasy.takeOffer.amount.buyer.limitInfoAmount", formattedAmount));
model.getAmountLimitInfoOverlayInfo().set(Res.get("bisqEasy.takeOffer.amount.buyer.limitInfo.minAmountCovered.overlay.info", sellersReputationScore, formattedAmount) + "\n\n");
}
}
} else {
model.getIsAmountLimitInfoVisible().set(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public class TakeOfferAmountView extends View<StackPane, TakeOfferAmountModel, T
private final Hyperlink amountLimitInfoAmount, learnMore, linkToWiki;
private final VBox content, amountLimitInfoOverlay;
private final Button closeOverlayButton;
private final HBox amountLimitInfoHBox;
private Subscription isAmountLimitInfoVisiblePin;

public TakeOfferAmountView(TakeOfferAmountModel model,
Expand Down Expand Up @@ -72,12 +73,10 @@ public TakeOfferAmountView(TakeOfferAmountModel model,
warningIcon.getStyleClass().add("overlay-icon-warning");

HBox.setMargin(warningIcon, new Insets(0, 5, 0, 0));
HBox amountLimitInfoHBox = new HBox(5, warningIcon, amountLimitInfo, amountLimitInfoAmount, learnMore);
HBox.setMargin(amountLimitInfoAmount, new Insets(0, 0, 0, -2.5));
amountLimitInfoHBox = new HBox(5, warningIcon, amountLimitInfo, amountLimitInfoAmount, learnMore);
amountLimitInfoHBox.setAlignment(Pos.BASELINE_CENTER);

// VBox.setMargin(headlineLabel, new Insets(-30, 0, 10, 0));
// root.getChildren().addAll(Spacer.fillVBox(), headlineLabel, amountComponentRoot, Spacer.fillVBox());

VBox.setMargin(headlineLabel, new Insets(-10, 0, 0, 0));
VBox.setMargin(amountLimitInfoHBox, new Insets(15, 0, 15, 0));
content.getChildren().addAll(Spacer.fillVBox(), headlineLabel, amountComponentRoot, amountLimitInfoHBox, Spacer.fillVBox());
Expand Down Expand Up @@ -108,6 +107,8 @@ protected void onViewAttached() {
amountLimitInfoAmount.visibleProperty().bind(amountLimitInfoAmount.managedProperty());
learnMore.managedProperty().bind(model.getIsAmountLimitInfoVisible());
learnMore.visibleProperty().bind(model.getIsAmountLimitInfoVisible());
amountLimitInfoHBox.managedProperty().bind(model.getIsAmountLimitInfoVisible());
amountLimitInfoHBox.visibleProperty().bind(model.getIsAmountLimitInfoVisible());

isAmountLimitInfoVisiblePin = EasyBind.subscribe(model.getIsAmountLimitInfoOverlayVisible(),
isAmountLimitInfoVisible -> {
Expand Down Expand Up @@ -143,6 +144,8 @@ protected void onViewDetached() {
amountLimitInfoAmount.visibleProperty().unbind();
learnMore.managedProperty().unbind();
learnMore.visibleProperty().unbind();
amountLimitInfoHBox.managedProperty().unbind();
amountLimitInfoHBox.visibleProperty().unbind();

isAmountLimitInfoVisiblePin.unsubscribe();

Expand Down
22 changes: 16 additions & 6 deletions i18n/src/main/resources/bisq_easy.properties
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ bisqEasy.tradeWizard.amount.limitInfo.overlay.close=Close overlay

bisqEasy.tradeWizard.amount.seller.wizard.numMatchingOffers.info=There {0} matching the chosen trade amount.
bisqEasy.tradeWizard.amount.seller.wizard.limitInfo=With your reputation score of {0}, you can trade up to
bisqEasy.tradeWizard.amount.seller.wizard.limitInfo.overlay.info=With a reputation score of {0}, you provide security for trades up to {1}.\n\n\
bisqEasy.tradeWizard.amount.seller.wizard.limitInfo.overlay.info=With a reputation score of {0}, you can trade up to {1}.\n\n\
You can find information on how to increase your reputation at ''Reputation/Build Reputation''.

bisqEasy.tradeWizard.amount.seller.limitInfo.scoreTooLow=With your reputation score of {0}, your trade amount should not exceed
Expand Down Expand Up @@ -217,7 +217,7 @@ bisqEasy.tradeWizard.amount.buyer.limitInfo.wizard.info.leadLine=There {0} match
bisqEasy.tradeWizard.amount.buyer.limitInfo.wizard.info=For offers up to {0}, reputation requirements are relaxed.
bisqEasy.tradeWizard.amount.buyer.limitInfo.wizard.overlay.info=Given the low min. amount of {0}, the reputation requirements are relaxed.\n\
For amounts up to {1}, sellers do not need reputation.\n\n\
At the 'SELECT OFFER' screen it is recommended to choose sellers with higher reputation.
At the ''Select Offer'' screen it is recommended to choose sellers with higher reputation.

bisqEasy.tradeWizard.amount.buyer.limitInfo.noReputationNeededForMaxOrFixedAmount=Sellers with no reputation can take offers up to {0}.
bisqEasy.tradeWizard.amount.buyer.limitInfo.noReputationNeededForMaxOrFixedAmount.riskInfo=Be sure you fully understand the risks involved.
Expand Down Expand Up @@ -368,12 +368,22 @@ bisqEasy.takeOffer.amount.description=The offer allows you can choose a trade am
bisqEasy.takeOffer.amount.description.limitedByTakersReputation=Your reputation score of {0} allows you can choose a trade amount\n\
between {1} and {2}

bisqEasy.takeOffer.amount.buyer.limitInfo.tooHighMax=Seller''s reputation score of {0} provides security only up to
bisqEasy.takeOffer.amount.buyer.limitInfo.tooHighMax=Seller''s reputation score is only {0}. It is not recommended to trade more than
bisqEasy.takeOffer.amount.buyer.limitInfoAmount={0}.
bisqEasy.takeOffer.amount.buyer.limitInfo.tooHighMin=Seller''s reputation score of {0} does not provide sufficient security for that offer.
bisqEasy.takeOffer.amount.buyer.limitInfo.tooHighMax.overlay.info=Seller''s reputation score of {0} does not provide sufficient security. \
However, for lower trade amounts (up to {1}), reputation requirements are more lenient.\n\n\
If you decide to proceed despite the lack of the seller''s reputation, ensure that you are fully aware of the associated risks. \
Bisq Easy''s security model relies on the seller''s reputation, as the buyer is required to send fiat currency first.
bisqEasy.takeOffer.amount.buyer.limitInfo.minAmountCovered=Seller''s reputation score of {0} provides security up to
bisqEasy.takeOffer.amount.buyer.limitInfo.minAmountCovered.overlay.info=Seller''s reputation score of {0} provides security for up to {1}.\n\n\
If you choose a higher amount, ensure that you are fully aware of the associated risks. \
Bisq Easy''s security model relies on the seller''s reputation, as the buyer is required to send fiat currency first.
bisqEasy.takeOffer.amount.buyer.limitInfo.minAmountNotCovered=Seller''s reputation score of {0} does not provide sufficient security for that offer.
bisqEasy.takeOffer.amount.buyer.limitInfo.tooHighMin.overlay.info=Seller''s reputation score of {0} does not provide sufficient security for that offer.\n\n\
It is recommended to trade lower amounts with repeated trades or with sellers who have higher reputation. \
If you decide to proceed despite the lack of the seller''s reputation, ensure that you are fully aware of the associated risks. \
Bisq Easy''s security model relies on the seller''s reputation, as the buyer is required to send fiat currency first.
bisqEasy.takeOffer.amount.buyer.limitInfo.learnMore=Learn more
bisqEasy.takeOffer.amount.buyer.limitInfo.overlay.info=Seller''s reputation score of {0} provides security for up to {1}.\n\n\
If you decide to trade above that amount, be sure to fully understand the risks. It is recommended to trade smaller amounts or repeat trades to lower potential risks.
bisqEasy.takeOffer.amount.buyer.limitInfo.overlay.linkToWikiText=To learn more about the reputation system, visit:

bisqEasy.takeOffer.paymentMethods.headline.fiat=Which payment method do you want to use?
Expand Down
8 changes: 5 additions & 3 deletions i18n/src/main/resources/chat.properties
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,11 @@ chat.message.takeOffer.buyer.makersReputationScoreTooLow.yes=Yes, I understand t
chat.message.takeOffer.buyer.makersReputationScoreTooLow.no=No, I look for another offer

chat.message.takeOffer.buyer.makersReputationTooLowButInLowAmountTolerance.headline=Please review the risks when taking that offer
chat.message.takeOffer.buyer.makersReputationTooLowButInLowAmountTolerance.warning=The seller''s reputation score is {0} and below the required reputation score of {1} for a trade amount of {2}.\n\n\
As the trade amount is rather low, reputation requirements are relaxed. If you choose to proceed with taking the offer despite the lack of the seller''s reputation, ensure you fully understand the risks involved. \
The security model of Bisq Easy is based on the seller''s reputation as the buyer need to send the fiat currency first.\n\n\
chat.message.takeOffer.buyer.makersReputationTooLowButInLowAmountTolerance.warning=The seller's reputation score is {0}, \
which is below the required score of {1} for a trade amount of {2}.\n\n\
Since the trade amount is relatively low, the reputation requirements have been relaxed. \
However, if you choose to proceed despite the seller's insufficient reputation, make sure you fully understand the associated risks. \
Bisq Easy''s security model depends on the seller''s reputation, as the buyer is required to send fiat currency first.\n\n\
To learn more about the reputation system, visit: [HYPERLINK:https://bisq.wiki/Reputation].\n\n\
Do you still want to take the offer?
chat.message.takeOffer.buyer.makersReputationTooLowButInLowAmountTolerance.yes=Yes, I understand the risk and want to continue
Expand Down
Loading