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
59 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
40 changes: 40 additions & 0 deletions
40
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,40 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import { Button, EmptyState, EmptyStateBody, EmptyStateIcon, EmptyStateSecondaryActions, Title } from '@patternfly/react-core'; | ||
import { PlusCircleIcon } from '@patternfly/react-icons'; | ||
import DirectProviderLink from '../SourceMissing/DirectProviderLink'; | ||
import { imageProps } from '../../helpers'; | ||
|
||
const missingPermissionTitle = 'No permissions available'; | ||
const missingPermissionDescription = ( | ||
<> | ||
<p>There are no permissions available for launching this image.</p> | ||
<p>Contact your org admin for granting launch permissions.</p> | ||
<p>or launch directly from the cloud provider console.</p> | ||
</> | ||
); | ||
|
||
const PermissionMissing = ({ image, onClose }) => { | ||
return ( | ||
<EmptyState> | ||
<EmptyStateIcon icon={PlusCircleIcon} /> | ||
<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; |