generated from RedHatInsights/frontend-starter-app
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(HMS-2496): add no permission empty state
- Loading branch information
Showing
3 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/Components/ProvisioningWizard/steps/NoPermission/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import { Button, EmptyState, EmptyStateBody, EmptyStateIcon, EmptyStateSecondaryActions, Title } from '@patternfly/react-core'; | ||
import { LockIcon } from '@patternfly/react-icons'; | ||
import DirectProviderLink from '../SourceMissing/DirectProviderLink'; | ||
import { imageProps } from '../../helpers'; | ||
|
||
const missingPermissionTitle = 'Access permissions needed'; | ||
const missingPermissionDescription = ( | ||
<> | ||
<p>To launch this image, contact your org admin to adjust your launch permissions. </p> | ||
<p>Alternatively, launch directly from the cloud provider console.</p> | ||
</> | ||
); | ||
|
||
const PermissionMissing = ({ image, onClose }) => { | ||
return ( | ||
<EmptyState> | ||
<EmptyStateIcon icon={LockIcon} /> | ||
<Title headingLevel="h4" size="lg"> | ||
{missingPermissionTitle} | ||
</Title> | ||
<EmptyStateBody>{missingPermissionDescription}</EmptyStateBody> | ||
<DirectProviderLink image={image} /> | ||
<EmptyStateSecondaryActions> | ||
<Button variant="link" onClick={onClose}> | ||
Close | ||
</Button> | ||
</EmptyStateSecondaryActions> | ||
</EmptyState> | ||
); | ||
}; | ||
|
||
PermissionMissing.propTypes = { | ||
image: imageProps, | ||
onClose: PropTypes.func.isRequired, | ||
}; | ||
|
||
export default PermissionMissing; |