* kanban board filtering done on server side
This commit is contained in:
parent
e23054315b
commit
44a31f4fd0
@ -9,51 +9,195 @@ class KanbanBoard implements \JsonSerializable
|
||||
/**
|
||||
* @var KanbanEntry[]|ArrayCollection
|
||||
*/
|
||||
private $kanbanEntries;
|
||||
private $inbox;
|
||||
|
||||
/**
|
||||
* @var KanbanEntry[]|ArrayCollection
|
||||
*/
|
||||
private $inProgress;
|
||||
|
||||
/**
|
||||
* @var KanbanEntry[]|ArrayCollection
|
||||
*/
|
||||
private $verification;
|
||||
|
||||
/**
|
||||
* @var KanbanEntry[]|ArrayCollection
|
||||
*/
|
||||
private $done;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->kanbanEntries = new ArrayCollection();
|
||||
$this->inbox = new ArrayCollection();
|
||||
$this->inProgress = new ArrayCollection();
|
||||
$this->verification = new ArrayCollection();
|
||||
$this->done = new ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return KanbanEntry[]|ArrayCollection
|
||||
*/
|
||||
public function getKanbanEntries(): ArrayCollection
|
||||
public function getInbox(): ArrayCollection
|
||||
{
|
||||
return $this->kanbanEntries;
|
||||
return $this->inbox;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param KanbanEntry[]|ArrayCollection $kanbanEntries
|
||||
* @param KanbanEntry[]|ArrayCollection $inbox
|
||||
* @return KanbanBoard
|
||||
*/
|
||||
public function setKanbanEntries(ArrayCollection $kanbanEntries): KanbanBoard
|
||||
public function setInbox(ArrayCollection $inbox): KanbanBoard
|
||||
{
|
||||
$this->kanbanEntries = $kanbanEntries;
|
||||
$this->inbox = $inbox;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param KanbanEntry $kanbanEntry
|
||||
* @param KanbanEntry $inbox
|
||||
* @return KanbanBoard
|
||||
*/
|
||||
public function addKanbanEntry(KanbanEntry $kanbanEntry): KanbanBoard
|
||||
public function addInbox(KanbanEntry $inbox): KanbanBoard
|
||||
{
|
||||
if(!$this->kanbanEntries->contains($kanbanEntry)) {
|
||||
$this->kanbanEntries->add($kanbanEntry);
|
||||
if (!$this->inbox->contains($inbox)) {
|
||||
$this->inbox->add($inbox);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param KanbanEntry $kanbanEntry
|
||||
* @param KanbanEntry $inbox
|
||||
* @return KanbanBoard
|
||||
*/
|
||||
public function removeKanbanEntry(KanbanEntry $kanbanEntry): KanbanBoard
|
||||
public function removeInbox(KanbanEntry $inbox): KanbanBoard
|
||||
{
|
||||
if($this->kanbanEntries->contains($kanbanEntry)) {
|
||||
$this->kanbanEntries->removeElement($kanbanEntry);
|
||||
if ($this->inbox->contains($inbox)) {
|
||||
$this->inbox->removeElement($inbox);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return KanbanEntry[]|ArrayCollection
|
||||
*/
|
||||
public function getInProgress(): ArrayCollection
|
||||
{
|
||||
return $this->inProgress;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param KanbanEntry[]|ArrayCollection $inProgress
|
||||
* @return KanbanBoard
|
||||
*/
|
||||
public function setInProgress(ArrayCollection $inProgress): KanbanBoard
|
||||
{
|
||||
$this->inProgress = $inProgress;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param KanbanEntry $inProgress
|
||||
* @return KanbanBoard
|
||||
*/
|
||||
public function addInProgress(KanbanEntry $inProgress): KanbanBoard
|
||||
{
|
||||
if (!$this->inProgress->contains($inProgress)) {
|
||||
$this->inProgress->add($inProgress);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param KanbanEntry $inProgress
|
||||
* @return KanbanBoard
|
||||
*/
|
||||
public function removeInProgress(KanbanEntry $inProgress): KanbanBoard
|
||||
{
|
||||
if ($this->inProgress->contains($inProgress)) {
|
||||
$this->inProgress->removeElement($inProgress);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return KanbanEntry[]|ArrayCollection
|
||||
*/
|
||||
public function getVerification(): ArrayCollection
|
||||
{
|
||||
return $this->verification;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param KanbanEntry[]|ArrayCollection $verification
|
||||
* @return KanbanBoard
|
||||
*/
|
||||
public function setVerification(ArrayCollection $verification): KanbanBoard
|
||||
{
|
||||
$this->verification = $verification;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param KanbanEntry $verification
|
||||
* @return KanbanBoard
|
||||
*/
|
||||
public function addVerification(KanbanEntry $verification): KanbanBoard
|
||||
{
|
||||
if (!$this->verification->contains($verification)) {
|
||||
$this->verification->add($verification);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param KanbanEntry $verification
|
||||
* @return KanbanBoard
|
||||
*/
|
||||
public function removeVerification(KanbanEntry $verification): KanbanBoard
|
||||
{
|
||||
if ($this->verification->contains($verification)) {
|
||||
$this->verification->removeElement($verification);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return KanbanEntry[]|ArrayCollection
|
||||
*/
|
||||
public function getDone(): ArrayCollection
|
||||
{
|
||||
return $this->done;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param KanbanEntry[]|ArrayCollection $verification
|
||||
* @return KanbanBoard
|
||||
*/
|
||||
public function setDone(ArrayCollection $verification): KanbanBoard
|
||||
{
|
||||
$this->done = $verification;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param KanbanEntry $verification
|
||||
* @return KanbanBoard
|
||||
*/
|
||||
public function addDone(KanbanEntry $verification): KanbanBoard
|
||||
{
|
||||
if (!$this->done->contains($verification)) {
|
||||
$this->done->add($verification);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param KanbanEntry $verification
|
||||
* @return KanbanBoard
|
||||
*/
|
||||
public function removeDone(KanbanEntry $verification): KanbanBoard
|
||||
{
|
||||
if ($this->done->contains($verification)) {
|
||||
$this->done->removeElement($verification);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
@ -63,6 +207,11 @@ class KanbanBoard implements \JsonSerializable
|
||||
*/
|
||||
function jsonSerialize()
|
||||
{
|
||||
return $this->kanbanEntries->getValues();
|
||||
return [
|
||||
'inbox' => $this->inbox->getValues(),
|
||||
'inProgress' => $this->inProgress->getValues(),
|
||||
'verification' => $this->verification->getValues(),
|
||||
'done' => $this->done->getValues(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -163,7 +163,20 @@ class DataCollectorService
|
||||
unset($jiraIssueType);
|
||||
}
|
||||
|
||||
$kanbanBoard->addKanbanEntry($kanbanEntry);
|
||||
switch($jiraStatus->getName()) {
|
||||
case "Backlog":
|
||||
$kanbanBoard->addInbox($kanbanEntry);
|
||||
break;
|
||||
case "In Progress":
|
||||
$kanbanBoard->addInProgress($kanbanEntry);
|
||||
break;
|
||||
case "Verification":
|
||||
$kanbanBoard->addVerification($kanbanEntry);
|
||||
break;
|
||||
case "Done":
|
||||
$kanbanBoard->addDone($kanbanEntry);
|
||||
break;
|
||||
}
|
||||
unset($kanbanEntry);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user