Skip to content

Commit

Permalink
Merge pull request #584 from caesar-team/hotfix/CAES-1708
Browse files Browse the repository at this point in the history
[Item] CAES-1708: Implemented change raws while share item.
  • Loading branch information
aburov-dev authored Jan 27, 2021
2 parents b0aa031 + 0baf21d commit 5d678d5
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Form/Type/Request/Item/BatchMoveItemRequestType.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->add('secret', TextType::class, [
'required' => false,
])
->add('raws', TextType::class, [
'required' => false,
])
;
}

Expand Down
3 changes: 3 additions & 0 deletions src/Form/Type/Request/Item/MoveItemRequestType.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->add('secret', TextType::class, [
'required' => false,
])
->add('raws', TextType::class, [
'required' => false,
])
;
}

Expand Down
12 changes: 12 additions & 0 deletions src/Request/Item/BatchMoveItemRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ final class BatchMoveItemRequest implements MoveItemRequestInterface

private ?string $secret = null;

private ?string $raws = null;

public function getItem(): Item
{
return $this->item;
Expand All @@ -31,4 +33,14 @@ public function setSecret(?string $secret): void
{
$this->secret = $secret;
}

public function getRaws(): ?string
{
return $this->raws;
}

public function setRaws(?string $raws): void
{
$this->raws = $raws;
}
}
13 changes: 13 additions & 0 deletions src/Request/Item/MoveItemRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ final class MoveItemRequest implements MoveItemRequestInterface

private ?string $secret;

private ?string $raws;

private User $user;

private Item $item;
Expand All @@ -27,6 +29,7 @@ public function __construct(Item $item, User $user)
{
$this->list = null;
$this->secret = null;
$this->raws = null;
$this->user = $user;
$this->item = $item;
}
Expand All @@ -51,6 +54,16 @@ public function setSecret(?string $secret): void
$this->secret = $secret;
}

public function getRaws(): ?string
{
return $this->raws;
}

public function setRaws(?string $raws): void
{
$this->raws = $raws;
}

public function getItem(): Item
{
return $this->item;
Expand Down
2 changes: 2 additions & 0 deletions src/Request/Item/MoveItemRequestInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ interface MoveItemRequestInterface
public function getItem(): Item;

public function getSecret(): ?string;

public function getRaws(): ?string;
}
3 changes: 3 additions & 0 deletions src/Services/ItemRelocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public function move(Directory $directory, MoveItemRequestInterface $request): v
if (null !== $request->getSecret()) {
$item->setSecret($request->getSecret());
}
if (null !== $request->getRaws()) {
$item->setRaws($request->getRaws());
}
$item->moveTo($directory);
$this->repository->save($item);
}
Expand Down

0 comments on commit 5d678d5

Please sign in to comment.