Skip to content

serval-admin: serval-builds: add copyable SF IDs in Input card#3888

Open
marksvc wants to merge 3 commits into
masterfrom
task/sb-ref-id
Open

serval-admin: serval-builds: add copyable SF IDs in Input card#3888
marksvc wants to merge 3 commits into
masterfrom
task/sb-ref-id

Conversation

@marksvc
Copy link
Copy Markdown
Collaborator

@marksvc marksvc commented May 15, 2026

The Inputs card lists training books and translation books. It also
indicates the project they are from. This patch changes the display to
include the SF project ID with a copy icon, to make it easy to get the
ID for the referenced project.

Screenshot of previous display:
image

Screenshot showing Input card, where you can see that there is now SF project IDs shown for the input projects, with a copy icon.
image


This change is Reviewable

@marksvc marksvc requested a review from Copilot May 15, 2026 19:14
@marksvc marksvc added the e2e Run e2e tests for this pull request label May 15, 2026
@marksvc marksvc marked this pull request as draft May 15, 2026 19:14
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Serval Administration “Serval builds” Inputs card to make referenced Scripture Forge project IDs visible and easily copyable, improving admin workflow when cross-referencing builds to SF projects.

Changes:

  • Added a small view-model (BuildInputItem) and mapping helper to produce display-ready input rows.
  • Updated the Inputs card UI to show SF project ID + copy button, plus optional short name/project name with links.
  • Added unit tests covering the new mapping helper and adjusted styling for the new layout.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.ts Adds BuildInputItem and determineBuildInputs() to prepare input display data (IDs, links, names, formatted books).
src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.html Renders project short name / name (linked), SF project ID in monospace, and a copy control in the Inputs card.
src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.scss Adds layout styles for the new multi-line per-project input display and ID styling.
src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.spec.ts Adds tests for determineBuildInputs() output (link, optional names, book formatting).
Comments suppressed due to low confidence (1)

src/SIL.XForge.Scripture/ClientApp/src/app/serval-administration/serval-builds.component.html:340

  • Same as above: projectBook.projectLink is always populated by determineBuildInputs(), so this @if (projectBook.projectLink != null) check is currently redundant and leaves an unreachable @else branch. Simplify by making projectLink required and removing the conditional, or return undefined when appropriate.
                                  @if (projectBook.projectLink != null) {
                                    <a
                                      [href]="projectBook.projectLink"
                                      target="_blank"
                                      rel="noopener"
                                      class="project-link"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +313 to +315
@for (projectBook of determineBuildInputs(projectBooks); track projectBook.sfProjectId) {
<div class="detail-project-books-item">
<div class="detail-project-books-meta detail-value-with-copy">
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this and started down the road of pre-computing the information for each record. But I changed course and used a pure pipe to do the transform. Rather than make a custom pipe for this particular transform, I made a generic pipe that lots me pass a lambda to perform a transform.

Comment on lines +317 to +346
@if (projectBook.projectLink != null) {
<a
[href]="projectBook.projectLink"
target="_blank"
rel="noopener"
class="project-link"
>
{{ projectBook.shortName }}
</a>
} @else {
<span class="project-link">{{ projectBook.shortName }}</span>
}
}
<span class="detail-project-books-id">{{ projectBook.sfProjectId }}</span>
<app-copy [value]="projectBook.sfProjectId"></app-copy>
</div>

@if (projectBook.projectName != null) {
@if (projectBook.projectLink != null) {
<a
[href]="projectBook.projectLink"
target="_blank"
rel="noopener"
class="project-link"
>
{{ projectBook.projectName }}
</a>
} @else {
<span class="project-link">{{ projectBook.projectName }}</span>
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed servalAdminProjectLinkFor to return type string when the input is string, and undefined when the input is undefined. I removed some @ifs in the template.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.03%. Comparing base (699901f) to head (94a3f25).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...p/serval-administration/serval-builds.component.ts 91.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3888   +/-   ##
=======================================
  Coverage   81.03%   81.03%           
=======================================
  Files         630      631    +1     
  Lines       40677    40688   +11     
  Branches     6601     6580   -21     
=======================================
+ Hits        32962    32973   +11     
  Misses       6694     6694           
  Partials     1021     1021           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

marksvc added 3 commits May 15, 2026 15:35
The Inputs card lists training books and translation books. It also
indicates the project they are from. This patch changes the display to
include the SF project ID with a copy icon, to make it easy to get the
ID for the referenced project.
@marksvc marksvc marked this pull request as ready for review May 15, 2026 21:36
@marksvc marksvc temporarily deployed to screenshot_diff May 15, 2026 21:41 — with GitHub Actions Inactive
@RaymondLuong3 RaymondLuong3 self-assigned this May 19, 2026
Copy link
Copy Markdown
Collaborator

@RaymondLuong3 RaymondLuong3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like there are merge conflicts, but otherwise it looks good.

@RaymondLuong3 reviewed 6 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on marksvc).

@RaymondLuong3 RaymondLuong3 removed the e2e Run e2e tests for this pull request label May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants