Skip to content

Commit

Permalink
MERGE: Merge branch '8.1' into 8.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	Neos.Fusion/Classes/Core/ObjectTreeParser/FilePatternResolver.php
  • Loading branch information
kdambekalns committed Jul 17, 2023
2 parents 6250458 + b5b6685 commit 47863d7
Show file tree
Hide file tree
Showing 14 changed files with 59 additions and 23 deletions.
18 changes: 13 additions & 5 deletions Neos.Fusion/Classes/Core/ObjectTreeParser/FilePatternResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/

use Neos\Fusion;
use Neos\Utility\Files;

/**
* Resolve files after a pattern.
Expand Down Expand Up @@ -56,13 +57,17 @@ class FilePatternResolver
* @return array|string[]
* @throws Fusion\Exception
*/
public static function resolveFilesByPattern(string $filePattern, ?string $filePathForRelativeResolves = null, string $defaultFileEndForUnspecificGlobbing = '.fusion'): array
public static function resolveFilesByPattern(string $filePattern, ?string $filePathForRelativeResolves, string $defaultFileEndForUnspecificGlobbing): array
{
$filePattern = trim($filePattern);
if ($filePattern === '') {
throw new Fusion\Exception("cannot resolve empty pattern: '$filePattern'", 1636144288);
}
if ($filePattern[0] === '/') {
if (str_contains($filePattern, '\\')) {
throw new Fusion\Exception("cannot resolve non-unix style pattern: '$filePattern'", 1688112067799);
}
$isAbsoluteWindowsPath = preg_match('`^[a-zA-Z]:/[^/]`', $filePattern) === 1;
if ($filePattern[0] === '/' || $isAbsoluteWindowsPath) {
throw new Fusion\Exception("cannot resolve absolute pattern: '$filePattern'", 1636144292);
}
if (self::isPatternStreamWrapper($filePattern) === false) {
Expand Down Expand Up @@ -91,21 +96,24 @@ protected static function resolveRelativePath(string $filePattern, ?string $file
if ($filePathForRelativeResolves === null) {
throw new Fusion\Exception('Relative file resolves are only possible with the argument $filePathForRelativeResolves passed.', 1636144731);
}
return dirname($filePathForRelativeResolves) . '/' . $filePattern;
return Files::concatenatePaths([dirname($filePathForRelativeResolves), $filePattern]);
}

protected static function parseGlobPatternAndResolveFiles(string $filePattern, string $defaultFileNameEnd): array
{
$fileIteratorCreator = match (1) {
// We use the flag SKIP_DOTS, as it might not be allowed to access `..` and we only are interested in files
// We use the flag UNIX_PATHS, so that stream wrapper paths are always valid on windows https://github.com/neos/neos-development-collection/issues/4358

// Match recursive wildcard globbing '<base>/**/*<end>?'
preg_match(self::RECURSIVE_GLOB_PATTERN, $filePattern, $matches) => static function (string $dir): \Iterator {
$recursiveDirectoryIterator = new \RecursiveDirectoryIterator($dir, \FilesystemIterator::SKIP_DOTS);
$recursiveDirectoryIterator = new \RecursiveDirectoryIterator($dir, \FilesystemIterator::SKIP_DOTS|\FilesystemIterator::UNIX_PATHS);
return new \RecursiveIteratorIterator($recursiveDirectoryIterator);
},

// Match simple wildcard globbing '<base>/*<end>?'
preg_match(self::SIMPLE_GLOB_PATTERN, $filePattern, $matches) => static function (string $dir): \Iterator {
return new \FilesystemIterator($dir, \FilesystemIterator::SKIP_DOTS);
return new \FilesystemIterator($dir, \FilesystemIterator::SKIP_DOTS|\FilesystemIterator::UNIX_PATHS);
},

default => throw new Fusion\Exception("The include glob pattern '$filePattern' is invalid. Only globbing with /**/* or /* is supported.", 1636144713),
Expand Down
10 changes: 5 additions & 5 deletions Neos.Neos/Resources/Private/Schema/NodeTypes.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ additionalProperties:

'group': { type: ['string', 'null'], description: 'Identifier of the inspector group in which this property should be edited. If not set, will not appear in inspector at all.' }

'position': { type: ['integer', 'null'], description: 'Position inside the inspector group, small numbers are sorted on top' }
'position': { type: ['string', 'integer', 'null'], description: 'Position inside the inspector group, small numbers are sorted on top' }

'editor': { type: ['string', 'null'], description: 'Name of the JavaScript Editor Class which is instanciated to edit this element in the inspector.' }

Expand Down Expand Up @@ -107,7 +107,7 @@ additionalProperties:

'group': { type: string, description: "Name of the group this content element is grouped into for the 'New Content Element' dialog." }

'position': { type: integer, description: 'Position of the node type in the insert new panels' }
'position': { type: ['string', 'integer', 'null'], description: 'Position of the node type in the insert new panels' }

'inspector':
type: dictionary
Expand All @@ -127,7 +127,7 @@ additionalProperties:

'icon': { type: string, description: "CSS Class for displaying an icon for each tab." }

'position': { type: integer, description: 'Position of the inspector tab, small numbers are sorted on left' }
'position': { type: ['string', 'integer', 'null'], description: 'Position of the inspector tab, small numbers are sorted on left' }

'groups':
type: dictionary
Expand All @@ -142,7 +142,7 @@ additionalProperties:

'tab': { type: string, description: "Reference to a tab identifier." }

'position': { type: integer, description: 'Position of the inspector group, small numbers are sorted on top' }
'position': { type: ['string', 'integer', 'null'], description: 'Position of the inspector group, small numbers are sorted on top' }

'collapsed': { type: boolean, description: 'If true, the group in the inspector panel is collapsed by default.' }

Expand All @@ -165,7 +165,7 @@ additionalProperties:

'viewOptions': { type: dictionary, description: "Options for the view" }

'position': { type: integer, description: 'Position of the view, small numbers are sorted on top' }
'position': { type: ['string', 'integer', 'null'], description: 'Position of the view, small numbers are sorted on top' }

'creationDialog':
type: dictionary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,19 @@
</td>
<td class="neos-action">
<f:if condition="{canPublishToBaseWorkspace}">
<button form="postHelper" formaction="{f:uri.action(action: 'publishNode', arguments: {node: change.node.contextPath, selectedWorkspace: selectedWorkspace})}" type="submit" class="neos-button neos-button-success neos-pull-right" title="{neos:backend.translate(id: 'publish', source: 'Main', package: 'Neos.Neos')}" data-neos-toggle="tooltip">
<i class="fas fa-check icon-white"></i>
</button>
<f:if condition="{document.isNew}">
<f:then>
<div class="neos-button neos-disabled neos-button-primary neos-pull-right"
title="{neos:backend.translate(id: 'cantPublishSingleNodeInNewPage', source: 'Main', package: 'Neos.Neos')}">
<i class="fas fa-check icon-white"></i>
</div>
</f:then>
<f:else>
<button form="postHelper" formaction="{f:uri.action(action: 'publishNode', arguments: {node: change.node.contextPath, selectedWorkspace: selectedWorkspace})}" type="submit" class="neos-button neos-button-primary neos-pull-right" title="{neos:backend.translate(id: 'publish', source: 'Main', package: 'Neos.Neos')}" data-neos-toggle="tooltip">
<i class="fas fa-check icon-white"></i>
</button>
</f:else>
</f:if>
</f:if>
<button form="postHelper" formaction="{f:uri.action(action: 'discardNode', arguments: {node: change.node.contextPath, selectedWorkspace: selectedWorkspace})}" type="submit" class="neos-button neos-button-danger neos-pull-right" title="{neos:backend.translate(id: 'discard', source: 'Main', package: 'Neos.Neos')}" data-neos-toggle="tooltip" data-placement="bottom">
<i class="fas fa-trash-alt icon-white"></i>
Expand Down
3 changes: 3 additions & 0 deletions Neos.Neos/Resources/Private/Translations/en/Main.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@
<trans-unit id="cantPublishBecauseTargetWorkspaceIsReadOnly" xml:space="preserve">
<source>Can't publish because the target workspace is read-only</source>
</trans-unit>
<trans-unit id="cantPublishSingleNodeInNewPage" xml:space="preserve">
<source>Can't publish a single node in a new page</source>
</trans-unit>
<trans-unit id="selectTargetWorkspace" xml:space="preserve">
<source>Select target workspace</source>
</trans-unit>
Expand Down
4 changes: 4 additions & 0 deletions Neos.Neos/Resources/Private/Translations/es/Main.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,10 @@
<source>Content Tree</source>
<target state="translated">Árbol de contenidos</target>
</trans-unit>
<trans-unit id="cantPublishSingleNodeInNewPage" xml:space="preserve">
<source>Can't publish a single node in a new page</source>
<target state="translated">No se puede publicar un solo nodo en una página nueva</target>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<body>
<trans-unit id="ui.label" xml:space="preserve">
<source>Content Collection</source>
<target state="translated">Colección de contenido</target>
<target state="translated">Recopilación de los contenidos</target>
</trans-unit>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<body>
<trans-unit id="ui.label" xml:space="preserve">
<source>Invalid node</source>
<target state="translated">Nodo inválido</target>
<target state="translated">Nodo incorrecto</target>
</trans-unit>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<body>
<trans-unit id="ui.label" xml:space="preserve">
<source>Plugin</source>
<target state="translated">Plugin</target>
<target state="translated">Complemento</target>
</trans-unit>
</body>
</file>
Expand Down
4 changes: 4 additions & 0 deletions Neos.Neos/Resources/Private/Translations/nl/Main.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,10 @@
<source>Content Tree</source>
<target state="translated">Contentboom</target>
</trans-unit>
<trans-unit id="cantPublishSingleNodeInNewPage" xml:space="preserve">
<source>Can't publish a single node in a new page</source>
<target state="translated">Niet mogelijk om een enkele node in een nieuwe pagina te publiceren</target>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<body>
<trans-unit id="ui.label" xml:space="preserve">
<source>Four column content</source>
<target state="translated">Contenido de cuatro columnas</target>
<target state="translated">El contenido en cuatro columnas</target>
</trans-unit>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ prototype(Neos.NodeTypes.ContentReferences:ContentReferences) < prototype(Neos.N
items = ${referenceNodesArray}
itemRenderer = Neos.Neos:ContentCase
itemName = 'node'

// Disable ContentElementWrapping for references itself
prototype(Neos.Neos:ContentElementWrapping) {
@if.render = false
}
// Disable InlineEditable for references itself
prototype(Neos.Neos:Editable) {
renderer.editable.condition = false
}
}
hasReferences = ${!!referenceNodesArray}
@cache {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<body>
<trans-unit id="ui.label" xml:space="preserve">
<source>Headline</source>
<target state="translated">Titular</target>
<target state="translated">Encabezado</target>
</trans-unit>
</body>
</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ public function siteCommand($packageKey, $siteName)
}

$generatorName = $this->output->select(
'What generator do you want to use?',
$selection
sprintf('What generator do you want to use? (<info>%s</info>): ', array_key_first($selection)),
$selection,
array_key_first($selection)
);

$generatorClass = $nameToClassMap[$generatorName];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ public function generateSitePackage(string $packageKey, string $siteName) : arra
'type' => 'neos-site',
"require" => [
"neos/neos" => "*"
],
"suggest" => [
"neos/seo" => "*"
]
]);

Expand Down

0 comments on commit 47863d7

Please sign in to comment.