From bb81487f73cec8515c34b3f3b24934f29ca99cd7 Mon Sep 17 00:00:00 2001 From: Mark Pedrotti Date: Tue, 24 Mar 2026 16:51:31 -0400 Subject: [PATCH] ROX-33770: Replace PropTypes in KeepBothSection component --- ui/apps/platform/eslint.config.js | 1 - .../src/Containers/Policies/Modal/KeepBothSection.tsx | 11 +++++------ .../Containers/Policies/Modal/RenamePolicySection.tsx | 4 ++-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/ui/apps/platform/eslint.config.js b/ui/apps/platform/eslint.config.js index 5cb5357837c2e..a79eb1c121970 100644 --- a/ui/apps/platform/eslint.config.js +++ b/ui/apps/platform/eslint.config.js @@ -1038,7 +1038,6 @@ module.exports = [ 'src/Containers/Login/LoginPage.jsx', // rewrite in TypeScript 'src/Containers/Login/TestLoginResultsPage.jsx', // rewrite in TypeScript 'src/Containers/MainPage/Header/UserMenu.tsx', // rewritten in TypeScript - 'src/Containers/Policies/Modal/KeepBothSection.tsx', // rewritten in TypeScript 'src/Containers/Risk/EventTimeline/**', // deprecated 'src/Containers/Risk/Process/Binaries.jsx', // rewrite in TypeScript? 'src/Containers/Risk/Process/BinaryCollapsible.jsx', // rewrite in TypeScript? diff --git a/ui/apps/platform/src/Containers/Policies/Modal/KeepBothSection.tsx b/ui/apps/platform/src/Containers/Policies/Modal/KeepBothSection.tsx index 51310da5d7d72..d7261b2d49e47 100644 --- a/ui/apps/platform/src/Containers/Policies/Modal/KeepBothSection.tsx +++ b/ui/apps/platform/src/Containers/Policies/Modal/KeepBothSection.tsx @@ -1,8 +1,11 @@ -import PropTypes from 'prop-types'; import { Field } from 'formik'; import { Radio } from '@patternfly/react-core'; -const KeepBothSection = ({ changeRadio }) => { +export type KeepBothSectionProps = { + changeRadio: (handler, name: string, value: string) => () => void; +}; + +const KeepBothSection = ({ changeRadio }: KeepBothSectionProps) => { return ( {({ field }) => ( @@ -19,8 +22,4 @@ const KeepBothSection = ({ changeRadio }) => { ); }; -KeepBothSection.propTypes = { - changeRadio: PropTypes.func.isRequired, -}; - export default KeepBothSection; diff --git a/ui/apps/platform/src/Containers/Policies/Modal/RenamePolicySection.tsx b/ui/apps/platform/src/Containers/Policies/Modal/RenamePolicySection.tsx index 1b0c0d9ada401..6642f5b7b7605 100644 --- a/ui/apps/platform/src/Containers/Policies/Modal/RenamePolicySection.tsx +++ b/ui/apps/platform/src/Containers/Policies/Modal/RenamePolicySection.tsx @@ -9,8 +9,8 @@ import { import { Field } from 'formik'; type RenamePolicySectionProps = { - changeRadio: (handler, name, value) => () => void; - changeText: (handler, name) => (_, value) => void; + changeRadio: (handler, name: string, value: string) => () => void; + changeText: (handler, name: string) => (_, value) => void; }; const RenamePolicySection = ({ changeRadio, changeText }: RenamePolicySectionProps) => {