Use CMS Certificate Title for program LinkedIn "Add to Profile"#3518
Use CMS Certificate Title for program LinkedIn "Add to Profile"#3518zamanafzal wants to merge 2 commits into
Conversation
OpenAPI ChangesNo changes detected Unexpected changes? Ensure your branch is up-to-date with |
There was a problem hiding this comment.
Pull request overview
Updates the program-certificate LinkedIn “Add to Profile” URL generation to prefer the CMS “Certificate Title” (certificate_page.product_name) over the program title, to better align what learners add to LinkedIn with what’s shown on the certificate experience.
Changes:
- Program branch of
getCertificateLinkedInUrlnow usesgetCertificateTitle(product_name, program.title)(course branch unchanged). - Adds unit tests covering program product-name preference, fallback behavior, and course behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| frontends/main/src/common/certificateUtils.ts | Uses CMS certificate_page.product_name (via getCertificateTitle) for program LinkedIn credential name, with fallback to program title. |
| frontends/main/src/common/certificateUtils.test.ts | Adds tests asserting the LinkedIn name param behavior for program + course certificates. |
The LinkedIn "Add to Profile" link for program certificates now uses the CMS "Certificate Title" (product_name) as the credential name, matching the title shown on the certificate, and falls back to the program title when product_name is unset. Course certificates are unchanged. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
| certificateType === CertificateType.Course | ||
| ? (certificateData as V2CourseRunCertificate).course_run.course.title | ||
| : (certificateData as V2ProgramCertificate).program.title | ||
| : getCertificateTitle( |
There was a problem hiding this comment.
the repeated (certificateData as V2ProgramCertificate) casts are a bit noisy; consider narrowing once to a local const program = certificateData as V2ProgramCertificate at the top of the program branch and reusing it for both certificate_page?.product_name and program.title for readability.
ahtesham-quraish
left a comment
There was a problem hiding this comment.
Looks good and Left few comments
Address review feedback by casting certificateData to V2ProgramCertificate a single time in the program branch instead of repeating the cast for each field access. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
90940f7 to
e699db6
Compare
What are the relevant tickets?
Follow-up to the certificate-title work (hq#11907, tracked in hq#11938).
Description
The LinkedIn "Add to Profile" link for a program certificate currently sends the program title as the credential
name. This changes it to the CMS "Certificate Title" (CertificatePage.product_name), so the certification a learner adds to LinkedIn matches the title printed on the certificate and shown on the certificate page. Falls back to the program title whenproduct_nameis unset.Reuses the
getCertificateTitlehelper (added in #3512) — the same resolver the certificate page heading, PDF, and metadata already use — so the LinkedIn name stays consistent with the displayed title.getCertificateLinkedInUrlis unchanged.getVerifiableCredentialLinkedInURL— which mitxonline #3698 updates to carry the same Certificate Title. Both paths therefore converge on the Certificate Title.Change
frontends/main/src/common/certificateUtils.ts—getCertificateLinkedInUrl, program branch:How to test
Automated:
New
getCertificateLinkedInUrltests assert:product_namedistinct fromprogram.title→ LinkedInnameparam is theproduct_name;product_name→ falls back toprogram.title;Manual:
product_name) differs from the program title (e.g. program title… MicroMasters, Certificate Title… MicroMasters Certificate)./certificate/program/<uuid>and confirm the heading shows the Certificate Title.name=param should be the Certificate Title, not the bare program title.name=follows the new title — proving it reads the CMS field live.