Skip to content

Commit 8f6717e

Browse files
authored
Merge pull request #1409 from jadmsaadaot/workplan-phase-color
Add color for phase info
2 parents 734381d + 233a835 commit 8f6717e

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

epictrack-api/src/api/schemas/response/phase_response.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class Meta(AutoSchemaBase.Meta):
2222
ea_act = fields.Nested(EAActSchema, dump_only=True)
2323
work_type = fields.Nested(WorkTypeSchema, dump_only=True)
2424
visibility = fields.Method("get_visibility")
25+
color = fields.Str()
2526

2627
def get_visibility(self, obj: PhaseCode) -> str:
2728
"""Return value for the visibility"""

epictrack-api/src/api/services/work.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,15 @@ def _serialize_work(work, work_staffs, works_statuses, work_phase):
9595
only=("id", "work_state", "work_type", "federal_involvement", "eao_team", "title", "is_active")).dump(work)
9696
if work_phase[0]:
9797
serialised_phase = WorkPhaseAdditionalInfoResponseSchema(
98-
only=("work_phase.name", "total_number_of_days", "next_milestone", "milestone_progress", "days_left")
99-
).dump(work_phase[0])
98+
only=(
99+
"work_phase.name",
100+
"total_number_of_days",
101+
"next_milestone",
102+
"milestone_progress",
103+
"days_left",
104+
"work_phase.phase.color"
105+
)
106+
).dump(phase_info[0])
100107

101108
serialized_work["phase_info"] = serialised_phase
102109

epictrack-web/src/components/myWorkplans/CardList.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ import NoResultsFound from "../NoResultsFound";
33
import Card from "./Card";
44

55
const CardList = () => {
6-
const cards = [];
6+
const cards = [1, 2, 3, 4, 5];
7+
78
if (cards.length === 0) {
89
return <NoResultsFound />;
910
}
1011

1112
return (
1213
<Grid container direction="row" spacing={2}>
13-
{[1, 2, 3, 4, 5].map(() => {
14+
{cards.map(() => {
1415
return (
1516
<Grid item>
1617
<Card />

0 commit comments

Comments
 (0)