Skip to content

Commit

Permalink
255: Fix description field as well as better output for the pdf gener… (
Browse files Browse the repository at this point in the history
#2439)

…ation.
  • Loading branch information
marklise authored Nov 19, 2024
1 parent 71e3342 commit bb144fd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion epictrack-api/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ notes=FIXME,XXX,TODO
ignored-modules=flask_sqlalchemy,sqlalchemy,SQLAlchemy,alembic,scoped_session
ignored-classes=scoped_session
min-similarity-lines=15
disable=C0301,W0511, R0917, C0411, R1710, E1101, W4904, R0914, R1702
disable=C0301,W0511, R0917, C0411, R1710, E1101, W4904, R0914, R1702, R0912
good-names=f,id,k,v

[isort]
Expand Down
7 changes: 6 additions & 1 deletion epictrack-api/src/api/reports/anticipated_schedule_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def __init__(self, filters, color_intensity):
"next_pecp_short_description",
"milestone_type",
"category_type",
"event_name"
"event_name",
"notes"
]
group_by = "phase_name"
template_name = "anticipated_schedule.docx"
Expand Down Expand Up @@ -272,6 +273,7 @@ def generate_report(self, report_date, return_type):
item_dict = item._asdict()
item_dict['work_issues'] = work_issues
works_list.append(item_dict)
item_dict['notes'] = ""

# go through all the work issues, find the update and add the description to the issue
for issue in work_issues:
Expand All @@ -289,6 +291,9 @@ def generate_report(self, report_date, return_type):
for work_issue in item_dict['work_issues']:
if work_issue.id == issue.id:
work_issue.description = work_issue_updates.description
current_app.logger.debug(f"----Work title: {work_issue.title}")
current_app.logger.debug(f"----Work description: {work_issue.description}")
item_dict['notes'] += f"{work_issue.title}: {work_issue.description} "

data = self._format_data(works_list, self.report_title)
data = self._update_staleness(data, report_date)
Expand Down
11 changes: 7 additions & 4 deletions epictrack-api/src/api/reports/report_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ def _format_data(self, data, report_title=None):
excluded_items = self.filters["exclude"]
if report_title == "Anticipated EA Referral Schedule":
for item in data:
obj = {
k: (item[k] if k != "work_issues" else self._deserialize_work_issues(item[k]))
for k in self.data_keys if k not in excluded_items
}
obj = {}
for k in self.data_keys:
if k not in excluded_items:
if k == "work_issues":
obj[k] = self._deserialize_work_issues(item[k])
else:
obj[k] = item[k]
if self.group_by:
obj["sl_no"] = len(formatted_data[obj.get(self.group_by)]) + 1
formatted_data[obj.get(self.group_by)].append(obj)
Expand Down
Binary file not shown.

0 comments on commit bb144fd

Please sign in to comment.