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.
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.
'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.
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>
By adding custom CSS For the `ib-subdued-link` class the link now looks
like normal text. This approach was chosen as other approaches such as
clicking a non-rendered link cause serious ruckus in the test suite.
This resolves: #805.
This adds indication of expiring presigned urls for aws.s3 targets. Previously the targets remained marked as `Ready` until the builds disappeared after 14 days.
When an image is ready, the countdown in hours is shown in `Status` column. After that the image is marked as `Expired` and the download link changes to `Recreate image`.
The insights platform is moving to react router v6, meaning router
contexts can no longer be nested. As a result all applications will end
up sharing the same `BrowserRouter`.
Switch to using the release (`/` or `/beta/`) as a basename for the
BrowserRouter, and offload the full path (`/insights/$appname`) to the
individual routes. This makes it easier to drop the BrowserRouter in
image builder for the platform one in future.
This commit modernizes the Redux store to bring it in line with the
current recommended best practices/patterns. It is possible because of a
recent previous commit that added Redux Toolkit as a dependency.
For detailed information on what modern Redux entails, see the Redux docs:
https://redux.js.org/introduction/getting-started#learn-modern-redux-livestream
Practically speaking, this means a huge reduction in boilerplate code.
Maintaining and extending the code will be much easier. All Redux logic
is now encapsulated by 'slices'. Reducers are defined in the slices, and
action creators and action types are generated automatically.
Redux Toolkit includes Immer, which greatly simplifies writing reducer logic
much simpler - state updates in Redux must be immutable, but working
with Javascript objects in an immutable fashion is clumsy, requiring
gratuitious use of the spread ... operator. With Immer, the state can be
updated as if mutable updates were allowed. Reducer logic has been
changed to take advantage of this in this commit.
This commit also removes a large amount of unused code. Fingers crossed
that nothing breaks. The tests do pass, afterall...
One other minor change... composesGet was renamed to fetchComposes and
composeGetStatus was renamed to fetchComposeStatus. This is in line with
the Redux documentation examples.
Fixes#797. This increases the size of the margin at the bottom of the table of images. That way the pagination controls are not obscured by the notifications icon.
Previously the polling was started once on mount, but the reference to
the list of composes the polling function had didn't get updated. Reset
the polling on each render, ensuring the polling function has the latest
the list of composes from the store.
Fixes#767
Fixes#594. This adds pagination to the bottom of the images list so the user doesn't have to scroll up to use it.
Tests were also updated to reflect the change.
In order to help people transition from using GUI to use the API directly,
it's helpful to give them an easy way to inspect the whole raw compose
request.
This commit adds a new button next to each compose that simply downloads
the original compose request in a json format. This request can then be
directly piped into the IB API to build a new image.
Original idea by Troy Dawson
Co-authored-by: Lucas Garfield <lucas@redhat.com>
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
Add error information for failed image
builds. The error details are only displayed
for failed builds and the error highest up
the error chain is displayed in the expandable
section of the image.
This commit displays the UUID in an expandable details row. This is
necessary because if an image was named, the UUID was not displayed.
It is important that a user know the UUID for troubleshooting, for
example in the case of requesting help with an image.
To facilitate this, the original Table component was converted to a
TableComposable component. TableComposable is newer and recommended over
the older Table by PatternFly.
When recreating an image navigate to the review step instead of the
initial step. This requires forming the step history to enable a
functional sidebar.
If a user has specified an image name the name will appear. Otherwise
the image's UUID will appear.
The test needed to be modified to search for the compose in the store
with either the image name or the id
The "guest-image", "image-installer", and "vsphere" image types now
display proper labels in the ImagesTable target column. Also, the upload
component is renamed to Target for consistency.
When a gcp image is successfully uploaded the user needs to know the
project id, image name, and account the image is shared with. These are
now displayed in a popover accessible from the status section of the
images table.