Skip to content

Conversation

@beccadawson
Copy link
Contributor

No description provided.

shilpanice and others added 9 commits April 25, 2025 12:31
… 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
… Add siblingHasChildren as OR condition in fetchAndBuildParentAndChildTree

Co-authored-by: Dale Hudson <[email protected]>
Co-authored-by: beccadawson <[email protected]>
Co-authored-by: beccadawson <[email protected]>
Co-authored-by: Dale Hudson <[email protected]>
…licate api call. Remove debug. Add TODO around grandparent toplevel logic.
@beccadawson beccadawson changed the base branch from main to NXT-543-Info-page-Navigation May 5, 2025 20:52
Base automatically changed from NXT-543-Info-page-Navigation to main May 30, 2025 14:15
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.

4 participants