Commit graph

1218 commits

Author SHA1 Message Date
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
dependabot[bot]
7324e647a4 build(deps-dev): bump sass from 1.64.2 to 1.66.1
Bumps [sass](https://github.com/sass/dart-sass) from 1.64.2 to 1.66.1.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.64.2...1.66.1)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-23 13:01:18 +02:00
Ondrej Ezr
1cd3f397e6 Remove the Preview banner 2023-08-23 09:39:18 +02:00
Ondrej Ezr
2a8e5a10df Launch button in stable environments
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.
2023-08-23 09:27:25 +02:00
dependabot[bot]
e5575d7a2d build(deps-dev): bump @babel/core from 7.22.9 to 7.22.10
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) 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-core)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-22 09:56:37 +02:00
dependabot[bot]
58d836db77 build(deps-dev): bump eslint-plugin-import from 2.27.5 to 2.28.1
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.27.5 to 2.28.1.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.27.5...v2.28.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-21 10:29:59 +02:00
Sanne Raymaekers
042af03052 CreateImageWizard: don't allow arbitrary mountpoints under /boot 2023-08-21 09:02:14 +02:00
lucasgarfield
29704a0725 eslint/hooks: obey rules of hooks
See https://legacy.reactjs.org/docs/hooks-rules.html.
2023-08-17 17:18:55 +02:00
Thomas Lavocat
8ab31edbe9 eslint/expect: uneffective tests
Correct the tests that were not testing the result. And set the values
to a functioning one.
2023-08-17 17:18:55 +02:00
Thomas Lavocat
3b8afeaf7d eslint/excpect: should not be called conditionally
This commit fixes the error but not really the pattern. We should
consider refactoring the tests following these guidelines:
https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-conditional-expect.md
2023-08-17 17:18:55 +02:00
Thomas Lavocat
a1834ed76e eslint: unused-expression
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.
2023-08-17 17:18:55 +02:00
Thomas Lavocat
89437c5e23 eslint: no conditional use calls
Move the calls of the use function outside conditions so that their
calling is consistent no matter what happens.
2023-08-17 17:18:55 +02:00
Thomas Lavocat
bf7f22413b eslintrc: identation
Correct indentation for the yml content.
2023-08-17 17:18:55 +02:00
Thomas Lavocat
a91ca3f9d0 eslint: configure eslint for react app
Add additional linting information and help on react components and
hooks. See https://www.npmjs.com/package/eslint-config-react-app
https://react.dev/learn/editor-setup#linting

Also, cleans duplicated between eslintrc and eslintrc-typescript.
2023-08-17 17:18:55 +02:00
Thomas Lavocat
178791f2ad router: lazy loading needs a suspense tag
According to the React documentation[0], a suspense tag is needed to
encapsulate a lazy loaded component. Some bad behavior have been fix in
the UI thanks to that tag (i.e notification popup unclosable after
wizard creation).

[0] https://react.dev/reference/react/lazy#suspense-for-code-splitting
2023-08-17 15:37:21 +02:00
Jakub Rusz
d66b013f5b pr_check: update to enable testing with MR image
We can now test using a test container built in a downstream MR.
2023-08-16 14:49:50 +02:00
lucasgarfield
0de68305c1 Wizard: Update registration step activation key link URL
Fixes HMS-2322: On the Register step of the image build wizard, the link
to "Create and manage activation keys here" should point to
https://console.redhat.com/insights/connector/activation-keys.
2023-08-16 14:31:52 +02:00
regexowl
8fbad0d99b test/fixtures: Migrate some fixtures to TypeScript
This migrates following fixtures to TypeScript:
- architectures
- customizations
- sources

Typing and explicit returns were added.

The extensions of `composes` and `packages` fixtures were also updated from .tsx to .ts
2023-08-16 13:39:16 +02:00
Amir Fefer
9fd260cfea feat(HMS-1909): enable a custom host in LOCAL_API env var 2023-08-16 13:27:21 +02:00
aabramov
d8e47de0c5 Add GCP quickstart 2023-08-16 10:07:02 +02:00