Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/mean-wasps-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@smartcontractkit/operator-ui': patch
---

Add OCR2 plugins selection for FMS
3 changes: 3 additions & 0 deletions src/components/Form/ChainConfigurationForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('ChainConfigurationForm', () => {
ocr2Multiaddr: '',
ocr2P2PPeerID: '',
ocr2KeyBundleID: '',
ocr2MedianPluginEnabled: false,
}

render(
Expand Down Expand Up @@ -72,6 +73,7 @@ describe('ChainConfigurationForm', () => {
ocr2Multiaddr: '',
ocr2P2PPeerID: '',
ocr2KeyBundleID: '',
ocr2MedianPluginEnabled: false,
}

render(
Expand Down Expand Up @@ -126,6 +128,7 @@ describe('ChainConfigurationForm', () => {
ocr2Multiaddr: '',
ocr2P2PPeerID: '',
ocr2KeyBundleID: '',
ocr2MedianPluginEnabled: false,
}

render(
Expand Down
18 changes: 18 additions & 0 deletions src/components/Form/ChainConfigurationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export type FormValues = {
ocr2Multiaddr?: string | null
ocr2P2PPeerID?: string | null
ocr2KeyBundleID?: string | null
ocr2MedianPluginEnabled: boolean
}

const ValidationSchema = Yup.object().shape({
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -429,7 +431,23 @@ export const ChainConfigurationForm = withStyles(styles)(
))}
</Field>
</Grid>

<Grid item xs={12}>
<Typography>Supported Plugins</Typography>
</Grid>

<Grid item xs={12}>
<Field
component={CheckboxWithLabel}
name="ocr2MedianPluginEnabled"
type="checkbox"
Label={{
label: 'Median',
}}
/>
</Grid>
</>

)}
</>
</Grid>
Expand Down
3 changes: 3 additions & 0 deletions src/hooks/queries/useFeedsManagersWithProposalsQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ const FEEDS_MANAGER__CHAIN_CONFIG_FIELDS = gql`
multiaddr
p2pPeerID
keyBundleID
plugins {
median
}
}
}
`
Expand Down
1 change: 1 addition & 0 deletions src/screens/FeedsManager/EditSupportedChainDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/screens/FeedsManager/NewSupportedChainDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const NewSupportedChainDialog = ({ onClose, open, onSubmit }: Props) => {
ocr2Multiaddr: '',
ocr2P2PPeerID: '',
ocr2KeyBundleID: '',
ocr2MedianPluginEnabled: false,
}

const chainIDs: string[] = chainData
Expand Down
2 changes: 2 additions & 0 deletions src/screens/FeedsManager/SupportedChainsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ export const SupportedChainsCard = withStyles(styles)(
values.ocr2P2PPeerID !== '' ? values.ocr2P2PPeerID : null,
ocr2KeyBundleID:
values.ocr2KeyBundleID != '' ? values.ocr2KeyBundleID : null,
ocr2Plugins: `{"median":${values.ocr2MedianPluginEnabled}}`
},
},
})
Expand Down Expand Up @@ -292,6 +293,7 @@ export const SupportedChainsCard = withStyles(styles)(
values.ocr2P2PPeerID !== '' ? values.ocr2P2PPeerID : null,
ocr2KeyBundleID:
values.ocr2KeyBundleID != '' ? values.ocr2KeyBundleID : null,
ocr2Plugins: `{"median":${values.ocr2MedianPluginEnabled}}`
},
},
})
Expand Down