diff --git a/src/core/components/auth/authorize-operation-btn.jsx b/src/core/components/auth/authorize-operation-btn.jsx index 7c2f2448..760bac2a 100644 --- a/src/core/components/auth/authorize-operation-btn.jsx +++ b/src/core/components/auth/authorize-operation-btn.jsx @@ -1,25 +1,23 @@ import React from "react" import PropTypes from "prop-types" -import ImPropTypes from "react-immutable-proptypes" export default class AuthorizeOperationBtn extends React.Component { + static propTypes = { + isAuthorized: PropTypes.bool.isRequired, + onClick: PropTypes.func + } + onClick =(e) => { e.stopPropagation() + let { onClick } = this.props - let { security, authActions, authSelectors } = this.props - let definitions = authSelectors.getDefinitionsByNames(security) - - authActions.showDefinitions(definitions) + if(onClick) { + onClick() + } } render() { - let { security, authSelectors } = this.props - - let isAuthorized = authSelectors.isAuthorized(security) - - if(isAuthorized === null) { - return null - } + let { isAuthorized } = this.props return (