From c096510b3d9fec90570968c9b0fb38219fd931dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Danyi?= Date: Fri, 27 Apr 2018 18:41:03 +0200 Subject: [PATCH] * kanban column added for team column config data * team contains jira filter id and kanban column config --- src/App/Entity/KanbanColumn.php | 83 ++++++++++++++++++++ src/App/Entity/KanbanEntry.php | 8 +- src/App/Entity/Team.php | 132 +++++++++++++++++++++++++++++++- src/App/Form/Team.php | 55 +++++++++++++ 4 files changed, 273 insertions(+), 5 deletions(-) create mode 100644 src/App/Entity/KanbanColumn.php diff --git a/src/App/Entity/KanbanColumn.php b/src/App/Entity/KanbanColumn.php new file mode 100644 index 0000000..8af7d6f --- /dev/null +++ b/src/App/Entity/KanbanColumn.php @@ -0,0 +1,83 @@ +jiraStatusName; + } + + /** + * @param string $jiraStatusName + * @return KanbanColumn + */ + public function setJiraStatusName(?string $jiraStatusName): KanbanColumn + { + $this->jiraStatusName = $jiraStatusName; + return $this; + } + + /** + * @return string + */ + public function getLabel(): ?string + { + return $this->label; + } + + /** + * @param string $label + * @return KanbanColumn + */ + public function setLabel(?string $label): KanbanColumn + { + $this->label = $label; + return $this; + } + + /** + * @return int + */ + public function getWipLimit(): ?int + { + return $this->wipLimit; + } + + /** + * @param int $wipLimit + * @return KanbanColumn + */ + public function setWipLimit(?int $wipLimit): KanbanColumn + { + $this->wipLimit = $wipLimit; + return $this; + } + + /** + * @return array + */ + function jsonSerialize() + { + return [ + 'jiraStatusName' => $this->getJiraStatusName(), + 'label' => $this->getLabel(), + 'wipLimit' => $this->getWipLimit(), + ]; + } +} diff --git a/src/App/Entity/KanbanEntry.php b/src/App/Entity/KanbanEntry.php index 29fff20..aa4e48f 100644 --- a/src/App/Entity/KanbanEntry.php +++ b/src/App/Entity/KanbanEntry.php @@ -309,7 +309,7 @@ class KanbanEntry implements \JsonSerializable /** * @return string */ - public function getIssuePriority(): string + public function getIssuePriority(): ?string { return $this->issuePriority; } @@ -318,7 +318,7 @@ class KanbanEntry implements \JsonSerializable * @param string $issuePriority * @return KanbanEntry */ - public function setIssuePriority(string $issuePriority): KanbanEntry + public function setIssuePriority(?string $issuePriority): KanbanEntry { $this->issuePriority = $issuePriority; return $this; @@ -327,7 +327,7 @@ class KanbanEntry implements \JsonSerializable /** * @return string */ - public function getIssuePriorityIcon(): string + public function getIssuePriorityIcon(): ?string { return $this->issuePriorityIcon; } @@ -336,7 +336,7 @@ class KanbanEntry implements \JsonSerializable * @param string $issuePriorityIcon * @return KanbanEntry */ - public function setIssuePriorityIcon(string $issuePriorityIcon): KanbanEntry + public function setIssuePriorityIcon(?string $issuePriorityIcon): KanbanEntry { $this->issuePriorityIcon = $issuePriorityIcon; return $this; diff --git a/src/App/Entity/Team.php b/src/App/Entity/Team.php index 23587ea..a690faa 100644 --- a/src/App/Entity/Team.php +++ b/src/App/Entity/Team.php @@ -47,6 +47,36 @@ class Team implements JsonSerializable */ private $slides; + /** + * @ORM\Column(name="filter_id", type="integer", nullable=true) + * @var int + */ + private $filterId; + + /** + * @ORM\Column(name="backlog_column", type="json", nullable=true) + * @var KanbanColumn + */ + private $backlogColumn; + + /** + * @ORM\Column(name="inprogress_column", type="json", nullable=true) + * @var KanbanColumn + */ + private $inprogressColumn; + + /** + * @ORM\Column(name="verification_column", type="json", nullable=true) + * @var KanbanColumn + */ + private $verificationColumn; + + /** + * @ORM\Column(name="done_column", type="json", nullable=true) + * @var KanbanColumn + */ + private $doneColumn; + /** * @ORM\Column(name="is_active", type="boolean") * @var bool @@ -69,8 +99,13 @@ class Team implements JsonSerializable public function __construct() { - $this->slides = new ArrayCollection; $this->members = new \ArrayObject; + $this->slides = new ArrayCollection; + + $this->backlogColumn = new KanbanColumn(); + $this->inprogressColumn = new KanbanColumn(); + $this->verificationColumn = new KanbanColumn(); + $this->doneColumn = new KanbanColumn(); } /** @@ -159,6 +194,96 @@ class Team implements JsonSerializable return $this; } + /** + * @return int + */ + public function getFilterId(): ?int + { + return $this->filterId; + } + + /** + * @param int $filterId + * @return Team + */ + public function setFilterId(?int $filterId): Team + { + $this->filterId = $filterId; + return $this; + } + + /** + * @return array|KanbanColumn + */ + public function getBacklogColumn() + { + return $this->backlogColumn; + } + + /** + * @param array $backlogColumn + * @return Team + */ + public function setBacklogColumn(?array $backlogColumn): Team + { + $this->backlogColumn = $backlogColumn; + return $this; + } + + /** + * @return array|KanbanColumn + */ + public function getInprogressColumn() + { + return $this->inprogressColumn; + } + + /** + * @param array $inprogressColumn + * @return Team + */ + public function setInprogressColumn(array $inprogressColumn): Team + { + $this->inprogressColumn = $inprogressColumn; + return $this; + } + + /** + * @return array|KanbanColumn + */ + public function getVerificationColumn() + { + return $this->verificationColumn; + } + + /** + * @param array $verificationColumn + * @return Team + */ + public function setVerificationColumn(?array $verificationColumn): Team + { + $this->verificationColumn = $verificationColumn; + return $this; + } + + /** + * @return array|KanbanColumn + */ + public function getDoneColumn() + { + return $this->doneColumn; + } + + /** + * @param array $doneColumn + * @return Team + */ + public function setDoneColumn(?array $doneColumn): Team + { + $this->doneColumn = $doneColumn; + return $this; + } + /** * @return bool */ @@ -222,6 +347,11 @@ class Team implements JsonSerializable 'id' => $this->getId(), 'name' => $this->getName(), 'members' => $this->getMembers(), + 'filterId' => $this->getFilterId(), + 'backlogColumn' => $this->getBacklogColumn() ?? new KanbanColumn(), + 'inprogressColumn' => $this->getInprogressColumn() ?? new KanbanColumn(), + 'verificationColumn' => $this->getVerificationColumn() ?? new KanbanColumn(), + 'doneColumn' => $this->getDoneColumn() ?? new KanbanColumn(), 'isActive' => $this->isActive(), 'createdAt' => $this->getCreatedAt() ? $this->getCreatedAt()->format("Y-m-d H:i:s") diff --git a/src/App/Form/Team.php b/src/App/Form/Team.php index 2f0aa57..4d6335f 100644 --- a/src/App/Form/Team.php +++ b/src/App/Form/Team.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace App\Form; +use App\Entity\KanbanColumn; use Zend\Form\Annotation; /** @@ -41,6 +42,60 @@ class Team */ private $members; + /** + * @Annotation\Type("Zend\Form\Element\Number") + * @Annotation\Required(true) + * @Annotation\Options({ + * "label": "Jira filter id" + * }) + * @var int + */ + private $filterId; + + /** + * This is a dummy field, not a text actually. Only used to filter the input + * @Annotation\Type("Zend\Form\Element\Text") + * @Annotation\Required(true) + * @Annotation\Options({ + * "label": "1st column" + * }) + * @var KanbanColumn + */ + private $backlogColumn; + + /** + * This is a dummy field, not a text actually. Only used to filter the input + * @Annotation\Type("Zend\Form\Element\Text") + * @Annotation\Required(true) + * @Annotation\Options({ + * "label": "1st column" + * }) + * @var KanbanColumn + */ + private $inprogressColumn; + + /** + * This is a dummy field, not a text actually. Only used to filter the input + * @Annotation\Type("Zend\Form\Element\Text") + * @Annotation\Required(true) + * @Annotation\Options({ + * "label": "1st column" + * }) + * @var KanbanColumn + */ + private $verificationColumn; + + /** + * This is a dummy field, not a text actually. Only used to filter the input + * @Annotation\Type("Zend\Form\Element\Text") + * @Annotation\Required(true) + * @Annotation\Options({ + * "label": "1st column" + * }) + * @var KanbanColumn + */ + private $doneColumn; + /** * Also a dummy field, a * @Annotation\Type("Zend\Form\Element\Text")