[Orders v2] Add support for app / user avatar for transaction list#5998
[Orders v2] Add support for app / user avatar for transaction list#5998
Conversation
Update all test fixtures and view models to handle the new required `brand` property on AppAvatarFragment. The GraphQL schema was updated to include app branding information, which caused TypeScript errors in test fixtures. Changes: - Add `brand: null` to all App test fixtures (6 files) - Add `creator: null` to OrderRefundDisplay test helper - Update OrderRefundsViewModel.getCreator() to handle nullable properties - Fix type conversion in RefundListItem for logoUrl (null to undefined) Fixes TypeScript strict mode errors in: - src/extensions/fixtures.ts - src/orders/components/OrderReturnPage/components/TransactionSubmitCard/fixtures.ts - src/orders/fixtures.ts (2 locations) - src/ordersV2/fixtures/OrderFixture.ts (2 locations) - src/ordersV2/OrderRefunds/OrderRefundsViewModel.test.ts (4 locations) - src/ordersV2/OrderRefunds/OrderRefundsViewModel.ts - src/ordersV2/OrderRefunds/RefundListItem.tsx 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for displaying app and user avatars in the transaction list for Orders v2. The implementation replaces a local UserAvatar component with a shared one and extends the data model to include creator information (initials and logo URL) for both apps and users.
Key Changes:
- Updated GraphQL fragments to fetch app brand logos
- Extended the
OrderRefundDisplaytype to include creator avatar data - Migrated from local
UserAvatarcomponent to shared@dashboard/components/UserAvatar
Reviewed Changes
Copilot reviewed 14 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/ordersV2/storybook/OrderRefunds.stories.tsx | Added creator mock data to all refund stories |
| src/ordersV2/fixtures/OrderFixture.ts | Added brand: null to app fixtures |
| src/ordersV2/UserAvatar.tsx | Removed local UserAvatar component (migrated to shared component) |
| src/ordersV2/OrderRefunds/RefundListItem.tsx | Updated to use shared UserAvatar with creator data |
| src/ordersV2/OrderRefunds/OrderRefundsViewModel.ts | Added getCreator method to extract avatar data from apps/users |
| src/ordersV2/OrderRefunds/OrderRefundsViewModel.test.ts | Updated test fixtures with brand and creator fields |
| src/orders/fixtures.ts | Added brand: null to app fixtures |
| src/orders/components/OrderReturnPage/components/TransactionSubmitCard/fixtures.ts | Added brand: null to app fixture |
| src/graphql/hooks.generated.ts | Generated GraphQL hooks with brand logo queries |
| src/fragments/orders.ts | Added brand logo to order granted refunds fragment |
| src/fragments/apps.ts | Added brand logo to app avatar fragment, removed TODO comment |
| src/extensions/fixtures.ts | Added brand: null to app fixture |
| src/components/UserAvatar/UserAvatar.tsx | Added scheme prop to support transparent avatar style |
| package.json | Upgraded @saleor/macaw-ui-next from 1.3.5 to 1.4.0 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Differences Found✅ No packages or licenses were added. SummaryExpand
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5998 +/- ##
==========================================
+ Coverage 39.49% 39.52% +0.02%
==========================================
Files 2429 2428 -1
Lines 39518 39532 +14
Branches 9037 9047 +10
==========================================
+ Hits 15609 15624 +15
+ Misses 22710 22709 -1
Partials 1199 1199 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Add comprehensive test coverage for getCreator method with 8 test cases covering app creators (with/without logos), user creators (with/without avatars), and edge cases (null values, empty names) - Fix static asset import in OrderRefunds.stories.tsx to use default import instead of wildcard import, following Vite best practices and Copilot recommendation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 14 out of 18 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Scope of the change
This PR adds support for displaying app and user avatars in the Orders v2 refund list.
Changes
AppAvatar,OrderGrantedRefund) and user avatarsschemeprop (defaults to "accent1") to support transparent backgroundsgetCreatormethod with 8 test cases covering:Implementation Details
The implementation uses the
OrderRefundDisplay.creatorfield which contains:initials: Generated from app name (first 2 chars) or user's name viagetUserInitials()logoUrl: App brand logo URL or user avatar URLThe
RefundListItemcomponent now displays:Testing
getCreator)