Skip to content

Folder nesting causes odd menu behavior and missing items from 'All' list #1018

@coreylafferty

Description

@coreylafferty

I am using Pattern Lab Node v0.0.3 / Pattern Lab Node Core v3.0.1 on Windows, with Node v10.15.1, using the Twig Edition.

I believe most of the issues referenced here are tweaks/improvements to the work @JosefBredereck did to add subfolder support in #992.

Expected Behavior

When nesting folders two deep (e.g., 02-organisms/section/) the resulting menu and 'ALL' list of components should behave similarly to how the PHP version of Pattern Lab does.

  • All components should appear on the 'ALL' page.
  • Menu items should be arranged alphabetically whether they have children or not.
  • View All links should point to a page that lists all items in that parent item.
  • View All links should appear at the bottom of the list of child items.
  • Items in folders should always be properly nested in that folder's parent menu item.
Actual Behavior
  • Items with names that match their folder name (e.g., /02-organisms/test/test.twig) do not show up in the 'ALL' list page of components. While they can be accessed directly through the menu, they should be visible on the main 'ALL' page.
  • Folders with nested child items show up in the menu before any single, non-nested components instead of showing them all alphabetically.
  • The 'View All' links added to nested folders do not point to a functional page. (Note: appears to be being worked on in [uikit-workshop] View All for sub types is broken #890 )
  • The 'View All' links appear at the top of the child list instead of the end.
  • The 'View All' link added to the primary menu list (e.g., /Templates/View All) appears after the nested folders but before the single, non-folder items. It should appear at the bottom of the menu, after all other menu items.
  • If a second level folder contains a file with the same name, the parent/child relationship is not reflected in the menu. For example, having this folder/file combination:
/02-organisms/test/test.twig
/02-organisms/test/test--large.twig

will output a menu with items like this:

- Organisms
-- Test
---- Test Large
-- Test

Renaming the folder so it does NOT match a file within it properly nests the menu items. For example, renaming the folder from 'test' to 'tests':

/02-organisms/tests/test.twig
/02-organisms/tests/test--large.twig

will output a menu with items like this:

- Organisms
-- Tests
---- Test
---- Test Large
Steps to Reproduce
  • Install the Node/Twig version of Pattern Lab with the starterkit-twig-demo starterkit (altho any Twig starter kit will show the same issues). Run 'npm run start'.
  • Compare menu items to file structure.
  • Try adding test.twig and test--large.twig using the folder names listed above and restart the 'start' task.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions