-
Notifications
You must be signed in to change notification settings - Fork 70
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
VACMS-10356 Add content validator for Preview URL links (#10356) #16040
VACMS-10356 Add content validator for Preview URL links (#10356) #16040
Conversation
d7b8eaa
to
ab7e4e6
Compare
This reverts commit 3431e2838886a644b71ec50dc4b0f9c24ded305d.
ab7e4e6
to
1262fe4
Compare
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 looks really good to me -- just two things:
- Pls open the PR from a branch on the repository so that tests run correctly.
- Consider adjusting the name to fit how broadly it works.
/** | ||
* Checks that the text does not use any preview URLs as paths. | ||
* | ||
* In other words, we want to avoid things like this: | ||
* | ||
* `<a href="/https://www.va.gov/">VA.gov</a>` | ||
* | ||
* @Constraint( | ||
* id = "PreventPreviewUrlsAsPathsInLinks", | ||
* label = @Translation("Prevent Preview URLs as Paths in Links", context = "Validation"), | ||
* type = { "string_long", "text_long" } | ||
* ) | ||
*/ | ||
class PreventPreviewUrlsAsPathsInLinks extends Constraint { |
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 appears to me to be somewhat misnamed -- it's not just blocking Preview URLs as paths, but as any href
. Which is good, but it'd be better if the name matched 🙂
Request: Please rename this.
Thanks also for the good QA steps 🙂 |
/** | ||
* Data provider. | ||
*/ | ||
public function validateDataProvider() { |
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.
Praise: Good test cases 👍🏻
Closing in favor of #16086 |
Description
Closes #10356.
Testing done
Screenshots
QA steps
What needs to be checked to prove this works?
What needs to be checked to prove it didn't break any related things?
What variations of circumstances (users, actions, values) need to be checked?
As user with ability to edit content:
Edit any node/page with rich text field, e.g. the VAMC system service description of a System Health Service.
Insert a link to a preview URL, e.g.
<a href="https://preview-staging.vfs.va.gov/example/path">Example Link!</a>
Try to save the document and be blocked by errors and validate that:
Edit any node/item with plain text field, e.g. description of a media image.
Add a link to a preview URL, e.g.
https://preview-staging.vfs.va.gov/example/path
Try to save the document and be blocked by errors and validate that:
Then validate Acceptance Criteria from issue
Definition of Done
Select Team for PR review
CMS Team
Public websites
Facilities
User support
Accelerated Publishing