This commit is contained in:
afornerot 2024-04-12 21:56:11 +02:00
parent d2ff60af5c
commit b530a4d8ff
3 changed files with 47 additions and 3 deletions

View File

@ -346,6 +346,10 @@ app_scrumissue_unblock:
path: /user/scrumissue/unblock
defaults: { _controller: App\Controller\ScrumissueController:unblock }
app_scrumissue_color:
path: /user/scrumissue/color
defaults: { _controller: App\Controller\ScrumissueController:color }
app_scrumissue_ctrlchange:
path: /user/scrumissue/ctrlchange
defaults: { _controller: App\Controller\ScrumissueController:ctrlchange }

View File

@ -250,7 +250,7 @@ class ScrumissueController extends AbstractController
// Bloquer l'issue
$response=$this->giteaservice->postIssueblocks($scrumissue->getScrum()->getGiteajson()["owner"]["login"],$scrumissue->getScrum()->getGiteajson()["name"],$scrumissue->getGiteanumber(),$issueblocked);
dump($response);
if(!$response) return new JsonResponse(['message' => 'Error api'], 403);
return new JsonResponse([]);
@ -275,6 +275,22 @@ class ScrumissueController extends AbstractController
return new JsonResponse([]);
}
public function color(Request $request)
{
$em = $this->getDoctrine()->getManager();
$id=$request->get('id');
$color=$request->get('color');
// Rechercher l'issue en cours
$scrumissue=$em->getRepository("App:Scrumissue")->find($id);
if(!$scrumissue) return new JsonResponse(['message' => 'No Issue'], 403);
$scrumissue->setColor($color);
$em->flush();
return new JsonResponse([]);
}
public function ctrlchange(Request $request)
{
$em = $this->getDoctrine()->getManager();

View File

@ -220,8 +220,15 @@
{% set dataassignees=dataassignees~"dataassignee"~assignee.id~" " %}
{% endfor %}
{% set backcolor="" %}
{% if not issue.color is empty %}
{% set backcolor="background-color:"~issue.color~";" %}
{% elseif issue.scrumissueblock and not issue.scrumissueblock.color is empty %}
{% set backcolor="background-color:"~issue.scrumissueblock.color~";" %}
{% endif %}
<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; {{ backcolor }}" >
<div class="flex-grow-1 d-flex align-items-center" style="max-width:224px";>
<div class="pr-2 issu-id" style="cursor:move">
#{{issue.giteanumber}}
@ -306,7 +313,7 @@
{% 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">
<input type="text" id="colorissu{{ issue.id }}" data-issue="{{ issue.id }}" class="pick-a-color form-control form-control spectrum sp-colorize" value="{{issue.color}}" autocomplete="off">
</div>
</div>
@ -716,6 +723,23 @@
});
});
$(".pick-a-color").on("change", function() {
$.ajax({
method: "POST",
url: "{{path("app_scrumissue_color")}}",
data: {
id:$(this).data("issue"),
color:$(this).val(),
},
success: function(data) {
location.reload();
},
error: function (request, status, error) {
alert("pb sur le set color");
}
});
});
// Filter Milestones
function filtermilestones() {
$.ajax({