From 3e8b963544a52f843ba03280715488c5e071e286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Olek=C5=A1=C3=A1k?= Date: Tue, 20 Jun 2023 23:04:03 +0200 Subject: [PATCH] Fix some prop type errors (#1911) --- .../Sorters/CustomSorters/SelectCustomSorter.js | 2 +- src/Components/SmartComponents/Modals/ReportConfigModal.js | 2 +- src/Components/SmartComponents/Remediation/Remediation.js | 6 +++++- .../SystemsExposedTable/SystemsExposedTableToolbar.js | 2 +- src/Utilities/Routes.js | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Components/PresentationalComponents/Sorters/CustomSorters/SelectCustomSorter.js b/src/Components/PresentationalComponents/Sorters/CustomSorters/SelectCustomSorter.js index 511dd4eb9..66782e526 100644 --- a/src/Components/PresentationalComponents/Sorters/CustomSorters/SelectCustomSorter.js +++ b/src/Components/PresentationalComponents/Sorters/CustomSorters/SelectCustomSorter.js @@ -32,7 +32,7 @@ const SelectCustomSorter = ({ sorterData, setSorterData, selectProps, options }) }; SelectCustomSorter.propTypes = { - sorterData: propTypes.object, + sorterData: propTypes.string, setSorterData: propTypes.func, selectProps: propTypes.object, options: propTypes.array diff --git a/src/Components/SmartComponents/Modals/ReportConfigModal.js b/src/Components/SmartComponents/Modals/ReportConfigModal.js index 8c84843d8..ca8e9e989 100644 --- a/src/Components/SmartComponents/Modals/ReportConfigModal.js +++ b/src/Components/SmartComponents/Modals/ReportConfigModal.js @@ -254,7 +254,7 @@ const ReportConfigModal = ({ ReportConfigModal.propTypes = { isOpen: propTypes.bool, filterData: propTypes.object, - sorterData: propTypes.object, + sorterData: propTypes.string, setFilterData: propTypes.func, setSorterData: propTypes.func, handleModalClose: propTypes.func, diff --git a/src/Components/SmartComponents/Remediation/Remediation.js b/src/Components/SmartComponents/Remediation/Remediation.js index d4d57e074..afd9d93a4 100644 --- a/src/Components/SmartComponents/Remediation/Remediation.js +++ b/src/Components/SmartComponents/Remediation/Remediation.js @@ -78,7 +78,11 @@ const Remediation = ({ cves, systems, manyRules, isDisabled }) => { Remediation.propTypes = { cves: propTypes.oneOfType([ propTypes.array, - propTypes.string + propTypes.string, + propTypes.shape({ + id: propTypes.string, + rules: propTypes.array + }) ]), systems: propTypes.oneOfType([ propTypes.array, diff --git a/src/Components/SmartComponents/SystemsExposedTable/SystemsExposedTableToolbar.js b/src/Components/SmartComponents/SystemsExposedTable/SystemsExposedTableToolbar.js index f676118e8..948527af1 100644 --- a/src/Components/SmartComponents/SystemsExposedTable/SystemsExposedTableToolbar.js +++ b/src/Components/SmartComponents/SystemsExposedTable/SystemsExposedTableToolbar.js @@ -147,7 +147,7 @@ SystemsExposedTableToolbar.propTypes = { parameters: propTypes.object, cveName: propTypes.string, cveStatusDetails: propTypes.object, - filterRuleValues: propTypes.object, + filterRuleValues: propTypes.array, expandAll: propTypes.func, hasSecurityRule: propTypes.bool, isAllExpanded: propTypes.bool, diff --git a/src/Utilities/Routes.js b/src/Utilities/Routes.js index b5e702854..578ba8389 100644 --- a/src/Utilities/Routes.js +++ b/src/Utilities/Routes.js @@ -80,7 +80,7 @@ const InsightsRoute = ({ component: Component, title, ...rest }) => { }; InsightsRoute.propTypes = { - component: PropTypes.func, + component: PropTypes.elementType, title: PropTypes.string };