fix(public-toc): show the author's name instead of the raw creator username - #707
Merged
Merged
Conversation
…ername
The public course overview rendered `content.creator`, which is the internal
username (e.g. `creatorjhpaastrika_0qfj`). The authenticated TOC shows the human
name from `creatorDetails[0].name` — "Jhpiego Cooperation" — and the public page
should match.
Copying that expression verbatim would have rendered nothing. The authenticated
TOC works only because app-toc-home parses the field first; this page is fed by
the public search API, which returns `creatorDetails` as a JSON **string**, so
indexing it yields "[" and then undefined. The content service returns the same
field already parsed, so the getter handles both shapes and falls back to
`creator` when the details are malformed or absent — it can never render less
than it did before.
Verified against the live payload for do_1146265657225789441402, where
creatorDetails is the string '[{"id":"28ec6b71…","name":"Jhpiego Cooperation"}]'.
Santhoshshivaprakash
approved these changes
Aug 4, 2026
vpPavithra
approved these changes
Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The public course overview showed the internal creator username —
creatorjhpaastrika_0qfj— where the signed-in course page showsJhpiego Cooperation. It now shows the same name. Release notes for 4.2.11 ride along on this branch.Why it isn't a one-line copy
The signed-in TOC renders
content?.content?.creatorDetails[0]?.name. Copying that expression here would have rendered nothing.That expression only works there because
app-toc-homeparses the field first:The public page is fed by the public search API, which returns
creatorDetailsas a JSON string. Verified against the live payload fordo_1146265657225789441402:The content service returns the same field already parsed, so the getter handles both shapes and falls back to
creatorwhen the details are malformed or absent — it can never render less than before.Verification
yarn run build:local, exit 0)public-toc-banner.component.spec.ts13/13, including 7 new cases covering both payload shapes plus malformed, absent, no-name and null-contentRisk
Low. Confined to the public course overview banner and fallback-guarded, so the worst case is the previous behaviour.