Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions core/lib/ui_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ var ui_builder = function () {
_.forEach(styleguidePatterns.patternGroups, function (patternTypeObj, patternType) {

var p;
var typePatterns = [];
var typePatterns = [], styleguideTypePatterns = [];
var styleGuideExcludes = patternlab.config.styleGuideExcludes;

_.forOwn(patternTypeObj, function (patternSubtypes, patternSubtype) {
Expand All @@ -508,6 +508,19 @@ var ui_builder = function () {
return pat.isDocPattern;
});

//determine if we should omit this subpatterntype completely from the viewall page
var omitPatternType = styleGuideExcludes && styleGuideExcludes.length
&& _.some(styleGuideExcludes, function (exclude) {
return exclude === patternType + '/' + patternSubtype;
});
if (omitPatternType) {
if (patternlab.config.debug) {
console.log('Omitting ' + patternType + '/' + patternSubtype + ' from building a viewall page because its patternSubGroup is specified in styleguideExcludes.');
}
} else {
styleguideTypePatterns = styleguideTypePatterns.concat(subtypePatterns);
}

typePatterns = typePatterns.concat(subtypePatterns);

var viewAllHTML = buildViewAllHTML(patternlab, subtypePatterns, patternPartial);
Expand Down Expand Up @@ -544,7 +557,7 @@ var ui_builder = function () {
console.log('Omitting ' + patternType + ' from building a viewall page because its patternGroup is specified in styleguideExcludes.');
}
} else {
patterns = patterns.concat(typePatterns);
patterns = patterns.concat(styleguideTypePatterns);
}
});
return patterns;
Expand Down