From 47bc08563e3abedc51b3b29bc6fda7ba898c7b2a Mon Sep 17 00:00:00 2001 From: giogam <151543+giogam@users.noreply.github.com> Date: Fri, 24 Mar 2023 13:36:29 +0000 Subject: [PATCH 1/2] Add checkbox for median plugin --- .../Form/ChainConfigurationForm.test.tsx | 3 +++ src/components/Form/ChainConfigurationForm.tsx | 18 ++++++++++++++++++ .../useFeedsManagersWithProposalsQuery.ts | 3 +++ .../FeedsManager/EditSupportedChainDialog.tsx | 1 + .../FeedsManager/NewSupportedChainDialog.tsx | 1 + .../FeedsManager/SupportedChainsCard.tsx | 2 ++ 6 files changed, 28 insertions(+) diff --git a/src/components/Form/ChainConfigurationForm.test.tsx b/src/components/Form/ChainConfigurationForm.test.tsx index 53758455..cdda3f56 100644 --- a/src/components/Form/ChainConfigurationForm.test.tsx +++ b/src/components/Form/ChainConfigurationForm.test.tsx @@ -26,6 +26,7 @@ describe('ChainConfigurationForm', () => { ocr2Multiaddr: '', ocr2P2PPeerID: '', ocr2KeyBundleID: '', + ocr2MedianPluginEnabled: false, } render( @@ -72,6 +73,7 @@ describe('ChainConfigurationForm', () => { ocr2Multiaddr: '', ocr2P2PPeerID: '', ocr2KeyBundleID: '', + ocr2MedianPluginEnabled: false, } render( @@ -126,6 +128,7 @@ describe('ChainConfigurationForm', () => { ocr2Multiaddr: '', ocr2P2PPeerID: '', ocr2KeyBundleID: '', + ocr2MedianPluginEnabled: false, } render( diff --git a/src/components/Form/ChainConfigurationForm.tsx b/src/components/Form/ChainConfigurationForm.tsx index d0528761..b4fb3a90 100644 --- a/src/components/Form/ChainConfigurationForm.tsx +++ b/src/components/Form/ChainConfigurationForm.tsx @@ -38,6 +38,7 @@ export type FormValues = { ocr2Multiaddr?: string | null ocr2P2PPeerID?: string | null ocr2KeyBundleID?: string | null + ocr2MedianPluginEnabled: boolean } const ValidationSchema = Yup.object().shape({ @@ -81,6 +82,7 @@ const ValidationSchema = Yup.object().shape({ then: Yup.string().required('Required').nullable(), }) .nullable(), + ocr2MedianPluginEnabled: Yup.boolean().required('Required'), }) const styles = (theme: Theme) => { @@ -429,7 +431,23 @@ export const ChainConfigurationForm = withStyles(styles)( ))} + + + Supported Plugins + + + + + + )} diff --git a/src/hooks/queries/useFeedsManagersWithProposalsQuery.ts b/src/hooks/queries/useFeedsManagersWithProposalsQuery.ts index dc8a924c..6d692d57 100644 --- a/src/hooks/queries/useFeedsManagersWithProposalsQuery.ts +++ b/src/hooks/queries/useFeedsManagersWithProposalsQuery.ts @@ -23,6 +23,9 @@ const FEEDS_MANAGER__CHAIN_CONFIG_FIELDS = gql` multiaddr p2pPeerID keyBundleID + plugins { + median + } } } ` diff --git a/src/screens/FeedsManager/EditSupportedChainDialog.tsx b/src/screens/FeedsManager/EditSupportedChainDialog.tsx index be9ed230..82ac74c9 100644 --- a/src/screens/FeedsManager/EditSupportedChainDialog.tsx +++ b/src/screens/FeedsManager/EditSupportedChainDialog.tsx @@ -71,6 +71,7 @@ export const EditSupportedChainDialog = ({ ocr2Multiaddr: cfg.ocr2JobConfig.multiaddr, ocr2P2PPeerID: cfg.ocr2JobConfig.p2pPeerID, ocr2KeyBundleID: cfg.ocr2JobConfig.keyBundleID, + ocr2MedianPluginEnabled: cfg.ocr2JobConfig.plugins.median, } const chainIDs: string[] = chainData diff --git a/src/screens/FeedsManager/NewSupportedChainDialog.tsx b/src/screens/FeedsManager/NewSupportedChainDialog.tsx index b8a91c08..234b9bc7 100644 --- a/src/screens/FeedsManager/NewSupportedChainDialog.tsx +++ b/src/screens/FeedsManager/NewSupportedChainDialog.tsx @@ -61,6 +61,7 @@ export const NewSupportedChainDialog = ({ onClose, open, onSubmit }: Props) => { ocr2Multiaddr: '', ocr2P2PPeerID: '', ocr2KeyBundleID: '', + ocr2MedianPluginEnabled: false, } const chainIDs: string[] = chainData diff --git a/src/screens/FeedsManager/SupportedChainsCard.tsx b/src/screens/FeedsManager/SupportedChainsCard.tsx index 73c49fc1..952a06da 100644 --- a/src/screens/FeedsManager/SupportedChainsCard.tsx +++ b/src/screens/FeedsManager/SupportedChainsCard.tsx @@ -221,6 +221,7 @@ export const SupportedChainsCard = withStyles(styles)( values.ocr2P2PPeerID !== '' ? values.ocr2P2PPeerID : null, ocr2KeyBundleID: values.ocr2KeyBundleID != '' ? values.ocr2KeyBundleID : null, + ocr2Plugins: `{"median":${values.ocr2MedianPluginEnabled}}` }, }, }) @@ -292,6 +293,7 @@ export const SupportedChainsCard = withStyles(styles)( values.ocr2P2PPeerID !== '' ? values.ocr2P2PPeerID : null, ocr2KeyBundleID: values.ocr2KeyBundleID != '' ? values.ocr2KeyBundleID : null, + ocr2Plugins: `{"median":${values.ocr2MedianPluginEnabled}}` }, }, }) From 43931df10e2c07508a7c839c531a4dc8caae8af7 Mon Sep 17 00:00:00 2001 From: eutopian Date: Tue, 28 Mar 2023 15:16:51 -0400 Subject: [PATCH 2/2] add changeset --- .changeset/mean-wasps-cover.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/mean-wasps-cover.md diff --git a/.changeset/mean-wasps-cover.md b/.changeset/mean-wasps-cover.md new file mode 100644 index 00000000..14ff809e --- /dev/null +++ b/.changeset/mean-wasps-cover.md @@ -0,0 +1,5 @@ +--- +'@smartcontractkit/operator-ui': patch +--- + +Add OCR2 plugins selection for FMS