From 808b4721a57bf6442dbfd4216f85148e675c5deb Mon Sep 17 00:00:00 2001 From: Jan-Felix Date: Wed, 21 Aug 2024 09:44:02 +0200 Subject: [PATCH 1/3] fix diff view alignment issue --- .../TargetItem/FunctionPermissionItem.tsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/app/components/permissions/TargetItem/FunctionPermissionItem.tsx b/packages/app/components/permissions/TargetItem/FunctionPermissionItem.tsx index 2e0b17e63..56084a617 100644 --- a/packages/app/components/permissions/TargetItem/FunctionPermissionItem.tsx +++ b/packages/app/components/permissions/TargetItem/FunctionPermissionItem.tsx @@ -25,10 +25,11 @@ const FunctionPermissionItem: React.FC< abi, modified, condition, - ...rest + send, + delegatecall, }) => { const functionAbi = abi?.find( - (fragment) => + (fragment: any) => fragment.type === "function" && toFunctionSelector(fragment) === selector ) as AbiFunction | undefined @@ -36,7 +37,9 @@ const FunctionPermissionItem: React.FC< + modified && ( + + ) } >
@@ -46,14 +49,16 @@ const FunctionPermissionItem: React.FC< selector={selector} abi={functionAbi} condition={condition} - {...rest} + send={send} + delegatecall={delegatecall} /> ) : ( )}
From 5c6458dd6c46018ad4485f26c7650aef8c301c4a Mon Sep 17 00:00:00 2001 From: Jan-Felix Date: Wed, 21 Aug 2024 09:44:14 +0200 Subject: [PATCH 2/3] fix permission anchors --- packages/app/ui/Anchor/index.tsx | 10 +++------- packages/app/ui/IconButton/index.tsx | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/packages/app/ui/Anchor/index.tsx b/packages/app/ui/Anchor/index.tsx index 4821720dd..28d62b6e5 100644 --- a/packages/app/ui/Anchor/index.tsx +++ b/packages/app/ui/Anchor/index.tsx @@ -1,7 +1,7 @@ "use client" import { ReactNode, createContext, useContext, useEffect } from "react" import { RiLinkM } from "react-icons/ri" -import { IconLinkButton } from "../IconButton" +import { IconAButton } from "../IconButton" const AnchorContext = createContext("") @@ -44,13 +44,9 @@ const Anchor: React.FC<{ }, [uniqueName]) return ( - + - + ) } diff --git a/packages/app/ui/IconButton/index.tsx b/packages/app/ui/IconButton/index.tsx index 55f4f63ee..261256194 100644 --- a/packages/app/ui/IconButton/index.tsx +++ b/packages/app/ui/IconButton/index.tsx @@ -1,5 +1,5 @@ import cn from "classnames" -import React from "react" +import React, { AnchorHTMLAttributes } from "react" import classes from "./style.module.css" import Link from "next/link" @@ -38,3 +38,18 @@ export const IconLinkButton: React.FC< {...rest} /> ) + +export const IconAButton: React.FC< + AnchorHTMLAttributes & { + danger?: boolean + small?: boolean + } +> = ({ className, danger, small, ...rest }) => ( + +) From 1fe47fd8ca250c16a3baad6e4184564b74194b2a Mon Sep 17 00:00:00 2001 From: Jan-Felix Date: Wed, 21 Aug 2024 12:40:05 +0200 Subject: [PATCH 3/3] update snapshot to fix test --- .../components/permissions/annotations.test.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/app/components/permissions/annotations.test.ts b/packages/app/components/permissions/annotations.test.ts index 03368ca4a..b35d22e2a 100644 --- a/packages/app/components/permissions/annotations.test.ts +++ b/packages/app/components/permissions/annotations.test.ts @@ -73,7 +73,7 @@ describe("processAnnotations()", () => { "explode": false, "in": "query", "name": "buy", - "required": true, + "required": false, "schema": { "deprecated": false, "items": { @@ -100,6 +100,22 @@ describe("processAnnotations()", () => { }, "style": "form", }, + { + "allowEmptyValue": false, + "allowReserved": false, + "explode": false, + "in": "query", + "name": "feeAmountBp", + "required": false, + "schema": { + "deprecated": false, + "maximum": 10000, + "minimum": 0, + "nullable": false, + "type": "integer", + }, + "style": "form", + }, ], "summary": "Make swaps on cowswap", "tags": [