serval-admin: serval-builds: support chapter-aware project book display#3847
serval-admin: serval-builds: support chapter-aware project book display#3847marksvc wants to merge 4 commits into
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.07% 81.07% -0.01%
==========================================
Files 630 630
Lines 40613 40651 +38
Branches 6580 6592 +12
==========================================
+ Hits 32929 32956 +27
- Misses 6654 6662 +8
- Partials 1030 1033 +3 ☔ View full report in Codecov by Sentry. |
pmachapman
left a comment
There was a problem hiding this comment.
This worked well for a test build I did a couple of months ago for partial books drafting:
@pmachapman reviewed 7 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on marksvc).
7ea0138 to
0366695
Compare
0366695 to
e591de7
Compare
marksvc
left a comment
There was a problem hiding this comment.
Oh, that's great; thanks for showing!
@marksvc made 1 comment.
Reviewable status: 3 of 7 files reviewed, all discussions resolved (waiting on pmachapman).
|
✅ No screenshot differences — all stories are identical. View the diff page at: https://pr-3847--sf-screenshot-diffs.netlify.app |
| /** Help template access static methods. */ | ||
| protected ServalBuildsComponent = ServalBuildsComponent; | ||
|
|
| const trainingBooksProjectBooks: ProjectBooks[] = row.trainingBooks.map(bookInfo => ({ | ||
| sfProjectId: bookInfo.sfProjectId, | ||
| projectDisplayName: bookInfo.projectDisplayName, | ||
| shortName: bookInfo.shortName, | ||
| booksAndChapters: bookInfo.books.map(book => ({ bookId: book })) | ||
| })); | ||
| const translationBooksProjectBooks: ProjectBooks[] = row.translationBooks.map(bookInfo => ({ | ||
| sfProjectId: bookInfo.sfProjectId, | ||
| projectDisplayName: bookInfo.projectDisplayName, | ||
| shortName: bookInfo.shortName, | ||
| booksAndChapters: bookInfo.books.map(book => ({ bookId: book })) | ||
| })); |
|
Thank you @pmachapman . I discovered that this change was regressing how the unique-book-usage count was working and made some additional changes to fix it. So if you could point your eyes to it again for a bit that would be great! Thank you! |
pmachapman
left a comment
There was a problem hiding this comment.
@pmachapman reviewed 4 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on marksvc).
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.
1543754 to
38fa016
Compare

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