Skip to content
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

FEATURE: Refactor publication and discarding endpoints #3752

Merged
merged 34 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c7ce636
!!!TASK: Refactor publication and discarding endpoints
grebaldi Mar 17, 2024
75a290e
TASK: Re-add flow annotations in backend service controller
grebaldi Mar 15, 2024
6958ebc
TASK: Add new publish/discard enpoints to Routes.yaml
grebaldi Mar 15, 2024
6c8be6b
TASK: Add new publish/discard routes to backend connector
grebaldi Mar 15, 2024
b01269c
TASK: Adjust Workspaces redux store to new publish/discard semantics
grebaldi Mar 15, 2024
7eafb3f
TASK: Wrap publishing endpoint invokations in command object
grebaldi Mar 18, 2024
18beaa6
TASK: Use @phpstan-param annotation for publish/discard actions
grebaldi Mar 18, 2024
334f1d5
TASK: Convert given `NodeAddress`es to `NodeAggregateId`s in all publ…
grebaldi Mar 18, 2024
c2d30de
TASK: Implement new publish workflow in redux-saga
grebaldi Mar 18, 2024
496a471
TASK: Adjust prop type in discard dialog
grebaldi Mar 18, 2024
7665b36
BUGFIX: Fix reference to publish/discard-scope in `@connect` of Disca…
grebaldi Mar 18, 2024
41c37b0
BUGFIX: Read `length` of publishable nodes to calculate `numberOfChan…
grebaldi Mar 18, 2024
b961b47
TASK: Turn PublishDiscardScope into enum and fix typo in references e…
grebaldi Mar 18, 2024
1945ec5
TASK: Introduce PublishDiscardMode
grebaldi Mar 18, 2024
768dd8d
TASK: Use site as removal attachment point if document is removed
grebaldi Mar 18, 2024
34f36ec
TASK: Implement new discard workflow in redux-saga
grebaldi Mar 18, 2024
8dc7616
TASK: Navigate to closest other document if current document has been…
grebaldi Mar 19, 2024
4c4185c
TASK: Fix linting errors
grebaldi Mar 19, 2024
3a06560
TASK: Temporarily add patch for neos/neos-development-collection#4943
grebaldi Mar 19, 2024
a3c0588
TASK: Update command and method names according to upstream changes
grebaldi Mar 22, 2024
6368826
TASK: Adjust publishing action names to match the Neos.Neos API
grebaldi Mar 22, 2024
2a4c5f9
TASK: Consider nullability of nodeType in Remove change object
grebaldi Mar 22, 2024
cb11477
Adjust to new workspace model
Mar 28, 2024
fabc40a
Introduce ChangeTargetWorkspace
Mar 29, 2024
de64755
TASK: Add SyncWorkspace application command and adjust BackendService…
grebaldi Mar 29, 2024
820942f
Adjust BackendServiceController to WorkspaceRebaseFailed exception
Mar 29, 2024
cc11ac1
Revert "Adjust BackendServiceController to WorkspaceRebaseFailed exce…
Mar 29, 2024
17aa6a7
Merge branch '9.0' into publishingBonanza
Apr 2, 2024
5a0a269
Adjust to Neos dev distribution adjustments
Apr 2, 2024
98b5ac2
Adjust to exposed rebase error handling strategy
Apr 3, 2024
5f9681d
TASK: Fix style ci
mhsdesign Apr 3, 2024
3937bf1
TASK: Rename `WorkspaceFactory` to `WorkspaceProvider`
mhsdesign Apr 4, 2024
5d69f43
TASK: Rename to `retrieveForWorkspaceName`
mhsdesign Apr 4, 2024
8e15504
Adjust to new workspace provider methods
Apr 5, 2024
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
37 changes: 37 additions & 0 deletions Classes/Application/ChangeTargetWorkspace.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

/*
* This file is part of the Neos.Neos.Ui package.
*
* (c) Contributors of the Neos Project - www.neos.io
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/

declare(strict_types=1);

namespace Neos\Neos\Ui\Application;

use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
use Neos\Flow\Annotations as Flow;
use Neos\Neos\FrontendRouting\NodeAddress;

/**
* The application layer level command DTO to communicate the change of the selected target workspace for publication
*
* @internal for communication within the Neos UI only
*/
#[Flow\Proxy(false)]
final readonly class ChangeTargetWorkspace
{
public function __construct(
public ContentRepositoryId $contentRepositoryId,
public WorkspaceName $workspaceName,
public WorkspaceName $targetWorkspaceName,
public NodeAddress $documentNode
) {
}
}
48 changes: 48 additions & 0 deletions Classes/Application/DiscardChangesInDocument.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

/*
* This file is part of the Neos.Neos package.
*
* (c) Contributors of the Neos Project - www.neos.io
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/

declare(strict_types=1);

namespace Neos\Neos\Ui\Application;

use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
use Neos\Flow\Annotations as Flow;

/**
* The application layer level command DTO to communicate discarding of all changes recorded for a given document
*
* @internal for communication within the Neos UI only
*/
#[Flow\Proxy(false)]
final readonly class DiscardChangesInDocument
{
public function __construct(
public ContentRepositoryId $contentRepositoryId,
public WorkspaceName $workspaceName,
public NodeAggregateId $documentId,
) {
}

/**
* @param array<string,string> $values
*/
public static function fromArray(array $values): self
{
return new self(
ContentRepositoryId::fromString($values['contentRepositoryId']),
WorkspaceName::fromString($values['workspaceName']),
NodeAggregateId::fromString($values['documentId']),
);
}
}
48 changes: 48 additions & 0 deletions Classes/Application/DiscardChangesInSite.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

/*
* This file is part of the Neos.Neos package.
*
* (c) Contributors of the Neos Project - www.neos.io
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/

declare(strict_types=1);

namespace Neos\Neos\Ui\Application;

use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
use Neos\Flow\Annotations as Flow;

/**
* The application layer level command DTO to communicate discarding of all changes recorded for a given site
*
* @internal for communication within the Neos UI only
*/
#[Flow\Proxy(false)]
final readonly class DiscardChangesInSite
{
public function __construct(
public ContentRepositoryId $contentRepositoryId,
public WorkspaceName $workspaceName,
public NodeAggregateId $siteId,
) {
}

/**
* @param array<string,string> $values
*/
public static function fromArray(array $values): self
{
return new self(
ContentRepositoryId::fromString($values['contentRepositoryId']),
WorkspaceName::fromString($values['workspaceName']),
NodeAggregateId::fromString($values['siteId']),
);
}
}
48 changes: 48 additions & 0 deletions Classes/Application/PublishChangesInDocument.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

/*
* This file is part of the Neos.Neos package.
*
* (c) Contributors of the Neos Project - www.neos.io
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/

declare(strict_types=1);

namespace Neos\Neos\Ui\Application;

use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
use Neos\Flow\Annotations as Flow;

/**
* The application layer level command DTO to communicate publication of all changes recorded for a given document
*
* @internal for communication within the Neos UI only
*/
#[Flow\Proxy(false)]
final readonly class PublishChangesInDocument
{
public function __construct(
public ContentRepositoryId $contentRepositoryId,
public WorkspaceName $workspaceName,
public NodeAggregateId $documentId,
) {
}

/**
* @param array<string,string> $values
*/
public static function fromArray(array $values): self
{
return new self(
ContentRepositoryId::fromString($values['contentRepositoryId']),
WorkspaceName::fromString($values['workspaceName']),
NodeAggregateId::fromString($values['documentId']),
);
}
}
48 changes: 48 additions & 0 deletions Classes/Application/PublishChangesInSite.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

/*
* This file is part of the Neos.Neos.Ui package.
*
* (c) Contributors of the Neos Project - www.neos.io
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/

declare(strict_types=1);

namespace Neos\Neos\Ui\Application;

use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
use Neos\Flow\Annotations as Flow;

/**
* The application layer level command DTO to communicate publication of all changes recorded for a given site
*
* @internal for communication within the Neos UI only
*/
#[Flow\Proxy(false)]
final readonly class PublishChangesInSite
{
public function __construct(
public ContentRepositoryId $contentRepositoryId,
public WorkspaceName $workspaceName,
public NodeAggregateId $siteId,
) {
}

/**
* @param array<string,string> $values
*/
public static function fromArray(array $values): self
{
return new self(
ContentRepositoryId::fromString($values['contentRepositoryId']),
WorkspaceName::fromString($values['workspaceName']),
NodeAggregateId::fromString($values['siteId']),
);
}
}
36 changes: 36 additions & 0 deletions Classes/Application/SyncWorkspace.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

/*
* This file is part of the Neos.Neos.Ui package.
*
* (c) Contributors of the Neos Project - www.neos.io
*
* This package is Open Source Software. For the full copyright and license
* information, please view the LICENSE file which was distributed with this
* source code.
*/

declare(strict_types=1);

namespace Neos\Neos\Ui\Application;

use Neos\ContentRepository\Core\Feature\WorkspaceRebase\Dto\RebaseErrorHandlingStrategy;
use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
use Neos\Flow\Annotations as Flow;

/**
* The application layer level command DTO to communicate the intent to rebase the workspace
*
* @internal for communication within the Neos UI only
*/
#[Flow\Proxy(false)]
final readonly class SyncWorkspace
{
public function __construct(
public ContentRepositoryId $contentRepositoryId,
public WorkspaceName $workspaceName,
public RebaseErrorHandlingStrategy $rebaseErrorHandlingStrategy
) {
}
}
7 changes: 7 additions & 0 deletions Classes/ContentRepository/Service/NeosUiNodeService.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints;
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
use Neos\Flow\Annotations as Flow;
use Neos\Neos\FrontendRouting\NodeAddress;
use Neos\Neos\Utility\NodeTypeWithFallbackProvider;

/**
Expand All @@ -43,4 +44,10 @@ public function findNodeBySerializedNodeAddress(string $serializedNodeAddress, C
);
return $subgraph->findNodeById($nodeAddress->nodeAggregateId);
}

public function deserializeNodeAddress(string $serializedNodeAddress, ContentRepositoryId $contentRepositoryId): NodeAddress
{
$contentRepository = $this->contentRepositoryRegistry->get($contentRepositoryId);
return NodeAddressFactory::create($contentRepository)->createFromUriString($serializedNodeAddress);
}
}
Loading
Loading