Skip to content

Commit

Permalink
Fixes #37236 - Add primaryButton prop to PermissionDenied component
Browse files Browse the repository at this point in the history
  • Loading branch information
ofedoren committed Mar 8, 2024
1 parent 21389fb commit c2bbfac
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
<span>
{__('You are not authorized to perform this action.')}
Expand Down Expand Up @@ -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

Check failure on line 47 in webpack/assets/javascripts/react_app/components/PermissionDenied/PermissionDenied.js

View workflow job for this annotation

GitHub Actions / test (12, 2.7, 14)

Insert `,`

Check failure on line 47 in webpack/assets/javascripts/react_app/components/PermissionDenied/PermissionDenied.js

View workflow job for this annotation

GitHub Actions / test (12, 2.7, 18)

Insert `,`

Check failure on line 47 in webpack/assets/javascripts/react_app/components/PermissionDenied/PermissionDenied.js

View workflow job for this annotation

GitHub Actions / test (12, 3.0, 14)

Insert `,`

Check failure on line 47 in webpack/assets/javascripts/react_app/components/PermissionDenied/PermissionDenied.js

View workflow job for this annotation

GitHub Actions / test (12, 3.0, 18)

Insert `,`
};

export default PermissionDenied;

0 comments on commit c2bbfac

Please sign in to comment.