@@ -34,6 +34,5 @@ class AssignedLabels extends RelationalEntity implements JsonSerializable {
|
||||
$this->addType('id', 'integer');
|
||||
$this->addType('cardId', 'integer');
|
||||
$this->addType('labelId', 'integer');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ use OCP\IDBConnection;
|
||||
use OCP\IGroupManager;
|
||||
use OCP\IUserManager;
|
||||
|
||||
class AssignedLabelsMapper extends DeckMapper {
|
||||
class AssignedLabelsMapper extends DeckMapper {
|
||||
private $cardMapper;
|
||||
private $userManager;
|
||||
/**
|
||||
@@ -55,5 +55,4 @@ class AssignedLabelsMapper extends DeckMapper {
|
||||
$labels = $this->findEntities($sql, [$cardId]);
|
||||
return $labels;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -425,7 +425,6 @@ class StackService {
|
||||
|
||||
$cards = $this->cardMapper->findAll($id);
|
||||
foreach ($cards as $card) {
|
||||
|
||||
$newCard = new Card();
|
||||
$newCard->setTitle($card->getTitle());
|
||||
$newCard->setStackId($newStack->getId());
|
||||
@@ -446,11 +445,9 @@ class StackService {
|
||||
);
|
||||
|
||||
if ($boardId === $stack->getBoardId()) {
|
||||
|
||||
$assignedLabels = $this->assignedLabelsMapper->find($card->getId());
|
||||
$newLabelArray = [];
|
||||
foreach ($assignedLabels as $assignedLabel) {
|
||||
|
||||
$assignment = new AssignedLabels();
|
||||
$assignment->setCardId($newCard->getId());
|
||||
$assignment->setLabelId($assignedLabel->getLabelId());
|
||||
@@ -472,9 +469,7 @@ class StackService {
|
||||
$newUserArray[] = $assignment;
|
||||
}
|
||||
$newCard->setAssignedUsers($newUserArray);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->enrichStackWithCards($newStack);
|
||||
|
||||
@@ -35,6 +35,7 @@ use OCA\Deck\Db\Stack;
|
||||
use OCA\Deck\Db\StackMapper;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use \Test\TestCase;
|
||||
use OCP\IL10N;
|
||||
|
||||
/**
|
||||
* Class StackServiceTest
|
||||
@@ -70,6 +71,8 @@ class StackServiceTest extends TestCase {
|
||||
private $changeHelper;
|
||||
/** @var EventDispatcherInterface */
|
||||
private $eventDispatcher;
|
||||
private $l10n;
|
||||
private $userId;
|
||||
|
||||
public function setUp(): void {
|
||||
parent::setUp();
|
||||
@@ -85,6 +88,9 @@ class StackServiceTest extends TestCase {
|
||||
$this->activityManager = $this->createMock(ActivityManager::class);
|
||||
$this->changeHelper = $this->createMock(ChangeHelper::class);
|
||||
$this->eventDispatcher = $this->createMock(EventDispatcherInterface::class);
|
||||
$this->l10n = $this->createMock(IL10N::class);
|
||||
$this->userId = "admin";
|
||||
|
||||
|
||||
$this->stackService = new StackService(
|
||||
$this->stackMapper,
|
||||
@@ -98,7 +104,9 @@ class StackServiceTest extends TestCase {
|
||||
$this->attachmentService,
|
||||
$this->activityManager,
|
||||
$this->eventDispatcher,
|
||||
$this->changeHelper
|
||||
$this->changeHelper,
|
||||
$this->l10n,
|
||||
$this->userId
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user