-
Notifications
You must be signed in to change notification settings - Fork 135
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
Migrates pages module #1412
Migrates pages module #1412
Conversation
8f2c5b4
to
e437a2b
Compare
e437a2b
to
2fbe5a8
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.
Wow, this is a lot of work done!
I've added some comments on appearance of pages from /donate
till /foundation
. To be continued.
I've also noticed one or two minor issues with Board
component, however that's unrelated to this PR.
Also the client tests are failing. I suspect it's related to adding $broadcast
to Board
component. Maybe this function will need mocking in tests. That's a guess. I haven't really investigated it.
Thanks a lot for this valuable input @mrkvon ! I was looking out for all these things but missed this bunch in the end. How should I proceed? Make the changes and force push the branch again? The only thing I don't know how to solve is to make the tests work and what to do about the $broadcast in the Boards component you suggested. |
Yes, when you push changes, this pull request will be updated. You probably don't need
I'll have a look when I continue the review (evening or tomorrow) and see if i can help. There are many changes in this PR, so it will take me a while to review. Or maybe somebody else will jump in so we have it reviewed quicker. 🙂 |
Also, notice the changes in #1405 to fix conflicts with master. ( |
2fbe5a8
to
b3ef25c
Compare
Indeed, if you just want to make the test work, then you can add this to the test file: jest.mock('@/modules/core/client/services/angular-compat'); If you also want to assert that the import { $broadcast } from '@/modules/core/client/services/angular-compat';
jest.mock('@/modules/core/client/services/angular-compat');
// then, later inside a test block
expect($broadcast).toHaveBeenCalledWith({ whatever: 'it gets', called: 'with' }); See
eventTrack angular-compat function.
|
Something seems a bit up with the photo credits:
So, it's something around when the pages change after first load does not work. Maybe try tracing through what happens and what is fired (I use One thing I did notice is that the [1] quick recap of useEffect(() => {
}, []) // <--- this array is the "dependencies" (controlling when it will re-run the block)
// so if we use a prop
function MyComponent({ someProp }) {
useEffect(() => {
// does something with the prop...
fetchThings(someProp);
}, [someProp]); // <--- declaring the dependency on "someProp"
} (I think https://reactjs.org/docs/hooks-overview.html is a nice overview of how hooks work, not currently loading for me though... 520 error...) |
Great work! This is a significant effort, and nearly ready I think! I think a lot of learning went into this. I check every page and didn't see anything wrong (apart from photo credits behaviour described above). I didn't click all the links but assume they are fine. I'm not quite sure what the |
It's linked from mobile header, 3 lines link: https://user-images.githubusercontent.com/87168/79903592-04a38f00-841c-11ea-9794-6b807997cf15.jpg I think it'll need to be changed to "slide out" menu but it's useful to turn it into react already now. |
Co-authored-by: Nick Sellen <[email protected]>
b3ef25c
to
21be47d
Compare
As it only checks object identity, when we pass in a new array each time (even with the same values) it considers that changed, but we only want it changes if the values _in_ the array change. Achieved with `.join(' ')`ing the values.
Previously was subscribing in the useEffect unsubscribe hook. I split it into two useEffect hooks as each call to `$on` returns it's own unsubscribe function that we can pass directly to the `useEffect` hook.
Using ++/-- it sometimes got it wrong (as it also got set to 0 on page change), and was at 0 even when there was a photo credit. This meant the photo credits were hidden when they shouldn't be.
After chatting with @edvardmk we decided it might be better if I fixed up the remaining issues, they were:
The commits themselves have reasonable detailed messages, and I also removed a few unneeded comments/TODO/files... Also, maybe out of interest my main "debugging" method to work this out, was just loads of dumb console.log calls in various places to see what is happening... |
Proposed Changes
creates react components for pages:
-- /donate
-- /donate/help
-- /donate/policy
-- /faq
-- /faq/foundation
-- /faq/technlogy
-- /faq/tribes
-- /foundation
-- /guide
-- /home
-- /media
-- /navigation
-- /privacy
-- /rules
-- /team
angular views for these pages
changes pages.client.routes.js
Testing Instructions
Fixes #