color priority

This commit is contained in:
afornerot 2024-04-12 20:27:25 +02:00
parent 8f8f53bff3
commit e98e1f2698
3 changed files with 35 additions and 2 deletions

View File

@ -188,6 +188,16 @@ class ScrumController extends AbstractController
// Mise à jour des issues par rapport à gitea
$em->getRepository("App:Scrum")->getGitea($data,$giteaassignees,$giteacolumns,$giteamilestones,$giteateams,$giteaprioritys,$giteatypes,$gitealabels,$forcereload);
// default color priority
$prioritycolor="#70c24a";
if(is_array($giteaprioritys)) {
$priority=$em->getRepository("App:Scrumpriority")->findOneBy(["scrum"=>$data,"giteaid"=>$giteaprioritys[array_key_last($giteaprioritys)]]);
if($priority) {
$prioritycolor="#".$priority->getGiteajson()["color"];
}
}
// Création du tableau des issues
$issues=$data->getScrumissues();
$tbissues=[];
@ -404,6 +414,7 @@ class ScrumController extends AbstractController
'sprints' => $data->getScrumsprintstosee($viewclosed),
'giteateams' => $giteateams,
'giteaprioritys' => $giteaprioritys,
'prioritycolor' => $prioritycolor,
'giteatypes' => $giteatypes,
'gitealabels' => $gitealabels,
'viewcondensed' => $viewcondensed,

View File

@ -33,6 +33,11 @@ class Scrumissue
*/
private $weight=0;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $color;
/**
* @ORM\Column(type="integer")
*/
@ -332,4 +337,16 @@ class Scrumissue
return $this;
}
public function getColor(): ?string
{
return $this->color;
}
public function setColor(?string $color): self
{
$this->color = $color;
return $this;
}
}

View File

@ -195,6 +195,7 @@
{% set datateams="" %}
{% set datatypes="" %}
{% set dataprioritys="datapriority"~giteaprioritys|last %}
{% set issuprioritycolor=prioritycolor %}
{% for label in issue.giteajson.labels %}
{% if label.id not in giteacolumns and label.id in giteateams %}
{% set datateams=datateams~"datateam"~label.id~" " %}
@ -206,6 +207,7 @@
{% if label.id not in giteacolumns and label.id in giteaprioritys %}
{% set dataprioritys="datapriority"~label.id~" " %}
{% set issuprioritycolor="#"~label.color %}
{% endif %}
{% if label.id not in giteacolumns and label.id not in giteateams and label.id not in giteatypes and label.id not in giteaprioritys %}
@ -218,7 +220,7 @@
{% set dataassignees=dataassignees~"dataassignee"~assignee.id~" " %}
{% endfor %}
<div id="issu{{ issue.id }}" data-id="{{ issue.id }}" data-issue="{{ issue.id }}" data-column="{{column.gicol}}" data-milestone="{{jalon.gijal}}" data-sprint="{{sprint.idspr}}" class="card mb-1 issue issue-{{issue.id}} {{datateams}} {{datatypes}} {{dataprioritys}} {{datalabels}} {{dataassignees}} state-{{issue.giteastate}}">
<div id="issu{{ issue.id }}" data-id="{{ issue.id }}" data-issue="{{ issue.id }}" data-column="{{column.gicol}}" data-milestone="{{jalon.gijal}}" data-sprint="{{sprint.idspr}}" class="card mb-1 issue issue-{{issue.id}} {{datateams}} {{datatypes}} {{dataprioritys}} {{datalabels}} {{dataassignees}} state-{{issue.giteastate}}" style="border-left: 10px solid {{issuprioritycolor}}">
<div class="card-footer p-1 d-flex" style="line-height:16px; border-top:none;">
<div class="flex-grow-1 d-flex align-items-center" style="max-width:224px";>
<div class="pr-2 issu-id" style="cursor:move">
@ -301,8 +303,11 @@
N'est plus bloquant pour #{{ issue.scrumissueblock.giteanumber}}
</span>
</div>
{% endif %}
<div>
<input type="text" id="colorissu{{ issue.id }}" class="pick-a-color form-control form-control spectrum sp-colorize" value="{{issue.color}}" autocomplete="off">
</div>
</div>
<div id="issu-detail{{ issue.id }}" class="card-body p-1 issu-detail">