From 1285429715357d8d445fd7fe2b789cfcd67c7da5 Mon Sep 17 00:00:00 2001 From: Oleh Fedorenko Date: Fri, 8 Mar 2024 15:36:04 +0000 Subject: [PATCH] Fixes #37236 - Add primaryButton prop to PermissionDenied component --- .../components/PermissionDenied/PermissionDenied.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webpack/assets/javascripts/react_app/components/PermissionDenied/PermissionDenied.js b/webpack/assets/javascripts/react_app/components/PermissionDenied/PermissionDenied.js index 02275d51a82..50d4d7f133d 100644 --- a/webpack/assets/javascripts/react_app/components/PermissionDenied/PermissionDenied.js +++ b/webpack/assets/javascripts/react_app/components/PermissionDenied/PermissionDenied.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import { translate as __ } from '../../common/I18n'; import { EmptyStatePattern as EmptyState } from '../common/EmptyState'; -const PermissionDenied = ({ missingPermissions }) => { +const PermissionDenied = ({ missingPermissions, primaryButton }) => { const description = ( {__('You are not authorized to perform this action.')} @@ -32,16 +32,19 @@ const PermissionDenied = ({ missingPermissions }) => { header={__('Permission Denied')} description={description} documentation={doc} + action={primaryButton} /> ); }; PermissionDenied.propTypes = { missingPermissions: PropTypes.array, + primaryButton: PropTypes.node, }; PermissionDenied.defaultProps = { missingPermissions: ['unknown'], + primaryButton: null, }; export default PermissionDenied;