Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

255: Fix description field as well as better output for the pdf gener… #2439

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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.