Skip to content

Commit

Permalink
MERGE: Merge branch '8.1' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kdambekalns committed Sep 12, 2022
2 parents 38a2d39 + 96478d1 commit a65cfc4
Show file tree
Hide file tree
Showing 9 changed files with 193 additions and 6 deletions.
8 changes: 3 additions & 5 deletions Neos.Fusion/Classes/Core/Runtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -773,10 +773,8 @@ protected function evaluateApplyValues($configurationWithEventualProperties, $fu
$singleApplyPath .= '/expression';
}
$singleApplyValues = $this->evaluate($singleApplyPath, null, self::BEHAVIOR_EXCEPTION);
if ($this->getLastEvaluationStatus() !== static::EVALUATION_SKIPPED) {
if ($singleApplyValues === null) {
continue;
} elseif (is_array($singleApplyValues)) {
if ($singleApplyValues !== null || $this->getLastEvaluationStatus() !== static::EVALUATION_SKIPPED) {
if (is_array($singleApplyValues)) {
foreach ($singleApplyValues as $key => $value) {
// skip keys which start with __, as they are purely internal.
if ($key[0] === '_' && $key[1] === '_' && in_array($key, Parser::$reservedParseTreeKeys, true)) {
Expand Down Expand Up @@ -837,7 +835,7 @@ protected function evaluateProcessors($valueToProcess, $configurationWithEventua

$this->pushContext('value', $valueToProcess);
$result = $this->evaluate($processorPath, $contextObject, self::BEHAVIOR_EXCEPTION);
if ($this->getLastEvaluationStatus() !== static::EVALUATION_SKIPPED) {
if ($result !== null || $this->getLastEvaluationStatus() !== static::EVALUATION_SKIPPED) {
$valueToProcess = $result;
}
$this->popContext();
Expand Down
10 changes: 10 additions & 0 deletions Neos.Fusion/Tests/Functional/FusionObjects/ApplyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,14 @@ public function rendererWithNestedPropsInApply()
$view->setFusionPath('apply/renderWithNestedProps');
self::assertEquals('::example::', $view->render());
}

/**
* @test
*/
public function evaluateLazyPropsWithLastOneSkipped()
{
$view = $this->buildView();
$view->setFusionPath('apply/evaluateLazyPropsWithLastOneSkipped');
self::assertSame(['lazyPropValue' => 'foo'], $view->render());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,15 @@ prototype(Neos.Fusion:TestNestedPropsB) < prototype(Neos.Fusion:Component) {
item_2 = '::'
}
}

// https://github.com/neos/neos-development-collection/issues/3469
apply.evaluateLazyPropsWithLastOneSkipped = Neos.Fusion:Component {
lazyPropValue = "foo"

lazyPropSkipped = "skip"
lazyPropSkipped.@if.1 = false

renderer = Neos.Fusion:DataStructure {
@apply.forceEvaluatedProps = ${Array.filter(props, prop => prop != null)}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,16 @@ processors.newSyntax.usingThisInProcessor = Neos.Fusion:Value {
@process.1 = ${value + this.append}
append = " append"
}

// https://github.com/neos/neos-development-collection/issues/3469
processors.newSyntax.skippedLazyPropsInProcessor = Neos.Fusion:Component {
lazyPropValue = "foo"

lazyPropSkipped = "skip"
lazyPropSkipped.@if.1 = false

renderer = Neos.Fusion:DataStructure {
buz = "bar"
@process.combine = ${Array.concat(value, Array.filter(props, prop => prop != null))}
}
}
10 changes: 10 additions & 0 deletions Neos.Fusion/Tests/Functional/FusionObjects/ProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,14 @@ public function usingThisInProcessorWorks()
{
$this->assertFusionPath('my value append', 'processors/newSyntax/usingThisInProcessor');
}

/**
* @test
*/
public function skippedLazyPropsInProcessor()
{
$view = $this->buildView();
$view->setFusionPath('processors/newSyntax/skippedLazyPropsInProcessor');
self::assertSame(['buz' => 'bar', 'lazyPropValue' => 'foo'], $view->render());
}
}
2 changes: 1 addition & 1 deletion Neos.Neos/Classes/Domain/Service/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class UserService
* @return QueryResultInterface The users
* @api
*/
public function getUsers(string $sortBy = 'accountidentifier', string $sortDirection = QueryInterface::ORDER_ASCENDING): QueryResultInterface
public function getUsers(string $sortBy = 'accounts.accountIdentifier', string $sortDirection = QueryInterface::ORDER_ASCENDING): QueryResultInterface
{
return $this->userRepository->findAllOrdered($sortBy, $sortDirection);
}
Expand Down
144 changes: 144 additions & 0 deletions Neos.Neos/Documentation/Appendixes/ReleaseNotes/810.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
========
Neos 8.1
========

This release of Neos comes with some great new features, bugfixes and a lot of modernisation of the existing code base.

As usual, we worked hard to keep this release as backwards compatible as possible but, since it's a major release, some of the changes might require manual
adjustments. So please make sure to carefully read the upgrade instructions below.


************
New Features
************

FEATURE: Refresh the rawContentMode
-----------------------------------

The raw content mode is implemented freshly and now only relies on the nodetype-configuration for rendering and not requiring a fusion integration. By default the raw mode will render all inline editable properties, previews of Images and all childnodes. This allows content first workflows with Neos or headless applications.

!`Home_-_Neos_Demo_Site <https://user-images.githubusercontent.com/1309380/175993575-986fed63-9c9d-4a06-ac95-d51296b96530.png>`_

It is possible to provide a special raw-mode rendering for nodetype by creating a prototype with the name of the nodetype + '.RawContentMode' as shown in the example below.

```
prototype(Neos.Demo:Content.Columns.Two.RawContentMode) < prototype(Neos.Neos:ContentComponent) {
renderer = afx`
<div style="display:grid; grid-template-columns: 1fr 1fr; grid-gap: 16px;">
<div><Neos.Neos:RawContent.NodeChildren @context.node={q(node).children('column0').get(0)} /></div>
<div><Neos.Neos:RawContent.NodeChildren @context.node={q(node).children('column1').get(0)} /></div>
</div>
`
}
```



Related issue: `#3705 <https://github.com/neos/neos-development-collection/issues/3705>`_

FEATURE: Introduce `Neos.Fusion:ActionUri` as replacement for `Neos.Fusion:UriBuilder`
--------------------------------------------------------------------------------------

The name ``Neos.Fusion:UriBuilder`` stands out from other fusion prototypes because it describes what the prototype does
instead of what will be the result. This contradicts the declarative nature of fusion. In addition it is not possible render links from a subrequests to other main-requests without manipulating the controllerContext. A common case for that is fusion-backend modules that want to render links to the content or other modules.

This change adds the prototype ``Neos.Fusion:ActionUri`` as a 1:1 replacement that implements the same api but allows to configure the ``request`` the uri is to be built from. This allows to create links from subrequests into other contexts.

``Neos.Fusion:ActionUri``:
- ``request``: (ActionRequest, defaults to the the current ``request``) The action request the uri is built from.
- ... all other attributes equal ``Neos.Fusion:UriBuilder``

Examples:

```
uri = Neos.Fusion:ActionUri {
package = 'My.Package'
controller = 'Registration'
action = 'new'
}
```

This prototype allows to link between different backend modules like the content-module

```
cotentModuleUri = Neos.Fusion:ActionUri {
request = ${request.mainRequest}
package="Neos.Neos.Ui"
controller="Backend"
action = 'index'
arguments.node = ${documentNode}
}
```
or the sites-module which uses a subrequest of the ``Backend\\\Module`` controller.
```
siteModuleUri = Neos.Fusion:ActionUri {
request = ${request.mainRequest}
action = "index"
package = "Neos.Neos"
controller = "Backend\\\Module"
arguments {
module = 'administration/sites'
moduleArguments {
@action = 'edit'
site = ${site}
}
}
}
```

In addition:

1. The prototype ``Neos.Fusion:Link.Action`` is adjusted to use ``Neos.Fusion:ActionUri`` instead of ``Neos.Fusion:UriBuilder`` for the ``href`` property.
2. Documentation is added for ``Neos.Fusion:Link.Action`` and ``Neos.Fusion:Link.Resource``

**Review instructions**

The change adds a new implementation instead of modifying or extending the UriBuilderImplementation to avoid breakiness as the ``UriBuilder`` uses the UriBuilder from the controllerContext while ``ActionUri`` creates a new UriBuilder.


FEATURE: Implement choice to sort properties for array objects
--------------------------------------------------------------

The new meta property ``@sortProperties`` can now be used to define
if properties should adhere to the ``@sorting`` meta and general
order of definition or if that is irrelevant.

Sorting itself is time consuming, and while that does not matter
for a single sort, a bigger site might have so many fusion objects
to render that the sorting can have massive influence on the render
performance. Therefore it's advisable to disable it whenever possible.

Specifically ``Neos.Fusion:Component`` as well as attributes in
``Neos.Fusion:Tag`` are now unsorted. Also http headers are unsorted.



Related issue: `#3792 <https://github.com/neos/neos-development-collection/issues/3792>`_

FEATURE: Display the rawContent-mode in the backend when neither documentType nor `/page` can be rendered
---------------------------------------------------------------------------------------------------------

The Neos backend will fallback to the RawContent mode as last resort if no other document rendering is possible. In the frontend a last try to render the via the ``documentType`` is done to create at least helpful error message that encourages good practices.

To implement this the ``path`` option is added to the ``Neos.Fusion:CanRender`` prototype to check wether the ``/page`` is available.

The whole feature is a building block to eventually allow content first workflows where no fusion rendering gas to be defined to edit content.


FEATURE: allow sorting in user management backend module
--------------------------------------------------------

If you go to the User Management Backend Module: Administration -> User Management, it's now possible to sort by the Name, The Accounts, and the last login by clicking on the specific header.

!`demo <https://user-images.githubusercontent.com/39345336/166480201-c1c43309-0c9d-453f-9722-aca812809b12.gif>`_

********************
Upgrade Instructions
********************

See https://docs.neos.io/cms/references/upgrade-instructions/upgrade-instructions-8-0-8-1

.. note::

Additionally all changes in Flow 8.1 apply, see the release notes to further information.
See https://flowframework.readthedocs.org/en/8.1/TheDefinitiveGuide/PartV/ReleaseNotes/810.html
Binary file modified Neos.Neos/Resources/Public/Images/Login/Wallpaper.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Neos.Neos/Resources/Public/Images/Login/Wallpaper.webp
Binary file not shown.

0 comments on commit a65cfc4

Please sign in to comment.