From 408bca0bd4326c85b816962fd3a4847ef5c65115 Mon Sep 17 00:00:00 2001 From: xLaura3m5 Date: Tue, 12 Mar 2024 14:47:44 +0100 Subject: [PATCH 1/6] TASK: move user menu to left drawer --- .../UserDropDown/RestoreButtonItem.js | 0 .../Drawer/UserDropDown/UserImage.js | 26 ++++++++++++ .../UserDropDown/index.js | 15 +++---- .../UserDropDown/style.module.css | 40 +++++++++++++------ packages/neos-ui/src/manifest.containers.js | 4 +- 5 files changed, 64 insertions(+), 21 deletions(-) rename packages/neos-ui/src/Containers/{PrimaryToolbar => Drawer}/UserDropDown/RestoreButtonItem.js (100%) create mode 100644 packages/neos-ui/src/Containers/Drawer/UserDropDown/UserImage.js rename packages/neos-ui/src/Containers/{PrimaryToolbar => Drawer}/UserDropDown/index.js (97%) rename packages/neos-ui/src/Containers/{PrimaryToolbar => Drawer}/UserDropDown/style.module.css (65%) diff --git a/packages/neos-ui/src/Containers/PrimaryToolbar/UserDropDown/RestoreButtonItem.js b/packages/neos-ui/src/Containers/Drawer/UserDropDown/RestoreButtonItem.js similarity index 100% rename from packages/neos-ui/src/Containers/PrimaryToolbar/UserDropDown/RestoreButtonItem.js rename to packages/neos-ui/src/Containers/Drawer/UserDropDown/RestoreButtonItem.js diff --git a/packages/neos-ui/src/Containers/Drawer/UserDropDown/UserImage.js b/packages/neos-ui/src/Containers/Drawer/UserDropDown/UserImage.js new file mode 100644 index 0000000000..70057995c6 --- /dev/null +++ b/packages/neos-ui/src/Containers/Drawer/UserDropDown/UserImage.js @@ -0,0 +1,26 @@ +import React, {PureComponent} from 'react'; +import PropTypes from 'prop-types'; +import {connect} from 'react-redux'; + +import {neos} from '@neos-project/neos-ui-decorators'; + +import style from './style.module.css'; + +@connect(state => ({ + userFirstName: state?.user?.name?.firstName, + userLastName: state?.user?.name?.lastName +})) +@neos() +export default class UserImage extends PureComponent { + static propTypes = { + userFirstName: PropTypes.string.isRequired, + impersonateStatus: PropTypes.bool.isRequired + }; + + render() { + const userInitials = this.props.userFirstName?.charAt(0) + this.props.userLastName?.charAt(0); + return ( +
{userInitials}
+ ); + } +} diff --git a/packages/neos-ui/src/Containers/PrimaryToolbar/UserDropDown/index.js b/packages/neos-ui/src/Containers/Drawer/UserDropDown/index.js similarity index 97% rename from packages/neos-ui/src/Containers/PrimaryToolbar/UserDropDown/index.js rename to packages/neos-ui/src/Containers/Drawer/UserDropDown/index.js index cac6937938..18efa136ab 100644 --- a/packages/neos-ui/src/Containers/PrimaryToolbar/UserDropDown/index.js +++ b/packages/neos-ui/src/Containers/Drawer/UserDropDown/index.js @@ -4,6 +4,7 @@ import {connect} from 'react-redux'; import {neos} from '@neos-project/neos-ui-decorators'; import {Icon, DropDown} from '@neos-project/react-ui-components'; +import UserImage from './UserImage'; import RestoreButtonItem from './RestoreButtonItem'; import I18n from '@neos-project/neos-ui-i18n'; @@ -28,10 +29,16 @@ export default class UserDropDown extends PureComponent {
- + {this.props.userName} +
  • + + +
  • @@ -41,12 +48,6 @@ export default class UserDropDown extends PureComponent {
  • -
  • - - -
  • {this.props.impersonateStatus === true ? ( ) : null} diff --git a/packages/neos-ui/src/Containers/PrimaryToolbar/UserDropDown/style.module.css b/packages/neos-ui/src/Containers/Drawer/UserDropDown/style.module.css similarity index 65% rename from packages/neos-ui/src/Containers/PrimaryToolbar/UserDropDown/style.module.css rename to packages/neos-ui/src/Containers/Drawer/UserDropDown/style.module.css index ae7b2b04a1..39da9c3603 100644 --- a/packages/neos-ui/src/Containers/PrimaryToolbar/UserDropDown/style.module.css +++ b/packages/neos-ui/src/Containers/Drawer/UserDropDown/style.module.css @@ -1,7 +1,7 @@ .wrapper { - display: inline-block; position: relative; vertical-align: top; + width: 100%; } .dropDown { position: static; @@ -12,15 +12,21 @@ position: relative; height: var(--spacing-GoldenUnit); border: 0; - background-color: var(--colors-ContrastDarker); text-align: right; + display: flex; + justify-content: flex-start; + align-items: center; + background: var(--colors-ContrastDarkest); + padding-top: 2em; + padding-bottom: 2em; - &:hover { + &:hover span { color: var(--colors-PrimaryBlue); } } .dropDown__btnIcon { - margin-right: .5em; + margin-right: 0.75em; + width: 2em !important; } .dropDown__userName { @media(max-width: 1024px) { @@ -28,15 +34,12 @@ } } .dropDown__contents { - position: absolute; min-width: 160px; - width: max-content; - right: 0px; - left: auto; padding: 2px !important; margin-top: -2px; - background: var(--colors-ContrastDarker); - box-shadow: 0 5px 5px rgba(0, 0, 0, .2); + background: var(--colors-ContrastDarkest); + position: relative; + box-shadow: none; @media(max-width: 768px) { min-width: 240px; @@ -47,7 +50,6 @@ .dropDown__item { height: var(--spacing-GoldenUnit); border-top: 1px solid var(--colors-ContrastDarker); - background: var(--colors-ContrastDarkest); &:hover { background: var(--colors-PrimaryBlue); @@ -68,5 +70,19 @@ } } .dropDown__itemIcon { - margin-right: .5em; + margin-right: 0.75em; + width: 2em !important; +} + +.user__image { + margin-right: 2em; + border-radius: 100%; + background: var(--colors-ContrastBright); + height: 32px; + width: 32px; + display: flex; + align-items: center; + justify-content: center; + align-content: center; + flex-wrap: nowrap; } diff --git a/packages/neos-ui/src/manifest.containers.js b/packages/neos-ui/src/manifest.containers.js index e6f4eb2f01..e83d59c27e 100644 --- a/packages/neos-ui/src/manifest.containers.js +++ b/packages/neos-ui/src/manifest.containers.js @@ -16,7 +16,6 @@ import SyncWorkspaceDialog from './Containers/Modals/SyncWorkspaceDialog/index'; import PrimaryToolbar from './Containers/PrimaryToolbar/index'; import DimensionSwitcher from './Containers/PrimaryToolbar/DimensionSwitcher/index'; -import UserDropDown from './Containers/PrimaryToolbar/UserDropDown/index'; import PublishDropDown from './Containers/PrimaryToolbar/PublishDropDown/index'; import WorkspaceSync from './Containers/PrimaryToolbar/WorkspaceSync/index'; import MenuToggler from './Containers/PrimaryToolbar/MenuToggler/index'; @@ -30,6 +29,7 @@ import PreviewButton from './Containers/SecondaryToolbar/PreviewButton/index'; import FullScreenButton from './Containers/SecondaryToolbar/FullScreenButton/index'; import Drawer from './Containers/Drawer/index'; +import UserDropDown from './Containers/Drawer/UserDropDown/index'; import VersionPanel from './Containers/Drawer/VersionPanel/index'; import LeftSideBar from './Containers/LeftSideBar/index'; @@ -64,7 +64,6 @@ manifest('main.containers', {}, globalRegistry => { containerRegistry.set('PrimaryToolbar/Left/Brand', Brand); containerRegistry.set('PrimaryToolbar/Right/EditPreviewDropDown', EditPreviewDropDown); containerRegistry.set('PrimaryToolbar/Right/DimensionSwitcher', DimensionSwitcher); - containerRegistry.set('PrimaryToolbar/Right/UserDropDown', UserDropDown); containerRegistry.set('PrimaryToolbar/Right/PublishDropDown', PublishDropDown); containerRegistry.set('PrimaryToolbar/Right/WorkspaceSync', WorkspaceSync); @@ -76,6 +75,7 @@ manifest('main.containers', {}, globalRegistry => { containerRegistry.set('Drawer', Drawer); containerRegistry.set('Drawer/Bottom/VersionPanel', VersionPanel); + containerRegistry.set('Drawer/Bottom/UserDropDown', UserDropDown); containerRegistry.set('LeftSideBar', LeftSideBar); containerRegistry.set('LeftSideBar/Top/PageTreeToolbar', PageTreeToolbar); From a83becd53426cea5c4c2ddbc3d5e05443ab26725 Mon Sep 17 00:00:00 2001 From: xLaura3m5 Date: Tue, 12 Mar 2024 15:15:02 +0100 Subject: [PATCH 2/6] fix lint --- .../src/Containers/Drawer/UserDropDown/style.module.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/neos-ui/src/Containers/Drawer/UserDropDown/style.module.css b/packages/neos-ui/src/Containers/Drawer/UserDropDown/style.module.css index 39da9c3603..dd35c0a91a 100644 --- a/packages/neos-ui/src/Containers/Drawer/UserDropDown/style.module.css +++ b/packages/neos-ui/src/Containers/Drawer/UserDropDown/style.module.css @@ -25,7 +25,7 @@ } } .dropDown__btnIcon { - margin-right: 0.75em; + margin-right: .75em; width: 2em !important; } .dropDown__userName { @@ -70,7 +70,7 @@ } } .dropDown__itemIcon { - margin-right: 0.75em; + margin-right: .75em; width: 2em !important; } From 7c1e7f9ed63705b6f76ca7713d9ac2da0694f21b Mon Sep 17 00:00:00 2001 From: xLaura3m5 Date: Tue, 12 Mar 2024 15:33:01 +0100 Subject: [PATCH 3/6] fix required prop UserImage --- .../neos-ui/src/Containers/Drawer/UserDropDown/UserImage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/neos-ui/src/Containers/Drawer/UserDropDown/UserImage.js b/packages/neos-ui/src/Containers/Drawer/UserDropDown/UserImage.js index 70057995c6..6ec62a546f 100644 --- a/packages/neos-ui/src/Containers/Drawer/UserDropDown/UserImage.js +++ b/packages/neos-ui/src/Containers/Drawer/UserDropDown/UserImage.js @@ -14,7 +14,7 @@ import style from './style.module.css'; export default class UserImage extends PureComponent { static propTypes = { userFirstName: PropTypes.string.isRequired, - impersonateStatus: PropTypes.bool.isRequired + userLastName: PropTypes.string.isRequired }; render() { From 9214c389bb79020e0b6a9547ac43350a7e17b1f9 Mon Sep 17 00:00:00 2001 From: xLaura3m5 Date: Tue, 12 Mar 2024 19:18:23 +0100 Subject: [PATCH 4/6] TASK: fix responsive styles --- .../Containers/Drawer/UserDropDown/style.module.css | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/packages/neos-ui/src/Containers/Drawer/UserDropDown/style.module.css b/packages/neos-ui/src/Containers/Drawer/UserDropDown/style.module.css index dd35c0a91a..54079efed0 100644 --- a/packages/neos-ui/src/Containers/Drawer/UserDropDown/style.module.css +++ b/packages/neos-ui/src/Containers/Drawer/UserDropDown/style.module.css @@ -28,11 +28,6 @@ margin-right: .75em; width: 2em !important; } -.dropDown__userName { - @media(max-width: 1024px) { - display: none; - } -} .dropDown__contents { min-width: 160px; padding: 2px !important; @@ -40,12 +35,6 @@ background: var(--colors-ContrastDarkest); position: relative; box-shadow: none; - - @media(max-width: 768px) { - min-width: 240px; - top: 40px; - margin-top: 0; - } } .dropDown__item { height: var(--spacing-GoldenUnit); From 852987dff345f190419bc81bfda72eb9c831d2ac Mon Sep 17 00:00:00 2001 From: xLaura3m5 Date: Wed, 13 Mar 2024 17:40:55 +0100 Subject: [PATCH 5/6] TASK: removed unneccessary constrains --- .../src/Containers/Drawer/UserDropDown/UserImage.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/neos-ui/src/Containers/Drawer/UserDropDown/UserImage.js b/packages/neos-ui/src/Containers/Drawer/UserDropDown/UserImage.js index 6ec62a546f..17d2293340 100644 --- a/packages/neos-ui/src/Containers/Drawer/UserDropDown/UserImage.js +++ b/packages/neos-ui/src/Containers/Drawer/UserDropDown/UserImage.js @@ -2,19 +2,17 @@ import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; import {connect} from 'react-redux'; -import {neos} from '@neos-project/neos-ui-decorators'; - import style from './style.module.css'; @connect(state => ({ userFirstName: state?.user?.name?.firstName, userLastName: state?.user?.name?.lastName })) -@neos() + export default class UserImage extends PureComponent { static propTypes = { - userFirstName: PropTypes.string.isRequired, - userLastName: PropTypes.string.isRequired + userFirstName: PropTypes.string, + userLastName: PropTypes.string }; render() { From da4faf9b7549365e58d726834ba1e0a878384db6 Mon Sep 17 00:00:00 2001 From: Bernhard Schmitt Date: Fri, 3 Nov 2023 12:01:42 +0100 Subject: [PATCH 6/6] Adjust to workspace aware commands --- .../Service/WorkspaceService.php | 4 ++-- .../Controller/BackendServiceController.php | 4 ++-- .../Domain/Model/Changes/AbstractCreate.php | 12 ++++++++-- Classes/Domain/Model/Changes/CopyAfter.php | 5 ++++ Classes/Domain/Model/Changes/CopyBefore.php | 5 ++++ Classes/Domain/Model/Changes/CopyInto.php | 5 ++++ Classes/Domain/Model/Changes/MoveAfter.php | 15 +++++++++--- Classes/Domain/Model/Changes/MoveBefore.php | 10 +++++++- Classes/Domain/Model/Changes/MoveInto.php | 11 +++++++-- Classes/Domain/Model/Changes/Property.php | 24 ++++++++++++------- Classes/Domain/Model/Changes/Remove.php | 10 +++++++- 11 files changed, 83 insertions(+), 22 deletions(-) diff --git a/Classes/ContentRepository/Service/WorkspaceService.php b/Classes/ContentRepository/Service/WorkspaceService.php index 2103322b8a..2880c2768e 100644 --- a/Classes/ContentRepository/Service/WorkspaceService.php +++ b/Classes/ContentRepository/Service/WorkspaceService.php @@ -179,13 +179,13 @@ public function predictRemoveNodeFeedbackFromDiscardIndividualNodesFromWorkspace } if ( - $nodeToDiscard->contentStreamId->equals($change->contentStreamId) + $nodeToDiscard->workspaceName->equals($workspace->workspaceName) && $nodeToDiscard->nodeAggregateId->equals($change->nodeAggregateId) && $nodeToDiscard->dimensionSpacePoint->equals($change->originDimensionSpacePoint) ) { $subgraph = $contentRepository->getContentGraph() ->getSubgraph( - $nodeToDiscard->contentStreamId, + $workspace->currentContentStreamId, $nodeToDiscard->dimensionSpacePoint, VisibilityConstraints::withoutRestrictions() ); diff --git a/Classes/Controller/BackendServiceController.php b/Classes/Controller/BackendServiceController.php index adc388d582..c1266be471 100644 --- a/Classes/Controller/BackendServiceController.php +++ b/Classes/Controller/BackendServiceController.php @@ -221,7 +221,7 @@ public function publishAction(array $nodeContextPaths, string $targetWorkspaceNa foreach ($nodeContextPaths as $contextPath) { $nodeAddress = $nodeAddressFactory->createFromUriString($contextPath); $nodeIdentifiersToPublish[] = new NodeIdToPublishOrDiscard( - $nodeAddress->contentStreamId, + $workspaceName, $nodeAddress->nodeAggregateId, $nodeAddress->dimensionSpacePoint ); @@ -279,7 +279,7 @@ public function discardAction(array $nodeContextPaths): void foreach ($nodeContextPaths as $contextPath) { $nodeAddress = $nodeAddressFactory->createFromUriString($contextPath); $nodeIdentifiersToDiscard[] = new NodeIdToPublishOrDiscard( - $nodeAddress->contentStreamId, + $workspaceName, $nodeAddress->nodeAggregateId, $nodeAddress->dimensionSpacePoint ); diff --git a/Classes/Domain/Model/Changes/AbstractCreate.php b/Classes/Domain/Model/Changes/AbstractCreate.php index 6cebb1e932..11ec715e95 100644 --- a/Classes/Domain/Model/Changes/AbstractCreate.php +++ b/Classes/Domain/Model/Changes/AbstractCreate.php @@ -108,8 +108,17 @@ protected function createNode( $nodeAggregateId = NodeAggregateId::create(); // generate a new NodeAggregateId + $contentRepository = $this->contentRepositoryRegistry->get($parentNode->subgraphIdentity->contentRepositoryId); + $workspace = $this->contentRepositoryRegistry->get($this->subject->subgraphIdentity->contentRepositoryId) + ->getWorkspaceFinder()->findOneByCurrentContentStreamId($parentNode->subgraphIdentity->contentStreamId); + if (!$workspace) { + throw new \Exception( + 'Could not find workspace for content stream "' . $parentNode->subgraphIdentity->contentStreamId->value . '"', + 1699008140 + ); + } $command = CreateNodeAggregateWithNode::create( - $parentNode->subgraphIdentity->contentStreamId, + $workspace->workspaceName, $nodeAggregateId, $nodeTypeName, OriginDimensionSpacePoint::fromDimensionSpacePoint($parentNode->subgraphIdentity->dimensionSpacePoint), @@ -117,7 +126,6 @@ protected function createNode( $succeedingSiblingNodeAggregateId, $nodeName ); - $contentRepository = $this->contentRepositoryRegistry->get($parentNode->subgraphIdentity->contentRepositoryId); $command = $this->applyNodeCreationHandlers($command, $nodeTypeName, $contentRepository); diff --git a/Classes/Domain/Model/Changes/CopyAfter.php b/Classes/Domain/Model/Changes/CopyAfter.php index df9f0afb26..a297059da1 100644 --- a/Classes/Domain/Model/Changes/CopyAfter.php +++ b/Classes/Domain/Model/Changes/CopyAfter.php @@ -71,12 +71,17 @@ public function apply(): void $targetNodeName = NodeName::fromString(uniqid('node-')); $contentRepository = $this->contentRepositoryRegistry->get($subject->subgraphIdentity->contentRepositoryId); + $workspace = $contentRepository->getWorkspaceFinder()->findOneByCurrentContentStreamId($subject->subgraphIdentity->contentStreamId); + if (!$workspace) { + throw new \Exception('Could not find workspace for content stream', 1699004343); + } $command = CopyNodesRecursively::createFromSubgraphAndStartNode( $contentRepository->getContentGraph()->getSubgraph( $subject->subgraphIdentity->contentStreamId, $subject->subgraphIdentity->dimensionSpacePoint, VisibilityConstraints::withoutRestrictions() ), + $workspace->workspaceName, $subject, OriginDimensionSpacePoint::fromDimensionSpacePoint($subject->subgraphIdentity->dimensionSpacePoint), $parentNodeOfPreviousSibling->nodeAggregateId, diff --git a/Classes/Domain/Model/Changes/CopyBefore.php b/Classes/Domain/Model/Changes/CopyBefore.php index 477c2c11c4..993a4511e1 100644 --- a/Classes/Domain/Model/Changes/CopyBefore.php +++ b/Classes/Domain/Model/Changes/CopyBefore.php @@ -64,12 +64,17 @@ public function apply(): void $targetNodeName = NodeName::fromString(uniqid('node-')); $contentRepository = $this->contentRepositoryRegistry->get($subject->subgraphIdentity->contentRepositoryId); + $workspace = $contentRepository->getWorkspaceFinder()->findOneByCurrentContentStreamId($subject->subgraphIdentity->contentStreamId); + if (!$workspace) { + throw new \Exception('Could not find workspace for content stream', 1699004343); + } $command = CopyNodesRecursively::createFromSubgraphAndStartNode( $contentRepository->getContentGraph()->getSubgraph( $subject->subgraphIdentity->contentStreamId, $subject->subgraphIdentity->dimensionSpacePoint, $subject->subgraphIdentity->visibilityConstraints ), + $workspace->workspaceName, $subject, OriginDimensionSpacePoint::fromDimensionSpacePoint($subject->subgraphIdentity->dimensionSpacePoint), $parentNodeOfSucceedingSibling->nodeAggregateId, diff --git a/Classes/Domain/Model/Changes/CopyInto.php b/Classes/Domain/Model/Changes/CopyInto.php index 122d9b16df..c5ed872a9e 100644 --- a/Classes/Domain/Model/Changes/CopyInto.php +++ b/Classes/Domain/Model/Changes/CopyInto.php @@ -72,12 +72,17 @@ public function apply(): void $targetNodeName = NodeName::fromString(uniqid('node-')); $contentRepository = $this->contentRepositoryRegistry->get($subject->subgraphIdentity->contentRepositoryId); + $workspace = $contentRepository->getWorkspaceFinder()->findOneByCurrentContentStreamId($subject->subgraphIdentity->contentStreamId); + if (!$workspace) { + throw new \Exception('Could not find workspace for content stream', 1699004343); + } $command = CopyNodesRecursively::createFromSubgraphAndStartNode( $contentRepository->getContentGraph()->getSubgraph( $subject->subgraphIdentity->contentStreamId, $subject->subgraphIdentity->dimensionSpacePoint, $subject->subgraphIdentity->visibilityConstraints ), + $workspace->workspaceName, $subject, OriginDimensionSpacePoint::fromDimensionSpacePoint($subject->subgraphIdentity->dimensionSpacePoint), $parentNode->nodeAggregateId, diff --git a/Classes/Domain/Model/Changes/MoveAfter.php b/Classes/Domain/Model/Changes/MoveAfter.php index c2405ca396..8c22dd28f1 100644 --- a/Classes/Domain/Model/Changes/MoveAfter.php +++ b/Classes/Domain/Model/Changes/MoveAfter.php @@ -76,8 +76,19 @@ public function apply(): void $hasEqualParentNode = $parentNode->nodeAggregateId ->equals($parentNodeOfPreviousSibling->nodeAggregateId); + + $contentRepository = $this->contentRepositoryRegistry->get($subject->subgraphIdentity->contentRepositoryId); + $workspace = $this->contentRepositoryRegistry->get($this->subject->subgraphIdentity->contentRepositoryId) + ->getWorkspaceFinder()->findOneByCurrentContentStreamId($subject->subgraphIdentity->contentStreamId); + if (!$workspace) { + throw new \Exception( + 'Could not find workspace for content stream "' . $subject->subgraphIdentity->contentStreamId->value . '"', + 1699008140 + ); + } + $command = MoveNodeAggregate::create( - $subject->subgraphIdentity->contentStreamId, + $workspace->workspaceName, $subject->subgraphIdentity->dimensionSpacePoint, $subject->nodeAggregateId, RelationDistributionStrategy::STRATEGY_GATHER_ALL, @@ -85,8 +96,6 @@ public function apply(): void $precedingSibling->nodeAggregateId, $succeedingSibling?->nodeAggregateId, ); - - $contentRepository = $this->contentRepositoryRegistry->get($subject->subgraphIdentity->contentRepositoryId); $contentRepository->handle($command)->block(); $updateParentNodeInfo = new UpdateNodeInfo(); diff --git a/Classes/Domain/Model/Changes/MoveBefore.php b/Classes/Domain/Model/Changes/MoveBefore.php index 276ac2fa26..b032e78255 100644 --- a/Classes/Domain/Model/Changes/MoveBefore.php +++ b/Classes/Domain/Model/Changes/MoveBefore.php @@ -72,10 +72,18 @@ public function apply(): void ->equals($succeedingSiblingParent->nodeAggregateId); $contentRepository = $this->contentRepositoryRegistry->get($subject->subgraphIdentity->contentRepositoryId); + $workspace = $this->contentRepositoryRegistry->get($this->subject->subgraphIdentity->contentRepositoryId) + ->getWorkspaceFinder()->findOneByCurrentContentStreamId($subject->subgraphIdentity->contentStreamId); + if (!$workspace) { + throw new \Exception( + 'Could not find workspace for content stream "' . $subject->subgraphIdentity->contentStreamId->value . '"', + 1699008140 + ); + } $contentRepository->handle( MoveNodeAggregate::create( - $subject->subgraphIdentity->contentStreamId, + $workspace->workspaceName, $subject->subgraphIdentity->dimensionSpacePoint, $subject->nodeAggregateId, RelationDistributionStrategy::STRATEGY_GATHER_ALL, diff --git a/Classes/Domain/Model/Changes/MoveInto.php b/Classes/Domain/Model/Changes/MoveInto.php index cde5731fa7..a6f8eb21f8 100644 --- a/Classes/Domain/Model/Changes/MoveInto.php +++ b/Classes/Domain/Model/Changes/MoveInto.php @@ -15,7 +15,6 @@ use Neos\ContentRepository\Core\Feature\NodeMove\Command\MoveNodeAggregate; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\Feature\NodeMove\Dto\RelationDistributionStrategy; -use Neos\Neos\Ui\Domain\Model\Feedback\Operations\RemoveNode; use Neos\Neos\Ui\Domain\Model\Feedback\Operations\UpdateNodeInfo; /** @@ -84,9 +83,17 @@ public function apply(): void ->equals($parentNode->nodeAggregateId); $contentRepository = $this->contentRepositoryRegistry->get($subject->subgraphIdentity->contentRepositoryId); + $workspace = $this->contentRepositoryRegistry->get($this->subject->subgraphIdentity->contentRepositoryId) + ->getWorkspaceFinder()->findOneByCurrentContentStreamId($subject->subgraphIdentity->contentStreamId); + if (!$workspace) { + throw new \Exception( + 'Could not find workspace for content stream "' . $subject->subgraphIdentity->contentStreamId->value . '"', + 1699008140 + ); + } $contentRepository->handle( MoveNodeAggregate::create( - $subject->subgraphIdentity->contentStreamId, + $workspace->workspaceName, $subject->subgraphIdentity->dimensionSpacePoint, $subject->nodeAggregateId, RelationDistributionStrategy::STRATEGY_GATHER_ALL, diff --git a/Classes/Domain/Model/Changes/Property.php b/Classes/Domain/Model/Changes/Property.php index 1e84723168..c9cff3c04c 100644 --- a/Classes/Domain/Model/Changes/Property.php +++ b/Classes/Domain/Model/Changes/Property.php @@ -38,9 +38,6 @@ use Neos\Neos\Ui\Domain\Service\NodePropertyConversionService; use Neos\Neos\Utility\NodeTypeWithFallbackProvider; -/** @codingStandardsIgnoreStart */ -/** @codingStandardsIgnoreEnd */ - /** * Changes a property on a node * @internal These objects internally reflect possible operations made by the Neos.Ui. @@ -158,6 +155,15 @@ public function apply(): void $propertyType = $this->getNodeType($subject)->getPropertyType($propertyName); + $workspace = $this->contentRepositoryRegistry->get($this->subject->subgraphIdentity->contentRepositoryId) + ->getWorkspaceFinder()->findOneByCurrentContentStreamId($subject->subgraphIdentity->contentStreamId); + if (!$workspace) { + throw new \Exception( + 'Could not find workspace for content stream "' . $subject->subgraphIdentity->contentStreamId->value . '"', + 1699008140 + ); + } + // Use extra commands for reference handling if ($propertyType === 'reference' || $propertyType === 'references') { $value = $this->getValue(); @@ -180,7 +186,7 @@ public function apply(): void $commandResult = $contentRepository->handle( SetNodeReferences::create( - $subject->subgraphIdentity->contentStreamId, + $workspace->workspaceName, $subject->nodeAggregateId, $subject->originDimensionSpacePoint, ReferenceName::fromString($propertyName), @@ -201,7 +207,7 @@ public function apply(): void // if origin dimension space point != current DSP -> translate transparently (matching old behavior) $contentRepository->handle( CreateNodeVariant::create( - $subject->subgraphIdentity->contentStreamId, + $workspace->workspaceName, $subject->nodeAggregateId, $subject->originDimensionSpacePoint, $originDimensionSpacePoint @@ -210,7 +216,7 @@ public function apply(): void } $commandResult = $contentRepository->handle( SetNodeProperties::create( - $subject->subgraphIdentity->contentStreamId, + $workspace->workspaceName, $subject->nodeAggregateId, $originDimensionSpacePoint, PropertyValuesToWrite::fromArray( @@ -225,7 +231,7 @@ public function apply(): void if ($propertyName === '_nodeType') { $commandResult = $contentRepository->handle( ChangeNodeAggregateType::create( - $subject->subgraphIdentity->contentStreamId, + $workspace->workspaceName, $subject->nodeAggregateId, NodeTypeName::fromString($value), NodeAggregateTypeChangeChildConstraintConflictResolutionStrategy::STRATEGY_DELETE @@ -235,7 +241,7 @@ public function apply(): void if ($value === true) { $commandResult = $contentRepository->handle( DisableNodeAggregate::create( - $subject->subgraphIdentity->contentStreamId, + $workspace->workspaceName, $subject->nodeAggregateId, $subject->originDimensionSpacePoint->toDimensionSpacePoint(), NodeVariantSelectionStrategy::STRATEGY_ALL_SPECIALIZATIONS @@ -245,7 +251,7 @@ public function apply(): void // unhide $commandResult = $contentRepository->handle( EnableNodeAggregate::create( - $subject->subgraphIdentity->contentStreamId, + $workspace->workspaceName, $subject->nodeAggregateId, $subject->originDimensionSpacePoint->toDimensionSpacePoint(), NodeVariantSelectionStrategy::STRATEGY_ALL_SPECIALIZATIONS diff --git a/Classes/Domain/Model/Changes/Remove.php b/Classes/Domain/Model/Changes/Remove.php index 872d84422a..b7b441d901 100644 --- a/Classes/Domain/Model/Changes/Remove.php +++ b/Classes/Domain/Model/Changes/Remove.php @@ -74,8 +74,16 @@ public function apply(): void $subgraph = $this->contentRepositoryRegistry->subgraphForNode($this->subject); $closestDocumentParentNode = $subgraph->findClosestNode($this->subject->nodeAggregateId, FindClosestNodeFilter::create(nodeTypes: NodeTypeNameFactory::NAME_DOCUMENT)); + $workspace = $this->contentRepositoryRegistry->get($this->subject->subgraphIdentity->contentRepositoryId) + ->getWorkspaceFinder()->findOneByCurrentContentStreamId($subject->subgraphIdentity->contentStreamId); + if (!$workspace) { + throw new \Exception( + 'Could not find workspace for content stream "' . $subject->subgraphIdentity->contentStreamId->value . '"', + 1699008140 + ); + } $command = RemoveNodeAggregate::create( - $subject->subgraphIdentity->contentStreamId, + $workspace->workspaceName, $subject->nodeAggregateId, $subject->subgraphIdentity->dimensionSpacePoint, NodeVariantSelectionStrategy::STRATEGY_ALL_SPECIALIZATIONS,