-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add emails and phone link checker #2199
Conversation
Code Climate has analyzed commit 46f5ed2 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 46.1% (50% is the threshold). This pull request will bring the total coverage in the repository to 76.0% (0.0% change). View more on Code Climate. |
I haven't tested the branch thoroughly yet, but got a quick thought so far:
If phones/mails are broken, they are still available under "Invalid" section for non-expert users (thus can be damaged). |
d28ad85
to
b5033fa
Compare
True, but I'd argue that an invalid phone/mail link is important enough to appear in the invalid section, so that also non-experts are aware of the issue.
Yes, but I think for links the link text is only identical in very rare cases, whereas for mails and phone numbers this will be the case in nearly all links (at least this is my assumption)... I'd say it's a good enough starting point, maybe the service team can provide feedback after we tested this for a while... |
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.
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.
Thank you 🎉
As far as I tested it, it seems to work. I have two thoughts, but I'm not sure how relevant they are.
Caveats: Only the link target is replaced, not the link text.
I found this piece of information very important to know. So I think it definitely should be documented. If you haven't already, I also would think about maybe adding a warning about this inside the CMS, probably rather just a small note after clicking on the replace button?- I noticed, that all email addresses I entered were found in the link checker, valid and invalid ones. I assumed, that this is the expected behavior, since I can just ignore the ones that are correct, but I thought it was still worth mentioning it
b2b9c4c
to
fa9dfbb
Compare
fa9dfbb
to
9197636
Compare
@seluianova Good idea, I adapted the error message in this case.
@JoeyStk Yes, makes sense. I agree that it might be confusing, especially if the link text is a URL itself and not a descriptive title. I added a second field now that indicates that the link text is read-only, what do you think?
Indeed, since the link checker itself does not check them (as indicated by the message "Email link (not automatically checked)")... maybe we could provide an upstream contribution to https://github.com/DjangoAdminHackers/django-linkcheck to also include (at least format-checking) of email and phone number links in the future... |
9197636
to
46f5ed2
Compare
Re-tested with the recent changes - ✅ |
Short description
Add the possibility to replace
mailto:
andtel:
links with the link checkerProposed changes
mailto:
andtel:
linksCaveats: Only the link target is replaced, not the link text. So if this feature is used without caution, it might create inconsistencies (e.g. tel links with a different phone number target than their displayed text etc.)... Thus, I decided to only make the new categories visible for expert users.
Resolved issues
Fixes: #2198
Pull Request Review Guidelines