Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Commit c448910

Browse files
authored
Merge pull request #565 from cowprotocol/release/2.25
Release/2.25
2 parents 23ffd91 + 05fe569 commit c448910

File tree

19 files changed

+524
-403
lines changed

19 files changed

+524
-403
lines changed

getWebpackConfig.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,6 @@ function getWebpackConfig({ apps = [], config = {}, envVars = {}, defineVars = {
158158
assert(templatePath, '"templatePath" missing in config')
159159
assert(logoPath, '"logoPath" missing in config')
160160

161-
// Log the apps
162-
console.log('apps', apps)
163-
164161
// Generate one entry point per app
165162
const entryPoints = apps.reduce((acc, app) => {
166163
const { name } = app

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cowprotocol/explorer",
3-
"version": "2.24.0",
3+
"version": "2.25.0",
44
"description": "",
55
"main": "src/index.js",
66
"sideEffects": false,
@@ -46,9 +46,9 @@
4646
"author": "",
4747
"dependencies": {
4848
"@apollo/client": "^3.1.5",
49-
"@cowprotocol/app-data": "v0.1.0",
49+
"@cowprotocol/app-data": "^1.0.2",
5050
"@cowprotocol/contracts": "1.3.1",
51-
"@cowprotocol/cow-sdk": "^2.0.6",
51+
"@cowprotocol/cow-sdk": "^2.2.1",
5252
"@fortawesome/fontawesome-svg-core": "^6.1.2",
5353
"@fortawesome/free-regular-svg-icons": "^6.1.2",
5454
"@fortawesome/free-solid-svg-icons": "^6.1.2",

src/api/operator/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export type RawOrder = EnrichedOrder
1818
*/
1919
export type Order = Pick<
2020
RawOrder,
21-
'owner' | 'uid' | 'appData' | 'kind' | 'partiallyFillable' | 'signature' | 'class'
21+
'owner' | 'uid' | 'appData' | 'kind' | 'partiallyFillable' | 'signature' | 'class' | 'fullAppData'
2222
> & {
2323
receiver: string
2424
txHash?: string

src/apps/explorer/components/TransactionsTableWidget/index.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import React, { useState, useEffect, useCallback } from 'react'
1+
import React, { useCallback, useEffect, useState } from 'react'
22
import { faListUl, faProjectDiagram } from '@fortawesome/free-solid-svg-icons'
3-
import { useHistory } from 'react-router-dom'
43

5-
import { useQuery } from 'hooks/useQuery'
4+
import { useQuery, useUpdateQueryString } from 'hooks/useQuery'
65
import { BlockchainNetwork, TransactionsTableContext } from './context/TransactionsTableContext'
76
import { useGetTxOrders, useTxOrderExplorerLink } from 'hooks/useGetOrders'
87
import RedirectToSearch from 'components/RedirectToSearch'
98
import { RedirectToNetwork, useNetworkId } from 'state/network'
109
import { Order } from 'api/operator'
1110
import { TransactionsTableWithData } from 'apps/explorer/components/TransactionsTableWidget/TransactionsTableWithData'
12-
import { TabItemInterface, TabIcon } from 'components/common/Tabs/Tabs'
11+
import { TabIcon, TabItemInterface } from 'components/common/Tabs/Tabs'
1312
import ExplorerTabs from '../common/ExplorerTabs/ExplorerTabs'
14-
import { TitleAddress, FlexContainer, Title } from 'apps/explorer/pages/styled'
13+
import { FlexContainer, Title, TitleAddress } from 'apps/explorer/pages/styled'
1514
import { BlockExplorerLink } from 'components/common/BlockExplorerLink'
1615
import { ConnectionStatus } from 'components/ConnectionStatus'
1716
import { Notification } from 'components/Notification'
1817
import { TransactionBatchGraph } from 'apps/explorer/components/TransanctionBatchGraph'
1918
import CowLoading from 'components/common/CowLoading'
19+
import { TAB_QUERY_PARAM_KEY } from 'apps/explorer/const'
2020

2121
interface Props {
2222
txHash: string
@@ -33,7 +33,7 @@ const DEFAULT_TAB = TabView[1]
3333

3434
function useQueryViewParams(): { tab: string } {
3535
const query = useQuery()
36-
return { tab: query.get('tab')?.toUpperCase() || DEFAULT_TAB } // if URL param empty will be used DEFAULT
36+
return { tab: query.get(TAB_QUERY_PARAM_KEY)?.toUpperCase() || DEFAULT_TAB } // if URL param empty will be used DEFAULT
3737
}
3838

3939
const tabItems = (orders: Order[] | undefined, networkId: BlockchainNetwork, txHash: string): TabItemInterface[] => {
@@ -61,7 +61,7 @@ export const TransactionsTableWidget: React.FC<Props> = ({ txHash }) => {
6161
const isZeroOrders = !!(orders && orders.length === 0)
6262
const notGpv2ExplorerData = useTxOrderExplorerLink(txHash, isZeroOrders)
6363

64-
const history = useHistory()
64+
const updateQueryString = useUpdateQueryString()
6565

6666
// Avoid redirecting until another network is searched again
6767
useEffect(() => {
@@ -81,9 +81,10 @@ export const TransactionsTableWidget: React.FC<Props> = ({ txHash }) => {
8181
setTabViewSelected(TabView[newTabViewName])
8282
}, [])
8383

84-
useEffect(() => {
85-
history.replace({ search: `?tab=${TabView[tabViewSelected].toLowerCase()}` })
86-
}, [history, tabViewSelected])
84+
useEffect(
85+
() => updateQueryString(TAB_QUERY_PARAM_KEY, TabView[tabViewSelected].toLowerCase()),
86+
[tabViewSelected, updateQueryString],
87+
)
8788

8889
if (errorTxPresentInNetworkId && networkId != errorTxPresentInNetworkId) {
8990
return <RedirectToNetwork networkId={errorTxPresentInNetworkId} />

src/apps/explorer/components/TransanctionBatchGraph/hooks.ts

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ import {
1818
PopperInstance,
1919
ViewType,
2020
} from 'apps/explorer/components/TransanctionBatchGraph/types'
21-
import { useQuery } from 'hooks/useQuery'
22-
import { useHistory } from 'react-router-dom'
21+
import { useQuery, useUpdateQueryString } from 'hooks/useQuery'
2322
import { Order } from 'api/operator'
2423
import { useTransactionData } from 'hooks/useTransactionData'
2524
import {
@@ -205,18 +204,9 @@ function useQueryViewParams(): { visualization: string } {
205204
}
206205

207206
function useUpdateVisQuery(): (vis: string) => void {
208-
const query = useQuery()
209-
const history = useHistory()
210-
211-
// TODO: this is causing one extra re-render as the query is being updated when history is updated
212-
// TODO: make it not depend on query
213-
return useCallback(
214-
(vis: string) => {
215-
query.set(VISUALIZATION_PARAM_NAME, vis)
216-
history.replace({ search: query.toString() })
217-
},
218-
[history, query],
219-
)
207+
const updateQueryString = useUpdateQueryString()
208+
209+
return useCallback((vis: string) => updateQueryString(VISUALIZATION_PARAM_NAME, vis), [updateQueryString])
220210
}
221211

222212
export function useTxBatchData(

src/apps/explorer/const.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,5 @@ export const SPECIAL_ADDRESSES = {
5353
'0xa03be496e67ec29bc62f01a428683d7f9c204930': 'Solver Rewards Safe',
5454
'0xca771eda0c70aa7d053ab1b25004559b918fe662': 'CoW DAO',
5555
}
56+
57+
export const TAB_QUERY_PARAM_KEY = 'tab'

0 commit comments

Comments
 (0)