From 66bc94037d95561287d556c03ca04b0bcab0e8bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Danyi?= Date: Mon, 17 Sep 2018 15:56:30 +0200 Subject: [PATCH] * builtin slide switching added to the backend --- src/App/Entity/KanbanBoard.php | 13 +++++- src/App/Entity/Team.php | 75 ++++++++++++++++++++++++++++++++++ src/App/Form/Team.php | 48 ++++++++++++++++++++++ 3 files changed, 135 insertions(+), 1 deletion(-) diff --git a/src/App/Entity/KanbanBoard.php b/src/App/Entity/KanbanBoard.php index 1a54b9b..2d6b880 100755 --- a/src/App/Entity/KanbanBoard.php +++ b/src/App/Entity/KanbanBoard.php @@ -8,6 +8,14 @@ use Doctrine\Common\Collections\ArrayCollection; class KanbanBoard implements \JsonSerializable { + const PRIO_MAP = [ + 'Trivial' => 0, + 'Minor' => 1, + 'Major' => 2, + 'Critical' => 3, + 'Blocker' => 4, + ]; + /** * @var KanbanEntry[]|ArrayCollection */ @@ -211,7 +219,10 @@ class KanbanBoard implements \JsonSerializable private function prioSort(array $toSort): array { usort($toSort, function (KanbanEntry $a, KanbanEntry $b) { - return $a->getTaurusPrio() <=> $b->getTaurusPrio(); +// if (null !== $a->getTaurusPrio()) { + return $a->getTaurusPrio() <=> $b->getTaurusPrio(); +// } +// return self::PRIO_MAP[$b->getIssuePriority()] <=> self::PRIO_MAP[$a->getIssuePriority()]; }); return $toSort; } diff --git a/src/App/Entity/Team.php b/src/App/Entity/Team.php index b9527e7..ef3bd54 100755 --- a/src/App/Entity/Team.php +++ b/src/App/Entity/Team.php @@ -57,6 +57,24 @@ class Team implements JsonSerializable */ private $slides; + /** + * @ORM\Column(name="kanban_enabled", type="boolean", options={"default" = true}) + * @var bool + */ + private $kanbanEnabled = true; + + /** + * @ORM\Column(name="commit_tracker_enabled", type="boolean", options={"default" = true}) + * @var bool + */ + private $commitTrackerEnabled = true; + + /** + * @ORM\Column(name="watched_enabled", type="boolean", options={"default" = true}) + * @var bool + */ + private $watchedEnabled = true; + /** * @ORM\Column(name="filter_id", type="integer", nullable=true) * @var int @@ -243,6 +261,60 @@ class Team implements JsonSerializable return $this; } + /** + * @return bool + */ + public function isKanbanEnabled(): bool + { + return $this->kanbanEnabled; + } + + /** + * @param bool $kanbanEnabled + * @return Team + */ + public function setKanbanEnabled(bool $kanbanEnabled): Team + { + $this->kanbanEnabled = $kanbanEnabled; + return $this; + } + + /** + * @return bool + */ + public function isCommitTrackerEnabled(): bool + { + return $this->commitTrackerEnabled; + } + + /** + * @param bool $commitTrackerEnabled + * @return Team + */ + public function setCommitTrackerEnabled(bool $commitTrackerEnabled): Team + { + $this->commitTrackerEnabled = $commitTrackerEnabled; + return $this; + } + + /** + * @return bool + */ + public function isWatchedEnabled(): bool + { + return $this->watchedEnabled; + } + + /** + * @param bool $watchedEnabled + * @return Team + */ + public function setWatchedEnabled(bool $watchedEnabled): Team + { + $this->watchedEnabled = $watchedEnabled; + return $this; + } + /** * @return int */ @@ -451,6 +523,9 @@ class Team implements JsonSerializable 'name' => $this->getName(), 'members' => $this->getMembers() ?? [], 'labels' => $this->getLabels() ?? [], + 'kanbanEnabled' => $this->isKanbanEnabled(), + 'commitTrackerEnabled' => $this->isCommitTrackerEnabled(), + 'watchedEnabled' => $this->isWatchedEnabled(), 'filterId' => $this->getFilterId(), 'dailyLockEnabled' => $this->isDailyLockEnabled(), 'dailyStartTime' => $this->getDailyStartTime() diff --git a/src/App/Form/Team.php b/src/App/Form/Team.php index d4d1437..67a8613 100755 --- a/src/App/Form/Team.php +++ b/src/App/Form/Team.php @@ -53,6 +53,54 @@ class Team */ private $labels; + /** + * This is a dummy field, not a text actually. Only used to filter the input + * @Annotation\Type("Zend\Form\Element\Text") + * @Annotation\Options({ + * "label": "Active" + * }) + * @Annotation\Validator({ + * "name":"NotEmpty", + * "options": {"type": Zend\Validator\NotEmpty::NULL} + * }) + * @Annotation\Required(false) + + * @var bool + */ + private $kanbanEnabled; + + /** + * This is a dummy field, not a text actually. Only used to filter the input + * @Annotation\Type("Zend\Form\Element\Text") + * @Annotation\Options({ + * "label": "Active" + * }) + * @Annotation\Validator({ + * "name":"NotEmpty", + * "options": {"type": Zend\Validator\NotEmpty::NULL} + * }) + * @Annotation\Required(false) + + * @var bool + */ + private $commitTrackerEnabled; + + /** + * This is a dummy field, not a text actually. Only used to filter the input + * @Annotation\Type("Zend\Form\Element\Text") + * @Annotation\Options({ + * "label": "Active" + * }) + * @Annotation\Validator({ + * "name":"NotEmpty", + * "options": {"type": Zend\Validator\NotEmpty::NULL} + * }) + * @Annotation\Required(false) + + * @var bool + */ + private $watchedEnabled; + /** * @Annotation\Type("Zend\Form\Element\Number") * @Annotation\Required(true)