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

AC-424:Do not require login location if no locations are configured. #391

Merged
merged 1 commit into from Nov 15, 2017
Merged

AC-424:Do not require login location if no locations are configured. #391

merged 1 commit into from Nov 15, 2017

Conversation

anonymous-ME
Copy link
Contributor

@anonymous-ME anonymous-ME commented Oct 13, 2017

JIRA TICKET NAME:

AC-424:Do not require login location if no locations are configured.

Summary:
Do not require login location if no locations are configured.

@@ -353,7 +360,7 @@ private Snackbar createSnackbar(String message) {
@Override
public void setLocationErrorOccurred(boolean errorOccurred) {
this.loginValidatorWatcher.setLocationErrorOccurred(errorOccurred);
mLoginButton.setEnabled(!errorOccurred);
Copy link
Member

Choose a reason for hiding this comment

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

Why don't you want to disable the login button when errors occur?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will make necessary changes .

@@ -116,17 +116,20 @@ public void onNothingSelected(AdapterView<?> adapterView) {

private boolean isAllDataValid() {

boolean result = validateNotEmpty(mUsername) && validateNotEmpty(mPassword) && validateNotEmpty(mLocation) && !urlChanged;
Copy link
Member

Choose a reason for hiding this comment

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

I would think that the validateNotEmpty() check stays, but in its body, we simply return valid of there are no login locations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dkayiwa why would we even validateNotEmpty for location , because if location is not configured we don't care about location . Right ?

My point is why to have validateNotEmpty(mLocation) when it does nothing . ie. Returns true no matter what .

mDropdownLocation.setVisibility(View.GONE);
mLoginButton.setEnabled(true);
}else {
mDropdownLocation.setVisibility(View.VISIBLE);
Copy link
Member

Choose a reason for hiding this comment

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

Do we need the else? I thought it was already disabled by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dkayiwa when the url / API is updated , the visibility of the mDropdownLocation should change accordingly .

@dkayiwa
Copy link
Member

dkayiwa commented Oct 20, 2017

The screenshot should be on the JIRA ticket instead of pull request.

@@ -353,7 +360,7 @@ private Snackbar createSnackbar(String message) {
@Override
public void setLocationErrorOccurred(boolean errorOccurred) {
this.loginValidatorWatcher.setLocationErrorOccurred(errorOccurred);
mLoginButton.setEnabled(!errorOccurred);
mDropdownLocation.setVisibility(View.GONE);
Copy link
Member

Choose a reason for hiding this comment

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

Isn't the above supposed to depend on the value of errorOccurred?

@dkayiwa
Copy link
Member

dkayiwa commented Oct 31, 2017

@anonymous-ME can you squash these commits into one as advised at? https://wiki.openmrs.org/display/docs/Pull+Request+Tips

@anonymous-ME
Copy link
Contributor Author

@dkayiwa squashed all commits into one.

@dkayiwa dkayiwa merged commit 9306af1 into openmrs:master Nov 15, 2017
henziger pushed a commit to henziger/openmrs-contrib-android-client that referenced this pull request Nov 28, 2017
@anonymous-ME
Copy link
Contributor Author

anonymous-ME commented Dec 4, 2017

Found a bug in this PR in validating the location dropdown.

Please refer to this PR for this issue. #395

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants