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

VACMS-10356 Add content validator for Preview URL links (#10356) #16086

Merged
merged 8 commits into from
Nov 13, 2023

Conversation

JunTaoLuo
Copy link
Contributor

@JunTaoLuo JunTaoLuo commented Nov 9, 2023

Description

Closes #10356.

Testing done

  • Added unit tests for validator
  • Tested functionality locally

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:

  1. Edit any node/page with rich text field, e.g. the VAMC system service description of a System Health Service.

  2. Insert a link to a preview URL, e.g. <a href="https://preview-staging.vfs.va.gov/example/path">Example Link!</a>

  3. Try to save the document and be blocked by errors and validate that:

    • An error appears at the top of the page:
    image
    • The field title is highlighted red to indicate error:
    image
    • An error appears at the bottom of the field:
    image
  4. Edit any node/item with plain text field, e.g. description of a media image.

  5. Add a link to a preview URL, e.g. https://preview-staging.vfs.va.gov/example/path

  6. Try to save the document and be blocked by errors and validate that:

    • An error appears at the top of the page:
    image
    • The field title is highlighted red to indicate error:
    image
    • An error appears at the bottom of the field:
    image
  7. Then validate Acceptance Criteria from issue

    • A link created to the preview server url will fail form validation and prevent save.
    • Validator is covered by unit tests.

Definition of Done

  • Documentation has been updated, if applicable.
  • Tests have been added if necessary.
  • Automated tests have passed.
  • Code Quality Tests have passed.
  • Acceptance Criteria in related issue are met.
  • Manual Code Review Approved.
  • If there are field changes, front end output has been thoroughly checked.

Select Team for PR review

  • CMS Team
  • Public websites
  • Facilities
  • User support
  • Accelerated Publishing

@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 9, 2023 19:21 Destroyed
ndouglas
ndouglas previously approved these changes Nov 9, 2023
Copy link
Contributor

@ndouglas ndouglas left a comment

Choose a reason for hiding this comment

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

MY MY MY, THIS PULL REQUEST IS JUST AS PRETTY AS A PICTURE!

Screenshot 2023-11-09 at 2 41 53 PM
Screenshot 2023-11-09 at 2 42 02 PM
Screenshot 2023-11-09 at 2 42 13 PM
Screenshot 2023-11-09 at 2 43 01 PM
Screenshot 2023-11-09 at 2 43 05 PM

Great job!

@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 9, 2023 19:48 Destroyed
@github-actions github-actions bot added the CMS Team CMS Product team that manages both editor exp and devops label Nov 9, 2023
@JunTaoLuo
Copy link
Contributor Author

@ndouglas Oops, I didn't realize pushing a new commit to fix a comment dismisses your review.

@JunTaoLuo JunTaoLuo force-pushed the VACMS-10356-Prevent-preview-links branch from 720a0da to 46975eb Compare November 9, 2023 20:14
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 9, 2023 20:14 Destroyed
@JunTaoLuo JunTaoLuo force-pushed the VACMS-10356-Prevent-preview-links branch from 46975eb to 4bfd64b Compare November 13, 2023 15:11
@va-cms-bot va-cms-bot temporarily deployed to Tugboat November 13, 2023 15:11 Destroyed
@JunTaoLuo JunTaoLuo requested a review from ndouglas November 13, 2023 15:11
@ndouglas
Copy link
Contributor

@JunTaoLuo NP, some repos here have that branch protection rule set (like this one), some don't (devops and content-build, notably).

@JunTaoLuo JunTaoLuo merged commit 21325fc into main Nov 13, 2023
18 checks passed
@JunTaoLuo JunTaoLuo deleted the VACMS-10356-Prevent-preview-links branch November 13, 2023 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMS Team CMS Product team that manages both editor exp and devops
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add form validation to prevent links to preview.
3 participants