-
Notifications
You must be signed in to change notification settings - Fork 405
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
Feature: Add The Ability To Hide Viewall Links #1034
Feature: Add The Ability To Hide Viewall Links #1034
Conversation
Just a note to say I'd really love to have this. |
@sghoweri can i switch this target to |
@bmuenzenmeyer go for it! |
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.
playing catchup on this feature - it is not accessible from a patternlab-config.json
entry, correct? ony at build time from the uikit?
EDIT:
looking at that edition for the first time - adding build:uikit
is an interesting end-user customization feature! 👍
$INIT_CWD is not cross-platform safe - going to try cross-env
@@ -2,4 +2,5 @@ | |||
|
|||
module.exports = { | |||
// buildDir: __dirname + '/www/pattern-lab', | |||
noViewAll: true, // uncomment to disable displaying viewAll links in Pattern Lab |
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.
this comment doesnt make sense, as it's enabled, not commented
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.
Derp — I think I was thinking we’d want this option to be disabled by default (hence the comment) but I probably I uncommented that when I was putting together my PR screenshot 🤦♂️
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.
bump
@bmuenzenmeyer yeah customizing / extending PL is an exciting area I’m hoping to spend some time planning out / documenting / building up! At a high level, I’m thinking about 3 overall ways PL’s UI could get customized:
|
@sghoweri can you change this to use cross-env? otherwise I can try quick it'd be nice to batch this in to the release (I hope we release today) |
@bmuenzenmeyer I can check this out now - no prob |
I am going to try to get this working on Windows then. |
Also like to get this into |
trying to work through this
|
this works!?
|
I am still seeing the pattern type view all, but sub type appears gone does this seem right @sghoweri |
Hmmm |
changing noViewAll seems to have no effect for me within my codebase |
pushed https://github.com/pattern-lab/patternlab-node/tree/1034-test
|
@sghoweri game to release |
@bmuenzenmeyer I'm good with that! |
@sghoweri just checking in on this - very excited for the functionality but i want to ensure it works in both Twig and Handlebars editions before we move forward. will try again after a dev upstream merge sometime soon |
once this merge conflict is resolved, I am hoping that #1098 will immensely help iterate on this solution |
tracking this work in https://github.com/pattern-lab/patternlab-node/tree/sghoweri-feature/no-viewall-links |
i've spent a fair amount of time with this and cannot get it to work - i wonder now that we have the @sghoweri you've also expressed concern that this might not be the best approach. thoughts on making this a runtime config option? |
@bmuenzenmeyer no worries, appreciate you taking a look at this. I'm looking this over this morning (probably trying to switch to using a runtime config out of simplicity); I'll see what I can do! |
It's entirely possible I'm either doing something wrong (though I was porting the twig edition code directly) or the is a simple cross platform fix... but I haven't found it yet. Thanks for plugging away on this with me! |
… the updated (optional) noViewAll config
…ed issues with pattern keys not always matching up with the3 generated navigation / query string
@bmuenzenmeyer this should be good to go! Updated the PR description + adjusted some stuff internally to now have this be based off of the runtime config vs having to recompile the UI in order to enable / disable this. |
will give this a go later this weekend @sghoweri - thanks! |
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.
This is working 💃
Ideally, this new config item is added to all edition patternlab-config.json
files too.
When features like this are released, we should really document them. I don't think there is any patternlab.io documentation on the theme
config. I will add a story if there isn't one. @bradfrost mentioned content being a good next step.
publicPath: '/public/styleguide/', | ||
// target the UIKit installed / symlinked under node_modules | ||
buildDir: __dirname + '/node_modules/@pattern-lab/uikit-workshop/dist', | ||
// noViewAll: true, |
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.
I think this can be removed
I was wrong - we did add it here https://patternlab.io/docs/advanced-config-options.html but it could certainly be improved with our rewrite / refresh |
…links Feature: Add The Ability To Hide Viewall Links
Summary
Adds the ability to hide any viewall links that would normally show up in the Pattern Lab navigation.
Details
Updates the Webpack build config +
.patternlabrc
config to support a newnoViewAll
config option when customizing Pattern Lab's UI.Before vs After
How To Test
npm run setup
.packages/edition-twig
folder and uncomment line 5 in the example.patternlabrc
config file.npm run build:uikit
from the samepackages/edition-twig
foldernpm run serve