diff --git a/Classes/Application/ReloadNodes/ReloadNodesQueryHandler.php b/Classes/Application/ReloadNodes/ReloadNodesQueryHandler.php index c0f9929e02..b53287e2d5 100644 --- a/Classes/Application/ReloadNodes/ReloadNodesQueryHandler.php +++ b/Classes/Application/ReloadNodes/ReloadNodesQueryHandler.php @@ -35,7 +35,6 @@ #[Flow\Scope("singleton")] final class ReloadNodesQueryHandler { - #[Flow\Inject] protected ContentRepositoryRegistry $contentRepositoryRegistry; diff --git a/Classes/Controller/BackendServiceController.php b/Classes/Controller/BackendServiceController.php index 39d686eb1c..faa6f7217f 100644 --- a/Classes/Controller/BackendServiceController.php +++ b/Classes/Controller/BackendServiceController.php @@ -38,6 +38,11 @@ use Neos\Neos\FrontendRouting\SiteDetection\SiteDetectionResult; use Neos\Neos\Service\UserService; use Neos\Neos\Ui\Application\ChangeTargetWorkspace; +use Neos\Neos\Ui\Application\DiscardAllChanges; +use Neos\Neos\Ui\Application\DiscardChangesInDocument; +use Neos\Neos\Ui\Application\DiscardChangesInSite; +use Neos\Neos\Ui\Application\PublishChangesInDocument; +use Neos\Neos\Ui\Application\PublishChangesInSite; use Neos\Neos\Ui\Application\ReloadNodes\ReloadNodesQuery; use Neos\Neos\Ui\Application\ReloadNodes\ReloadNodesQueryHandler; use Neos\Neos\Ui\Application\SyncWorkspace\ConflictsOccurred; @@ -201,14 +206,16 @@ public function publishChangesInSiteAction(array $command): void try { /** @todo send from UI */ $contentRepositoryId = SiteDetectionResult::fromRequest($this->request->getHttpRequest())->contentRepositoryId; - $siteNodeAddress = $this->nodeService->deserializeNodeAddress( + $command['contentRepositoryId'] = $contentRepositoryId->value; + $command['siteId'] = $this->nodeService->deserializeNodeAddress( $command['siteId'], $contentRepositoryId - ); + )->nodeAggregateId->value; + $command = PublishChangesInSite::fromArray($command); $publishingResult = $this->workspacePublishingService->publishChangesInSite( - $contentRepositoryId, - $siteNodeAddress->workspaceName, - $siteNodeAddress->nodeAggregateId, + $command->contentRepositoryId, + $command->workspaceName, + $command->siteId, ); $this->view->assign('value', [ 'success' => [ @@ -238,15 +245,18 @@ public function publishChangesInDocumentAction(array $command): void try { /** @todo send from UI */ $contentRepositoryId = SiteDetectionResult::fromRequest($this->request->getHttpRequest())->contentRepositoryId; - $documentNodeAddress = $this->nodeService->deserializeNodeAddress( + $command['contentRepositoryId'] = $contentRepositoryId->value; + $command['documentId'] = $this->nodeService->deserializeNodeAddress( $command['documentId'], $contentRepositoryId - ); + )->nodeAggregateId->value; + $command = PublishChangesInDocument::fromArray($command); + try { $publishingResult = $this->workspacePublishingService->publishChangesInDocument( - $contentRepositoryId, - $documentNodeAddress->workspaceName, - $documentNodeAddress->nodeAggregateId, + $command->contentRepositoryId, + $command->workspaceName, + $command->documentId, ); $this->view->assign('value', [ @@ -290,9 +300,14 @@ public function discardAllChangesAction(array $command): void try { /** @todo send from UI */ $contentRepositoryId = SiteDetectionResult::fromRequest($this->request->getHttpRequest())->contentRepositoryId; - $workspaceName = WorkspaceName::fromString($command['workspaceName']); + $command['contentRepositoryId'] = $contentRepositoryId->value; + $command = DiscardAllChanges::fromArray($command); + + $discardingResult = $this->workspacePublishingService->discardAllWorkspaceChanges( + $command->contentRepositoryId, + $command->workspaceName + ); - $discardingResult = $this->workspacePublishingService->discardAllWorkspaceChanges($contentRepositoryId, $workspaceName); $this->view->assign('value', [ 'success' => [ 'numberOfAffectedChanges' => $discardingResult->numberOfDiscardedChanges @@ -320,15 +335,17 @@ public function discardChangesInSiteAction(array $command): void try { /** @todo send from UI */ $contentRepositoryId = SiteDetectionResult::fromRequest($this->request->getHttpRequest())->contentRepositoryId; - $siteNodeAddress = $this->nodeService->deserializeNodeAddress( + $command['contentRepositoryId'] = $contentRepositoryId->value; + $command['siteId'] = $this->nodeService->deserializeNodeAddress( $command['siteId'], $contentRepositoryId - ); + )->nodeAggregateId->value; + $command = DiscardChangesInSite::fromArray($command); $discardingResult = $this->workspacePublishingService->discardChangesInSite( - $contentRepositoryId, - $siteNodeAddress->workspaceName, - $siteNodeAddress->nodeAggregateId + $command->contentRepositoryId, + $command->workspaceName, + $command->siteId ); $this->view->assign('value', [ @@ -358,11 +375,18 @@ public function discardChangesInDocumentAction(array $command): void try { /** @todo send from UI */ $contentRepositoryId = SiteDetectionResult::fromRequest($this->request->getHttpRequest())->contentRepositoryId; - $documentNodeAddress = $this->nodeService->deserializeNodeAddress( + $command['contentRepositoryId'] = $contentRepositoryId->value; + $command['documentId'] = $this->nodeService->deserializeNodeAddress( $command['documentId'], $contentRepositoryId + )->nodeAggregateId->value; + $command = DiscardChangesInDocument::fromArray($command); + + $discardingResult = $this->workspacePublishingService->discardChangesInDocument( + $command->contentRepositoryId, + $command->workspaceName, + $command->documentId ); - $discardingResult = $this->workspacePublishingService->discardChangesInDocument($contentRepositoryId, $documentNodeAddress->workspaceName, $documentNodeAddress->nodeAggregateId); $this->view->assign('value', [ 'success' => [ diff --git a/Classes/Infrastructure/Configuration/ConfigurationProvider.php b/Classes/Infrastructure/Configuration/ConfigurationProvider.php index fe9ca959ae..f18d4e05f3 100644 --- a/Classes/Infrastructure/Configuration/ConfigurationProvider.php +++ b/Classes/Infrastructure/Configuration/ConfigurationProvider.php @@ -88,6 +88,9 @@ public function getConfiguration( ]; } + /** + * @return array + */ private function getAllowedTargetWorkspaces(ContentRepository $contentRepository): array { $backendUser = $this->userService->getBackendUser();