Skip to content

Commit 25d906c

Browse files
committed
Merge branch 'main' into develop
2 parents 745e17f + 8d2edd7 commit 25d906c

File tree

13 files changed

+227
-32
lines changed

13 files changed

+227
-32
lines changed

.release-please-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"apps/cowswap-frontend": "1.93.2",
3-
"apps/explorer": "2.38.0",
3+
"apps/explorer": "2.39.0",
44
"libs/permit-utils": "0.5.0",
55
"libs/widget-lib": "0.18.0",
66
"libs/widget-react": "0.11.0",
@@ -18,7 +18,7 @@
1818
"libs/types": "1.5.0",
1919
"libs/ui": "1.16.0",
2020
"libs/wallet": "1.7.0",
21-
"apps/cow-fi": "1.19.2",
21+
"apps/cow-fi": "1.19.3",
2222
"libs/wallet-provider": "1.0.0",
2323
"libs/ui-utils": "1.1.0",
2424
"libs/abis": "1.2.0",

apps/cow-fi/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [1.19.3](https://github.com/cowprotocol/cowswap/compare/cow-fi-v1.19.2...cow-fi-v1.19.3) (2024-12-16)
4+
5+
6+
### Bug Fixes
7+
8+
* **cowfi:** fix pages crashes ([#5206](https://github.com/cowprotocol/cowswap/issues/5206)) ([525d079](https://github.com/cowprotocol/cowswap/commit/525d0794c10e0950dc0036f2f9c2e8e728117969))
9+
310
## [1.19.2](https://github.com/cowprotocol/cowswap/compare/cow-fi-v1.19.1...cow-fi-v1.19.2) (2024-12-12)
411

512

apps/cow-fi/app/(learn)/learn/articles/[[...pageIndex]]/page.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { Article, getArticles, getCategories } from '../../../../../services/cms'
44
import { ArticlesPageComponents } from '@/components/ArticlesPageComponents'
5+
import { redirect } from 'next/navigation'
56

67
const ITEMS_PER_PAGE = 24
78

@@ -28,7 +29,14 @@ export async function generateStaticParams() {
2829

2930
export default async function Page({ params }: Props) {
3031
const pageParam = (await params)?.pageIndex
31-
const page = pageParam && pageParam.length > 0 ? parseInt(pageParam[0], 10) : 1
32+
const paramsAreSet = Boolean(pageParam && pageParam.length > 0)
33+
const pageIndexIsValid = Boolean(pageParam && /^\d+$/.test(pageParam))
34+
35+
if (paramsAreSet && !pageIndexIsValid) {
36+
return redirect('/learn/articles')
37+
}
38+
39+
const page = pageParam && pageIndexIsValid ? parseInt(pageParam, 10) : 1
3240

3341
const articlesResponse = (await getArticles({ page, pageSize: ITEMS_PER_PAGE })) as ArticlesResponse
3442

apps/cow-fi/app/(main)/tokens/[tokenId]/page.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { TokenPageComponent } from '@/components/TokenPageComponent'
99
import type { Metadata } from 'next'
1010
import type { TokenDetails } from '../../../../types'
1111
import { getPageMetadata } from '@/util/getPageMetadata'
12+
import { redirect } from 'next/navigation'
1213

1314
type Props = {
1415
params: Promise<{ tokenId: string }>
@@ -35,6 +36,8 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
3536

3637
const token = await getTokenDetails(tokenId)
3738

39+
if (!token) return {}
40+
3841
return getPageMetadata(getTokenMetaData(token))
3942
}
4043

@@ -51,5 +54,7 @@ export default async function Page({ params }: Props) {
5154

5255
const token = await getTokenDetails(tokenId)
5356

57+
if (!token) return redirect('/tokens')
58+
5459
return <TokenPageComponent token={token} />
5560
}

apps/cow-fi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cowprotocol/cow-fi",
3-
"version": "1.19.2",
3+
"version": "1.19.3",
44
"description": "CoW DAO website",
55
"main": "index.js",
66
"author": "",

apps/cow-fi/services/tokens/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ export async function getTokensInfo(): Promise<TokenInfo[]> {
4848
*
4949
* @returns token details for the given token id
5050
*/
51-
export async function getTokenDetails(coingeckoId: string): Promise<TokenDetails> {
51+
export async function getTokenDetails(coingeckoId: string): Promise<TokenDetails | undefined> {
5252
const id = coingeckoId.toLowerCase()
5353
const tokensRaw = await _getAllTokensData()
54-
return tokensRaw.find(({ id: _id }) => _id === id) as TokenDetails
54+
return tokensRaw.find(({ id: _id }) => _id === id) as TokenDetails | undefined
5555
}
5656

5757
function _getDescriptionFilePaths(): string[] {

apps/cowswap-frontend/src/common/pure/OrderProgressBarV2/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,8 @@ function FinishedStep(props: OrderProgressBarV2Props) {
839839
{solvers.length > 1 && (
840840
<p>
841841
<b>
842-
{solvers.length} out of {totalSolvers} solvers
842+
{solvers.length}
843+
{totalSolvers ? ` out of ${totalSolvers}` : ''} solvers
843844
</b>{' '}
844845
submitted a solution
845846
</p>

apps/explorer/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [2.39.0](https://github.com/cowprotocol/cowswap/compare/explorer-v2.38.0...explorer-v2.39.0) (2024-12-17)
4+
5+
6+
### Features
7+
8+
* warn about unsigned orders, and hide not relevant orders ([#5214](https://github.com/cowprotocol/cowswap/issues/5214)) ([0d19616](https://github.com/cowprotocol/cowswap/commit/0d196168076fda10e8e5d823d0288ce0ed1bd612))
9+
310
## [2.38.0](https://github.com/cowprotocol/cowswap/compare/explorer-v2.37.0...explorer-v2.38.0) (2024-12-04)
411

512

apps/explorer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cowprotocol/explorer",
3-
"version": "2.38.0",
3+
"version": "2.39.0",
44
"description": "CoW Swap Explorer",
55
"main": "src/main.tsx",
66
"author": "",

apps/explorer/src/components/orders/DetailsTable/index.tsx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react'
33
import { ExplorerDataType, getExplorerLink } from '@cowprotocol/common-utils'
44
import { SupportedChainId } from '@cowprotocol/cow-sdk'
55
import { Command } from '@cowprotocol/types'
6-
import { Media } from '@cowprotocol/ui'
6+
import { Icon, Media, UI } from '@cowprotocol/ui'
77
import { TruncatedText } from '@cowprotocol/ui/pure/TruncatedText'
88

99
import { faFill, faGroupArrowsRotate, faHistory, faProjectDiagram } from '@fortawesome/free-solid-svg-icons'
@@ -31,6 +31,7 @@ import { Order } from 'api/operator'
3131
import { getUiOrderType } from 'utils/getUiOrderType'
3232

3333
import { OrderHooksDetails } from '../OrderHooksDetails'
34+
import { UnsignedOrderWarning } from '../UnsignedOrderWarning'
3435

3536
const tooltip = {
3637
orderID: 'A unique identifier ID for this order.',
@@ -87,6 +88,8 @@ const tooltip = {
8788
}
8889

8990
export const Wrapper = styled.div`
91+
--cow-color-alert: ${({ theme }): string => theme.alert2};
92+
9093
display: flex;
9194
flex-direction: row;
9295
@@ -126,6 +129,10 @@ export const LinkButton = styled(LinkWithPrefixNetwork)`
126129
}
127130
`
128131

132+
const WarningRow = styled.tr`
133+
background-color: ${({ theme }): string => theme.background};
134+
`
135+
129136
export type Props = {
130137
chainId: SupportedChainId
131138
order: Order
@@ -167,12 +174,20 @@ export function DetailsTable(props: Props): React.ReactNode | null {
167174
}
168175

169176
const onCopy = (label: string): void => clickOnOrderDetails('Copy', label)
177+
const isSigning = status === 'signing'
170178

171179
return (
172180
<SimpleTable
173181
columnViewMobile
174182
body={
175183
<>
184+
{isSigning && (
185+
<WarningRow>
186+
<td colSpan={2}>
187+
<UnsignedOrderWarning />
188+
</td>
189+
</WarningRow>
190+
)}
176191
<tr>
177192
<td>
178193
<span>
@@ -195,6 +210,12 @@ export function DetailsTable(props: Props): React.ReactNode | null {
195210
</td>
196211
<td>
197212
<Wrapper>
213+
{isSigning && (
214+
<>
215+
<Icon image="ALERT" color={UI.COLOR_ALERT} />
216+
&nbsp;
217+
</>
218+
)}
198219
<RowWithCopyButton
199220
textToCopy={owner}
200221
onCopy={(): void => onCopy('ownerAddress')}

0 commit comments

Comments
 (0)