-
Notifications
You must be signed in to change notification settings - Fork 992
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
Change password #344
Change password #344
Conversation
…e doing almost the whole thing. i'll write a better commit message when i open the PR
Deriving Graphql endpoint from web endpoint so we don't have to manually change it for staging. Created Activity extensions for showing Snackbars. Created reusable Snackbar extensions for success and error messages. The Snackbar extensions return themselves so you can chain them (if you wanted to inflate a success/error snackbar manually). Change password: Showing warning when new password is less than 6 characters. Showing warning when confirm password is not equal to new confirm. Disabling save button until all validations pass. Added 2 new LoginReasons: CHANGE_PASSWORD and RESET_PASSWORD because we want to prefill the email if it's supplied from the intent but need to check if we're showing the reset dialog or change password snackbar. When password is successfully changed, taking user to LoginActivity. LoginActivity shows success snackbar letting the user know their changes were saved. Made LoginActivity's root a CoordinatorLayout so the Snackbar is shown over the keyboard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RequiresActivityViewModel(ChangePasswordViewModel.ViewModel::class) | ||
class ChangePasswordActivity : BaseActivity<ChangePasswordViewModel.ViewModel>() { | ||
|
||
var saveEnabled = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be private
} | ||
} | ||
|
||
companion object { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can define this at the top of the class I think instead of a companion object because no other class is accessing this constant
const val MINIMUM_PASSWORD_LENGTH = 6
interface ChangePasswordViewModel {
what did i do?
TLDR; the most.
Updated strings.
Added mutation for changing password.
Added green check icon.
Deriving GraphQL endpoint from web endpoint so we don't have to manually change it for staging.
Changed staging toolbar to grey so we can see green toolbar icons.
Also fixed it in XML previews.
Created
Activity
extensions for showingSnackbar
s.Created reusable
Snackbar
extensions for success and error messages.The
Snackbar
extensions return themselves so you can chain them (if you wanted to inflate a success/errorSnackbar
manually).Change password:
Showing warning when new password is less than 6 characters.
Showing warning when confirm password is not equal to new confirm.
Disabling save button until all validations pass.
Added 2 new
LoginReasons
:CHANGE_PASSWORD
andRESET_PASSWORD
because we want to prefill the email if it's supplied from the intent but need to check if we're showing the reset dialog or change password Snackbar.Moved the text changed listeners to before we subscribe to the
prefillEmail
output.When password is successfully changed, taking user to
LoginActivity
.LoginActivity shows success
Snackbar
letting the user know their changes were saved.Made LoginActivity's root a
CoordinatorLayout
so theSnackbar
is shown over the keyboard.Tests on tests on tests.
see
what's left?
Final copy.