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

Reinstate Breadcrumbs #2023

Merged
merged 4 commits into from
Oct 7, 2024

Conversation

rachel-lawrie
Copy link
Collaborator

@rachel-lawrie rachel-lawrie commented Sep 19, 2024

Reinstates logic for clicking breadcrumbs in mobile to serve as navigation.

Note that clicking breadcrumbs were disabled as part of #1947.

Description

Fixes #2022

  1. Adds back in onClick logic
  2. Adds logic to check if the focus has a page associated with it, or if it has children in the tree. If it has children in the tree, the folderpage with the children is returned. If it has a page, then the PolicyOutput page is returned.

Screenshots

https://www.loom.com/share/79ab325e6fa0402eb70b7bef0cff72f8?sid=cff59996-d6e2-40ad-a00e-a5e8b0c36868

Tests

Tested locally (created new policy, clicked through each policy, compared to tree to ensure no pages are missing).

Also ran test suite. 8 are failing but not due to any of these changes. I compared to the master branch and all 8 were failing there too.

Reinstates logic for clicking breadcrumbs in mobile as navigation.

Adds logic to address clicking breadcrumb for Policy Output to mirror that of Household Impact.
@rachel-lawrie rachel-lawrie changed the title Fixes #2022 Reinstate Breadcrumbs Sep 19, 2024
Everything seems to work, still need to test thoroughly and remove console.logs
@anth-volk
Copy link
Collaborator

@rachel-lawrie I believe you said this is ready for review, but if so, would you mind moving it out of draft?

@rachel-lawrie rachel-lawrie marked this pull request as ready for review September 24, 2024 17:14
@anth-volk anth-volk self-requested a review September 25, 2024 22:46
@anth-volk
Copy link
Collaborator

@rachel-lawrie I suspect the test failure was a fluke, as other PRs failed similarly around the same time as yours, except these were incredibly minor. They've also all been re-run and passed.

Copy link
Collaborator

@anth-volk anth-volk left a comment

Choose a reason for hiding this comment

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

Thanks for this, @rachel-lawrie. Just had a couple code quality requests, then this should be good to merge!

middle = (
<>
// eslint-disable-next-line no-console
console.log("focus:" + focus);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you remove this and the below console statements?

}

// This code works
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm a bit unclear as to what this commented code block is for

);
} else {
// eslint-disable-next-line no-console
console.log("no node");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you remove this console log, as well?

@anth-volk anth-volk self-requested a review October 4, 2024 17:12
Copy link
Collaborator

@anth-volk anth-volk left a comment

Choose a reason for hiding this comment

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

Thank you very much @rachel-lawrie!

@anth-volk anth-volk merged commit a213a02 into PolicyEngine:master Oct 7, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Breadcrumbs do not work for navigation on mobile
2 participants