Skip to content

Commit

Permalink
Last phase last decision event should show selected decision maker (b…
Browse files Browse the repository at this point in the history
…cgov#1700)

* Delegation of Decision should show the chosen decision maker in the last phase last event decision
  • Loading branch information
dinesh-aot authored Jan 18, 2024
1 parent e83a3fa commit 7a10b31
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 3 additions & 5 deletions epictrack-api/src/api/services/work_phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,12 @@ def find_multiple_works_phases_status(
result_dict = {}
work_ids = list(work_params_dict.keys())

work_phases_dict, total_work_phases = cls._query_work_phases(work_ids)
work_phases_dict = cls._query_work_phases(work_ids)[0]

index = 1
for work_id, work_phase_id in work_params_dict.items():
result_dict[work_id] = cls._find_work_phase_status(
work_id, work_phase_id, work_phases_dict.get(work_id, [])
)
result_dict["is_last_phase"] = index == total_work_phases
index = index + 1

return result_dict

Expand Down Expand Up @@ -150,7 +147,7 @@ def _find_work_phase_status(cls, work_id, work_phase_id, work_phases):
events = EventService.find_events(work_id, event_categories=PRIMARY_CATEGORIES)
if work_phase_id is not None:
work_phases = [wp for wp in work_phases if wp.id == work_phase_id]
for work_phase in work_phases:
for index, work_phase in enumerate(work_phases, start=1):
result_item = {"work_phase": work_phase}
total_days = (
work_phase.end_date.date() - work_phase.start_date.date()
Expand All @@ -175,6 +172,7 @@ def _find_work_phase_status(cls, work_id, work_phase_id, work_phases):

days_left = cls._get_days_left(suspended_days, total_days, work_phase)
result_item["days_left"] = days_left
result_item["is_last_phase"] = index == len(work_phases)
result.append(result_item)
return result

Expand Down
6 changes: 5 additions & 1 deletion epictrack-web/src/components/shared/DatePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ const TrackDatePicker: React.FC<TrackDatePickerProps> = ({
fullWidth: true,
placeholder: placeholder ?? DATE_FORMAT,
onKeyDown: (e) => e.preventDefault(),
onBlur: (e) => rest.onBlur(e),
onBlur: (e) => {
if (rest.onBlur) {
rest.onBlur(e);
}
},
...(textFieldProps ?? {}),
},
...restSlotProps,
Expand Down

0 comments on commit 7a10b31

Please sign in to comment.