Skip to content

Commit

Permalink
[Track-280] 30-60-90 Report Update work/milestone filters and formatt…
Browse files Browse the repository at this point in the history
…ing (#2491)
  • Loading branch information
tolkamps1 authored Jan 6, 2025
1 parent 4c09fcc commit 7bb5c53
Show file tree
Hide file tree
Showing 5 changed files with 355 additions and 164 deletions.
2 changes: 2 additions & 0 deletions epictrack-api/src/api/models/event_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class EventTypeEnum(enum.Enum):
# pylint: disable=C0103
ADM = 16
CEAO_DECISION = 15
COMMENT_PERIOD = 22
EAC_MINISTER = 13
MINISTER_DECISION = 14
REFERRAL = 5
TIME_LIMIT_RESUMPTION = 38
Expand Down
8 changes: 4 additions & 4 deletions epictrack-api/src/api/reports/report_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ class ReportFactory(ABC):

def __init__(
self,
color_intensity=None,
data_keys=None,
filters=None,
group_by=None,
group_sort_order=None,
item_sort_key=None,
template_name=None,
filters=None,
color_intensity=None
template_name=None
):
"""Constructor"""
self.data_keys = data_keys
Expand Down Expand Up @@ -62,7 +62,7 @@ def _format_data(self, data, report_title=None):
else:
for item in data:
obj = {
k: getattr(item, k) for k in self.data_keys if k not in excluded_items
k: getattr(item, k, None) for k in self.data_keys if k not in excluded_items
}
if self.group_by:
formatted_data[obj.get(self.group_by, -1)].append(obj)
Expand Down
6 changes: 3 additions & 3 deletions epictrack-api/src/api/reports/resource_forecast_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ def __init__(self, filters, color_intensity):
]
group_by = "work_id"
super().__init__(
color_intensity=color_intensity,
data_keys=data_keys,
group_by=group_by,
template_name=None,
filters=filters,
color_intensity=color_intensity
group_by=group_by,
template_name=None
)
self.excluded_items = []
if self.filters and "exclude" in self.filters:
Expand Down
Loading

0 comments on commit 7bb5c53

Please sign in to comment.