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.
fix(HMS-3203): Add GCP copy image command when missing a source
This adds a clipboard box to make copying (and thus saving) the image easier.
- Loading branch information
1 parent
600221d
commit 4a154a6
Showing
5 changed files
with
56 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
File renamed without changes.
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/SourceMissing/GCPCreateImage.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 { ClipboardCopy, StackItem } from '@patternfly/react-core'; | ||
import { imageProps } from '../../helpers'; | ||
import './GCP.scss'; | ||
|
||
const createImageCommand = (options) => { | ||
return `gcloud compute images create ${options.image_name}-copy --source-image-project ${options.project_id} --source-image ${options.image_name}`; | ||
}; | ||
|
||
const GCPCreateImage = ({ text, image }) => { | ||
return ( | ||
<> | ||
<StackItem> | ||
<strong>{text}</strong> | ||
</StackItem> | ||
<StackItem isFilled> | ||
<ClipboardCopy | ||
className="custom-clipboard-copy" | ||
hoverTip="Copy" | ||
clickTip="Copied" | ||
ouiaId="gcp-copy-image" | ||
data-testid="gcp-copy-image" | ||
variant="expansion" | ||
isReadOnly | ||
> | ||
{createImageCommand(image.uploadStatus.options)} | ||
</ClipboardCopy> | ||
</StackItem> | ||
</> | ||
); | ||
}; | ||
|
||
GCPCreateImage.propTypes = { | ||
image: imageProps, | ||
text: PropTypes.string, | ||
}; | ||
|
||
export default GCPCreateImage; |
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