-
Notifications
You must be signed in to change notification settings - Fork 531
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
Fixes #4352: Spelling mistake while setting up pin in 'Enter a New Pin' dialog box #4425
Conversation
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.
@pratyaksh1610 PTAL at the suggested changes.
@@ -68,7 +68,9 @@ class ResetPinDialogFragmentPresenter @Inject constructor( | |||
val dialog = AlertDialog.Builder(activity, R.style.OppiaAlertDialogTheme) | |||
.setTitle(R.string.reset_pin_enter) | |||
.setView(binding.root) | |||
.setMessage("This PIN wil be $name's new PIN and will be required when signing in.") | |||
|
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.
Remove this extra blank line.
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.
Sure !
.setMessage("This PIN wil be $name's new PIN and will be required when signing in.") | ||
|
||
.setMessage("This PIN will be $name's new PIN and will be required when signing in.") | ||
|
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.
Remove this extra blank line.
@rt4914 removed the blank lines. Pls review. |
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.
Hi @pratyaksh1610. I caught this in passing, but I think there might be a bit more work needed here. PTAL at my in-file comment.
@@ -68,7 +68,7 @@ class ResetPinDialogFragmentPresenter @Inject constructor( | |||
val dialog = AlertDialog.Builder(activity, R.style.OppiaAlertDialogTheme) | |||
.setTitle(R.string.reset_pin_enter) | |||
.setView(binding.root) | |||
.setMessage("This PIN wil be $name's new PIN and will be required when signing in.") | |||
.setMessage("This PIN will be $name's new PIN and will be required when signing in.") |
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 actually should be an app string so that it can be localized. I'm a bit surprised we missed this.
Could you move this to strings.xml? You can see other strings that take variables for a reference on how to pass a value to a localized string.
Also, please add a test to verify that the dialog's message is correct when opened.
@BenHenning I have localised the string. |
@pratyaksh1610 I suggest looking at other dialog fragment tests in the codebase for an idea on how to set up such a test, including verifying string contents. You'll need to create a new test file for the reset pin dialog fragment.
This seems like a transient Android Studio issue--I suggest creating a new discussion in the discussions board to see if anyone else can help with this (as I'm not sure offhand). |
@BenHenning Created a new test file |
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.
Thanks @pratyaksh1610. Apologies for the delayed review. I've taken a pass & left some thoughts--PTAL!
app/build.gradle
Outdated
@@ -16,6 +16,7 @@ android { | |||
versionName "1.0" | |||
multiDexEnabled true | |||
testInstrumentationRunner "org.oppia.android.testing.OppiaTestRunner" | |||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
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 & the other build.gradle changes shouldn't be needed--please make sure follow existing conventions for how to set up the test correctly (i.e. which annotations to use).
import androidx.test.espresso.matcher.ViewMatchers.withId | ||
import org.junit.Test | ||
|
||
class ResetPinDialogMessageTest { |
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 should be setting up a test activity & opening the dialog under test to verify. See: https://github.com/oppia/oppia-android/blob/develop/app/src/sharedTest/java/org/oppia/android/app/devoptions/ViewEventLogsFragmentTest.kt for a reference. Note that you might be able to use https://github.com/oppia/oppia-android/blob/develop/app/src/main/java/org/oppia/android/app/testing/activity/TestActivity.kt instead of creating a new test activity, too (which will be a bit easier, so that's a good place to start).
Also @pratyaksh1610 it appears that you have failing CI checks--please make sure to address these as well. |
@BenHenning So i just need to add that |
@BenHenning For adding a test, should I create a new test activity for that alert dialog and add the function mentioned below in that file ?
|
@pratyaksh1610 yep you'll need to create a new test activity to host the dialog fragment, and then intent to it in a new test suite in order to bring up the dialog in order to test it. |
@BenHenning I have made the changes. Please review. Thanks. |
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.
@pratyaksh1610 LGTM
withId(R.id.admin_settings_input_pin_edit_text), | ||
isDescendantOfA(withId(R.id.admin_settings_input_pin)) | ||
) | ||
).inRoot(isDialog()) |
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.
I think the formatting here can be improved otherwise the PR looks good.
@pratyaksh1610 sorry but I need to close this. See point (4) https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#making-a-local-code-change-using-the-terminal. Since this PR was force-pushed, it'll need to be recreated. Please avoid force pushing in the future as it breaks comment history and makes incremental reviews much more difficult (which is why we have a no-allow policy for force pushing. |
@BenHenning I have made a new PR for the same. Please review. |
Explanation
Fixes #4352
Updated the spelling while setting up pin in 'Enter a New Pin' dialog box.
Screenshots -
Before
After
Essential Checklist
For UI-specific PRs only
If your PR includes UI-related changes, then: