Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdsToPublishOrDiscard;
use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdToPublishOrDiscard;
use Neos\ContentRepository\Core\Feature\WorkspaceCreation\Exception\WorkspaceAlreadyExists;
use Neos\ContentRepositoryRegistry\Factory\ProjectionCatchUpTrigger\CatchUpTriggerWithSynchronousOption;
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindAncestorNodesFilter;
use Neos\ContentRepository\Core\Projection\ContentGraph\NodeTypeConstraints;
use Neos\ContentRepository\Core\SharedModel\Node\NodeName;
use Neos\Flow\I18n\Exception\IndexOutOfBoundsException;
use Neos\Flow\I18n\Exception\InvalidFormatPlaceholderException;
Expand Down Expand Up @@ -538,8 +538,11 @@ public function publishNodeAction(string $nodeAddress, WorkspaceName $selectedWo
)
),
);
$contentRepository->handle($command)
->block();
// performance speedup
CatchUpTriggerWithSynchronousOption::synchronously(fn() =>
$contentRepository->handle($command)
->block()
);

$this->addFlashMessage($this->translator->translateById(
'workspaces.selectedChangeHasBeenPublished',
Expand Down Expand Up @@ -576,8 +579,11 @@ public function discardNodeAction(string $nodeAddress, WorkspaceName $selectedWo
)
),
);
$contentRepository->handle($command)
->block();
// performance speedup
CatchUpTriggerWithSynchronousOption::synchronously(fn() =>
$contentRepository->handle($command)
->block()
);

$this->addFlashMessage($this->translator->translateById(
'workspaces.selectedChangeHasBeenDiscarded',
Expand Down Expand Up @@ -630,8 +636,11 @@ public function publishOrDiscardNodesAction(array $nodes, string $action, string
$selectedWorkspace,
NodeIdsToPublishOrDiscard::create(...$nodesToPublishOrDiscard),
);
$contentRepository->handle($command)
->block();
// performance speedup
CatchUpTriggerWithSynchronousOption::synchronously(fn() =>
$contentRepository->handle($command)
->block()
);
$this->addFlashMessage($this->translator->translateById(
'workspaces.selectedChangesHaveBeenPublished',
[],
Expand All @@ -646,8 +655,11 @@ public function publishOrDiscardNodesAction(array $nodes, string $action, string
$selectedWorkspace,
NodeIdsToPublishOrDiscard::create(...$nodesToPublishOrDiscard),
);
$contentRepository->handle($command)
->block();
// performance speedup
CatchUpTriggerWithSynchronousOption::synchronously(fn() =>
$contentRepository->handle($command)
->block()
);
$this->addFlashMessage($this->translator->translateById(
'workspaces.selectedChangesHaveBeenDiscarded',
[],
Expand All @@ -672,11 +684,12 @@ public function publishWorkspaceAction(WorkspaceName $workspace): void
$contentRepositoryId = SiteDetectionResult::fromRequest($this->request->getHttpRequest())
->contentRepositoryId;
$contentRepository = $this->contentRepositoryRegistry->get($contentRepositoryId);
$contentRepository->handle(
new PublishWorkspace(
// performance speedup
CatchUpTriggerWithSynchronousOption::synchronously(fn() =>
$contentRepository->handle(new PublishWorkspace(
$workspace
)
)->block();
))->block()
);
$workspace = $contentRepository->getWorkspaceFinder()->findOneByName($workspace);
/** @var Workspace $workspace Otherwise the command handler would have thrown an exception */
/** @var WorkspaceName $baseWorkspaceName Otherwise the command handler would have thrown an exception */
Expand Down Expand Up @@ -705,11 +718,14 @@ public function discardWorkspaceAction(WorkspaceName $workspace): void
$contentRepositoryId = SiteDetectionResult::fromRequest($this->request->getHttpRequest())
->contentRepositoryId;
$contentRepository = $this->contentRepositoryRegistry->get($contentRepositoryId);
$contentRepository->handle(
DiscardWorkspace::create(
$workspace,
)
)->block();
// performance speedup
CatchUpTriggerWithSynchronousOption::synchronously(fn() =>
$contentRepository->handle(
DiscardWorkspace::create(
$workspace,
)
)->block()
);

$this->addFlashMessage($this->translator->translateById(
'workspaces.allChangesInWorkspaceHaveBeenDiscarded',
Expand Down
Loading