Fix ITocGeneratorService resolution in tiered Docs applications#25799
Open
maliming wants to merge 1 commit into
Open
Fix ITocGeneratorService resolution in tiered Docs applications#25799maliming wants to merge 1 commit into
ITocGeneratorService resolution in tiered Docs applications#25799maliming wants to merge 1 commit into
Conversation
ITocGeneratorService is a presentation helper for rendering, not a remote application service, so it must be registered on the web tier.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses DI resolution issues for ITocGeneratorService in tiered/layered Docs applications by relocating the Table of Contents (TOC) generation helper into the Web layer and ensuring it’s no longer treated as a remote application service.
Changes:
- Added TOC model types (
TocHeading,TocItem) and a Web-layerTocGeneratorServiceimplementation. - Updated
ITocGeneratorServiceto no longer inherit fromIApplicationService(so it’s not considered a remote app service). - Updated
Volo.Docs.Application.abppkg.analyze.jsonto remove the TOC generator from the Application module’s analyzed “applicationService” contents.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| modules/docs/src/Volo.Docs.Web/TableOfContents/TocHeading.cs | Introduces TOC heading/tree model types used by the Web UI. |
| modules/docs/src/Volo.Docs.Web/TableOfContents/TocGeneratorService.cs | Adds a Web-layer TOC generation service based on Markdig parsing. |
| modules/docs/src/Volo.Docs.Web/TableOfContents/ITocGeneratorService.cs | Removes IApplicationService inheritance so the TOC helper is not treated as a remote service. |
| modules/docs/src/Volo.Docs.Application/Volo.Docs.Application.abppkg.analyze.json | Removes TOC generator service metadata from Application module analysis output. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## rel-10.6 #25799 +/- ##
============================================
+ Coverage 49.06% 49.36% +0.30%
============================================
Files 3738 3687 -51
Lines 126821 124434 -2387
Branches 9753 9508 -245
============================================
- Hits 62223 61430 -793
+ Misses 62728 61151 -1577
+ Partials 1870 1853 -17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Move the Docs
TableOfContentspresentation helper back to the Web layer soITocGeneratorServiceresolves in tiered applications; it is a rendering helper, not a remote application service.Reported by @LEIRONGHUA in #25796.