Add partner base names to agreement alerts#2642
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2642 +/- ##
==========================================
- Coverage 78.28% 78.28% -0.01%
==========================================
Files 281 281
Lines 20603 20609 +6
Branches 2103 2105 +2
==========================================
+ Hits 16129 16133 +4
- Misses 4426 4428 +2
Partials 48 48
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
6a750af to
8f62101
Compare
|
@aerinsol review appreciated :) |
There was a problem hiding this comment.
@pylipp there is some inconsistency with how the request version (final screencap of the four) is bolding names and bases. I'd like that to be resolved before committing. My suggestions:
- Bold the status (or OPEN in this case)
- Make sure there's a colon
:after From
And yes, I like the separate 'involved bases' section you have - clearer and faster to read.
8f62101 to
797e12f
Compare
There was a problem hiding this comment.
Pull request overview
Adds partner base names to the transfer agreement overlay dialogs so users can see which bases are involved when reviewing/accepting/terminating agreements.
Changes:
- Extend transfer-agreement table row data with
partnerBases. - Populate
partnerBasesfrom GraphQLsourceBases/targetBases(currently only for bidirectional agreements). - Render partner base names in the agreement overlay text for several agreement states.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
front/src/views/Transfers/TransferAgreementOverview/TransferAgreementOverviewView.tsx |
Adds partnerBases to transformed table rows and fills it from sourceBases/targetBases for bidirectional agreements. |
front/src/views/Transfers/TransferAgreementOverview/components/TransferAgreementOverlay.tsx |
Displays partner base names in the overlay dialog copy across multiple agreement states. |
| agreementRow.partnerOrg = element.targetOrganisation.name; | ||
| agreementRow.partnerBases = element.targetBases?.map((base) => base.name) ?? []; | ||
| } else if (currentOrgId === targetOrgId) { | ||
| agreementRow.partnerOrg = element.sourceOrganisation.name; | ||
| agreementRow.partnerBases = element.sourceBases?.map((base) => base.name) ?? []; |
There was a problem hiding this comment.
partnerBases is only populated for Bidirectional agreements. For SendingTo / ReceivingFrom agreements the field stays as the default empty array, so the overlay will display no base names even though sourceBases/targetBases are available in the fragment. Populate partnerBases in the non-bidirectional branches as well (use targetBases when the partner is the target org, and sourceBases when the partner is the source org).
| Created By: <Text as="b">{data.requestedBy}</Text> on{" "} | ||
| <Text as="b">{data.requestedOn}</Text> | ||
| <br /> | ||
| From <Text as="b">{data.partnerOrg}</Text> | ||
| Involved base(s): {data.partnerBases.join(", ")} | ||
| </chakra.span> |
There was a problem hiding this comment.
data.partnerBases.join(", ") renders an empty string when partnerBases is empty/undefined (e.g., agreements can legitimately have no active bases). Consider rendering a fallback like “All bases”/“—”, or conditionally hiding the line when there are no base names to show.
| Your transfer agreement with {data.partnerOrg} (involved base(s):{" "} | ||
| {data.partnerBases.join(", ")}) is currently <Text as="b">ACCEPTED</Text>. | ||
| </chakra.span> |
There was a problem hiding this comment.
If partnerBases is empty, this parenthesized “(involved base(s): …)” renders as (involved base(s): ), which looks broken. Use a conditional/fallback string to avoid showing empty parentheses.
| Your transfer agreement with {data.partnerOrg} (involved base(s):{" "} | ||
| {data.partnerBases.join(", ")}) is currently <Text as="b">DECLINED</Text>. | ||
| </chakra.span> |
There was a problem hiding this comment.
If partnerBases is empty, this parenthesized “(involved base(s): …)” renders as (involved base(s): ), which looks broken. Use a conditional/fallback string to avoid showing empty parentheses.
| Your transfer agreement with {data.partnerOrg} (involved base(s):{" "} | ||
| {data.partnerBases.join(", ")}) is currently <Text as="b">ENDED</Text>. | ||
| </chakra.span> |
There was a problem hiding this comment.
If partnerBases is empty, this parenthesized “(involved base(s): …)” renders as (involved base(s): ), which looks broken. Use a conditional/fallback string to avoid showing empty parentheses.
https://trello.com/c/yzjlsoIC