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

NTP: Fix a couple of UI issues in the New Trade Protocol #3410

Merged
merged 4 commits into from
Oct 15, 2019
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 @@ -19,6 +19,7 @@

import bisq.core.support.dispute.arbitration.ArbitrationManager;
import bisq.core.support.dispute.mediation.MediationManager;
import bisq.core.support.dispute.refund.RefundManager;

import javax.inject.Inject;

Expand All @@ -42,6 +43,11 @@ public class SupportTicketsPresentation {
@Getter
private final BooleanProperty showOpenMediationTicketsNotification = new SimpleBooleanProperty();

@Getter
private final StringProperty numOpenRefundTickets = new SimpleStringProperty();
@Getter
private final BooleanProperty showOpenRefundTicketsNotification = new SimpleBooleanProperty();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are numOpenRefundTickets and showOpenRefundTicketsNotification variables used somewhere outside of SupportTicketsPresentation ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I can see, just like the other properties.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are numOpenRefundTickets and showOpenRefundTicketsNotification variables used somewhere outside of SupportTicketsPresentation ?

But yes, the getters for all properties are not necessary anymore (there was a use case in the past). I'll change it in one of my next PRs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So why we need these properties ? Seems like we only set values, but never use them. Or I miss something ?

Copy link
Contributor Author

@ripcurlx ripcurlx Oct 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So why we need these properties ? Seems like we only set values, but never use them. Or I miss something ?

I changed it already locally where all except of one two properties (numOpenSupportTickets, showOpenSupportTicketsNotification) are removed


@Getter
private final StringProperty numOpenSupportTickets = new SimpleStringProperty();
@Getter
Expand All @@ -50,14 +56,19 @@ public class SupportTicketsPresentation {
private final ArbitrationManager arbitrationManager;
@org.jetbrains.annotations.NotNull
private final MediationManager mediationManager;
private RefundManager refundManager;

@Inject
public SupportTicketsPresentation(ArbitrationManager arbitrationManager, MediationManager mediationManager) {
public SupportTicketsPresentation(ArbitrationManager arbitrationManager,
MediationManager mediationManager,
RefundManager refundManager) {
this.arbitrationManager = arbitrationManager;
this.mediationManager = mediationManager;
this.refundManager = refundManager;

arbitrationManager.getNumOpenDisputes().addListener((observable, oldValue, newValue) -> onChange());
mediationManager.getNumOpenDisputes().addListener((observable, oldValue, newValue) -> onChange());
refundManager.getNumOpenDisputes().addListener((observable, oldValue, newValue) -> onChange());
}

private void onChange() {
Expand All @@ -71,7 +82,12 @@ private void onChange() {
numOpenMediationTickets.set(String.valueOf(mediationTickets));
showOpenMediationTicketsNotification.set(mediationTickets > 0);

int supportTickets = arbitrationTickets + mediationTickets;
AtomicInteger openRefundDisputes = new AtomicInteger(refundManager.getNumOpenDisputes().get());
int refundTickets = openRefundDisputes.get();
numOpenRefundTickets.set(String.valueOf(refundTickets));
showOpenRefundTicketsNotification.set(refundTickets > 0);

int supportTickets = arbitrationTickets + mediationTickets + refundTickets;
numOpenSupportTickets.set(String.valueOf(supportTickets));
showOpenSupportTicketsNotification.set(supportTickets > 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ public void cleanupDisputes() {

@Override
protected String getDisputeInfo(Dispute dispute) {
String role = Res.get("shared.arbitrator2").toLowerCase();
String link = "https://bisq.network/docs/exchange/arbitration-system";
String role = Res.get("shared.arbitrator").toLowerCase();
String link = "https://docs.bisq.network/trading-rules.html#legacy-arbitration"; //TODO needs to be created
return Res.get("support.initialInfo", role, role, link);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void cleanupDisputes() {
@Override
protected String getDisputeInfo(Dispute dispute) {
String role = Res.get("shared.refundAgent").toLowerCase();
String link = "https://bisq.network/docs/exchange/refundAgent"; //todo create link
String link = "https://docs.bisq.network/trading-rules.html#arbitration";
return Res.get("support.initialInfo", role, role, link);
}

Expand Down
9 changes: 5 additions & 4 deletions core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ shared.seller=seller
shared.buyer=buyer
shared.allEuroCountries=All Euro countries
shared.acceptedTakerCountries=Accepted taker countries
shared.arbitrator=Selected arbitrator
shared.tradePrice=Trade price
shared.tradeAmount=Trade amount
shared.tradeVolume=Trade volume
Expand Down Expand Up @@ -208,9 +207,11 @@ shared.learnMore=Learn more
shared.dismiss=Dismiss
shared.selectedArbitrator=Selected arbitrator
shared.selectedMediator=Selected mediator
shared.selectedRefundAgent=Selected arbitrator
shared.mediator=Mediator
shared.arbitrator2=Arbitrator
shared.refundAgent=Refund agent
shared.arbitrator=Arbitrator
shared.refundAgent=Arbitrator
shared.refundAgentForSupportStaff=Refund agent
shared.delayedPayoutTxId=Refund collateral transaction ID


Expand Down Expand Up @@ -994,7 +995,7 @@ support.initialInfo=Please enter a description of your problem in the text field
\t Sometimes the data directory gets corrupted and leads to strange bugs. \n\
\t See: https://docs.bisq.network/backup-recovery.html#switch-to-a-new-data-directory\n\n\
Please make yourself familiar with the basic rules for the dispute process:\n\
\t● You need to respond to the {0}}''s requests within 2 days.\n\
\t● You need to respond to the {0}''s requests within 2 days.\n\
\t● Mediators respond in between 2 days. Arbitrators respond in between 5 business days.\n\
\t● The maximum period for a dispute is 14 days.\n\
\t● You need to cooperate with the {1} and provide the information they request to make your case.\n\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ public ArbitratorRegistrationView(ArbitratorRegistrationViewModel model,

@Override
protected String getRole() {
return Res.get("shared.arbitrator2");
return Res.get("shared.arbitrator");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ public RefundAgentRegistrationView(RefundAgentRegistrationViewModel model,

@Override
protected String getRole() {
return Res.get("shared.refundAgent");
return Res.get("shared.refundAgentForSupportStaff");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,15 @@ private void addContent() {
if (dispute.getSupportType() != null) {
switch (dispute.getSupportType()) {
case ARBITRATION:
// TODO update in next release to shared.selectedArbitrator and delete shared.arbitrator entry
title = Res.get("shared.arbitrator");
title = Res.get("shared.selectedArbitrator");
break;
case MEDIATION:
title = Res.get("shared.selectedMediator");
break;
case TRADE:
break;
case REFUND:
title = Res.get("shared.refundAgent");
title = Res.get("shared.selectedRefundAgent");
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,13 @@ private void updateAgentTabs() {

// We might get that method called before we have the map is filled in the arbitratorManager
if (arbitratorTab != null) {
arbitratorTab.setText(Res.get("support.tab.ArbitratorsSupportTickets", Res.get("shared.arbitrator2")).toUpperCase());
arbitratorTab.setText(Res.get("support.tab.ArbitratorsSupportTickets", Res.get("shared.arbitrator")).toUpperCase());
}
if (mediatorTab != null) {
mediatorTab.setText(Res.get("support.tab.ArbitratorsSupportTickets", Res.get("shared.mediator")).toUpperCase());
}
if (refundAgentTab != null) {
refundAgentTab.setText(Res.get("support.tab.ArbitratorsSupportTickets", Res.get("shared.refundAgent")).toUpperCase());
refundAgentTab.setText(Res.get("support.tab.ArbitratorsSupportTickets", Res.get("shared.refundAgentForSupportStaff")).toUpperCase());
}
}

Expand Down