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

chore(PPDSC-2280): chore-ppdse-2280-added prevent default #366

Merged
merged 2 commits into from
Sep 8, 2022

Conversation

baburay23
Copy link
Contributor

PPDSC-2280

What

  1. Background - If you are on a page on the website that is not the homepage and you click privacy policy link in the footer section it goes back to homepage and the privacy policy modal does not load. The ticket suggested that the href should be updated to whatever page the user is on when they click the pp modal. However I found this did not work. I tried the below example
<LinkStandalone
    {...props}
    href="components/overview"
    role="button"

this had some weird behaviour the pp modal would show but the page would then refresh and go to "components/overview" and the PP modal would disappear.
I found that the href being passed in the LinkStandlone component was the problem. I did some research and ended up adding event.preventDefault(); this stops the page from refreshing when and just displays the PP modal as expected whatever page i am on in the site.

  1. What does the reviewers should expect- to test this locally i went to _document.tsx and commented out the line below. I think in order to test you might have to do the same

Screenshot 2022-09-08 at 12 45 08

I have done:

  • Written unit tests against changes
  • Written functional tests against the component and/or NewsKit site
  • Updated relevant documentation

I have tested manually:

  • The feature's functionality is working as expected on Chrome, Firefox, Safari and Edge
  • The screen reader reads and flows through the elements as expected.
  • There are no new errors in the browser console coming from this PR.
  • When visual test is not added, it renders correctly on different browsers and mobile viewports (Safari, Firefox, small mobile viewport, tablet)
  • The Playground feature is working as expected

Before:

After:

Who should review this PR:

How to test:

@baburay23 baburay23 added the ready for review Please assist in getting this reviewed label Sep 8, 2022
@baburay23 baburay23 merged commit 102c70c into main Sep 8, 2022
@baburay23 baburay23 deleted the chore/PPDSC-2280-privacy-policy-link-fix branch September 8, 2022 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review Please assist in getting this reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants