Conversation
Custom frameworks rendered with an initials avatar on the public Trust Portal because they have no built-in SVG logo. Admins can now upload a PNG/JPEG/WebP image (max 256KB) per custom framework, shown next to its status; it falls back to the initials avatar when none is set. - DB: nullable TrustCustomFramework.badgeS3Key (additive migration) - API: POST/DELETE /v1/trust-portal/custom-frameworks/badge (trust:update), org-scoped tenant check, badge logic in TrustCustomFrameworkBadgeService; badgeUrl (24h signed URL, null-safe) added to admin + public payloads - Admin UI: uploadable logo slot for custom frameworks; read-only users still see the badge but cannot edit it - Reuses the favicon upload pattern (base64 -> S3 -> signed URL); uploading a badge never publishes a framework. SVG excluded (XSS). Tests: 65 trust-portal jest specs (service + controller). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Addresses cubic review on #3173: - Badge upload now rejects on the MIME type alone (it's stored as the S3 ContentType), so a disallowed type can no longer pass just because the filename carries an allowed extension. Drops the extension fallback. - UploadCustomFrameworkBadgeDto.fileData is now @IsBase64 + @maxlength (~256KB), rejecting malformed/oversized payloads at the request boundary instead of only after decode. Service keeps the exact decoded-byte cap. - Frontend badge picker aligned to the same MIME-only rule. Tests: +1 service (disallowed-MIME-with-allowed-extension) and a new DTO validation spec (base64 + max-length + required fields). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Marking a risk as "Closed" reverted to "Pending". Root cause: the generate-risk-mitigation Trigger.dev task unconditionally wrote status: pending (and reassigned assigneeId) on the risk every time it ran. Besides onboarding, that task re-runs against EXISTING risks via the "Regenerate" mitigation button and via task-unlink (refreshTreatmentPlan, fire-and-forget). Those runs are async and land AFTER the user's synchronous PATCH save, silently overwriting Closed -> Pending. Fix: extract buildMitigationDefaultWrites, which scopes each write so the task only applies onboarding DEFAULTS and never clobbers a user-managed risk: - status: promote only a still-default `open` risk to `pending` (where status: open). Never downgrade a user-set pending/closed/archived. - assigneeId: assign the author only when the risk is still unassigned. The status/assignee where-clauses also make this race-safe if the user edits the risk while the async job is in flight. Onboarding behavior is unchanged (baseline/AI-drafted risks are created open/unassigned, so they still become pending and get the author). Adds unit tests for the helper. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…load Addresses cubic review on #3173. The admin CustomFrameworkBadge <img> had no onError handler, so an expired signed URL or failed load left a broken image instead of the initials avatar (the public portal component already did this). Adds an onError -> initials fallback, reset whenever badgeUrl changes so a freshly uploaded/replaced badge gets a fresh attempt. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…badges feat(trust-portal): upload custom framework badges on the trust portal
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
…-to-pending fix(risk): stop AI mitigation from reopening user-closed risks
Contributor
|
🎉 This PR is included in version 3.84.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.
Summary by cubic
Adds uploadable badge images for custom frameworks in the Trust Portal and shows them on admin and public views, falling back to initials when absent or expired. Also fixes a regression where the risk mitigation task could reopen closed risks by scoping updates to only open/unassigned risks.
New Features
/v1/trust-portal/custom-frameworks/badge(trust:update), org-scoped. Stores PNG/JPEG/WebP ≤256KB in the org assets bucket and returns a 24h signed URL.badgeUrladded to admin and public payloads for custom frameworks.CustomFrameworkBadgewith upload/replace/remove in settings; read-only users see the badge without controls. Falls back to initials on image load error.Migration
badgeS3KeytoTrustCustomFramework. Run migrations.APP_AWS_ORG_ASSETS_BUCKET). No breaking changes; existing frameworks continue showing initials.Written for commit ed9387e. Summary will update on new commits.