diff --git a/frontend/src/component/common/ApiError/ApiError.tsx b/frontend/src/component/common/ApiError/ApiError.tsx index 4622fc7442..e68d410cae 100644 --- a/frontend/src/component/common/ApiError/ApiError.tsx +++ b/frontend/src/component/common/ApiError/ApiError.tsx @@ -5,6 +5,7 @@ interface IApiErrorProps { className?: string; onClick: () => void; text: string; + style?: React.CSSProperties; } const ApiError: React.FC = ({ diff --git a/frontend/src/component/common/ResponsiveButton/ResponsiveButton.tsx b/frontend/src/component/common/ResponsiveButton/ResponsiveButton.tsx index 3794b5f1ba..a6e49f57fe 100644 --- a/frontend/src/component/common/ResponsiveButton/ResponsiveButton.tsx +++ b/frontend/src/component/common/ResponsiveButton/ResponsiveButton.tsx @@ -5,6 +5,7 @@ interface IResponsiveButtonProps { Icon: React.ElementType; onClick: () => void; tooltip?: string; + disabled?: boolean; maxWidth: string; } @@ -13,33 +14,37 @@ const ResponsiveButton: React.FC = ({ onClick, maxWidth, tooltip, + disabled = false, children, ...rest }) => { const smallScreen = useMediaQuery(`(max-width:${maxWidth})`); return ( - - + + + - - } - elseShow={ - - } - /> + } + elseShow={ + + } + /> + + ); }; diff --git a/frontend/src/component/feature/FeatureToggleListNew/FeatureToggleListNewItem/FeatureToggleListNewItem.tsx b/frontend/src/component/feature/FeatureToggleListNew/FeatureToggleListNewItem/FeatureToggleListNewItem.tsx index ec534b4ab7..33f3b685d9 100644 --- a/frontend/src/component/feature/FeatureToggleListNew/FeatureToggleListNewItem/FeatureToggleListNewItem.tsx +++ b/frontend/src/component/feature/FeatureToggleListNew/FeatureToggleListNewItem/FeatureToggleListNewItem.tsx @@ -14,6 +14,7 @@ import { IEnvironments } from '../../../../interfaces/featureToggle'; import ConditionallyRender from '../../../common/ConditionallyRender'; import useToast from '../../../../hooks/useToast'; import { getTogglePath } from '../../../../utils/route-path-helpers'; +import { SyntheticEvent } from 'react-router/node_modules/@types/react'; interface IFeatureToggleListNewItemProps { name: string; @@ -40,13 +41,13 @@ const FeatureToggleListNewItem = ({ const history = useHistory(); const ref = useRef(null); - const onClick = (e: Event) => { + const onClick = (e: SyntheticEvent) => { if (!ref.current?.contains(e.target)) { history.push(getTogglePath(projectId, name)); } }; - const handleToggle = (env: IEnvironments) => { + const handleToggle = (env: IEnvironments, e: SyntheticEvent) => { toggleFeatureByEnvironment(env.name, env.enabled) .then(() => { setToastData({ @@ -68,14 +69,14 @@ const FeatureToggleListNewItem = ({ return ( <> - - + + {name} +
handleToggle(env)} + onClick={handleToggle.bind(this, env)} /> diff --git a/frontend/src/component/menu/Header/Header.tsx b/frontend/src/component/menu/Header/Header.tsx index 679ce4db7f..f1233d6380 100644 --- a/frontend/src/component/menu/Header/Header.tsx +++ b/frontend/src/component/menu/Header/Header.tsx @@ -91,12 +91,8 @@ const Header = () => { condition={!smallScreen} show={
- Projects} - /> + Projects Feature toggles - Reporting - } - /> - } > - - - - } - /> - } /> } > diff --git a/frontend/src/page/project/access.js b/frontend/src/page/project/access.js deleted file mode 100644 index aacff8d119..0000000000 --- a/frontend/src/page/project/access.js +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; -import ProjectAccess from '../../component/project/access-container.js'; -import PropTypes from 'prop-types'; - -const render = ({ match: { params }, history }) => ( - -); - -render.propTypes = { - match: PropTypes.object.isRequired, - history: PropTypes.object.isRequired, -}; - -export default render; diff --git a/frontend/src/page/reporting/index.js b/frontend/src/page/reporting/index.js deleted file mode 100644 index 0b2d23a87e..0000000000 --- a/frontend/src/page/reporting/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import React from 'react'; -import ReportingContainer from '../../component/Reporting/ReportingContainer'; - -const render = () => ; - -export default render;