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

@ -187,6 +187,16 @@ class ScrumController extends AbstractController
// Mise à jour des issues par rapport à gitea // Mise à jour des issues par rapport à gitea
$em->getRepository("App:Scrum")->getGitea($data,$giteaassignees,$giteacolumns,$giteamilestones,$giteateams,$giteaprioritys,$giteatypes,$gitealabels,$forcereload); $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 // Création du tableau des issues
$issues=$data->getScrumissues(); $issues=$data->getScrumissues();
@ -404,6 +414,7 @@ class ScrumController extends AbstractController
'sprints' => $data->getScrumsprintstosee($viewclosed), 'sprints' => $data->getScrumsprintstosee($viewclosed),
'giteateams' => $giteateams, 'giteateams' => $giteateams,
'giteaprioritys' => $giteaprioritys, 'giteaprioritys' => $giteaprioritys,
'prioritycolor' => $prioritycolor,
'giteatypes' => $giteatypes, 'giteatypes' => $giteatypes,
'gitealabels' => $gitealabels, 'gitealabels' => $gitealabels,
'viewcondensed' => $viewcondensed, 'viewcondensed' => $viewcondensed,

View File

@ -33,6 +33,11 @@ class Scrumissue
*/ */
private $weight=0; private $weight=0;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $color;
/** /**
* @ORM\Column(type="integer") * @ORM\Column(type="integer")
*/ */
@ -332,4 +337,16 @@ class Scrumissue
return $this; 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 datateams="" %}
{% set datatypes="" %} {% set datatypes="" %}
{% set dataprioritys="datapriority"~giteaprioritys|last %} {% set dataprioritys="datapriority"~giteaprioritys|last %}
{% set issuprioritycolor=prioritycolor %}
{% for label in issue.giteajson.labels %} {% for label in issue.giteajson.labels %}
{% if label.id not in giteacolumns and label.id in giteateams %} {% if label.id not in giteacolumns and label.id in giteateams %}
{% set datateams=datateams~"datateam"~label.id~" " %} {% set datateams=datateams~"datateam"~label.id~" " %}
@ -206,6 +207,7 @@
{% if label.id not in giteacolumns and label.id in giteaprioritys %} {% if label.id not in giteacolumns and label.id in giteaprioritys %}
{% set dataprioritys="datapriority"~label.id~" " %} {% set dataprioritys="datapriority"~label.id~" " %}
{% set issuprioritycolor="#"~label.color %}
{% endif %} {% 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 %} {% 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~" " %} {% set dataassignees=dataassignees~"dataassignee"~assignee.id~" " %}
{% endfor %} {% 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="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="flex-grow-1 d-flex align-items-center" style="max-width:224px";>
<div class="pr-2 issu-id" style="cursor:move"> <div class="pr-2 issu-id" style="cursor:move">
@ -301,8 +303,11 @@
N'est plus bloquant pour #{{ issue.scrumissueblock.giteanumber}} N'est plus bloquant pour #{{ issue.scrumissueblock.giteanumber}}
</span> </span>
</div> </div>
{% endif %}
{% 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>
<div id="issu-detail{{ issue.id }}" class="card-body p-1 issu-detail"> <div id="issu-detail{{ issue.id }}" class="card-body p-1 issu-detail">