serval-admin: serval-builds: support chapter-aware project book display#3847
Open
serval-admin: serval-builds: support chapter-aware project book display#3847
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Serval Administration “Serval builds” UI to display chapter-aware scripture ranges (partial-book builds) by parsing chapter ranges from backend scriptureRange strings and formatting them for display.
Changes:
- Extend
ProjectBooksto carrybooksAndChapters(book id + optional chapter list) instead of a plainbooksarray. - Parse chapter numbers from semicolon-delimited
scriptureRangesegments and display them in compact range notation (e.g.,GEN 10-11, 16-19; EXO). - Keep Draft Jobs insulated from the new chapter-aware model by introducing
DraftJobsProjectBooksand only adapting when exporting.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.ts | Adds formatting helpers to render book+chapter ranges and updates project-books formatting to use the new model. |
| src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.spec.ts | Updates existing expectations and adds coverage for compact chapter-range formatting. |
| src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.html | Switches UI display/tooltip rendering from books to formatted booksAndChapters. |
| src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds-statistics.ts | Updates book counting logic to use booksAndChapters. |
| src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-build-report.ts | Introduces BookAndChapters, updates ProjectBooks, and parses chapter ranges from scriptureRange. |
| src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-build-report.spec.ts | Updates expectations for the new booksAndChapters model and adds a chapter-parsing test. |
| src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/draft-jobs.component.ts | Introduces DraftJobsProjectBooks and adapts export formatting without implementing chapter-aware display in Draft Jobs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3847 +/- ##
=======================================
Coverage 81.04% 81.05%
=======================================
Files 630 630
Lines 40592 40624 +32
Branches 6588 6597 +9
=======================================
+ Hits 32898 32926 +28
- Misses 6661 6665 +4
Partials 1033 1033 ☔ View full report in Codecov by Sentry. |
Recently a change was made in the backend where Serval builds might be reported with chapter numbers, indicating a partial book. This patch modifies the Serval builds tab to display that chapter information. Unfortunately, it may not be possible to actually test this behvaiour very easily until we start to use partial book drafting. It is possible to see the new frontend behaviour by modifying the backend to re-write data with chapter lists. In draft-jobs.component.ts there is a change to using a new `DraftJobsProjectBooks` instead of `projectBooks`. This is so the new feature doesn't need to also be implemented in the draft jobs component.
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.
Recently a change was made in the backend where Serval builds might be
reported with chapter numbers, indicating a partial book. This patch
modifies the Serval builds tab to display that chapter information.
Unfortunately, it may not be possible to actually test this behvaiour
very easily until we start to use partial book drafting. It is
possible to see the new frontend behaviour by modifying the backend to
re-write data with chapter lists.
In draft-jobs.component.ts there is a change to using a new
DraftJobsProjectBooksinstead ofprojectBooks. This is so the newfeature doesn't need to also be implemented in the draft jobs
component.
Screenshot showing chapter numbers in table row: (note: I didn't try to make the chapter usage make sense in this example screenshot; this is just to show the information)

Screenshot showing chapter numbers in expanded details:

This change is