-
Notifications
You must be signed in to change notification settings - Fork 405
fix(1049): Treat folders like patterns only if they're subfolders of … #1054
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
fix(1049): Treat folders like patterns only if they're subfolders of … #1054
Conversation
|
It seems the pattern states are missing from the nav with this change. |
|
Hey @kryp71c, |
|
@kmonahan I think they mean the state is missing. For example, if you create a file named dog.md next to your dog.mustache or dog.twig file, and add the following contents: the 'inreview' yellow dot doesn't show next to the item in the menu. I suspect that's due to the removal of the 'info' variable being passed in. |
|
Ah, got it. Thanks! WIll investigate and update my branch. |
|
Dug into this one and I think what actually needs to be fixed here is what's being done in PR #1058 . I tested locally with a pattern called Dog with a state of 'inreview' and a pattern called Dog Special with a state of 'inprogress'. When I organized the patterns in the Likewise, when I organized the patterns in the Where I don't see the indicators is when I use the Rather than have the status indicator appear in the nav next to the pattern subtype name if it matches the pattern, my desired behavior here would be for the pattern subtype to have a submenu listing the pattern(s) and their status indicators. When I merged #1058 in locally, that's exactly what I get: So rather than make further changes here, I think it makes more sense to leave this PR as-is and handle the directory flattening issue in 1058, unless there are other state display issues beyond that one. |
|
@sghoweri @bmuenzenmeyer now that #1058 is accepted, I believe this PR should be good to go. |
|
i'll need some time to re-read through this |
sghoweri
left a comment
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.
Hey thanks so much for this @kmonahan!
I've tested this out locally with a few different combos of nested folders / patterns (including adding State to a few of them to double-check that 😉) and can verify that this all seems to be working as expected (and as an added bonus, now seems to match the overall expected behavior of Pattern Lab PHP as well). 🎉
Nice work!
# Conflicts: # packages/uikit-workshop/dist/styleguide/js/patternlab-viewer.js
…ry-naming fix(1049): Treat folders like patterns only if they're subfolders of …




…pattern groupings
Closes #1049
Summary of changes:
Limits the separated pattern-folder support to patterns that are nested at least two levels deep. This seems to be how the PHP version works and supports both of the following use cases:
[patternType]/[patternSubType]/[pattern]/[pattern].hbs(which appears to be the original intent of #992 and[patternType]/[patternSubType]/[pattern].hbs, where the pattern and patternSubType are the same (as in the use case in #1049, where the patternSubTypebuttonmight containbutton.hbsandbutton--variant.hbs.