-
Notifications
You must be signed in to change notification settings - Fork 534
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
Fix #4760 In Terms of Service the website should be displayed as link and should be clickable. #5213
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.
Thanks @Tejas-67!
Please include a video demo of your solution working as expected.
Once you have addressed the comments, please assig this back to me. See wiki section.
app/src/main/java/org/oppia/android/app/policies/PoliciesFragmentPresenter.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/org/oppia/android/app/policies/PoliciesFragmentPresenter.kt
Outdated
Show resolved
Hide resolved
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 @Tejas-67, I have added a nit, but nothing blocking. Please fix and reassign.
app/src/main/java/org/oppia/android/app/policies/PoliciesFragmentPresenter.kt
Outdated
Show resolved
Hide resolved
Hi @Tejas-67, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to ask someone to merge your PR once the CI checks pass and you're happy with it. Thanks! |
Thanks @Tejas-67. Could you please fix the failing tests? See https://github.com/oppia/oppia-android/wiki/Interpreting-CI-Results for finding out which tests are failing. |
Hey @adhiamboperes , fixed some lint issues that was causing the tests to fail. Other tests failing because the link to navigate to privacy policy page from terms of service page is not working. A possible fix would be to add another span for the link. Should i go ahead with this fix or raise a issue after this PR is merged? |
@Tejas-67, all existing tests must pass for the PR to be merged. Can you identify why the links are not working? What has changed? |
@adhiamboperes , The links are not working because the text is enclosed in <oppia-noninteractive-policy link="privacy">Privacy Policy and html.fromHtml doesn't recognize this. One fix could be to to wrap the text with another span. |
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.
@adhiamboperes , The links are not working because the text is enclosed in Privacy Policy and html.fromHtml doesn't recognize this. One fix could be to to wrap the text with another span.
I think this was working before your fix, right? It is worth taking a step back and finding a different solution. Take a look at this class that handles custom html tags. I believe it has a fromHtml() function that is used in the HtmlParser.kt class, which in computeCustomTagHandlers(), parses the policy tag.
@Tejas-67, are you still working on this PR? |
@adhiamboperes Yes, I am working on it. |
Hi @Tejas-67, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue. |
Hey @adhiamboperes , please check the new code. |
Hey @adhiamboperes, do I need to raise a new PR for this issue? |
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 @Tejas-67! (Sorry for the delay in review here).
Based on previous conversation, you do not need to close a PR and open a new one, when undoing unwanted changes, you can simply create new commits after you have changed code back to the way it was, and push to the branch.
(However when working on a different issue, you need to create a new branch from develop).
Our wiki has a good set of instructions that can help. https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR. Please let me know if you have further questions.
utility/src/main/java/org/oppia/android/util/parser/html/HtmlParser.kt
Outdated
Show resolved
Hide resolved
utility/src/main/java/org/oppia/android/util/parser/html/HtmlParser.kt
Outdated
Show resolved
Hide resolved
utility/src/main/java/org/oppia/android/util/parser/html/HtmlParser.kt
Outdated
Show resolved
Hide resolved
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.
Sorry, meant to request changes as per my comments.
… link and should be clickable.
- Replace brittle string manipulation with robust regex matching using .toRegex().find() - Introduce new helper functions for code simplification
bcc938d
to
33caba8
Compare
@adhiamboperes please check. |
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 @Tejas-67!
Hi @Tejas-67, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to ask someone to merge your PR once the CI checks pass and you're happy with it. Thanks! |
Explanation
Fix #4760 In Terms of Service the website should be displayed as link and should be clickable
This Solution uses SpannableString to solve the the issue. We get the url from html spannable using regex and then set a span around it to make the link clickable.
Essential Checklist
For UI-specific PRs only
If your PR includes UI-related changes, then:
Demo Video
oppia-.webm