The `<LaunchWizard>` architecture prop was specified incorrectly,
which caused the Instance dropdown in the Launch wizard to fail to load
instance types.
This commit is a hotfix that restores functionality to the Launch
wizard.
The `appendTo` variable can't be recomputed on every render. Wrap it in
a useState() hook to work properly.
Additionally, the `hasAccess` property was missing from the
<ProvisioningWizard> component.
To ensure full backwards compatibility, the component has also been
wrapped in a <Suspense> as it was previously.
The edge images table is going to be integrated in the frontend code
base in the coming weeks. To help smooth that development process there
is need for a feature flag that would keep the current behavior running
on stage and prod while the new image table is being developed.
For now dummy code is returned for when the flag is on, and legacy
behavior keeps on going when the flag is off.
The stage flag can be seen there:
- https://insights-stage.unleash.devshift.net/projects/default/features/image-builder.edge.local-image-table
The prod flag can be seen there:
- https://insights.unleash.devshift.net/projects/default/features/image-builder.edge.local-image-table
The commit brings in some documentation in the Readme. Any member of
the team should be able to follow these steps to add in new feature
flags and use them in the code base.
The commit also brings in two new testing files for the future
components to come. For now these tests only check that the mocking
value for the unleash flag is properly set.
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.
Travis will check that the API suffers from no changes while running
`npm run api` on the PR. If there are changes, an error message will
send the contributor to check the README page about open api generated
code.
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.
The "Step Image output - clicking Next loads Upload to AWS" and "Step Upload to Azure - clicking Next loads Registration" were sometimes returning the "Warning: An update to <element> inside a test was not wrapped in act(...)" error.
This seems to have been caused by an early exit in the `setUp()` function in the first `describe` block.
Safeguards were put in place to fix this behaviour.
As this error didn't occur every time, testing the updates was not easy. This current fix passed the threshold of ten successful runs of `npm run test`.
After bumping to React 18 linter was outputting following error: "ReactDOM.render is deprecated since React 18.0.0, use createRoot instead, see https://reactjs.org/link/switch-to-createroot"
This fixes the problem.
Test `component renders error state correctly` was outputting errors for both AWS and Azure tests.
This was caused by calling `server.use()` after the wizard was already rendered.
Fixed by moving the one time server mock response to the very beginning of the unit test. Also added `server.resetHandlers()` to be run after each of the unit tests.
Thanks to this fix, azure tests could be merged again. Which means no more splitting into `CreateImageWizard.azure.test.js` and `CreateImageWizard.azure.2.test.js`
This updates following test suites after bumping react and testing-library:
- CreateImageWizard.azure.test.js
- CreateImageWizard.azure.2.test.js
- CreateImageWizard.content.test.js
- CreateImageWizard.test.js
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.