Some checks failed
Node.js CI / build (push) Failing after 2s
Node.js CI / e2e-tests (+(a11y|security|bugs)/**/*cy.js) (push) Failing after 2s
Node.js CI / e2e-tests (features/**/!(o|d|m)*.cy.js) (push) Failing after 2s
Node.js CI / e2e-tests (features/**/+(o|d)*.cy.js) (push) Failing after 2s
Node.js CI / e2e-tests (features/**/m*.cy.js) (push) Failing after 2s
CodeQL / Analyze (javascript) (push) Failing after 1m15s
Security scan for docker image / build (push) Failing after 59s
32 lines
1000 B
JavaScript
Executable File
32 lines
1000 B
JavaScript
Executable File
import React from "react"
|
|
import PropTypes from "prop-types"
|
|
|
|
export default class AuthorizeBtnContainer extends React.Component {
|
|
|
|
static propTypes = {
|
|
specActions: PropTypes.object.isRequired,
|
|
specSelectors: PropTypes.object.isRequired,
|
|
authActions: PropTypes.object.isRequired,
|
|
authSelectors: PropTypes.object.isRequired,
|
|
getComponent: PropTypes.func.isRequired
|
|
}
|
|
|
|
render () {
|
|
const { authActions, authSelectors, specSelectors, getComponent} = this.props
|
|
|
|
const securityDefinitions = specSelectors.securityDefinitions()
|
|
const authorizableDefinitions = authSelectors.definitionsToAuthorize()
|
|
|
|
const AuthorizeBtn = getComponent("authorizeBtn")
|
|
|
|
return securityDefinitions ? (
|
|
<AuthorizeBtn
|
|
onClick={() => authActions.showDefinitions(authorizableDefinitions)}
|
|
isAuthorized={!!authSelectors.authorized().size}
|
|
showPopup={!!authSelectors.shownDefinitions()}
|
|
getComponent={getComponent}
|
|
/>
|
|
) : null
|
|
}
|
|
}
|