-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
BUGFIX: Fix inconsistencies in document tree with node tree presets #3822
Conversation
The drop targets used to have `visibility: hidden` set via CSS. Testcafé considers them absent, which is semantically correct. This commit uses a different CSS tactic do make the drop targets invisible, but "physically" present.
For this, the E2E test distribution now exposes two endpoints: - /test/write-additional-settings - /test/remove-additional-settings An E2E test can thus via `fetch` add settings to the current setup and remove the altered settings on cleanup. This became necessary, because the tests for the node tree preset feature require explicit settings to configure node tree presets. By default, node tree presets are inactive.
a88b9fb
to
9f3e833
Compare
Every singular node operation can be expressed as a "multiple nodes" operation. Redundancy in this area has lead to bugs.
…t do not match filter
You are awesome! Also love the part with the deprecation of the singular operations! |
Wow ❤️ What is going on :D Thanks i guess :D The tests will probably allow us to reimplement this feature for Neos 9 then as it seems useful after all: #3702 (currently its broken in 9.0 - as its an Neos Ui attached concept where were intercept link clicks ant attach query params) Also nice idea with the post routes for adjusting settings. I run into the same problem and decided to use different Flow sub context that i dynamically set via header and special magic in |
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 tried it out locally and works like a charm 👍
…ectBox This allows us to target every part of a select box specifically in E2E tests.
81e8d23
to
9e83031
Compare
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.
Looks good to me! Thank you so much for these fixes 🌷
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.
Great work as usual, thanks!
I can't really judge the JS parts, but I can confirm that this fixes some nasty bugs with a Neos 8.3 installation of mine and I could not (yet *g) observe any unwanted side effects
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.
Works as advertised and change looks sensible, awesome ❤️
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.
forgot to publish my review ;) But looks all good by reading though ^^
* @return array | ||
*/ | ||
public function renderNodesWithParents(array $nodes, ControllerContext $controllerContext): array | ||
public function renderNodesWithParents(array $nodes, ControllerContext $controllerContext, ?string $nodeTypeFilter = null): array | ||
{ | ||
// For search operation we want to include all nodes, not respecting the "baseNodeType" setting |
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.
that statement is not correct anymore i guess ;)
switch (action.type) { | ||
case system.INIT: { | ||
const contextPath = action.payload.cr.nodes.documentNode || action.payload.cr.nodes.siteNode; | ||
draft.focused = contextPath ? [contextPath] : []; | ||
break; | ||
} | ||
case nodes.ADD: |
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.
thanks for providing tests for this new logic ❤️
fixes: #3816, #2583, #2800
Add settings during E2E test run
This PR indroduces a mechanism to add additional settings during E2E test run.
This is necessary, because the newly introduced
nodeTreePresets.e2e.js
test fixture requires node tree presets to be configured. Node tree presets are not active by default, so we need to set up additional settings for this test fixture specifically.Read details on how this is achieved
The mechanism is achieved by providing two public endpoints in the test distribution:
POST /test/write-additional-settings
This endpoint accepts a JSON-encoded object as a body. It's top-most key must be
settings
. Any value passed tosettings
will be YAML-serialised and written toFLOW_PATH_CONFIGURATION/Settings.Additional.yaml
.This endpoint then also registers a signal handler for
bootstrapShuttingDown
, in which it will flush all caches, so that the additional configuration will be used upon the next request.EXAMPLE
This will write the following
Settings.Additional.yaml
:POST /test/remove-additional-settings
This endpoint does not require any data and will remove the
FLOW_PATH_CONFIGURATION/Settings.Additional.yaml
file, if it exists.If the file was removed, this endpoint then also registers a signal handler for
bootstrapShuttingDown
, in which it will flush all caches, so that the removed configuration will no longer be used upon the next request.EXAMPLE
This will remove
Settings.Additional.yaml
, if it exists.Fix for #3816 & #2583
The Problem
The
PageTree
redux state is trackinghidden
nodes, presumably for the purpose to hide all nodes that are not part of the current search result set.This is indicated by how
hiddenContextPaths
for page tree search results are calculated:neos-ui/packages/neos-ui-sagas/src/UI/PageTree/index.js
Lines 191 to 193 in fd5c917
When node type filter and search term are cleared, the nodes that have been flagged as
hidden
during the last search, remainhidden
aftwards, because the page tree state is not properly cleaned up.The Solution
For clarity, I decided to flip the
hidden
state into avisible
state. By defaultvisible
is set tonull
, indicating that every node should be shown in the tree.When a search term or node type filter is set,
visible
will at first contain all context paths in the search result set (including intermediaries that are only ancestors of matching nodes).While
visible
is notnull
, every node that is added to the in-memory store will be added to thevisible
list as well.visible
here only means "This node is invited to the tree party". A node that is invited, may still not be shown, because its parent is collapsed. Every node that is not invited, will never be shown, no matter what other toggle state may be set.Fix for #2800 Part I
The Problem
Since #2794 all structural change operations handle an optional
baseNodeType
to account for currently set tree filters.#2794 had been introduced in October 2020. About a year before that, in December 2019, batch operations for tree nodes had been introduced via #2568. #2794 did not consider the changes made in #2568, so the
baseNodeType
isn't being sent when tree nodes are moved. This leads to the disappearance of all nodes beneath the reference parent.The logic for this would have needed to be handled in the
moveDroppedNodes.js
saga. Oddly enough, the 4 years old merge commit of #2794 shows that it wasn't present then:https://github.com/neos/neos-ui/tree/ed9e04cdcaf5774914a60d866a8589709b4704f8/packages/neos-ui-sagas/src/CR/NodeOperations
In the 5 years old merge commit for #2568,
moveDroppedNodes.js
does indeed exist:https://github.com/neos/neos-ui/tree/48233fee50c106334a949647ed3deef6d66dfa3c/packages/neos-ui-sagas/src/CR/NodeOperations
I have no explanation for this.
The Solution
I added the missing
baseNodeType
tomoveDroppedNodes.js
.Fix for #2800 Part II
The problem
Similar to #3816 & #2583, the PageTree state did not recognize when a context path changed (which is what happens, if a node gets moved "into" another one).
The solution
I modified the PageTree reducer, so it tracks the
CR.Nodes.UPDATE_PATH
action as well.Additional Changes
getForTreeWithParents
finisher of the FlowQuery APIcopy
as opposed tocopyMultiple
,move
as opposed tomoveMultiple
and so on)Remaining TODOs