Skip to content

Commit

Permalink
Merge pull request #3762 from neos/feature/conflict-resolution-02/reb…
Browse files Browse the repository at this point in the history
…ase-conflicts

!!!FEATURE: Offer resolution strategies when conflicts arise during rebase
  • Loading branch information
mhsdesign authored May 13, 2024
2 parents c8ba57e + 8d2d1cb commit f7424b3
Show file tree
Hide file tree
Showing 65 changed files with 3,435 additions and 527 deletions.
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ jobs:
./flow flow:cache:flush
./flow flow:cache:warmup
./flow doctrine:migrate
./flow user:create --username=admin --password=admin --first-name=John --last-name=Doe --roles=Administrator
./flow user:create --username=admin --password=admin --first-name=Admin --last-name=Admington --roles=Administrator
./flow user:create --username=editor --password=editor --first-name=Editor --last-name=McEditworth --roles=Editor
- run:
name: Start flow server
command: /home/circleci/app/flow server:run --port 8081
Expand Down
45 changes: 45 additions & 0 deletions Classes/Application/DiscardAllChanges.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?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\Workspace\WorkspaceName;
use Neos\Flow\Annotations as Flow;

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

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

use Neos\Flow\Annotations as Flow;

/**
* A DTO representing a rebase conflict
*
* @internal for communication within the Neos UI only
*/
#[Flow\Proxy(false)]
final readonly class Conflict implements \JsonSerializable
{
public function __construct(
public ?IconLabel $affectedSite,
public ?IconLabel $affectedDocument,
public ?IconLabel $affectedNode,
public ?TypeOfChange $typeOfChange,
public ?ReasonForConflict $reasonForConflict
) {
}

public function jsonSerialize(): mixed
{
return get_object_vars($this);
}
}
57 changes: 57 additions & 0 deletions Classes/Application/SyncWorkspace/Conflicts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?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\SyncWorkspace;

use Neos\ContentRepository\Core\ContentRepository;
use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint;
use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName;
use Neos\Flow\Annotations as Flow;

/**
* @internal for communication within the Neos UI only
*/
#[Flow\Proxy(false)]
final readonly class Conflicts implements \JsonSerializable, \Countable
{
/** @var Conflict[] */
private array $items;

public function __construct(Conflict ...$items)
{
$this->items = $items;
}

public static function builder(
ContentRepository $contentRepository,
WorkspaceName $workspaceName,
?DimensionSpacePoint $preferredDimensionSpacePoint,
): ConflictsBuilder {
return new ConflictsBuilder(
contentRepository: $contentRepository,
workspaceName: $workspaceName,
preferredDimensionSpacePoint: $preferredDimensionSpacePoint
);
}

public function jsonSerialize(): mixed
{
return $this->items;
}

public function count(): int
{
return count($this->items);
}
}
Loading

0 comments on commit f7424b3

Please sign in to comment.