-
Notifications
You must be signed in to change notification settings - Fork 30
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
Replace url-parse with URL #3671
Conversation
31ec985
to
180ec50
Compare
269ca13
to
25603d9
Compare
packages/app-content-pages/src/shared/components/ZooHeaderWrapper/ZooHeaderWrapperContainer.js
Outdated
Show resolved
Hide resolved
04e1a03
to
bea02ba
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.
Code changes look good, but when I run https://local.zooniverse.org:3000/projects/brooke/i-fancy-cats locally (on Chrome) it renders "window is not defined" and there are a few Uncaught Errors, the first of which is Uncaught Error: Target container is not a DOM element.
.
This Sentry issue is me, related to error noted. |
bea02ba
to
6dcf409
Compare
I’ll stage this to kubernetes so that we can take a look. I assume the page just crashes in Node? |
Oh, I see the error in the diff. |
return new Url(asPath, true) | ||
getUrlObject() { | ||
const isBrowser = typeof window !== 'undefined' | ||
if (isBrowser) { |
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.
These changes also need to be added to the project app.
Ok, this branch is deployed here (with the error): I'm going to push a change to the |
6dcf409
to
13a096f
Compare
Re-deployed to |
13a096f
to
b12770c
Compare
@mcbouslog I'd made changes to the auth modal in the content pages app but not copied those same changes to the project app. At the moment, the Zooniverse page header has to be edited in both places 😒 . Everything should be working now eg. https://fe-project-branch.preview.zooniverse.org/projects/marshexplorer/marsh-explorer |
I'm also not sure why |
Replace the `url-parse` package with the native URL interface, which is supported in Node and in browsers.
b12770c
to
a440357
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.
Looks good! Tested locally, tested on https://fe-project-branch.preview.zooniverse.org/projects/marshexplorer/marsh-explorer, ran app-content locally and confirmed expected sign in and register modals appear 👍 .
Replace the
url-parse
package with the native URL interface, which is supported in Node and in browsers. Using the native interface should make both NextJS apps more secure.From
url-parse
's Readme:Package
app-content-pages
app-project
lib-panoptes-js
How to Review
Sign in and register should work in both NextJS apps. The project app should still load projects based on the slug in the page URL.
Checklist
PR Creator - Please cater the checklist to fit the review needed for your code changes.
PR Reviewer - Use the checklist during your review. Each point should be checkmarked or discussed before PR approval.
General
yarn panic && yarn bootstrap
ordocker-compose up --build
and FEM works as expectedGeneral UX
Example Staging Project: i-fancy-cats
Refactoring