Skip to content

Commit

Permalink
Update next pcp phase name. Formatting tweaks for .docx
Browse files Browse the repository at this point in the history
  • Loading branch information
Marilynn-Stone committed Dec 20, 2024
1 parent a6df6e5 commit 3dff376
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
13 changes: 13 additions & 0 deletions epictrack-api/src/api/reports/anticipated_schedule_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def __init__(self, filters, color_intensity):
"event_name",
"notes",
"next_pecp_number_of_days",
"next_pecp_phase_name",
"amendment_title",
"work_type_id",
"work_type"
Expand Down Expand Up @@ -312,6 +313,7 @@ def _fetch_data(self, report_date):
Event.actual_date,
).label("next_pecp_date"),
next_pecp_query.c.notes.label("next_pecp_short_description"),
next_pecp_query.c.phase_name.label("next_pecp_phase_name"),
func.coalesce(next_pecp_query.c.number_of_days, 0).label("next_pecp_number_of_days"),
)
)
Expand All @@ -324,6 +326,7 @@ def _fetch_data(self, report_date):
# - If successful, extracts and concatenates text from JSON blocks.
# - Logs a warning if JSON parsing fails.
for result in results_dict:
result['next_pecp_phase_name'] = result.get('next_pecp_phase_name', None)
if 'next_pecp_short_description' in result and result['next_pecp_short_description'] is not None:
current_app.logger.debug(f"Next PECP Short Description: {result['next_pecp_short_description']}")
try:
Expand Down Expand Up @@ -353,6 +356,7 @@ def generate_report(self, report_date, return_type):
item_dict = item._asdict()
item_dict['work_issues'] = work_issues
item_dict['next_pecp_number_of_days'] = item.next_pecp_number_of_days
item_dict['next_pecp_phase_name'] = item.next_pecp_phase_name
item_dict['notes'] = ""

# go through all the work issues, find the update and add the description to the issue
Expand Down Expand Up @@ -554,6 +558,7 @@ def _get_next_pcp_query(self, start_date):
db.session.query(
Event,
Event.number_of_days,
WorkPhase.name.label("phase_name"),
)
.join(
next_pcp_min_date_query,
Expand All @@ -562,6 +567,14 @@ def _get_next_pcp_query(self, start_date):
func.coalesce(Event.actual_date, Event.anticipated_date) == next_pcp_min_date_query.c.min_pcp_date,
),
)
.join(
EventConfiguration,
EventConfiguration.id == Event.event_configuration_id
)
.join(
WorkPhase,
EventConfiguration.work_phase_id == WorkPhase.id
)
.filter(
Event.event_configuration_id.in_(pecp_configuration_ids),
)
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export default function AnticipatedEAOSchedule() {
if (reportData.status === 200) {
const reports = reportData.data as ReportData;
setReports(reports.data);
console.info("ReportData:", reports);
}

if (reportData.status === 204) {
Expand Down Expand Up @@ -211,6 +212,7 @@ export default function AnticipatedEAOSchedule() {
.map((group, _) => {
const groupName = group.group;
const items = group.items;
console.info("group:", group);
return (
<>
<Accordion
Expand All @@ -226,7 +228,7 @@ export default function AnticipatedEAOSchedule() {
</AccordionSummary>
<AccordionDetails>
{items.map((item, itemIndex) => {
console.log(item);
console.log("item:",item);
return (
<Accordion key={itemIndex} elevation={0}>
<AccordionSummary
Expand Down

0 comments on commit 3dff376

Please sign in to comment.