Skip to content

Commit 301a7e0

Browse files
author
Renato Marinho
authored
Merge pull request #262 from Mainstay-Technologies/master
Fix for sprint planning index error
2 parents 72c08fb + ad8deeb commit 301a7e0

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

app/Http/Controllers/Web/IssueController.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,16 @@ public function index($slug)
3535
->with('issues.sprint')
3636
->with('issues.configEffort')
3737
->first();
38-
39-
$issues = $sprint->issues;
38+
39+
//when viewing from sprint planning, issues need to be passed in an array indexed by their status, so they can be put in the appropriate kanban columns
40+
$is = $sprint->issues;
41+
$issues = array();
42+
foreach($is as $i) {
43+
$issues[$i->config_status_id] = array();
44+
}
45+
foreach($is as $i) {
46+
$issues[$i->config_status_id][] = $i;
47+
}
4048
} else {
4149
$sprint = null;
4250
$issues = Auth::user()->issues()

resources/views/partials/forms/issue.blade.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
@if( $obj->productBacklog->sprints()->count() )
2424
<select name="sprint_id" class="form-control">
2525
@foreach ($obj->productBacklog->sprints()->get() as $sprint)
26-
<option @if(isset($issue->sprint_id) && $issue->sprint_id = $sprint->id) selected="selected" @endif
26+
<option
27+
@if(isset($issue->sprint_id) && $issue->sprint_id == $sprint->id) selected="selected"
28+
@elseif(isset($obj->id) && $obj->id == $sprint->id) selected = "selected"
29+
@endif
2730
value="{{$sprint->id}}">{{$sprint->title}} - {{$sprint->timebox}}</option>
2831
@endforeach
2932
</select>

0 commit comments

Comments
 (0)