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

add fix for redirect #1997

Merged

Conversation

accbjt
Copy link
Contributor

@accbjt accbjt commented Mar 14, 2024

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

Description

  • 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 14, 2024 19:31
@accbjt accbjt force-pushed the fix/ASUB-8279-broken-login-redirect branch 2 times, most recently from 4650b01 to 2390be8 Compare March 20, 2024 02:16
@accbjt accbjt force-pushed the fix/ASUB-8279-broken-login-redirect branch from 2390be8 to 7fb4f1d Compare March 20, 2024 02:29
@accbjt accbjt force-pushed the fix/ASUB-8279-broken-login-redirect branch 2 times, most recently from 36c0443 to 4bd3868 Compare March 20, 2024 02:42
@accbjt accbjt force-pushed the fix/ASUB-8279-broken-login-redirect branch 3 times, most recently from f235341 to bfa7177 Compare March 20, 2024 02:53
@accbjt accbjt force-pushed the fix/ASUB-8279-broken-login-redirect branch from bfa7177 to 75cbab7 Compare March 20, 2024 03:06
@accbjt accbjt force-pushed the fix/ASUB-8279-broken-login-redirect branch from 75cbab7 to 6a6a574 Compare March 20, 2024 03:37
@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.

@vgalatro
Copy link
Contributor

Yeah storybook is currently not working. The version we're using won't run on correctly on the newer versions of node and upgrading to the latest version of Storybook is a large lift that we're still looking into.

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.

@accbjt , just one question about a configuration change, otherwise everything is looking good.

.eslintrc.js Outdated
@@ -29,6 +29,7 @@ module.exports = {
},
ecmaVersion: 2020,
sourceType: "module",
requireConfigFile: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason behind this configuration change? I'm not seeing a difference in results with the linter with or without this setting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On my computer it was giving me an error and wouldn't lint my files. Not sure why it was doing it but this is what fixed it. When I remove this line of code I get this error.

Parsing error: No Babel config file detected for /Users/tranb2/Sites/wpmedia/arc-themes-blocks/blocks/identity-block/components/login/index.jsx. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files.eslint

Copy link
Contributor

Choose a reason for hiding this comment

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

There's a babel config at the root of the project so that's strange it couldn't be found. Could you revert this line and push it back up (in both PRs please)? After that I can approve and merge both.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vgalatro Yeah, I was thinking the same thing. Maybe it is a VSCode issue. I updated both PR's. Thanks

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.

LGTM!

@vgalatro vgalatro merged commit 2019c2b into arc-themes-release-version-2.3.0 Mar 20, 2024
3 of 5 checks passed
@vgalatro vgalatro deleted the fix/ASUB-8279-broken-login-redirect branch March 20, 2024 17:10
accbjt added a commit that referenced this pull request Mar 20, 2024
* add fix for redirect

* add regwall fix more mobile

* update PB preview query param

* remove requireConfigFile config
accbjt added a commit that referenced this pull request Mar 20, 2024
* add fix for redirect

* add regwall fix more mobile

* update PB preview query param

* remove requireConfigFile config
accbjt added a commit that referenced this pull request Mar 20, 2024
* add fix for redirect

* add regwall fix more mobile

* update PB preview query param

* remove requireConfigFile config
vgalatro pushed a commit that referenced this pull request Mar 21, 2024
* add fix for redirect

* add regwall fix more mobile

* update PB preview query param

* remove requireConfigFile config
vgalatro pushed a commit that referenced this pull request Mar 21, 2024
* add fix for redirect

* add regwall fix more mobile

* update PB preview query param

* remove requireConfigFile config
vgalatro pushed a commit that referenced this pull request Mar 21, 2024
add fix for redirect (#1997)

* add fix for redirect

* add regwall fix more mobile

* update PB preview query param

* remove requireConfigFile config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants