Commit graph

98 commits

Author SHA1 Message Date
regexowl
c0cc236c5a ImagesTable: Update wording and links on empty state
This updates text and links on empty state according to recent mocks.
2023-07-20 13:20:24 +02:00
Sanne Raymaekers
f20686df4d CreateImageWizard: Add support for vsphere-ova imagetype
The OVA type is also the default when checking VMWare now.
2023-07-05 13:02:39 +02:00
regexowl
021f6019ba ImagesTable: Fix the GCP launch link
This fixes the bug when Launch button got replaced with Image command button even in the Preview.
2023-06-29 18:31:27 +02:00
regexowl
57be1e4a9d ImagesTable: Update Image commands popover for GCP images
This adds "Launch an instance" and "Save a copy" commands to the Image commands popover for GCP images.
2023-06-29 11:12:51 +02:00
mgold1234
795aa99fc3 imagesTable: capitalize all release values
This commit change the value of release column to be consistently,
and always show with Capital letter
related to issue - https://github.com/RedHatInsights/image-builder-frontend/issues/946
2023-06-26 13:05:29 +02:00
lucasgarfield
0fd07f1f74 RTKQ: Add typing to RTKQ hooks in apiSlice
This commit adds typing to the RTK Query hooks. The hooks have been
refactored to be simpler and all custom query functions have been
removed.
2023-06-20 16:36:39 +02:00
regexowl
2e6ea2ccaa ImagesTable: Remove Image name Spinner for failed Azure images
This removes Spinner next to the Image name when a build of an Azure image fails.
2023-06-15 14:56:04 +02:00
regexowl
5c8a08f45c ImagesTable: Add image details and update ClonesTable
This adds expandable rows details for each image and updates ClonesTable according to the new mocks.
2023-06-14 16:07:27 +02:00
lucasgarfield
b73b0ecd56 Wizard: Enable Azure and GCP provisioning links in ephemeral
Unleash is being used to determine whether or not to use the Launch
wizard for Azure and GCP images. Unleash is not yet supported in our
ephemeral environments, but we want our ephemeral environments to have
parity with beta. This commit ensures that the Launch wizard opens for
Azure and GCP images in ephemeral.
2023-06-09 15:59:44 +02:00
Klara Simickova
6af015f0e0 Revert "ImagesTable: Update ClonesTable"
This reverts commit 2f55648310.
2023-06-01 18:12:08 +02:00
regexowl
2f55648310 ImagesTable: Update ClonesTable
This updates ClonesTable according to the new mocks.
2023-06-01 16:38:49 +02:00
Amir Fefer
38f0b37a6b feat(HMS-776): Add feature flag for gcp provisioning 2023-05-30 14:08:03 +02:00
lucasgarfield
e8a40e27dc Wizard: Add Azure launch link for images created in preview
If an image does not contain a subscription_id property, the link to
view the image in Azure will be malformed. This happens when a user
creates an Azure image in beta/preview using sources, and then clicks
the 'View uploaded image' link in stable.

Now, if an Azure image was created using sources (as evidenced by presence
of a source_id in request's upload options), the Launch button appears
and its popover has a link to Preview.
2023-05-05 15:22:53 +02:00
regexowl
1fcb1cb4b5 ImagesTable: Fix switch statement in ImageLink
This fixes an erroneous switch statement.
2023-05-05 14:55:17 +02:00
lucasgarfield
56475e9470 Wizard: Fix erroneous switch statement in ImageLink
The switch statement used to determine the image type for the Launch
wizard was written incorrectly, this commit fixes it.
2023-05-05 13:56:41 +02:00
lucasgarfield
fb9b9ca9a6 Wizard: Adjust AWS launch popover for images created in preview
If an image does not contain a share_with_accounts property, launch
links do not appear in the launch popover. This happens when a user
creates an AWS image in beta/preview, and then clicks Launch in stable.

A message is now displayed that explains the image was created using
Preview features, and the link to Preview has been clarified to be more
explicit.
2023-05-05 12:52:27 +02:00
regexowl
d54d347d83 ClonesTable: Remove created_at column from the clones table
This removes the `created_at` column from the clones table as per the latest designs.
2023-05-05 12:26:16 +02:00
regexowl
dde0f195b4 ImagesTable/ShareImageModal: Update sharing options for AWS
This disables sharing to new regions in case of failed build of the parent image.

The regions that always end in failure were also disabled in the `ShareImageModal`.
2023-05-05 12:20:33 +02:00
lucasgarfield
70c232471a ImagesTable: Change 'beta' to 'preview' in Launch popover 2023-05-05 11:46:11 +02:00
lucasgarfield
675a676709 ClonesTable: Remove Instance column
The instance column is no longer in the clones table per the latest
designs.
2023-05-05 10:38:20 +02:00
lucasgarfield
b2e6e3cf04 Wizard: Use useChrome hook to set beta feature flag
The use of chrome.isBeta is deprecated, the useChrome hook should be
used instead to obtain an isBeta() function. Using the deprecrated
chrome.isBeta pollutes the browser console with warning messages.

This commit replaces the isBeta() helper function with a new custom
hook, useGetEnvironment().

We still sometimes need to know which environment is running outside of
React components, where we cannot call the useChrome() or
useGetEnvironment() hooks. For instance, in the json used to define a
wizard step. Therefore a new isBeta variable has been added to the
form's initialState for use in these cases.
2023-04-28 17:07:31 +02:00
regexowl
031fd08b91 ImagesTable: Add popovers with error details for failed builds
This removes error details from the image detail and moves them to popovers activated by clicking on "Image build failed" status.

Popovers were also added for clones which didn't include any error details previously.
2023-04-25 11:20:34 +02:00
lucasgarfield
d06f929227 LaunchWizard: Add large variant prop to set width of wizard correctly
Without this prop, the wizard's width expands to fill the entire window.
2023-04-21 12:22:30 +02:00
Pavel Odvody
2f13390eee Add MODAL_ANCHOR and anchor ShareImageModal
This patch adds a constant `MODAL_ANCHOR` so that the value
can be used in multiple modals that require it. Also the
ShareImageModal is now properly anchored to it.

Signed-off-by: Pavel Odvody <pavel@redhat.com>
2023-04-20 17:02:04 +02:00
Pavel Odvody
b0a7456860 Use custom modal to show the wizard
So that it's anchored to proper element via `appendTo`

Signed-off-by: Pavel Odvody <pavel@redhat.com>
2023-04-20 17:02:04 +02:00
Pavel Odvody
45547c607b Ensure Launch wizard is anchored to proper element
By default modals are anchored to document.body which inteferes
with quickstarts

Signed-off-by: Pavel Odvody <pavel@redhat.com>
2023-04-20 17:02:04 +02:00
lucasgarfield
bc1435994d Router: Modify /share and /imagewizard routing
Insights offers 'quickstarts', which can be used to provide
mini-tutorials in a sidebar.

Unfortunately, these quickstarts change our URL... they add an optional
query parameter related to the quickstart. The process of doing so
destroys our router's `location`, setting it to undefined.

We have been using the location state to store the GUID of the image,
needed when opening the wizard via the `Recreate image` action or when
opening the share modal.

As a workaround, we can simply accept that the quickstarts will change
our URL and destroy our router's location. Instead, we now put the image
id (its UUID) in the route itself. We can access it in the components as
necessary via the useParams hook.
2023-04-20 14:59:12 +02:00
Lucas Garfield
0870ea7d55
ImagesTable: Fix bug where Launch link incorrectly displayed (#1085)
This commit fixes a bug where the Launch link (which opens the
Provisioning wizard) was incorrectly displayed for all image types.

The bug is currently in production beta, so this commit is needed for
the hotfix. Changes made are minimal, only what is necessary to fix the
bug - we still need to discuss the getImageProvider() function (the
original source of the bug) with the Provisioning team.
2023-04-19 10:53:26 +02:00
Sanne Raymaekers
341b37a567 ImagesTable/RegionsPopover: add "go to beta" under launch 2023-04-14 17:36:31 +02:00
Ondrej Ezr
dcb1e23298 Always enable launch for AWS 2023-04-14 11:59:18 +02:00
Ondrej Ezr
451b5784d5 Send upload info to ProvisioningWizard 2023-04-07 10:48:06 +02:00
Ondrej Ezr
78bc71fe6a Allow launch wizard for Azure images 2023-03-29 12:11:14 +02:00
lucasgarfield
f0ae99b31e ClonesTable: Ensure source exists before reading its account_id property
If a clone is created using a source, and the source is then deleted,
the source will be undefined. Attempting to read the account_id from
undefined causes the app to crash. Optional chaining fixes this.
2023-03-08 10:53:39 +01:00
lucasgarfield
39af9bddeb ImagesTable: Only show Launch link for images using sources
The Launch service wizard should only be used to launch AWS images that
were created using share_with_sources (and not share_with_accounts) in
their request.

The Launch service only supports a single source at the moment, as does
the Image Builder Frontend. Therefore, we do not pass the entire
share_with_sources array - only the 0th element, which should be the
`only` source for images created using the front-end. We do not expect
full compatibility between images created using the API (which could
theoretically have multiple sources in share_with_sources) and Image
Builder Frontend.
2023-03-07 16:28:38 +01:00
lucasgarfield
5d4e365ef8 ImagesTable: Display AWS account number when image uses sources
This commit displays the AWS account number in the `Account` column in
the AWS clones table.
2023-03-07 15:07:25 +01:00
Jacob Kozol
d05e9da3d7 ImagesTable: support additional image type labels
If image types are created that do not have a descriptive label then
default to using the image type.
2023-02-17 09:48:49 +01:00
Amir Fefer
acb0991ed4 feat(HMS-776): Add provider to provisioning wizard 2023-02-16 17:33:14 +01:00
lucasgarfield
4000b8d5e5 ESLint: Add prefer-const rule
Require const declarations for variables that are never reassigned after
being declared. If a variable is never reassigned, using the const
declaration is better. const declaration tells readers, “this variable
is never reassigned,” reducing cognitive load and improving
maintainability.
2023-02-10 11:37:06 +01:00
Ondrej Ezr
ceec580981 Hide Launch button until image is built
Refs HMSPROV-377
2023-02-09 09:14:10 +01:00
Ondrej Ezr
7e89e74813 Do not show Launch button on copied images 2023-02-09 09:14:10 +01:00
Ondrej Ezr
224df6de17 Enable provisioning wizard in Ephemeral environment 2023-01-13 09:47:54 +01:00
lucasgarfield
670f1c106f ImagesTable: Fix status bug
Fixes #899. The status of images (parent images and clones) in the
clones table was displayed incorrectly - the 'highest priority'
(e.g. failure > success) was displayed for all images.

This was due to a bug in a conditional in the ImageBuildStatus
component. In the main images table, rows for AWS images should display
the highest priority status of *all* images. A single failed clone
should cause the status of the row in the main images table to be
failure, even if the parent compose status is successful.

This logic was incorrectly being applied to *all* statuses. This commit
fixes this - from now on, this logic is only used for rows in the main
images table.
2023-01-06 14:20:06 +01:00
Sanne Raymaekers
026f2fbad4 ImagesTables: only show provisioning link in beta 2022-12-13 16:30:31 +01:00
Sanne Raymaekers
cb8ab9347e CreateImageWizard: use non-deprecated image type aliases
'ami' was deprecated a while ago, and is kept around as an alias of
'aws'. Same with 'vhd' and 'azure', and 'vhd' and 'gcp'.

This maintains support for the old aliases where necessary.
2022-12-06 15:14:53 +01:00
regexowl
ab1a7f4aab ESLint: Use --fix with updated rules to order imports
This applies the updated sorting rules to the files by running `npm run lint:js:fix`
2022-12-02 16:29:58 +01:00
Ondřej Budai
47d99a3903 ImagesTable: indent the downloaded compose request
Prior to this commit, the downloaded request was just an ugly unformatted
json. Surely, `jq . <request.json` could fix that, but it's much more
convenient if the frontend does it itself.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-11-30 11:43:13 +01:00
Amir Fefer
28de575b94 HMSPROV #355 - add architecture to provisioning wizard 2022-11-18 12:40:56 +01:00
lucasgarfield
a42a6a220f ShareImageModal: Add ShareImageModal to clone (share) AWS composes 2022-11-08 11:29:31 +01:00
lucasgarfield
5c37e3b45b Images Table: Add clones table for AWS composes 2022-11-08 11:29:31 +01:00
regexowl
9c4c24746f ImagesTable: Fix Recreate image button
This removes an extra `/` from the path for the `navigate` function to be able to resolve relative path correctly.
2022-11-07 12:40:12 +01:00