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

[VDG] Make password button texts depends on intent #11778

Merged
merged 6 commits into from
Oct 25, 2023

Conversation

SuperJMN
Copy link
Collaborator

This adapts the password request view to show "Next" or "SEND", depending on the intent of the request.

Replaces #11594 (review)

Copy link
Collaborator

@MarnixCroes MarnixCroes left a comment

Choose a reason for hiding this comment

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

I guess it should also be Send at speeding up/cancel a transaction dialog?

@@ -26,10 +28,22 @@ public PasswordAuthDialogViewModel(IWalletModel wallet)
AuthorizationFailedMessage = $"The password is incorrect.{Environment.NewLine}Please try again.";
}

public string ContinueText => Intent == PasswordRequestIntent.Send ? "SEND" : "Next";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
public string ContinueText => Intent == PasswordRequestIntent.Send ? "SEND" : "Next";
public string ContinueText => Intent == PasswordRequestIntent.Send ? "Send" : "Next";

Copy link
Contributor

@nopara73 nopara73 left a comment

Choose a reason for hiding this comment

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

Copy link
Collaborator

@soosr soosr left a comment

Choose a reason for hiding this comment

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

Why doesn't just pass the string via ctor?

@SuperJMN
Copy link
Collaborator Author

SuperJMN commented Oct 24, 2023

Why doesn't just pass the string via ctor?

I did exactly that initially, but looked a bit redundant when we actually have only 2 values. I can restore this approach if you think it's enough/convenient.

@soosr
Copy link
Collaborator

soosr commented Oct 24, 2023

Why doesn't just pass the string via ctor?

I did exactly that initially, but looked a bit redundant when we actually have only 2 values. I can restore this approach if you think it's enough/convenient.

Yes, please. Just keep it simple

@pull-request-size pull-request-size bot added size/S and removed size/M labels Oct 24, 2023
@@ -16,7 +16,7 @@ public static AuthorizationDialogBase GetAuthorizationDialog(IWalletModel wallet
}
else
{
return new PasswordAuthDialogViewModel(wallet, PasswordRequestIntent.Send);
return new PasswordAuthDialogViewModel(wallet, "SEND");
Copy link
Collaborator

Choose a reason for hiding this comment

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

[NavigationMetaData(Title = "Enter your password", NavigationTarget = NavigationTarget.CompactDialogScreen)]
public partial class PasswordAuthDialogViewModel : AuthorizationDialogBase
{
private readonly IWalletModel _wallet;
[AutoNotify] private string _password;

public PasswordAuthDialogViewModel(IWalletModel wallet, PasswordRequestIntent intent)
public PasswordAuthDialogViewModel(IWalletModel wallet, string continueText)
Copy link
Collaborator

Choose a reason for hiding this comment

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

string continueText = "Continue" and only pass it where Send is required.

@@ -281,7 +281,7 @@ private void RegisterViewModels()
{
// TODO: Remove reference to WalletRepository when this ViewModel is Decoupled
// TODO: Why is this code duplicated?
var pwAuthDialog = new PasswordAuthDialogViewModel(walletViewModel.WalletModel, PasswordRequestIntent.Other);
var pwAuthDialog = new PasswordAuthDialogViewModel(walletViewModel.WalletModel, "Next");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wasn't it Continue before?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes it is

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You're right. I don't know why I changed it...

Copy link
Collaborator

@MarnixCroes MarnixCroes left a comment

Choose a reason for hiding this comment

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

ACK 12b6188

yahiheb
yahiheb previously approved these changes Oct 24, 2023
Copy link
Collaborator

@yahiheb yahiheb left a comment

Choose a reason for hiding this comment

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

tACK

@soosr soosr merged commit 2f8e13a into WalletWasabi:master Oct 25, 2023
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants