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

Fix/asub 8279 broken login redirect 2.1.2 #2015

Conversation

accbjt
Copy link
Contributor

@accbjt accbjt commented Mar 18, 2024

If you have not filled out the checklist below, the pr is not ready for review.

Description

This is a specific fix for Irish News but will also be added to 2.3.0 here in another PR #1997

  • This is a fix for the log in redirect. When logged in the user would not get redirected back to the page they were on.
  • This also has a fix for the RegWall button getting blocked in mobile.

Jira Ticket

Acceptance Criteria

  • Should redirect to the previous page after logging in.
  • Registration Wall should be above the fold on Safari and Chrome

Test Steps

Log in Redirect:

  • Sign up and make sure you have an account with the website. Create a sign up page if needed
  • Create a page for the login page to redirect to with a link to the log in page that you can click on.
  • Create a log in page if you do not have one.
  • Open the page for the redirect page.
  • Click on the log in link - this will redirect you to the log in page.
  • Fill out the form to log in.
  • Log in should redirect you to the redirect page you created.

RegWall button:

  • Create a page with the Paywall block
  • Add the RegWall
  • You will need to comment some code and return only the RegWall in the paywall theme block. This will allow you to see the RegWall without any logic to trigger a showing of the RegWall.
	return (
		<RegwallOffer
			actionText={registerActionText}
			actionUrl={registerActionUrl}
			displayMode={displayMode}
			headlineText={registerHeaderText}
			linkPrompt={payLinkPrompt}
			linkText={linkText}
			linkUrl={linkUrl}
			reasonPrompt={registerReasonPrompt}
			subheadlineText={registerSubHeaderText}
			className={BLOCK_CLASS_NAME}
		/>
	);
  • You will need to either open the Paywall page on a iPhone device using the IP address or you can open it in the Xcode simulator. You can only test Chrome on a mobile device.

Effect Of Changes

Before

Login Redirect:

  • Click log in from an article.
  • Log in - then it would send you to the home page and not the article you were on.

RegWall:
Screenshot 2024-03-14 at 7 28 18 PM

After

Login Redirect:

  • Should redirect you to the article page you were on after you log in.

RegWall:
Screenshot 2024-03-14 at 7 20 21 PM

IMG_60E0869E7B74-1

Dependencies or Side Effects

None

Author Checklist

The author of the PR should fill out the following sections to ensure this PR is ready for review.

  • Confirmed all the test steps a reviewer will follow above are working.
  • Confirmed there are no linter errors. Please run npm run lint to check for errors. Often, npm run lint:fix will fix those errors and warnings.
  • Ran this code locally and checked that there are not any unintended side effects. For example, that a CSS selector is scoped only to a particular block.
  • Confirmed this PR has reasonable code coverage. You can run npm run test:coverage to see your progress.
    • Confirmed this PR has unit test files
    • Ran npm run test, made sure all tests are passing
    • If the amount of work to write unit tests for this change are excessive,
      please explain why (so that we can fix it whenever it gets refactored).
  • Confirmed relevant documentation has been updated/added.

Reviewer Checklist

The reviewer of the PR should copy-paste this template into the review comments on review.

  • Linting code actions have passed.
  • Ran the code locally based on the test instructions.
    • I don’t think this is needed to be tested locally. For example, a padding style change (storybook?) or a logic change (write a test).
  • I am a member of the engine theme team so that I can approve and merge this. If you're not on the team, you won't have access to approve and merge this pr.
  • Looked to see that the new or changed code has code coverage, specifically. We want the global code coverage to keep on going up with targeted testing.

@accbjt accbjt requested a review from a team as a code owner March 18, 2024 04:38
@vgalatro vgalatro self-assigned this Mar 19, 2024
@vgalatro vgalatro added the review in progress A review is underway. Even if an approval has been submitted, wait for all reviews to be completed. label Mar 19, 2024
Copy link
Contributor

@vgalatro vgalatro left a comment

Choose a reason for hiding this comment

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

The changes look fine, but there's linting errors and a failing test that will prevent the block from being published. Please check them with npm run lint:changed-feature-branch and npm run test:changed-feature-branch.

@vgalatro vgalatro added needs changes The reviewer has requested changes from the PR author and removed review in progress A review is underway. Even if an approval has been submitted, wait for all reviews to be completed. labels Mar 19, 2024
@accbjt
Copy link
Contributor Author

accbjt commented Mar 20, 2024

@vgalatro I made the fixes for the style linting and also fix the test. Looks like the project is missing the storybook module and also the stylelint is failing on a sh issue. When I run it locally it looks fine.

const Test = (props) => {
function Test(props) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did this have to change here, but was left the same in the other PR?

Copy link
Contributor Author

@accbjt accbjt Mar 20, 2024

Choose a reason for hiding this comment

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

I had the same question but for some reason on this PR it gave me some linting errors in the test file. Not sure what changed from the 2.1.2 and 2.3.0 but it gave me this linting error and I did a lint:fix and this is what it generated.

All I did was a cherry pick so the code should be the same.

Copy link
Contributor

@vgalatro vgalatro left a comment

Choose a reason for hiding this comment

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

Ok, everything looks good now! I'll merge this after confirming with Denise since it'll be available to 2.1.2 prod right after merging and publishing.

@vgalatro vgalatro added ready to merge It's time! Merge this PR. Woo! and removed needs changes The reviewer has requested changes from the PR author labels Mar 20, 2024
@rmbrntt rmbrntt merged commit 8114894 into arc-themes-release-version-2.1.2 Mar 20, 2024
3 of 5 checks passed
@rmbrntt rmbrntt deleted the fix/ASUB-8279-broken-login-redirect-2.1.2 branch March 20, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge It's time! Merge this PR. Woo!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants