Skip to content

MPDX-9702 Add Export Goals as PDF (Print All) button to Active Goals tab - #1990

Open
wjames111 wants to merge 1 commit into
mainfrom
MPDX-9702
Open

MPDX-9702 Add Export Goals as PDF (Print All) button to Active Goals tab#1990
wjames111 wants to merge 1 commit into
mainfrom
MPDX-9702

Conversation

@wjames111

Copy link
Copy Markdown
Contributor

Description

  • Enables the previously-disabled Print All button on the MPD Goal Admin "Active Goals" tab: it exports every goal in the selected cohort as a single printable PDF (for NSO hard copies) and downloads it in the browser.
  • The button is disabled — with an explanatory tooltip — until the cohort's training costs have been entered, the gate the ticket describes as shared with Run & Send.
  • The async generate → download-URL flow mirrors the existing contacts CSV-export pattern (exportRest.tsx): spinner while generating, temporary-anchor download, error snackbar on failure.
  • The printCohortGoals mutation (MPDX-9691) does not exist yet (no mpdx_api PR, not on staging), and MpdGoalAdmin is still the mock prototype tool, so generateCohortGoalsPdf currently builds a valid placeholder PDF client-side behind the exact seam the mutation will slot into (marked TODO(MPDX-9691)). CI codegen against the real schema also forbids referencing the mutation today.
  • Added a second mock cohort ("Spring NSO 2027", training costs not entered) so the disabled gate is reachable in the UI and tests.
  • Decisions on the ticket's open questions: Print All exports all goals in the cohort (the MPDX-9690 PDF service renders incomplete goals with blank lines); no selected-ids "More Actions" variant added.
  • Related: MPDX-9702. Depends on MPDX-9691 (mutation, for real wiring) and MPDX-9690 (PDF service, CruGlobal/mpdx_api#3507). Note: the Run & Send buttons are not yet gated on training costs — flagged for follow-up rather than expanding this ticket's scope.

Testing

  • Go to HR Tools → MPD Goal Calculator - Admin Table (Active Goals tab)
  • With the default "Fall NSO 2026" training selected, click Print All
  • Check that a MPD Goals - Fall NSO 2026.pdf file downloads and opens, listing the cohort's goals (placeholder content until MPDX-9691 is wired)
  • Switch the Training dropdown to "Spring NSO 2027"
  • Check that Print All is disabled and hovering it shows "Enter training costs for this cohort to print its goals."
  • Open Training Cost → View/Edit, fill in all costs, and save
  • Check that Print All becomes enabled

Checklist:

  • I have given my PR a title with the format "MPDX-(JIRA#) (summary sentence max 80 chars)"
  • I have applied the appropriate labels (Add the label "Preview" to automatically create a preview environment)
  • I have run the Claude Code /quality:agent-review command locally and fixed any relevant suggestions
  • I have requested a review from another person on the project
  • I have tested my changes in preview or in staging
  • I have cleaned up my commit history

🤖 Generated with Claude Code

Enable the Active Goals toolbar's Print All button: it generates a
single printable PDF of the selected cohort's goals (for NSO hard
copies) and downloads it via the CSV-export anchor pattern, gated on
the cohort's training costs being entered like Run & Send.

The printCohortGoals mutation (MPDX-9691) doesn't exist yet — the
whole MpdGoalAdmin tool is still a mock prototype — so the generate
step builds a placeholder PDF client-side behind the same
generate-then-download seam the mutation will slot into.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Bundle sizes [mpdx-react]

Compared against 8b6c94e

No significant changes found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant