fix: SetTeam shows team name, TransactionCard receives teams
- Pass teams list to TransactionCard - Resolve team name from tx.new_value (team_id) - Shows 'Team -> Support' instead of just 'Team changed' Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -104,10 +104,12 @@ function userLabel(users: User[], userId: string | null) {
|
|||||||
function TransactionCard({
|
function TransactionCard({
|
||||||
tx,
|
tx,
|
||||||
users,
|
users,
|
||||||
|
teams,
|
||||||
customFieldLabels,
|
customFieldLabels,
|
||||||
}: {
|
}: {
|
||||||
tx: Transaction;
|
tx: Transaction;
|
||||||
users: User[];
|
users: User[];
|
||||||
|
teams: Team[];
|
||||||
customFieldLabels: Record<string, string>;
|
customFieldLabels: Record<string, string>;
|
||||||
}) {
|
}) {
|
||||||
const isSystem =
|
const isSystem =
|
||||||
@@ -134,7 +136,8 @@ function TransactionCard({
|
|||||||
} else if (tx.transaction_type === "SetOwner") {
|
} else if (tx.transaction_type === "SetOwner") {
|
||||||
message = tx.new_value ? `Assigned to ${userLabel(users, tx.new_value)}` : "Unassigned";
|
message = tx.new_value ? `Assigned to ${userLabel(users, tx.new_value)}` : "Unassigned";
|
||||||
} else if (tx.transaction_type === "SetTeam") {
|
} else if (tx.transaction_type === "SetTeam") {
|
||||||
message = "Team changed";
|
const teamName = tx.new_value ? (teams.find((t) => t.id === tx.new_value)?.name ?? "?") : null;
|
||||||
|
message = teamName ? `Team → ${teamName}` : "Team cleared";
|
||||||
} else if (tx.transaction_type === "CustomFieldChange") {
|
} else if (tx.transaction_type === "CustomFieldChange") {
|
||||||
const fieldName = tx.field ? customFieldLabels[tx.field] ?? "Custom field" : "Custom field";
|
const fieldName = tx.field ? customFieldLabels[tx.field] ?? "Custom field" : "Custom field";
|
||||||
message = tx.new_value ? `${fieldName} set to ${tx.new_value}` : `${fieldName} cleared`;
|
message = tx.new_value ? `${fieldName} set to ${tx.new_value}` : `${fieldName} cleared`;
|
||||||
@@ -664,6 +667,7 @@ export default function TicketDetailPage({
|
|||||||
key={tx.id}
|
key={tx.id}
|
||||||
tx={tx}
|
tx={tx}
|
||||||
users={users}
|
users={users}
|
||||||
|
teams={teams}
|
||||||
customFieldLabels={customFieldLabels}
|
customFieldLabels={customFieldLabels}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|||||||
Reference in New Issue
Block a user