This commit converts the Images Table to Typescript and converts all API
calls to image-builder to use RTK Query hooks.
This should increase the performance of the app significantly.
Previously our calls to the image-builder API were made in series. They
are now made in parallel. We may want to investigate the possibility of
hitting rate limiting now that we will be issuing requests in much more
rapid succession.
In the tests, moving to RTK Query hooks has allowed us to remove
virtually all Jest mocking. However, this means that some of our
previous tests which tested against implementation details were broken.
Most notably, we no longer check the Redux store to verify that clones
have been added correctly and we no longer check that compose requests
were issued successfully. Test coverage will be restored in a follow-up
PR where the dev-dependency @msw/data is added. Adding a persistent data
layer to the tests using @msw/data will allow us to verify that our POST
requests (creating composes and cloning them) are working by testing
that the Images Table has been updated.
This updates the Repositories and Review step as per [mocks](https://www.sketch.com/s/d7aa6d29-fca0-4283-a846-09cc5fd10612/a/MyEbDz7).
Repositories with the unavailable or invalid status have a popover that allows for further inspection. The time of the last introspection and the counter of failed attempts was added to the popover, together with the "Go to Repositories" button.
On Recreate the payload repositories are checked against "freshly" fetched list of repositories. In case any of the previously checked repositories is no longer available in content sources an Alert is rendered on both Repositories and Review steps. The unavailable repository is checked, but the checkbox is disabled and the information is dashed out. Since the information about the repository is stored in the Repository type, the only information available to be rendered is the baseurl.
Create image button is also disabled when recreating an image with unavailable repositories.
Fixes HMS-1492
This changes all occurences of "rhc" and "remote host configuration" from capitalized to lowercase.
In cases where the sentence started with "rhc" this was changed to "remote host configuration" to avoid
starting the sentence with "Rhc".
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 moves Beta only features to stable environment:
- Sharing Images through Sources
- Launch button
This tries to avoid any refactoring, just moving components from Beta to stable with minimal changes.
A ternary operator means that something's going to be assigned to
something, and I think the interpretor might or might not have had
executed that ternary operator before this fix 🤷. Anyway,
rewritten as a if, it's the same as before, except that this time we
know it'll be executed.
This removes a warning on a no-op being fired when the wizard changes a
state when the request for creation comes back as a success.
Instead don't update the form state if the wizard is going to be closed
anyway.
Some components were crashing in the test due to a lack of protection
for cases where any data is returned from the API. This solution is
quite temporary and is only ment to allow the unit tests to execute
without throwing errors. A major refactor of the queries is on its way
with RTKQueries and will fix the behavior when data can't be properly
fetched.
Incorrect proptype for `selectedAvailablePackages` was causing following error:
```Warning: Failed prop type: Invalid prop `selectedAvailablePackages` of type `object` supplied to `ExactMatch`, expected an array.```
This fixes the problem.
The conditional in the image details component needed to have a check
added for vsphere-ova type images.
A mock compose and corresponding status for a vsphere-ova type image
have also been added.
Previously the Popover was used within the title of the tab. In addition
to the fact that the Popover had a button to get triggered, it created a
button in a button issue. The web browser was reporting this as abnormal
and the UI behavior was not ideal: while clicking on the interrogation
mark the user was also moved to the corresponding tab.
This commit fixes that issue by using a TabAction to get the Popover
working. Inspired by the patternfly documentation:
- http://v4-archive.patternfly.org/v4/components/tabs#help-action
This disables adding of repositories that do not have 'Valid' status.
Status column was also added to the Repositories table to make the reason why the checkbox is disabled visible.
This commit adds eslint support for .ts and .tsx files.
The recommended Typescript rules are applied only to .ts and .tsx files
and not to existing .js or .jsx files. This is accomplished by creating
a separate .eslintrc-typescript.yml file and pointing to it in the
.eslintrc.yml overrides parameter.
A .eslintignore file was added. This file has syntax similiar to
.gitignore and is used to ignore the programatically generated API
slices so that we do not have to deal with a massive diff whenever we
update one of them.
A useEffect was used without conditions to update the value of a state
variable depending on the form state. That's apparent to a way to
initialize the state. Instead, what can be done, is to immediately
initialize the state at the proper value.
Failed AWS images showed a `Failed to share image to one or more regions.` error even though they weren't shared to other regions.
This was caused by checking for a 'failure' status in an array of `imageStatuses` that included the parent status.