Skip to content

Commit 4596fd3

Browse files
committed
Merge branch '6.0'
2 parents 781fd5f + 748a774 commit 4596fd3

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

Classes/Controller/ApiController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,14 @@ protected function getStyleguideObjects($sitePackageKey): array
165165

166166
$hiddenPrototypeNamePatterns = $this->configurationService->getSiteConfiguration($sitePackageKey, 'hiddenPrototypeNamePatterns');
167167
if (is_array($hiddenPrototypeNamePatterns)) {
168+
$alwaysShowPrototypes = $this->configurationService->getSiteConfiguration($sitePackageKey, 'alwaysShowPrototypes');
168169
foreach ($hiddenPrototypeNamePatterns as $pattern) {
169170
$styleguideObjects = array_filter(
170171
$styleguideObjects,
171-
function ($prototypeName) use ($pattern) {
172+
function ($prototypeName) use ($pattern, $alwaysShowPrototypes) {
173+
if (in_array($prototypeName, $alwaysShowPrototypes, true)) {
174+
return true;
175+
}
172176
return fnmatch($pattern, $prototypeName) === false;
173177
},
174178
ARRAY_FILTER_USE_KEY

Configuration/Settings.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ Sitegeist:
7070
color: '#FFF'
7171

7272
hiddenPrototypeNamePatterns: { }
73+
alwaysShowPrototypes: { }
7374

7475
preview:
7576
fusionRootPath: '/<Sitegeist.Monocle:Preview.Page>'

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,18 @@ Sitegeist:
249249
- 'Another.Vendor.Site:Prototype'
250250
```
251251

252+
Specific components can be "unhidden" even if they match one of the `hiddenPrototypeNamePatterns` patterns:
253+
254+
```YAML
255+
Sitegeist:
256+
Monocle:
257+
alwaysShowPrototypes:
258+
- 'Vendor.Site:Some.Component.ThatShouldBeShown'
259+
- 'Another.Vendor.Site:Prototype.ThatShouldBeShown'
260+
```
261+
262+
This allows for including prototypes of packages selectively.
263+
252264
### Site-specific configuration
253265

254266
All configurations can be overwritten for each selected site package.

0 commit comments

Comments
 (0)