Commit graph

1237 commits

Author SHA1 Message Date
Djebran Lezzoum
50b76751e7 edge: Fixes federated edge image details view.
The federated image details been broken by a prior PR.
FIXES: https://issues.redhat.com/browse/HMS-2620
2023-09-22 01:06:06 +02:00
dependabot[bot]
3e84abba3f build(deps-dev): bump @redhat-cloud-services/eslint-config-redhat-cloud-services
Bumps @redhat-cloud-services/eslint-config-redhat-cloud-services from 1.3.0 to 2.0.3.

---
updated-dependencies:
- dependency-name: "@redhat-cloud-services/eslint-config-redhat-cloud-services"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-21 10:53:23 +02:00
mgold1234
1bb7519cc4 api: add new edge endpoints
This commit adds 2 more RTQ Query in preparation of porting edge source code to image-builder-frontend
2023-09-19 10:27:23 +02:00
Justin Sherrill
5d6b6dfbfe Filter content-sources repos by origin and content_type 2023-09-19 09:22:37 +02:00
lucasgarfield
99ae627007 LaunchWizard: Correct architecture prop
The `<LaunchWizard>` architecture prop was specified incorrectly,
which caused the Instance dropdown in the Launch wizard to fail to load
instance types.
2023-09-18 16:08:57 +02:00
lucasgarfield
adaec7e34d LaunchWizard: Restore Launch wizard functionality
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.
2023-09-18 15:38:47 +02:00
Thomas Lavocat
543d4e95d3 edge: setup an unleash toggle for the image table
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.
2023-09-18 13:35:37 +02:00
lucasgarfield
7b9e726151 ImagesTable: Convert ImagesTable to Typescript & RTK Query
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.
2023-09-18 10:35:04 +02:00
lucasgarfield
155a0cf57c deps-dev: bump @types/react and @types/react-dom
This commit bumps @types/react and @types/react-dom. Notably, this
prevents tsserver from issuing an error when React components return
undefined.
2023-09-18 10:35:04 +02:00
Jakub Rusz
4fe1242c49 Adding some ouiaId for File system customization 2023-09-13 15:56:10 +02:00
Ondrej Ezr
1e37a6ece9 Migrate to Provisioning API nested root 2023-09-11 15:19:31 +02:00
Thomas Lavocat
f147d5f4fe api: update from latest imageBuilder@main
Adds the composeId to the CloneResponseItem element.
Updates the mocks accordingly
2023-09-11 13:20:15 +02:00
mgold1234
e998dd802b API: generate more RTK query for edge
This commit adds more RTQ query in preparation of porting edge source code to image-builder-frontend
2023-09-11 11:09:51 +02:00
Thomas Lavocat
9fe77c5e67 readme: add documentation on API and enpoints 2023-09-11 11:01:33 +02:00
Thomas Lavocat
a999083404 ci: checks that the API is not manually changed
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.
2023-09-11 11:01:33 +02:00
Ondrej Ezr
b64f36e68f Extract quickstarts banner into its own component 2023-09-11 10:40:13 +02:00
regexowl
9f5a0af826 Wizard: Update the Repositories step
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.
2023-09-11 10:30:04 +02:00
Amir Fefer
0822a69619 feat(HMS-1454): add RBAC permissions to launch wizard 2023-09-07 14:18:44 +02:00
Tomáš Hozza
226a74ff99 Actions: add workflow for marking and closing stale issues and PRs
Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2023-09-07 12:10:15 +02:00
Thomas Lavocat
01e9a1d152 api: ignore the generated code from eslintignore
Restore the edgeApi.ts file to the programmatically generated values by
rtkq and add the file to the list of ignored files for eslint.
2023-09-06 10:30:11 +02:00
dependabot[bot]
a149304801 build(deps-dev): bump stylelint from 15.10.2 to 15.10.3
Bumps [stylelint](https://github.com/stylelint/stylelint) from 15.10.2 to 15.10.3.
- [Release notes](https://github.com/stylelint/stylelint/releases)
- [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stylelint/stylelint/compare/15.10.2...15.10.3)

---
updated-dependencies:
- dependency-name: stylelint
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-06 08:42:36 +02:00
mgold1234
e266073718 Api: generate RTK Query for Edge
This commit adds the Edge API to RTK Query in preparation of porting edge source code to image-builder-frontend
2023-09-04 15:14:48 +02:00
lucasgarfield
85ab893c2b API: Add mutations for creating composes and clones
This commit adds mutations for the /compose and
/composes/:composeId/clone POST end points to the Image Builder API
slice.
2023-09-04 10:50:00 +02:00
dependabot[bot]
a28a1ab9cc build(deps): bump react-router-dom from 6.14.2 to 6.15.0
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.14.2 to 6.15.0.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.15.0/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 09:41:57 +02:00
dependabot[bot]
c84b493eba build(deps-dev): bump eslint-plugin-jest-dom from 5.0.1 to 5.1.0
Bumps [eslint-plugin-jest-dom](https://github.com/testing-library/eslint-plugin-jest-dom) from 5.0.1 to 5.1.0.
- [Release notes](https://github.com/testing-library/eslint-plugin-jest-dom/releases)
- [Commits](https://github.com/testing-library/eslint-plugin-jest-dom/compare/v5.0.1...v5.1.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-jest-dom
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-01 08:19:47 +02:00
dependabot[bot]
ac8c9ac3c3 build(deps-dev): bump @babel/plugin-transform-runtime
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.22.9 to 7.22.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.22.10/packages/babel-plugin-transform-runtime)

---
updated-dependencies:
- dependency-name: "@babel/plugin-transform-runtime"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-31 12:35:38 +02:00
regexowl
ff0eb304bf test: Safeguard first setUp() in .test and .azure against early exit
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`.
2023-08-30 16:01:02 +02:00
regexowl
8a31592ef8 bootstrap: Fix "ReactDOM.render is deprecated since React 18.0.0" lint error
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.
2023-08-30 16:01:02 +02:00
regexowl
38e2852734 test: Fix problem with mocked server.use calls
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`
2023-08-30 16:01:02 +02:00
regexowl
e71d98da08 test: Update CreateImageWizard tests
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
2023-08-30 16:01:02 +02:00
regexowl
9f3ed3d0ec test: Update testUtils
This updates `clickBack`, `clickCancel` and `clickNext` functions in testUtils.js
2023-08-30 16:01:02 +02:00
regexowl
31859822e9 test: Update ImagesTable tests
This updates ImagesTable.test.js after bumping react and testing-library.
2023-08-30 16:01:02 +02:00
regexowl
ecb33431c4 test: Update ShareImageModal tests
This updates ShareImageModal.test.js after bumping react and testing-library.
2023-08-30 16:01:02 +02:00
regexowl
07a8054744 deps: Bump to react 18.2.0 and testing-library 14.0.0
This bumps react and react-dom from 17.0.2 to 18.2.0 and testing-library from 12.1.5 to 14.0.0
2023-08-30 16:01:02 +02:00
Thomas Lavocat
108f0bc017 openapi: update image builder yaml to latest@main
Update the yaml openapi representation from the latest version on image
builder's repo commit 0ebf2401589b8f8d88d37aebbef17c009160bc7f
2023-08-30 15:14:19 +02:00
Thomas Lavocat
45b717bc27 openapi: import from yaml instead of JSON
Use the yaml representation of the openapi used in Image Builder to load
generate the RTKQ code.
2023-08-30 15:14:19 +02:00
dependabot[bot]
d85b02daa8 build(deps-dev): bump postcss-scss from 4.0.6 to 4.0.7
Bumps [postcss-scss](https://github.com/postcss/postcss-scss) from 4.0.6 to 4.0.7.
- [Changelog](https://github.com/postcss/postcss-scss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss-scss/compare/4.0.6...4.0.7)

---
updated-dependencies:
- dependency-name: postcss-scss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-30 09:12:38 +02:00
Sanne Raymaekers
93c1f43544 CreateImageWizard: add WSL image type in preview 2023-08-29 13:37:56 +02:00
regexowl
ab1b60ee99 feat(HMS-1491): Fix capitalization on the Register step
This fixes the capitalization on the Review step from "Automatically Register your systems" to "Automatically register your systems".
2023-08-29 12:55:49 +02:00
regexowl
90a012d49b HMS-1492: Change rhc to non-capitalized
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".
2023-08-29 12:36:38 +02:00
dependabot[bot]
d67aed929c build(deps-dev): bump @typescript-eslint/eslint-plugin
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.2.1 to 6.4.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.4.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-25 08:21:11 +02:00
Ondrej Ezr
8b796ef431 Switch to Content Sources search
Enable searching for RH packages through Content Sources service.
Gates the search by Content Sources feature flag, to keep the easy kill switch.
2023-08-24 14:41:16 +02:00
dependabot[bot]
b7d2a1522f build(deps-dev): bump jest-environment-jsdom from 29.6.2 to 29.6.3
Bumps [jest-environment-jsdom](https://github.com/jestjs/jest/tree/HEAD/packages/jest-environment-jsdom) from 29.6.2 to 29.6.3.
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v29.6.3/packages/jest-environment-jsdom)

---
updated-dependencies:
- dependency-name: jest-environment-jsdom
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-24 08:59:55 +02:00
regexowl
8cb2fc1936 LandingPage: Update Quickstarts expandable
This removes the second line of text in the Quickstarts expandable and changes heading of the expandable section based on the environment.
2023-08-23 17:46:29 +02:00
mgold1234
52966fc729 Wizard: update popup with repositories name on Review step
fixes https://github.com/RedHatInsights/image-builder-frontend/issues/1305
This commit update popup of custom repositories with name of repository instead
of url of repository
2023-08-23 16:13:01 +02:00
lucasgarfield
a5aad6935f ImagesTable: Update RegionsPopover to prepare for Launch/Provisioning GA
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.
2023-08-23 15:59:32 +02:00
Ondrej Ezr
b486f44dcb Custom Repositories gate by Feature flag 2023-08-23 15:38:25 +02:00
regexowl
77ff00d107 lint: Fix the "Expected a default case" warning
This fixes the "Expected a default case" warning
2023-08-23 14:54:23 +02:00
regexowl
b3767e0503 lint: Fix "missing alt for images" warning
This fixes the "img elements must have an alt prop, either with meaningful text, or an empty string for decorative images" warning.
2023-08-23 14:54:23 +02:00
regexowl
a9dc4f4a14 lint: Fix "assign before exporting" warnings
This fixes all instances which caused the following lint warning: "Assign object/arrow function to a variable before exporting as module default"
2023-08-23 14:54:23 +02:00