diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 53ce0c45af..62d355c459 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,27 +1,27 @@ { - "apps/cowswap-frontend": "1.93.2", - "apps/explorer": "2.38.0", + "apps/cowswap-frontend": "1.95.0", + "apps/explorer": "2.40.1", "libs/permit-utils": "0.5.0", "libs/widget-lib": "0.18.0", "libs/widget-react": "0.11.0", - "apps/widget-configurator": "1.10.0", + "apps/widget-configurator": "1.10.1", "libs/analytics": "1.9.0", - "libs/assets": "1.11.0", - "libs/common-const": "1.12.2", + "libs/assets": "1.12.0", + "libs/common-const": "1.13.0", "libs/common-hooks": "1.6.0", "libs/common-utils": "1.8.0", - "libs/core": "1.5.0", + "libs/core": "1.6.0", "libs/ens": "1.3.0", "libs/events": "1.5.0", "libs/snackbars": "1.1.0", - "libs/tokens": "1.13.0", + "libs/tokens": "1.13.1", "libs/types": "1.5.0", - "libs/ui": "1.16.0", - "libs/wallet": "1.7.0", - "apps/cow-fi": "1.19.2", + "libs/ui": "1.17.0", + "libs/wallet": "1.8.0", + "apps/cow-fi": "1.19.3", "libs/wallet-provider": "1.0.0", "libs/ui-utils": "1.1.0", - "libs/abis": "1.2.0", + "libs/abis": "1.2.1", "libs/balances-and-allowances": "1.2.0", "libs/iframe-transport": "1.0.0", "libs/hook-dapp-lib": "1.4.0", diff --git a/apps/cow-fi/CHANGELOG.md b/apps/cow-fi/CHANGELOG.md index 3b35ad3415..921aa39b64 100644 --- a/apps/cow-fi/CHANGELOG.md +++ b/apps/cow-fi/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.19.3](https://github.com/cowprotocol/cowswap/compare/cow-fi-v1.19.2...cow-fi-v1.19.3) (2024-12-16) + + +### Bug Fixes + +* **cowfi:** fix pages crashes ([#5206](https://github.com/cowprotocol/cowswap/issues/5206)) ([525d079](https://github.com/cowprotocol/cowswap/commit/525d0794c10e0950dc0036f2f9c2e8e728117969)) + ## [1.19.2](https://github.com/cowprotocol/cowswap/compare/cow-fi-v1.19.1...cow-fi-v1.19.2) (2024-12-12) diff --git a/apps/cow-fi/app/(learn)/learn/articles/[[...pageIndex]]/page.tsx b/apps/cow-fi/app/(learn)/learn/articles/[[...pageIndex]]/page.tsx index 590c10c700..f048215b23 100644 --- a/apps/cow-fi/app/(learn)/learn/articles/[[...pageIndex]]/page.tsx +++ b/apps/cow-fi/app/(learn)/learn/articles/[[...pageIndex]]/page.tsx @@ -2,6 +2,7 @@ import { Article, getArticles, getCategories } from '../../../../../services/cms' import { ArticlesPageComponents } from '@/components/ArticlesPageComponents' +import { redirect } from 'next/navigation' const ITEMS_PER_PAGE = 24 @@ -28,7 +29,14 @@ export async function generateStaticParams() { export default async function Page({ params }: Props) { const pageParam = (await params)?.pageIndex - const page = pageParam && pageParam.length > 0 ? parseInt(pageParam[0], 10) : 1 + const paramsAreSet = Boolean(pageParam && pageParam.length > 0) + const pageIndexIsValid = Boolean(pageParam && /^\d+$/.test(pageParam)) + + if (paramsAreSet && !pageIndexIsValid) { + return redirect('/learn/articles') + } + + const page = pageParam && pageIndexIsValid ? parseInt(pageParam, 10) : 1 const articlesResponse = (await getArticles({ page, pageSize: ITEMS_PER_PAGE })) as ArticlesResponse diff --git a/apps/cow-fi/app/(main)/tokens/[tokenId]/page.tsx b/apps/cow-fi/app/(main)/tokens/[tokenId]/page.tsx index f52dbd237e..56aeeb9478 100644 --- a/apps/cow-fi/app/(main)/tokens/[tokenId]/page.tsx +++ b/apps/cow-fi/app/(main)/tokens/[tokenId]/page.tsx @@ -9,6 +9,7 @@ import { TokenPageComponent } from '@/components/TokenPageComponent' import type { Metadata } from 'next' import type { TokenDetails } from '../../../../types' import { getPageMetadata } from '@/util/getPageMetadata' +import { redirect } from 'next/navigation' type Props = { params: Promise<{ tokenId: string }> @@ -35,6 +36,8 @@ export async function generateMetadata({ params }: Props): Promise { const token = await getTokenDetails(tokenId) + if (!token) return {} + return getPageMetadata(getTokenMetaData(token)) } @@ -51,5 +54,7 @@ export default async function Page({ params }: Props) { const token = await getTokenDetails(tokenId) + if (!token) return redirect('/tokens') + return } diff --git a/apps/cow-fi/package.json b/apps/cow-fi/package.json index bdb5bfaaa7..a10cdedee2 100644 --- a/apps/cow-fi/package.json +++ b/apps/cow-fi/package.json @@ -1,6 +1,6 @@ { "name": "@cowprotocol/cow-fi", - "version": "1.19.2", + "version": "1.19.3", "description": "CoW DAO website", "main": "index.js", "author": "", diff --git a/apps/cow-fi/services/tokens/index.ts b/apps/cow-fi/services/tokens/index.ts index c2cee43198..fa00faf495 100644 --- a/apps/cow-fi/services/tokens/index.ts +++ b/apps/cow-fi/services/tokens/index.ts @@ -48,10 +48,10 @@ export async function getTokensInfo(): Promise { * * @returns token details for the given token id */ -export async function getTokenDetails(coingeckoId: string): Promise { +export async function getTokenDetails(coingeckoId: string): Promise { const id = coingeckoId.toLowerCase() const tokensRaw = await _getAllTokensData() - return tokensRaw.find(({ id: _id }) => _id === id) as TokenDetails + return tokensRaw.find(({ id: _id }) => _id === id) as TokenDetails | undefined } function _getDescriptionFilePaths(): string[] { diff --git a/apps/cowswap-frontend/CHANGELOG.md b/apps/cowswap-frontend/CHANGELOG.md index c754fa057c..eef1aa82e0 100644 --- a/apps/cowswap-frontend/CHANGELOG.md +++ b/apps/cowswap-frontend/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [1.95.0](https://github.com/cowprotocol/cowswap/compare/cowswap-v1.94.0...cowswap-v1.95.0) (2024-12-18) + + +### Features + +* force release to release, pleaseeee ([a59eb27](https://github.com/cowprotocol/cowswap/commit/a59eb275a96fb13c9521784a051f734d947a1b1f)) + +## [1.94.0](https://github.com/cowprotocol/cowswap/compare/cowswap-v1.93.2...cowswap-v1.94.0) (2024-12-18) + + +### Features + +* allow 1 year max deadline ([#5227](https://github.com/cowprotocol/cowswap/issues/5227)) ([64e3f40](https://github.com/cowprotocol/cowswap/commit/64e3f40a19da19ba7d44f4ebcb1b494fd4426882)) + + +### Bug Fixes + +* account for a bad CMS request ([#5221](https://github.com/cowprotocol/cowswap/issues/5221)) ([8d2edd7](https://github.com/cowprotocol/cowswap/commit/8d2edd7d87f0622fdc5885b45175b89b49eae1ec)) + ## [1.93.2](https://github.com/cowprotocol/cowswap/compare/cowswap-v1.93.1...cowswap-v1.93.2) (2024-12-13) diff --git a/apps/cowswap-frontend/index.html b/apps/cowswap-frontend/index.html index c746e1ba09..67135301fe 100644 --- a/apps/cowswap-frontend/index.html +++ b/apps/cowswap-frontend/index.html @@ -37,7 +37,6 @@ -