-
Notifications
You must be signed in to change notification settings - Fork 2
Nxt 583 update levels in section nav #370
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
Draft
beccadawson
wants to merge
12
commits into
main
Choose a base branch
from
NXT-583-Update-levels-in-Section-Nav
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… info page template (#358) * NXT-574 Create SectionNav component using stackedNav from the design system * NXT-574 Remove unwanted and unused code from InfoPage and slug page * NXT-574 Rename variable used in StoryblokSectionNav * NXT-574 Add unit test cases for StoryblokSectionNav * NXT-574 Add a common API call to reduce code duplication. * NXT-574 Add reusable logic for parentChildTreeStructure * NXT-574 Move second iteration of building tree structure logic (if no children)to a common function * NXT-574 Remove commented code from slug * NXT-574 Fix Lint Issues * NXT-574 Lint Fixes * NXT-574 Add type to secondIteration variable * NXT-574 Add filterFunction and return Array from API calls * NXT-574 Create utils folder for all common functions * NXT-574 Add word-wrap : break word * NXT-574 make nav wider between 600 - 900px from 3 to a 4 span column size * NXT-574 Refactor the FetchLink in storyblok.ts * NXT-574 add unit tests for changes to fetchLinks defaults Co-authored-by: John Davey <[email protected]> * NXT-574 remove defaults from calls to fetchLinks Co-authored-by: John Davey <[email protected]> Co-authored-by: Shilpa Unni <[email protected]> * NXT-574 rename currentFolderLink var to avoid confusion (link object not "link" like a href!) * NXT-574 start on re-refactoring section nav tree structure code 🥴 Co-authored-by: John Davey <[email protected]> Co-authored-by: Shilpa Unni <[email protected]> * NXT-574 update code comments to clarify behaviour around parents/siblings/children * NXT-574 Fix broken render logic from yesterday. Add recursion to traverse up the tree until children are found. * NXT-574 Added word-wrap to wrap text if it is too long * NXT-574 Added comment on LN54 to discuss * Revert "NXT-574 Fix broken render logic from yesterday. Add recursion to traverse up the tree until children are found." This reverts commit cdf7198. * NXT-574 fix-up refactoring basis Co-authored-by: Shilpa Unni <[email protected]> Co-authored-by: beccadawson <[email protected]> * NXT-574 Rename section nav variables to be more understandable * NXT-547 var rename * NXT-574 variable rename * NXT-574 Remove redundanct secondIteration var * NXT-574 add comment clarifying the logic. Remove console.log * NXT-574 rename vars for clarity * NXT-574 Remove redundant code Co-authored-by: Shilpa Unni <[email protected]> Co-authored-by: beccadawson <[email protected]> * NXT-574 Refactor reUseFetchingLogic function * NXT-574 Changed prop name from "parentAndSiblingLinksElse" to "currentPageNoChildrenTree" * NXT-574 Refactor logic around fetching parent and slug page tree logic Co-authored-by: beccadawson <[email protected]> Co-authored-by: Shilpa Unni <[email protected]> * NXT-574 Moved ternary logic into filterTreeStucture. * Rename filterTreeStructure to assignChildrenToParent Co-authored-by: beccadawson <[email protected]> Co-authored-by: John Davey <[email protected]> * NXT-574 Move iteration from reUseFetchLogic to assignChildrenToParent. Refactor assignChildrenToParent to return a single array rather than an object. Adjust render logic in catchallslug to reflect changes. Co-authored-by: beccadawson <[email protected]> Co-authored-by: Shilpa Unni <[email protected]> * NXT-574 Renamed vars and added comments for clarity. Removed unused newFetch code * NXT-574 removed need for different tree var in NoChildren scenario and updated naming in Section Nav component. Removed console logs from testing prev changes * NXT-574 Updated unit test cases and also moved mockData to mockData directory Co-authored-by: John Davey <[email protected]> * NXT-574 Moved the logic to build the tree out of catchAllSlug * NXT-574 Moved buildTree to the bottom of utils file Co-authored-by: John Davey <[email protected]> Co-authored-by: beccadawson <[email protected]> * NXT-574 Add additional unit test to cover the isCurrent scenario * NXT-574 Added addition unit tests to cover toplevel current tree * NXT-574 remove remaining instances of currentPageNoChildrenTree as no longer being created by section nav component * NXT-574 lint fixes and remove commented code/add TODOs * NXT-574 Update SBLink type to reflect actual shape of data, reflect in mock data and reflect new mock data in unit tests Co-authored-by: Shilpa Unni <[email protected]> Co-authored-by: John Davey <[email protected]> * NXT-574 Create intersection type for custom link shape needed by section nav and update to use this throughout section nav code * NXT-574 refactor getCurrentFolderItems into own function and rename remaining functions for clarity * NXT-574 Update section nav nested link logic so nested UL isn't rendered when childlinks is empty * NXT-574 Lint Fixes --------- Co-authored-by: Becca Dawson <[email protected]> Co-authored-by: Shilpa Unni <[email protected]> Co-authored-by: John Davey <[email protected]>
… if none of current page's siblings have children
…d incorporating into buildTree function WIP
Co-authored-by: beccadawson <[email protected]>
… Add siblingHasChildren as OR condition in fetchAndBuildParentAndChildTree Co-authored-by: Dale Hudson <[email protected]> Co-authored-by: beccadawson <[email protected]>
…oot page always has siblings.
Co-authored-by: beccadawson <[email protected]> Co-authored-by: Dale Hudson <[email protected]>
…licate api call. Remove debug. Add TODO around grandparent toplevel logic.
…age has children and when `isRootPage` is true.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.