Commit graph

851 commits

Author SHA1 Message Date
Simon Steinbeiss
d66c141e8d Remove unused variable 2023-02-27 16:54:29 +01:00
Simon Steinbeiss
35c7d6ff29 LandingPage: Show 'Open Service' badge and popover
This commit moves the reference to our source code out of the help
popover to its own.
COMPOSER-1899
2023-02-27 16:54:29 +01:00
dependabot[bot]
6b95f03b3d build(deps): bump react-router-dom from 6.6.2 to 6.8.1
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.6.2 to 6.8.1.
- [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.8.1/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-02-27 16:29:13 +01:00
lucasgarfield
8adfd793d6 Jest: Add mock service worker server commands to jest.setup.js
This commit makes the `msw` server globally available to all test files.
Given that the majority of our test files will ultimately make calls to
APIs using RTK Query (calls are made in both the table and the wizard),
making these globally available in jest.setup.js is reasonable.
2023-02-22 16:26:15 +01:00
regexowl
a0ed7cd37e App: Disable the global filter
This disables the global filter on the top of the page. So later when an option to filter images by name is added,
there won't be multiple filters which could lead to confusion.
2023-02-22 12:45:04 +01:00
dependabot[bot]
65de66f66d build(deps): bump @reduxjs/toolkit from 1.9.1 to 1.9.3
Bumps [@reduxjs/toolkit](https://github.com/reduxjs/redux-toolkit) from 1.9.1 to 1.9.3.
- [Release notes](https://github.com/reduxjs/redux-toolkit/releases)
- [Commits](https://github.com/reduxjs/redux-toolkit/compare/v1.9.1...v1.9.3)

---
updated-dependencies:
- dependency-name: "@reduxjs/toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-22 09:49:31 +01:00
Jacob Kozol
d05e9da3d7 ImagesTable: support additional image type labels
If image types are created that do not have a descriptive label then
default to using the image type.
2023-02-17 09:48:49 +01:00
Amir Fefer
acb0991ed4 feat(HMS-776): Add provider to provisioning wizard 2023-02-16 17:33:14 +01:00
Sanne Raymaekers
b5833ca976 src/repos: Fix urls
These URLs are used for package searching with the content-service.

- Remove the google cloud repos, these are added only for gcp
- Fix centos 9 URLs
2023-02-16 14:10:32 +01:00
lucasgarfield
6fd2a04292 Jest: Polyfill fetch and Request
We are migrating towards using RTK Query for API calls, and using `msw`
to mock APIs in our tests.

RTK Query's `fetchBaseQuery` requires the use of `fetch` and `Request`.

`fetch()` was added to Node in v18, and the ability to use it in
Jest tests was added to Jest in v28. However, it still cannot be used
with a `jsdom` test environment.

Therefore, it is necessary to add a polyfill. There are several
libraries available for this but many others in this situation have had
success using `whatwg-fetch` and so it was selected somewhat
arbitrarily.

It is also important that `whatwg-fetch` is imported before
`fetchBaseQuery` (otherwise, a nuisance console warning will be issued).
To ensure this happens, it is imported in a Jest setup file.
2023-02-15 09:23:24 +01:00
lucasgarfield
131559b351 MSW: Add mock definition for /provisioning/v1/sources end point
This commit adds the necessarily handler, resolver, and server to use
MSW for mocking the /provisioning/v1/sources endpoint.

The server can be used in tests like so:
```javascript
// src/setupTests.js
import { server } from './mocks/server.js'
// Establish API mocking before all tests.
beforeAll(() => server.listen())

// Reset any request handlers that we may add during the tests,
// so they don't affect other tests.
afterEach(() => server.resetHandlers())

// Clean up after the tests are finished.
afterAll(() => server.close())
```
2023-02-15 09:23:24 +01:00
lucasgarfield
9d8236ad76 Dev Dependencies: Add Mock Service Worker
As we begin migrating to RTK Query for API calls, we will need a means
of mocking API endpoints for testing that works well with RTKQ. Mock
Service Worker is an API mocking library that uses the Service Worker
API to intercept actual requests and is recommended for use with RTKQ.

https://mswjs.io/docs/

Some additional justification from the creator of RKT Query that
explains why we would not want to simply continue mocking our API
endpoints using Jest:
```
I wouldn't use jest mocking. I would mock the API.

The reason for this being is that your mocks will assume certain return
values from the RTKQ hook - and if your assumptions are wrong, you might
have a nice green running test, but in reality your app will still fail.

An example of this would be using skip and not checking for
isUninitialized - since that case will not come up if you are not using
skip and you might just assume that you will only ever see isLoading,
isSuccess and isError cases in your component. It's a perfectly valid
assumption in many cases, but not always true. Mocking RTKQ would hide
the resulting bug behind green tests.

Instead, I would recommend using something like mock service worker to
just mock your api endpoints and let RTKQ do it's work. That is how we
are testing RTKQ ourselved in our own tests - you are welcome to take a
ook there: RTKQ tests.
```
https://stackoverflow.com/a/70313785
2023-02-15 09:23:24 +01:00
dependabot[bot]
7ff62220d7 build(deps-dev): bump eslint-plugin-testing-library from 5.9.1 to 5.10.1
Bumps [eslint-plugin-testing-library](https://github.com/testing-library/eslint-plugin-testing-library) from 5.9.1 to 5.10.1.
- [Release notes](https://github.com/testing-library/eslint-plugin-testing-library/releases)
- [Changelog](https://github.com/testing-library/eslint-plugin-testing-library/blob/main/.releaserc.json)
- [Commits](https://github.com/testing-library/eslint-plugin-testing-library/compare/v5.9.1...v5.10.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-10 11:59:00 +01:00
lucasgarfield
4000b8d5e5 ESLint: Add prefer-const rule
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.
2023-02-10 11:37:06 +01:00
Sanne Raymaekers
3207afce90
config: remove module name in webpack config (#959)
Due to merging the openshift and chrome plugin systems there's
additional requirements on the format of the module name.

Camelcase is the default, so the values can just be removed from the
config.
2023-02-09 12:17:27 +01:00
dependabot[bot]
fdfea790a2 build(deps): bump @data-driven-forms/react-form-renderer
Bumps [@data-driven-forms/react-form-renderer](https://github.com/data-driven-forms/react-forms/tree/HEAD/packages/react-form-renderer) from 3.19.1 to 3.20.0.
- [Release notes](https://github.com/data-driven-forms/react-forms/releases)
- [Commits](https://github.com/data-driven-forms/react-forms/commits/v3.20.0/packages/react-form-renderer)

---
updated-dependencies:
- dependency-name: "@data-driven-forms/react-form-renderer"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-09 09:36:22 +01:00
Ondrej Ezr
ceec580981 Hide Launch button until image is built
Refs HMSPROV-377
2023-02-09 09:14:10 +01:00
Ondrej Ezr
7e89e74813 Do not show Launch button on copied images 2023-02-09 09:14:10 +01:00
dependabot[bot]
4c33f34970 build(deps-dev): bump css-loader from 6.7.1 to 6.7.3
Bumps [css-loader](https://github.com/webpack-contrib/css-loader) from 6.7.1 to 6.7.3.
- [Release notes](https://github.com/webpack-contrib/css-loader/releases)
- [Changelog](https://github.com/webpack-contrib/css-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/css-loader/compare/v6.7.1...v6.7.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-07 17:05:16 +01:00
lucasgarfield
0e4d12bae0 Dev Deps: Bump Jest to 29.4.1
This commit bumps Jest to 29.4.1. This requires adding two additional
development dependencies.

As of Jest 28 `jest-environment-jsdom` is no longer shipped with Jest by
default, and has therefore been added as a dependency.

`uuid` was also added as a dev dependency. Jest 29 introduced some
compatibility issues with `uuid` that were fixed in `uuid@9`:
https://github.com/uuidjs/uuid/issues/451#issuecomment-1206284480

We import and use `uuid` in our tests, but as it was a dependencies
dependency we did not control which version was installed. Version 8
(what was installed) causes Jest tests to fail like so:
```
    SyntaxError: Unexpected token 'export'

    > 29 | import { v4 as uuidv4 } from 'uuid';
```
2023-02-07 11:06:59 +01:00
lucasgarfield
d4eb5f78f0 Redux: Add RTK Query + /provisioning/v1/sources endpoint
This commit adds the /provisioning/v1/sources endpoint via a new
apiSlice.js which uses RTK Query's createApi method.

RTK Query allows us to query the /provisioning/v1/sources endpoint using an
automatically generated React hook, `useGetSourcesQuery`. The usage is
something like this (from within a React component):
`const { data: sources, isLoading, isSuccess, isError, error } =
useGetSourcesQuery()`.

This will make it much easier for us to manage data caching and just as
importantly manage loading and error states properly.

Future PRs will migrate data fetching in the other slices (clones, composes,
repositories) to the apiSlice.

For more info on RTK Query, see:
https://redux.js.org/tutorials/essentials/part-7-rtk-query-basics
2023-01-26 11:00:58 +01:00
Sanne Raymaekers
1fa0466676 src/test: use stage tests for prod-beta tests
Content sources is now available in prod-beta, so let's test simulating
the production env, but split on beta/non-beta.
2023-01-25 16:15:51 +01:00
Sanne Raymaekers
a25ec459d8 CreateImageWizard: use content sources in production beta
Enables package searching and custom repositories.
2023-01-25 16:15:51 +01:00
regexowl
6131dafe48 Wizard: Update order of releases on the Image output step
Fixes #909. Fixes #918.

This updates the order of the releases on the Image output step to sort from newest to oldest. The RELEASES Object was converted to Map which remembers insertion order.

The color of the `Show options for further development of RHEL` option in the Release dropdown select was also changed to blue.
2023-01-25 14:21:18 +01:00
dependabot[bot]
6ffa9063e0 build(deps): bump @reduxjs/toolkit from 1.8.5 to 1.9.1
Bumps [@reduxjs/toolkit](https://github.com/reduxjs/redux-toolkit) from 1.8.5 to 1.9.1.
- [Release notes](https://github.com/reduxjs/redux-toolkit/releases)
- [Commits](https://github.com/reduxjs/redux-toolkit/compare/v1.8.5...v1.9.1)

---
updated-dependencies:
- dependency-name: "@reduxjs/toolkit"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-23 13:21:13 +01:00
dependabot[bot]
d219a81c2d build(deps-dev): bump eslint-plugin-jest-dom from 4.0.1 to 4.0.3
Bumps [eslint-plugin-jest-dom](https://github.com/testing-library/eslint-plugin-jest-dom) from 4.0.1 to 4.0.3.
- [Release notes](https://github.com/testing-library/eslint-plugin-jest-dom/releases)
- [Commits](https://github.com/testing-library/eslint-plugin-jest-dom/compare/v4.0.1...v4.0.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-20 15:00:33 +01:00
dependabot[bot]
4a1a215da7 build(deps-dev): bump eslint-plugin-import from 2.26.0 to 2.27.5
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.26.0 to 2.27.5.
- [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.26.0...v2.27.5)

---
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-01-20 12:15:10 +01:00
dependabot[bot]
62405d7683 build(deps-dev): bump eslint-plugin-react from 7.31.11 to 7.32.1
Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.31.11 to 7.32.1.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.31.11...v7.32.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-20 11:24:24 +01:00
regexowl
cbd6b1e4cb Wizard: Update the File system step
Fixes #911. Fixes #912.

This updates the File system step. The changes are:
- changed the toggle group for selecting the mode of partitioning to radio select and updated information for each radio button as mentioned in #911
- added information to the "automatic" option of the file system configuration as mentioned in #912
- updated information for the "manual" option of the configuration as mentioned in mocks
2023-01-19 16:07:58 +01:00
dependabot[bot]
a3a7d9a441 build(deps): bump @data-driven-forms/react-form-renderer
Bumps [@data-driven-forms/react-form-renderer](https://github.com/data-driven-forms/react-forms/tree/HEAD/packages/react-form-renderer) from 3.16.10 to 3.19.1.
- [Release notes](https://github.com/data-driven-forms/react-forms/releases)
- [Commits](https://github.com/data-driven-forms/react-forms/commits/v3.19.1/packages/react-form-renderer)

---
updated-dependencies:
- dependency-name: "@data-driven-forms/react-form-renderer"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-18 09:33:34 +01:00
dependabot[bot]
6b35b9c0c5 build(deps-dev): bump eslint from 8.23.0 to 8.32.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.23.0 to 8.32.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.23.0...v8.32.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-17 09:09:30 +01:00
dependabot[bot]
a62d39ee25 build(deps): bump @redhat-cloud-services/frontend-components-notifications
Bumps [@redhat-cloud-services/frontend-components-notifications](https://github.com/RedHatInsights/frontend-components) from 3.2.11 to 3.2.12.
- [Release notes](https://github.com/RedHatInsights/frontend-components/releases)
- [Commits](https://github.com/RedHatInsights/frontend-components/commits)

---
updated-dependencies:
- dependency-name: "@redhat-cloud-services/frontend-components-notifications"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-16 15:06:23 +01:00
dependabot[bot]
6e512e42ab build(deps-dev): bump postcss-scss from 4.0.3 to 4.0.6
Bumps [postcss-scss](https://github.com/postcss/postcss-scss) from 4.0.3 to 4.0.6.
- [Release notes](https://github.com/postcss/postcss-scss/releases)
- [Changelog](https://github.com/postcss/postcss-scss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss-scss/compare/4.0.3...4.0.6)

---
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-01-16 13:29:29 +01:00
dependabot[bot]
2f6ac0a2c5 build(deps-dev): bump @redhat-cloud-services/eslint-config-redhat-cloud-services
Bumps @redhat-cloud-services/eslint-config-redhat-cloud-services from 1.2.2 to 1.2.6.

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-13 12:12:59 +01:00
dependabot[bot]
998db813a9 build(deps): bump react-router-dom from 6.4.2 to 6.6.2
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.4.2 to 6.6.2.
- [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.6.2/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-01-13 10:56:41 +01:00
Ondrej Ezr
224df6de17 Enable provisioning wizard in Ephemeral environment 2023-01-13 09:47:54 +01:00
lucasgarfield
0f0bb301ee Update prod webpack config to share router module. 2023-01-12 15:41:26 +01:00
Martin Maroši
88240aa757 Allow modals to be rendered on top of landing table. 2023-01-12 15:41:26 +01:00
Martin Maroši
0f89ced2a0 Change routing to consume chrome history context. 2023-01-12 15:41:26 +01:00
Martin Maroši
aa0a21301c Do not append extra / in resolveRelPath 2023-01-12 15:41:26 +01:00
Martin Maroši
122176ecbe Update webpack config to share router module. 2023-01-12 15:41:26 +01:00
dependabot[bot]
9c22d50786 build(deps-dev): bump stylelint from 14.14.1 to 14.16.1
Bumps [stylelint](https://github.com/stylelint/stylelint) from 14.14.1 to 14.16.1.
- [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/14.14.1...14.16.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-12 10:28:41 +01:00
dependabot[bot]
31debdfa05 build(deps-dev): bump @redhat-cloud-services/frontend-components-config
Bumps [@redhat-cloud-services/frontend-components-config](https://github.com/RedHatInsights/frontend-components) from 4.6.13 to 4.6.36.
- [Release notes](https://github.com/RedHatInsights/frontend-components/releases)
- [Commits](https://github.com/RedHatInsights/frontend-components/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-12 09:49:00 +01:00
dependabot[bot]
9cf00e1f27 build(deps-dev): bump @babel/preset-react from 7.16.7 to 7.18.6
Bumps [@babel/preset-react](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-react) from 7.16.7 to 7.18.6.
- [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.18.6/packages/babel-preset-react)

---
updated-dependencies:
- dependency-name: "@babel/preset-react"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-11 11:12:03 +01:00
dependabot[bot]
b9b746825e build(deps-dev): bump sass from 1.49.9 to 1.57.1
Bumps [sass](https://github.com/sass/dart-sass) from 1.49.9 to 1.57.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.49.9...1.57.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-01-11 09:39:49 +01:00
dependabot[bot]
a59fa1e7c6 build(deps-dev): bump @babel/core from 7.19.0 to 7.20.12
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.19.0 to 7.20.12.
- [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.20.12/packages/babel-core)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-09 16:40:16 +01:00
lucasgarfield
772aca36fa build(deps): bump @redhat-cloud-services/frontend-components-utilities from 3.2.16 to 3.3.11
Moving to @redhat-cloud-services/frontend-component utilities broke
several tests, this commit fixes those tests.

Additionally, this commit bumps @patternfly/react-core and
@patternfly/react-table to versions 4.267.6 and 4.112.6, respectively.
2023-01-09 12:40:27 +01:00
dependabot[bot]
f1763d51bd build(deps): bump json5 from 1.0.1 to 1.0.2
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-06 14:52:04 +01:00
lucasgarfield
670f1c106f ImagesTable: Fix status bug
Fixes #899. The status of images (parent images and clones) in the
clones table was displayed incorrectly - the 'highest priority'
(e.g. failure > success) was displayed for all images.

This was due to a bug in a conditional in the ImageBuildStatus
component. In the main images table, rows for AWS images should display
the highest priority status of *all* images. A single failed clone
should cause the status of the row in the main images table to be
failure, even if the parent compose status is successful.

This logic was incorrectly being applied to *all* statuses. This commit
fixes this - from now on, this logic is only used for rows in the main
images table.
2023-01-06 14:20:06 +01:00
Jakub Rusz
03b22647c5 Wizard: add ouiaId to release select
This will help QE with testing the app by having a specific locator for
this element.
2023-01-06 13:26:35 +01:00