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>
By default all modals are anchored to document.body
which interferes with Quickstarts by overlaying them.
This patch anchors the modal to the main element outside
of the Quickstart so that both can be visible at the same time.
Signed-off-by: Pavel Odvody <pavel@redhat.com>
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.
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.
When creating a new image and selecting an activation key on the Registration step the warning about unavailable key information is displayed even though the key information is loaded without any problems.
This shows the error on the Registration step only when fetching the activation key information ends in error.
Fixes#913.
This adds status bars to the `DualListSelectorPane` on the Packages step. The status bar indicates how many packages were found and how many of those have been selected.
Warning for too many returned results was also added. When an exact match is found during a search with over 100 results, it is shown together with the warning.
This migrates calls to RHSM endpoints `activation_keys` and `/activation_keys/{name}` to RTK Query.
Tests were also updated to use Mock Service Worker instead of previous Jest mock function.
Fixes#1065.
This sets buttons on the Repositories and Additional custom packages steps to `CustomButtons` to ensure buttons in each of the steps have a unique ID.
This commit fixes a bug in the wizard. The Azure step name was
incorrectly set when using the 'Recreate image' option which caused the
wizard to crash when trying to access the Azure step.
Fixes#910. This disables the remove button and select for the root partition as that one is required to continue with creating an image.
The third point mentioned in the issue is removing mount points that have already been chosen from the dropdown to prevent adding duplicate mountpoints.
This point was not implemented as we need to allow the user to create multiple sub directories under the same mount point if needed.
Fixes#919.
This updates the Review step as per proposed mocks.
The tabs were replaced by expandable sections containing all the information relevant to a specific step.
Fixes#914.
This adds a maximum height limit to the dual list selector on the Packages step.
That way the Wizard doesn't become scrollable when the Packages search returns more results.
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.
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.
The search input on the Packages step is disabled until needed data is fetched. This was causing a problem on the Additional custom packages step which uses the same component.
A check of the current step was added so the search input gets disabled only for the Packages step.
Previously the base repository links for each distribution were read from `repos.js` file. This gets the needed information
from a call to api endpoint `architectures/{distribution}`. The data is fetched via RTK Query and is then filtered by an
architecture. For now the x86_64 architecture is hardcoded, this will change when multiple architectures get available.
This commit updates the link on the registration step so users are
directed to the exact place where they can manage keys.
Because managing keys through the customer portal will soon become
deprecated (keys will be managed through the keys service on insights)
the text was also changed to be more general.
This commit makes the new AWS sources feature only available in beta.
Note that the RTKQ hooks related to AWS sources are called in several
places outside of the AWS Target step (a prefetch on the Image Output
step and useQuery hook on the review step) but have not been hidden
behind beta flags - this should not present any problems and will make
exposing this feature in stable much easier when the time comes.
This commit adds the ability to specify AWS targets using the sources
service on insights.
This is the first commit to the codebase that makes use of the new RTK
Query endpoints, so I will provide a bit of additional context here:
The sources are obtained by calling the `useGetAWSSourcesQuery()` hook.
This hook can be called in any component where information about the
sources is needed.
A few tricks are used to make the user experience as responsive as
possible.
The `prefetch()` hook provided by RTK Query is called when the user
clicks on the AWS button on the image output step. This triggers the
initial request for the sources, which will then (hopefully) be ready by the
time the user clicks to the next step (the AWS target environment step)
where they are needed.
Because we anticipate a common user workflow to involve using the Create
image wizard in one browser tab and the sources service in another tab,
sources are also refetched every time the source dropdown is opened.
This means that if a user adds a source while in the middle of using the
wizard, they will be able to see it in the wizard's sources dropdown
without refreshing their browser.
Finally, because of the `Recreate image` feature, the
`useGetAWSSourcesQuery` hook also needs to be called on the review step.
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.