ImagesTable: Update RegionsPopover to prepare for Launch/Provisioning GA
Previously, the Launch/Provisioning wizard was only available in preview. If an AWS or Azure image was created in preview and shared with a source, and then viewed in the images table in stable, a popover over the stable launch link would inform the user that the image had been created in preview and provide a link to go to preview. Now that launch/provisioning is going GA and the launch wizard is available in stable, this feature is no longer necessary.
This commit is contained in:
parent
b486f44dcb
commit
a5aad6935f
2 changed files with 2 additions and 62 deletions
|
|
@ -4,7 +4,6 @@ import {
|
|||
Button,
|
||||
ClipboardCopy,
|
||||
ClipboardCopyVariant,
|
||||
Divider,
|
||||
Popover,
|
||||
Text,
|
||||
TextContent,
|
||||
|
|
@ -18,7 +17,6 @@ import { RegionsPopover } from './RegionsPopover';
|
|||
|
||||
import { selectImageById } from '../../store/composesSlice';
|
||||
import { resolveRelPath } from '../../Utilities/path';
|
||||
import BetaLabel from '../sharedComponents/BetaLabel';
|
||||
|
||||
const launchInstanceCommand = (uploadStatus) => {
|
||||
return `gcloud compute instances create ${uploadStatus.options.image_name}-instance --image-project ${uploadStatus.options.project_id} --image ${uploadStatus.options.image_name}`;
|
||||
|
|
@ -66,7 +64,6 @@ const ImageLinkDirect = ({ imageId, isExpired, isInClonesTable }) => {
|
|||
return <RegionsPopover composeId={image.id} />;
|
||||
}
|
||||
} else if (uploadStatus.type === 'azure') {
|
||||
const createdInPreview = image?.uploadOptions?.source_id;
|
||||
const url =
|
||||
'https://portal.azure.com/#@' +
|
||||
image.uploadOptions.tenant_id +
|
||||
|
|
@ -76,38 +73,7 @@ const ImageLinkDirect = ({ imageId, isExpired, isInClonesTable }) => {
|
|||
image.uploadOptions.resource_group +
|
||||
'/providers/Microsoft.Compute/images/' +
|
||||
uploadStatus.options.image_name;
|
||||
return createdInPreview ? (
|
||||
<Popover
|
||||
/* popovers aren't rendered inside of the main page section, make sure our prefixed css still
|
||||
* applies */
|
||||
className="imageBuilder"
|
||||
aria-label="Launch instance"
|
||||
headerContent={<div>Launch instance</div>}
|
||||
bodyContent={
|
||||
<>
|
||||
<>
|
||||
<p>
|
||||
This image was created using features only available in Preview.
|
||||
</p>
|
||||
<Divider className="pf-u-mt-sm pf-u-mb-sm" />
|
||||
<Button
|
||||
isInline
|
||||
component="a"
|
||||
variant="link"
|
||||
href="/preview/insights/image-builder/landing"
|
||||
>
|
||||
<BetaLabel />
|
||||
Launch from Preview
|
||||
</Button>
|
||||
</>
|
||||
</>
|
||||
}
|
||||
>
|
||||
<Button variant="link" isInline>
|
||||
Launch
|
||||
</Button>
|
||||
</Popover>
|
||||
) : (
|
||||
return (
|
||||
<Button
|
||||
component="a"
|
||||
target="_blank"
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
import React, { useMemo } from 'react';
|
||||
|
||||
import { Button, Divider, Popover } from '@patternfly/react-core';
|
||||
import { Button, Popover } from '@patternfly/react-core';
|
||||
import { createSelector } from '@reduxjs/toolkit';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useSelector } from 'react-redux';
|
||||
|
||||
import { selectComposeById, selectImagesById } from '../../store/composesSlice';
|
||||
import { useGetEnvironment } from '../../Utilities/useGetEnvironment';
|
||||
import BetaLabel from '../sharedComponents/BetaLabel';
|
||||
|
||||
export const selectRegions = createSelector(
|
||||
[selectComposeById, selectImagesById],
|
||||
|
|
@ -59,7 +57,6 @@ const ImageLinkRegion = ({ region, ami }) => {
|
|||
};
|
||||
|
||||
export const RegionsPopover = ({ composeId }) => {
|
||||
const { isBeta } = useGetEnvironment();
|
||||
const regions = useSelector((state) => selectRegions(state, composeId));
|
||||
|
||||
const listItems = useMemo(() => {
|
||||
|
|
@ -74,9 +71,6 @@ export const RegionsPopover = ({ composeId }) => {
|
|||
return listItems;
|
||||
}, [regions]);
|
||||
|
||||
const compose = useSelector((state) => selectComposeById(state, composeId));
|
||||
const createdInPreview = compose?.share_with_sources?.[0] ? true : false;
|
||||
|
||||
return (
|
||||
<Popover
|
||||
/* popovers aren't rendered inside of the main page section, make sure our prefixed css still
|
||||
|
|
@ -87,26 +81,6 @@ export const RegionsPopover = ({ composeId }) => {
|
|||
bodyContent={
|
||||
<>
|
||||
<ul>{listItems}</ul>
|
||||
{!isBeta() && (
|
||||
<>
|
||||
{createdInPreview && (
|
||||
<p>
|
||||
This image was created using features only available in
|
||||
Preview.
|
||||
</p>
|
||||
)}
|
||||
<Divider className="pf-u-mt-sm pf-u-mb-sm" />
|
||||
<Button
|
||||
isInline
|
||||
component="a"
|
||||
variant="link"
|
||||
href="/preview/insights/image-builder/landing"
|
||||
>
|
||||
<BetaLabel />
|
||||
Launch from Preview
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
}
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue