Skip to content

Commit 398251c

Browse files
authored
feat: shorten report indicators sheet name (#601)
* feat: show indicator title on excel sheet * add support for separate excel sheet names * fix report indicators order * add short indicator sheet names
1 parent 0668729 commit 398251c

16 files changed

Lines changed: 1000 additions & 43 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Contracts\Enums;
6+
7+
use BackedEnum;
8+
use Illuminate\Contracts\Support\Htmlable;
9+
10+
interface HasSheetName extends BackedEnum
11+
{
12+
public function getSheetName(): string | Htmlable | null;
13+
}

app/Enums/Report/Standard/Indicators/Activity.php

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66

77
use App\Contracts\Enums\HasColumns;
88
use App\Contracts\Enums\HasQuery;
9+
use App\Contracts\Enums\HasSheetName;
910
use App\Contracts\Enums\HasTypes;
1011
use App\Enums\Report\Type;
1112
use App\Enums\User\Role;
1213
use CommitGlobal\Enums\Concerns\Arrayable;
1314
use CommitGlobal\Enums\Concerns\Comparable;
1415
use Filament\Support\Contracts\HasLabel;
1516

16-
enum Activity: string implements HasQuery, HasLabel, HasTypes, HasColumns
17+
enum Activity: string implements HasQuery, HasLabel, HasSheetName, HasTypes, HasColumns
1718
{
1819
use Arrayable;
1920
use Comparable;
@@ -55,6 +56,27 @@ public function getLabel(): ?string
5556
};
5657
}
5758

59+
public function getSheetName(): string
60+
{
61+
return match ($this) {
62+
self::A01 => __('report.standard.sheet.activity.A01'),
63+
self::A02 => __('report.standard.sheet.activity.A02'),
64+
self::A03 => __('report.standard.sheet.activity.A03'),
65+
self::A04 => __('report.standard.sheet.activity.A04'),
66+
self::A05 => __('report.standard.sheet.activity.A05'),
67+
self::A06 => __('report.standard.sheet.activity.A06'),
68+
self::A07 => __('report.standard.sheet.activity.A07'),
69+
self::A08 => __('report.standard.sheet.activity.A08'),
70+
self::A09 => __('report.standard.sheet.activity.A09'),
71+
self::A10 => __('report.standard.sheet.activity.A10'),
72+
self::A11 => __('report.standard.sheet.activity.A11'),
73+
self::A12 => __('report.standard.sheet.activity.A12'),
74+
self::A13 => __('report.standard.sheet.activity.A13'),
75+
self::A14 => __('report.standard.sheet.activity.A14'),
76+
self::A15 => __('report.standard.sheet.activity.A15'),
77+
};
78+
}
79+
5880
public function class(): string
5981
{
6082
return "\\App\\Reports\\Queries\\Activity\\{$this->value}";

app/Enums/Report/Standard/Indicators/CasesHealth.php

Lines changed: 134 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66

77
use App\Contracts\Enums\HasColumns;
88
use App\Contracts\Enums\HasQuery;
9+
use App\Contracts\Enums\HasSheetName;
910
use App\Contracts\Enums\HasTypes;
1011
use App\Enums\Report\Type;
1112
use App\Enums\User\Role;
1213
use CommitGlobal\Enums\Concerns\Arrayable;
1314
use CommitGlobal\Enums\Concerns\Comparable;
1415
use Filament\Support\Contracts\HasLabel;
1516

16-
enum CasesHealth: string implements HasQuery, HasLabel, HasTypes, HasColumns
17+
enum CasesHealth: string implements HasQuery, HasLabel, HasSheetName, HasTypes, HasColumns
1718
{
1819
use Arrayable;
1920
use Comparable;
@@ -277,6 +278,138 @@ public function getLabel(): ?string
277278
};
278279
}
279280

281+
public function getSheetName(): string
282+
{
283+
return match ($this) {
284+
self::CH01 => __('report.standard.sheet.cases_health.CH01'),
285+
self::CH02 => __('report.standard.sheet.cases_health.CH02'),
286+
self::CH03 => __('report.standard.sheet.cases_health.CH03'),
287+
self::CH04 => __('report.standard.sheet.cases_health.CH04'),
288+
self::CH05 => __('report.standard.sheet.cases_health.CH05'),
289+
self::CH06 => __('report.standard.sheet.cases_health.CH06'),
290+
self::CH07 => __('report.standard.sheet.cases_health.CH07'),
291+
self::CH08 => __('report.standard.sheet.cases_health.CH08'),
292+
self::CH09 => __('report.standard.sheet.cases_health.CH09'),
293+
self::CH10 => __('report.standard.sheet.cases_health.CH10'),
294+
self::CH11 => __('report.standard.sheet.cases_health.CH11'),
295+
self::CH12 => __('report.standard.sheet.cases_health.CH12'),
296+
self::CH13 => __('report.standard.sheet.cases_health.CH13'),
297+
self::CH14 => __('report.standard.sheet.cases_health.CH14'),
298+
self::CH15 => __('report.standard.sheet.cases_health.CH15'),
299+
self::CH16 => __('report.standard.sheet.cases_health.CH16'),
300+
self::CH17 => __('report.standard.sheet.cases_health.CH17'),
301+
self::CH18 => __('report.standard.sheet.cases_health.CH18'),
302+
self::CH19 => __('report.standard.sheet.cases_health.CH19'),
303+
self::CH20 => __('report.standard.sheet.cases_health.CH20'),
304+
self::CH21 => __('report.standard.sheet.cases_health.CH21'),
305+
self::CH22 => __('report.standard.sheet.cases_health.CH22'),
306+
self::CH23 => __('report.standard.sheet.cases_health.CH23'),
307+
self::CH24 => __('report.standard.sheet.cases_health.CH24'),
308+
self::CH25 => __('report.standard.sheet.cases_health.CH25'),
309+
self::CH26 => __('report.standard.sheet.cases_health.CH26'),
310+
self::CH27 => __('report.standard.sheet.cases_health.CH27'),
311+
self::CH28 => __('report.standard.sheet.cases_health.CH28'),
312+
self::CH29 => __('report.standard.sheet.cases_health.CH29'),
313+
self::CH30 => __('report.standard.sheet.cases_health.CH30'),
314+
self::CH31 => __('report.standard.sheet.cases_health.CH31'),
315+
self::CH32 => __('report.standard.sheet.cases_health.CH32'),
316+
self::CH33 => __('report.standard.sheet.cases_health.CH33'),
317+
self::CH34 => __('report.standard.sheet.cases_health.CH34'),
318+
self::CH35 => __('report.standard.sheet.cases_health.CH35'),
319+
self::CH36 => __('report.standard.sheet.cases_health.CH36'),
320+
self::CH37 => __('report.standard.sheet.cases_health.CH37'),
321+
self::CH38 => __('report.standard.sheet.cases_health.CH38'),
322+
self::CH39 => __('report.standard.sheet.cases_health.CH39'),
323+
self::CH40 => __('report.standard.sheet.cases_health.CH40'),
324+
self::CH41 => __('report.standard.sheet.cases_health.CH41'),
325+
self::CH42 => __('report.standard.sheet.cases_health.CH42'),
326+
self::CH43 => __('report.standard.sheet.cases_health.CH43'),
327+
self::CH44 => __('report.standard.sheet.cases_health.CH44'),
328+
self::CH45 => __('report.standard.sheet.cases_health.CH45'),
329+
self::CH46 => __('report.standard.sheet.cases_health.CH46'),
330+
self::CH47 => __('report.standard.sheet.cases_health.CH47'),
331+
self::CH48 => __('report.standard.sheet.cases_health.CH48'),
332+
self::CH49 => __('report.standard.sheet.cases_health.CH49'),
333+
self::CH50 => __('report.standard.sheet.cases_health.CH50'),
334+
self::CH51 => __('report.standard.sheet.cases_health.CH51'),
335+
self::CH52 => __('report.standard.sheet.cases_health.CH52'),
336+
self::CH53 => __('report.standard.sheet.cases_health.CH53'),
337+
self::CH54 => __('report.standard.sheet.cases_health.CH54'),
338+
self::CH55 => __('report.standard.sheet.cases_health.CH55'),
339+
self::CH56 => __('report.standard.sheet.cases_health.CH56'),
340+
self::CH57 => __('report.standard.sheet.cases_health.CH57'),
341+
self::CH58 => __('report.standard.sheet.cases_health.CH58'),
342+
self::CH59 => __('report.standard.sheet.cases_health.CH59'),
343+
self::CH60 => __('report.standard.sheet.cases_health.CH60'),
344+
self::CH61 => __('report.standard.sheet.cases_health.CH61'),
345+
self::CH62 => __('report.standard.sheet.cases_health.CH62'),
346+
self::CH63 => __('report.standard.sheet.cases_health.CH63'),
347+
self::CH64 => __('report.standard.sheet.cases_health.CH64'),
348+
self::CH65 => __('report.standard.sheet.cases_health.CH65'),
349+
self::CH66 => __('report.standard.sheet.cases_health.CH66'),
350+
self::CH67 => __('report.standard.sheet.cases_health.CH67'),
351+
self::CH68 => __('report.standard.sheet.cases_health.CH68'),
352+
self::CH69 => __('report.standard.sheet.cases_health.CH69'),
353+
self::CH70 => __('report.standard.sheet.cases_health.CH70'),
354+
self::CH71 => __('report.standard.sheet.cases_health.CH71'),
355+
self::CH72 => __('report.standard.sheet.cases_health.CH72'),
356+
self::CH73 => __('report.standard.sheet.cases_health.CH73'),
357+
self::CH74 => __('report.standard.sheet.cases_health.CH74'),
358+
self::CH75 => __('report.standard.sheet.cases_health.CH75'),
359+
self::CH76 => __('report.standard.sheet.cases_health.CH76'),
360+
self::CH77 => __('report.standard.sheet.cases_health.CH77'),
361+
self::CH78 => __('report.standard.sheet.cases_health.CH78'),
362+
self::CH79 => __('report.standard.sheet.cases_health.CH79'),
363+
self::CH80 => __('report.standard.sheet.cases_health.CH80'),
364+
self::CH81 => __('report.standard.sheet.cases_health.CH81'),
365+
self::CH82 => __('report.standard.sheet.cases_health.CH82'),
366+
self::CH83 => __('report.standard.sheet.cases_health.CH83'),
367+
self::CH84 => __('report.standard.sheet.cases_health.CH84'),
368+
self::CH85 => __('report.standard.sheet.cases_health.CH85'),
369+
self::CH86 => __('report.standard.sheet.cases_health.CH86'),
370+
self::CH87 => __('report.standard.sheet.cases_health.CH87'),
371+
self::CH88 => __('report.standard.sheet.cases_health.CH88'),
372+
self::CH89 => __('report.standard.sheet.cases_health.CH89'),
373+
self::CH90 => __('report.standard.sheet.cases_health.CH90'),
374+
self::CH91 => __('report.standard.sheet.cases_health.CH91'),
375+
self::CH92 => __('report.standard.sheet.cases_health.CH92'),
376+
self::CH93 => __('report.standard.sheet.cases_health.CH93'),
377+
self::CH94 => __('report.standard.sheet.cases_health.CH94'),
378+
self::CH95 => __('report.standard.sheet.cases_health.CH95'),
379+
self::CH96 => __('report.standard.sheet.cases_health.CH96'),
380+
self::CH97 => __('report.standard.sheet.cases_health.CH97'),
381+
self::CH98 => __('report.standard.sheet.cases_health.CH98'),
382+
self::CH99 => __('report.standard.sheet.cases_health.CH99'),
383+
self::CH100 => __('report.standard.sheet.cases_health.CH100'),
384+
self::CH101 => __('report.standard.sheet.cases_health.CH101'),
385+
self::CH102 => __('report.standard.sheet.cases_health.CH102'),
386+
self::CH103 => __('report.standard.sheet.cases_health.CH103'),
387+
self::CH104 => __('report.standard.sheet.cases_health.CH104'),
388+
self::CH105 => __('report.standard.sheet.cases_health.CH105'),
389+
self::CH106 => __('report.standard.sheet.cases_health.CH106'),
390+
self::CH107 => __('report.standard.sheet.cases_health.CH107'),
391+
self::CH108 => __('report.standard.sheet.cases_health.CH108'),
392+
self::CH109 => __('report.standard.sheet.cases_health.CH109'),
393+
self::CH110 => __('report.standard.sheet.cases_health.CH110'),
394+
self::CH111 => __('report.standard.sheet.cases_health.CH111'),
395+
self::CH112 => __('report.standard.sheet.cases_health.CH112'),
396+
self::CH113 => __('report.standard.sheet.cases_health.CH113'),
397+
self::CH114 => __('report.standard.sheet.cases_health.CH114'),
398+
self::CH115 => __('report.standard.sheet.cases_health.CH115'),
399+
self::CH116 => __('report.standard.sheet.cases_health.CH116'),
400+
self::CH117 => __('report.standard.sheet.cases_health.CH117'),
401+
self::CH118 => __('report.standard.sheet.cases_health.CH118'),
402+
self::CH119 => __('report.standard.sheet.cases_health.CH119'),
403+
self::CH120 => __('report.standard.sheet.cases_health.CH120'),
404+
self::CH121 => __('report.standard.sheet.cases_health.CH121'),
405+
self::CH122 => __('report.standard.sheet.cases_health.CH122'),
406+
self::CH123 => __('report.standard.sheet.cases_health.CH123'),
407+
self::CH124 => __('report.standard.sheet.cases_health.CH124'),
408+
self::CH125 => __('report.standard.sheet.cases_health.CH125'),
409+
self::CH126 => __('report.standard.sheet.cases_health.CH126'),
410+
};
411+
}
412+
280413
public function class(): string
281414
{
282415
return "\\App\\Reports\\Queries\\CasesHealth\\{$this->value}";

app/Enums/Report/Standard/Indicators/Child.php

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66

77
use App\Contracts\Enums\HasColumns;
88
use App\Contracts\Enums\HasQuery;
9+
use App\Contracts\Enums\HasSheetName;
910
use App\Contracts\Enums\HasTypes;
1011
use App\Enums\Report\Type;
1112
use App\Enums\User\Role;
1213
use CommitGlobal\Enums\Concerns\Arrayable;
1314
use CommitGlobal\Enums\Concerns\Comparable;
1415
use Filament\Support\Contracts\HasLabel;
1516

16-
enum Child: string implements HasQuery, HasLabel, HasTypes, HasColumns
17+
enum Child: string implements HasQuery, HasLabel, HasSheetName, HasTypes, HasColumns
1718
{
1819
use Arrayable;
1920
use Comparable;
@@ -87,6 +88,43 @@ public function getLabel(): ?string
8788
};
8889
}
8990

91+
public function getSheetName(): string
92+
{
93+
return match ($this) {
94+
self::C01 => __('report.standard.sheet.child.C01'),
95+
self::C02 => __('report.standard.sheet.child.C02'),
96+
// self::C03 => __('report.standard.sheet.child.C03'),
97+
self::C04 => __('report.standard.sheet.child.C04'),
98+
self::C05 => __('report.standard.sheet.child.C05'),
99+
self::C06 => __('report.standard.sheet.child.C06'),
100+
self::C07 => __('report.standard.sheet.child.C07'),
101+
self::C08 => __('report.standard.sheet.child.C08'),
102+
self::C09 => __('report.standard.sheet.child.C09'),
103+
self::C10 => __('report.standard.sheet.child.C10'),
104+
self::C11 => __('report.standard.sheet.child.C11'),
105+
self::C12 => __('report.standard.sheet.child.C12'),
106+
self::C13 => __('report.standard.sheet.child.C13'),
107+
self::C14 => __('report.standard.sheet.child.C14'),
108+
self::C15 => __('report.standard.sheet.child.C15'),
109+
self::C16 => __('report.standard.sheet.child.C16'),
110+
self::C17 => __('report.standard.sheet.child.C17'),
111+
self::C18 => __('report.standard.sheet.child.C18'),
112+
self::C19 => __('report.standard.sheet.child.C19'),
113+
self::C20 => __('report.standard.sheet.child.C20'),
114+
self::C21 => __('report.standard.sheet.child.C21'),
115+
self::C22 => __('report.standard.sheet.child.C22'),
116+
self::C23 => __('report.standard.sheet.child.C23'),
117+
self::C24 => __('report.standard.sheet.child.C24'),
118+
self::C25 => __('report.standard.sheet.child.C25'),
119+
self::C26 => __('report.standard.sheet.child.C26'),
120+
self::C27 => __('report.standard.sheet.child.C27'),
121+
self::C28 => __('report.standard.sheet.child.C28'),
122+
self::C29 => __('report.standard.sheet.child.C29'),
123+
self::C30 => __('report.standard.sheet.child.C30'),
124+
self::C31 => __('report.standard.sheet.child.C31'),
125+
};
126+
}
127+
90128
public function class(): string
91129
{
92130
return "\\App\\Reports\\Queries\\Child\\{$this->value}";

app/Enums/Report/Standard/Indicators/CommunityActivities.php

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66

77
use App\Contracts\Enums\HasColumns;
88
use App\Contracts\Enums\HasQuery;
9+
use App\Contracts\Enums\HasSheetName;
910
use App\Contracts\Enums\HasTypes;
1011
use App\Enums\Report\Type;
1112
use App\Enums\User\Role;
1213
use CommitGlobal\Enums\Concerns\Arrayable;
1314
use CommitGlobal\Enums\Concerns\Comparable;
1415
use Filament\Support\Contracts\HasLabel;
1516

16-
enum CommunityActivities: string implements HasQuery, HasLabel, HasTypes, HasColumns
17+
enum CommunityActivities: string implements HasQuery, HasLabel, HasSheetName, HasTypes, HasColumns
1718
{
1819
use Arrayable;
1920
use Comparable;
@@ -71,9 +72,35 @@ public function getLabel(): ?string
7172
self::CA21 => __('report.standard.indicator.community_activities.CA21'),
7273
self::CA22 => __('report.standard.indicator.community_activities.CA22'),
7374
self::CA23 => __('report.standard.indicator.community_activities.CA23'),
74-
self::CA24 => __('report.standard.indicator.community_activities.CA24'),
75-
self::CA25 => __('report.standard.indicator.community_activities.CA25'),
76-
self::CA26 => __('report.standard.indicator.community_activities.CA26'),
75+
};
76+
}
77+
78+
public function getSheetName(): string
79+
{
80+
return match ($this) {
81+
self::CA01 => __('report.standard.sheet.community_activities.CA01'),
82+
self::CA02 => __('report.standard.sheet.community_activities.CA02'),
83+
self::CA03 => __('report.standard.sheet.community_activities.CA03'),
84+
self::CA04 => __('report.standard.sheet.community_activities.CA04'),
85+
self::CA05 => __('report.standard.sheet.community_activities.CA05'),
86+
self::CA06 => __('report.standard.sheet.community_activities.CA06'),
87+
self::CA07 => __('report.standard.sheet.community_activities.CA07'),
88+
self::CA08 => __('report.standard.sheet.community_activities.CA08'),
89+
self::CA09 => __('report.standard.sheet.community_activities.CA09'),
90+
self::CA10 => __('report.standard.sheet.community_activities.CA10'),
91+
self::CA11 => __('report.standard.sheet.community_activities.CA11'),
92+
self::CA12 => __('report.standard.sheet.community_activities.CA12'),
93+
self::CA13 => __('report.standard.sheet.community_activities.CA13'),
94+
self::CA14 => __('report.standard.sheet.community_activities.CA14'),
95+
self::CA15 => __('report.standard.sheet.community_activities.CA15'),
96+
self::CA16 => __('report.standard.sheet.community_activities.CA16'),
97+
self::CA17 => __('report.standard.sheet.community_activities.CA17'),
98+
self::CA18 => __('report.standard.sheet.community_activities.CA18'),
99+
self::CA19 => __('report.standard.sheet.community_activities.CA19'),
100+
self::CA20 => __('report.standard.sheet.community_activities.CA20'),
101+
self::CA21 => __('report.standard.sheet.community_activities.CA21'),
102+
self::CA22 => __('report.standard.sheet.community_activities.CA22'),
103+
self::CA23 => __('report.standard.sheet.community_activities.CA23'),
77104
};
78105
}
79106

0 commit comments

Comments
 (0)