Skip to content

Commit 223eff6

Browse files
authored
Merge pull request #7 from Dion213/CDASH-22
Bugfix
2 parents e4350ec + 484479f commit 223eff6

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

resources/views/tile.blade.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
<div class="pl-3 pt-1 pb-1 rounded-t-lg flex" style="font-size: 1.4rem; background-color: rgb(0, 82, 204);">
1313
<div class="w-5/6">{{$issue["key"]}}</div>
1414
@if ($issue['asImg'])
15-
<img class="w-1/6 rounded-full" src="{{$issue["asImg"]}}" style="max-width: 2rem" alt="employee profile picture">
16-
@else
17-
<div class="w-1/6 rounded-full" style="max-width: 2rem">{{ $issue['asInitials'] }}</div>
15+
<img class="w-1/6 rounded-full" src="{{$issue["asImg"]}}" style="max-width: 2rem" alt="employee profile picture">
16+
@elseif (! $issue['asImg'] && $issue['asInitials'])
17+
<div class="flex justify-center items-center rounded-full bg-yellow-500 text-base w-8 h-8">
18+
<p>{{ $issue['asInitials'] }}</p>
19+
</div>
1820
@endif
1921
</div>
2022
<div class="rounded-b-lg" style="border: 1px solid rgb(0, 82, 204); border-top: 0; color:white;">

src/FetchDataFromJiraCommand.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,17 @@ public function handle()
2828

2929
$jiraData = [];
3030
$i = 0;
31-
foreach ($output["issues"] as $issue){
32-
$initials = explode(' ', $issue["fields"]["assignee"]["displayName"]);
31+
foreach ($output["issues"] as $issue) {
32+
$nameArray = explode(' ', $issue["fields"]["assignee"]["displayName"]);
33+
34+
$initials = substr($nameArray[0], 0, 1).
35+
(($nameArray[1] ?? false) ? substr($nameArray[(count($nameArray)-1)], 0, 1) : '');
3336

3437
$jiraData[$i] = [
3538
'key' => $issue["key"],
3639
'title' => $issue["fields"]["summary"],
37-
'prImg' => $issue["fields"]["project"]["avatarUrls"]["48x48"],
3840
'asImg' => $issue["fields"]["assignee"]["avatarUrls"]["48x48"] ?? null,
39-
'asInitials' => substr($initials[0],0,1).substr($initials[1],0,1),
41+
'asInitials' => substr($initials[0],0,1).substr($initials[1],0,1) ?? null,
4042
];
4143
$i++;
4244
}

0 commit comments

Comments
 (0)