Skip to content

Commit b36918d

Browse files
authored
fix: url to inner transaction when viewing groups (#40)
1 parent a6b4e94 commit b36918d

File tree

6 files changed

+23
-17
lines changed

6 files changed

+23
-17
lines changed

src/features/transactions/components/__snapshots__/group-graph.group-1.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@
288288
>
289289
<a
290290
class="text-primary underline"
291-
href="/explore/transaction/VE767RE4HGQM7GFC7MUVY3J67KOR5TV34OBTDDEQTDET2UFM7KTQ/inner/1"
291+
href="/explore/transaction/INDQXWQXHF22SO45EZY7V6FFNI6WUD5FHRVDV6NCU6HD424BJGGA/inner/1"
292292
>
293293
Inner 1
294294
</a>
@@ -419,7 +419,7 @@
419419
>
420420
<a
421421
class="text-primary underline"
422-
href="/explore/transaction/VE767RE4HGQM7GFC7MUVY3J67KOR5TV34OBTDDEQTDET2UFM7KTQ/inner/2"
422+
href="/explore/transaction/INDQXWQXHF22SO45EZY7V6FFNI6WUD5FHRVDV6NCU6HD424BJGGA/inner/2"
423423
>
424424
Inner 2
425425
</a>
@@ -532,7 +532,7 @@
532532
>
533533
<a
534534
class="text-primary underline"
535-
href="/explore/transaction/VE767RE4HGQM7GFC7MUVY3J67KOR5TV34OBTDDEQTDET2UFM7KTQ/inner/2-1"
535+
href="/explore/transaction/INDQXWQXHF22SO45EZY7V6FFNI6WUD5FHRVDV6NCU6HD424BJGGA/inner/2-1"
536536
>
537537
Inner 2-1
538538
</a>
@@ -641,7 +641,7 @@
641641
>
642642
<a
643643
class="text-primary underline"
644-
href="/explore/transaction/VE767RE4HGQM7GFC7MUVY3J67KOR5TV34OBTDDEQTDET2UFM7KTQ/inner/3"
644+
href="/explore/transaction/INDQXWQXHF22SO45EZY7V6FFNI6WUD5FHRVDV6NCU6HD424BJGGA/inner/3"
645645
>
646646
Inner 3
647647
</a>
@@ -752,7 +752,7 @@
752752
>
753753
<a
754754
class="text-primary underline"
755-
href="/explore/transaction/VE767RE4HGQM7GFC7MUVY3J67KOR5TV34OBTDDEQTDET2UFM7KTQ/inner/4"
755+
href="/explore/transaction/INDQXWQXHF22SO45EZY7V6FFNI6WUD5FHRVDV6NCU6HD424BJGGA/inner/4"
756756
>
757757
Inner 4
758758
</a>
@@ -865,7 +865,7 @@
865865
>
866866
<a
867867
class="text-primary underline"
868-
href="/explore/transaction/VE767RE4HGQM7GFC7MUVY3J67KOR5TV34OBTDDEQTDET2UFM7KTQ/inner/4-1"
868+
href="/explore/transaction/INDQXWQXHF22SO45EZY7V6FFNI6WUD5FHRVDV6NCU6HD424BJGGA/inner/4-1"
869869
>
870870
Inner 4-1
871871
</a>
@@ -972,7 +972,7 @@
972972
>
973973
<a
974974
class="text-primary underline"
975-
href="/explore/transaction/VE767RE4HGQM7GFC7MUVY3J67KOR5TV34OBTDDEQTDET2UFM7KTQ/inner/5"
975+
href="/explore/transaction/INDQXWQXHF22SO45EZY7V6FFNI6WUD5FHRVDV6NCU6HD424BJGGA/inner/5"
976976
>
977977
Inner 5
978978
</a>
@@ -1082,7 +1082,7 @@
10821082
>
10831083
<a
10841084
class="text-primary underline"
1085-
href="/explore/transaction/VE767RE4HGQM7GFC7MUVY3J67KOR5TV34OBTDDEQTDET2UFM7KTQ/inner/6"
1085+
href="/explore/transaction/INDQXWQXHF22SO45EZY7V6FFNI6WUD5FHRVDV6NCU6HD424BJGGA/inner/6"
10861086
>
10871087
Inner 6
10881088
</a>
@@ -1195,7 +1195,7 @@
11951195
>
11961196
<a
11971197
class="text-primary underline"
1198-
href="/explore/transaction/VE767RE4HGQM7GFC7MUVY3J67KOR5TV34OBTDDEQTDET2UFM7KTQ/inner/6-1"
1198+
href="/explore/transaction/INDQXWQXHF22SO45EZY7V6FFNI6WUD5FHRVDV6NCU6HD424BJGGA/inner/6-1"
11991199
>
12001200
Inner 6-1
12011201
</a>
@@ -1301,7 +1301,7 @@
13011301
>
13021302
<a
13031303
class="text-primary underline"
1304-
href="/explore/transaction/VE767RE4HGQM7GFC7MUVY3J67KOR5TV34OBTDDEQTDET2UFM7KTQ/inner/7"
1304+
href="/explore/transaction/INDQXWQXHF22SO45EZY7V6FFNI6WUD5FHRVDV6NCU6HD424BJGGA/inner/7"
13051305
>
13061306
Inner 7
13071307
</a>
@@ -1410,7 +1410,7 @@
14101410
>
14111411
<a
14121412
class="text-primary underline"
1413-
href="/explore/transaction/VE767RE4HGQM7GFC7MUVY3J67KOR5TV34OBTDDEQTDET2UFM7KTQ/inner/8"
1413+
href="/explore/transaction/INDQXWQXHF22SO45EZY7V6FFNI6WUD5FHRVDV6NCU6HD424BJGGA/inner/8"
14141414
>
14151415
Inner 8
14161416
</a>
@@ -1519,7 +1519,7 @@
15191519
>
15201520
<a
15211521
class="text-primary underline"
1522-
href="/explore/transaction/VE767RE4HGQM7GFC7MUVY3J67KOR5TV34OBTDDEQTDET2UFM7KTQ/inner/8-1"
1522+
href="/explore/transaction/INDQXWQXHF22SO45EZY7V6FFNI6WUD5FHRVDV6NCU6HD424BJGGA/inner/8-1"
15231523
>
15241524
Inner 8-1
15251525
</a>
@@ -1642,7 +1642,7 @@
16421642
>
16431643
<a
16441644
class="text-primary underline"
1645-
href="/explore/transaction/VE767RE4HGQM7GFC7MUVY3J67KOR5TV34OBTDDEQTDET2UFM7KTQ/inner/9"
1645+
href="/explore/transaction/INDQXWQXHF22SO45EZY7V6FFNI6WUD5FHRVDV6NCU6HD424BJGGA/inner/9"
16461646
>
16471647
Inner 9
16481648
</a>

src/features/transactions/components/inner-transaction-link.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,20 @@ import { Urls } from '@/routes/urls'
44
import { PropsWithChildren } from 'react'
55

66
type Props = PropsWithChildren<{
7+
transactionId: string
78
innerTransactionId: string
89
className?: string
910
}>
1011

11-
export function InnerTransactionLink({ innerTransactionId, className, children }: Props) {
12+
export function InnerTransactionLink({ transactionId, innerTransactionId, className, children }: Props) {
1213
return (
1314
<TemplatedNavLink
1415
className={cn(!children && 'text-primary underline', className)}
1516
urlTemplate={Urls.Explore.Transaction.ById.Inner.ById}
16-
urlParams={{ innerTransactionId: innerTransactionId }}
17+
urlParams={{
18+
transactionId: transactionId,
19+
innerTransactionId: innerTransactionId,
20+
}}
1721
>
1822
{children ? children : `Inner ${innerTransactionId}`}
1923
</TemplatedNavLink>

src/features/transactions/components/transactions-graph.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function ConnectionToParent() {
9494
function TransactionId({ hasParent, transaction }: { hasParent: boolean; transaction: Transaction | InnerTransaction }) {
9595
const component = useMemo(() => {
9696
if ('innerId' in transaction) {
97-
return <InnerTransactionLink innerTransactionId={transaction.innerId} />
97+
return <InnerTransactionLink transactionId={transaction.networkTransactionId} innerTransactionId={transaction.innerId} />
9898
}
9999
return <TransactionLink transactionId={transaction.id} short={true} />
100100
}, [transaction])

src/features/transactions/components/transactions-table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const transactionsTableColumns: ColumnDef<FlattenedTransaction>[] = [
3535
}}
3636
>
3737
{'innerId' in transaction ? (
38-
<InnerTransactionLink innerTransactionId={transaction.innerId} />
38+
<InnerTransactionLink transactionId={transaction.networkTransactionId} innerTransactionId={transaction.innerId} />
3939
) : (
4040
<TransactionLink transactionId={transaction.id} short={true} />
4141
)}

src/features/transactions/mappers/transaction-common-properties-mappers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const asJson = (transactionResult: TransactionResult) =>
5050

5151
export const asInnerTransactionId = (networkTransactionId: string, index: string): InnerTransactionId => {
5252
return {
53+
networkTransactionId: networkTransactionId,
5354
id: `${networkTransactionId}-${index}`,
5455
innerId: index,
5556
}

src/features/transactions/models/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export enum AppCallOnComplete {
150150
}
151151

152152
export type InnerTransactionId = {
153+
networkTransactionId: string
153154
id: string
154155
innerId: string
155156
}

0 commit comments

Comments
 (0)