Commit graph

2744 commits

Author SHA1 Message Date
Sanne Raymaekers
fcbcbb3d22 store/cockpitApi: write blueprints to disk 2025-01-30 10:53:01 +01:00
Sanne Raymaekers
1dc657a351 store/cockpitApi: invalidate cache after building an image
With the custom query functions the cached data from getComposes and
getBlueprintComposes doesn't get invalidated. Luckily RTKQuery provides
a mechanism to invalidate the cache after a mutation.
2025-01-30 10:53:01 +01:00
Sanne Raymaekers
75eb0afd10 src/test/mocks: add cockpit mocks
Adds `mtime` tot fsinfo, and `replace` to `cockpit.file`.
2025-01-30 10:53:01 +01:00
Sanne Raymaekers
c8c62dda9d store/cockpitApi: compose status support
Finds the relevant compose, asks for its status and reads the original
compose request from disk.
2025-01-30 10:53:01 +01:00
Sanne Raymaekers
7bd5e2fa95 ImagesTable: switch to mixed api for getting composes 2025-01-30 10:53:01 +01:00
Sanne Raymaekers
0775acdb4d store/cockpitApi: support getting composes
Reads all of the image entries under the cache.
2025-01-30 10:53:01 +01:00
Sanne Raymaekers
449aad5306 Blueprints/BuildImagesButton: switch to mixed api
The mixed api supports both the service and on-prem.
2025-01-30 10:53:01 +01:00
Sanne Raymaekers
d13276eeee store/cockpitApi: support building images from blueprint
The structure of the local cache is now:
```
└── blueprint
    └── blueprint.json
    └── image1
    └── image2
└── blueprint2
    └── blueprint2.json
    └── image1
```

Building an image reads the blueprint, and creates a new image file
under the relevant blueprint folder, which contains the image request.

The image request that's sent off to composer and the request that's
saved differs slightly in the upload structures.
2025-01-30 10:53:01 +01:00
Sanne Raymaekers
e4538826fd constants: use .cache for blueprints
`.cache` is for writing, `.local/share` is technically static data.
2025-01-30 10:53:01 +01:00
regexowl
4145157858 Wizard: Add firewall services
This adds firewall services, using the `<ChippingInput>` components. New tests were also added.
2025-01-29 14:48:15 +01:00
Amir
3c27f68b97 scripts: add start:federated script 2025-01-28 14:32:18 +01:00
Gianluca Zuccarelli
94f24ce085 store/cockpitApi: add create blueprint mutation 2025-01-28 13:29:21 +01:00
Gianluca Zuccarelli
c104f30cd2 store/cockpitApi: add list snapshot mutation
This is not ideal, but we needed to add an empty endpoint for
this, even though we're ignoring it on prem. The frontend for
the service makes the api call regardless, so we can't ignore
this.
2025-01-28 13:29:21 +01:00
Gianluca Zuccarelli
a3529f9108 CreateImageWizard: ignore org-id for on-prem
We can ignore the org-id when trying to get the state of the
blueprint during the blueprint creation. This is unnecessary
info for `on-prem`
2025-01-28 13:29:21 +01:00
Gianluca Zuccarelli
d0a69082f3 CreateImageWizard: disable analytics for on-prem 2025-01-28 13:29:21 +01:00
regexowl
e34ed8c230 test: Kernel edit tests
This adds kernel tests for the edit mode.
2025-01-28 11:49:17 +01:00
regexowl
a4d672b4e8 Blueprints: Add kernel to on-prem mapper
This adds kernel to the on-prem mapper.
2025-01-28 11:35:44 +01:00
Michal Gold
6e36232e1a Wizard: Add remove user button in users step
this adds remove user button and add unit test as well.
2025-01-27 14:30:22 -06:00
regexowl
96d68583a3 Wizard: Add kernel to Review step
This adds a kernel expandable to the Review step.
2025-01-27 13:48:39 -06:00
Michal Gold
aa8086176b wizard: create new component with add eyeIcon button inside textInput
this commit create new component with add eyeIcon button inside textInput,
for password field
2025-01-27 13:35:18 -06:00
Gianluca Zuccarelli
f2c5dcc1b3 store/backendApi: tidy up mixed api imports
The list of imports was growing really long and getting a bit
unmanageable. This commit tidies the imports up by importing all
the queries into two variables.
2025-01-27 17:03:06 +01:00
Gianluca Zuccarelli
45b83bd4fb CreateImageWizard: initialize on-prem with host arch
Initialize the create image wizard with the host arch for the
on-prem frontend.
2025-01-27 17:03:06 +01:00
Gianluca Zuccarelli
44af2f278b CreateImageWizard: initialize on-prem with host distro
Initialize the create image wizard with the host's distribution for the
on-premise frontend.
2025-01-27 17:03:06 +01:00
Gianluca Zuccarelli
ed8254f962 test/mocks: add cockpit os-release
Add a stub function for the `os-release` package from cockpit.
2025-01-27 17:03:06 +01:00
Gianluca Zuccarelli
c510918f2c constants: add centos-10 & fedora-41 2025-01-27 17:03:06 +01:00
Gianluca Zuccarelli
29b7e02de2 CreateImageWizard: hide activation keys for on-prem
Subject says it all
2025-01-27 17:03:06 +01:00
Gianluca Zuccarelli
e64008aec7 CreateImageWizard: disable steps for on-prem
For a start, we will disable custom repositories and the OpenSCAP steps
for the on-prem version of the frontend.
2025-01-27 17:03:06 +01:00
Gianluca Zuccarelli
592ea952e2 store: add missing apis to onPrem
Currently, the wizard still needs some of the other stores. If we
omit them, the wizard fails to launch
2025-01-27 17:03:06 +01:00
Gianluca Zuccarelli
6e9bd89b08 store/backendApi: create a useBackendPrefetch hook
Create a helper hook for RTK prefetch queries. This wrapper function
is needed since the imagebuilderApi and cockpitApi aren't at parity
yet.
2025-01-27 17:03:06 +01:00
Gianluca Zuccarelli
5a70e31d5a store/cockpitApi: empty get oscap profiles function
Create the boilerplate function for getting the Oscap profiles. We will
need to make a call to the `oscap` binary to get this information. So
we will leave it empty for now.
2025-01-27 17:03:06 +01:00
Gianluca Zuccarelli
34bf64debc store/cockpitApi: get blueprint endpoint
Create a get blueprint endpoint for the on-prem store.
2025-01-27 17:03:06 +01:00
Gianluca Zuccarelli
5988c42b6f store/cockpitApi: getArchitectures endpoint
We were making a call to a dead endpoint to get the architectures.
Instead, create a custom query function to return the list of architectures
and image types.
2025-01-27 17:03:06 +01:00
Gianluca Zuccarelli
6ca7edb949 Utilities: fix useGetEnvironment
We need to check for the on-prem use case
2025-01-27 17:03:06 +01:00
Gianluca Zuccarelli
aef3f4a3e4 multi: on-prem can't use the unleash flag
Switch the useFlag usage to the stub function defined in the
`useGetEnvironment` utility
2025-01-27 17:03:06 +01:00
Gianluca Zuccarelli
34368c4f84 cockpit: switch to hashrouter
The browser router doesn't seem to work inside cockpit, switching
to the hashrouter resolves this.
2025-01-27 17:03:06 +01:00
regexowl
6a29f7f344 Wizard: Remove redundant code, fix addItem
Removed redundant code and updated `addItem` to check for duplicate arguments in both required and non-required list.
2025-01-27 13:21:48 +01:00
regexowl
1b21852518 Wizard: Add kernel append input
This adds the kernel append input. New arguments can be added by pressing the "Add" button or hitting Enter after the argument.

The kernel arguments linked to a selected OpenSCAP profile are rendered in a category marked as "Required by OpenSCAP" and are read only.
2025-01-27 13:21:48 +01:00
regexowl
199dd3d5d7 Utilities: Fix "no-unnecessary-condition" issue 2025-01-25 21:06:00 -06:00
regexowl
607f2ee3c7 ImagesTable: Fix "no-unnecessary-condition" issues 2025-01-25 21:06:00 -06:00
regexowl
d2b644b65f LandingPage: Fix "no-unnecessary-condition" issues 2025-01-25 21:06:00 -06:00
regexowl
08e0a0c384 test: Fix "no-unnecessary-condition" issues 2025-01-25 21:06:00 -06:00
regexowl
c8c7c7dd0b Blueprints: Fix "no-unnecessary-condition" issues 2025-01-25 21:06:00 -06:00
regexowl
1c50407b19 devDeps: Manually bump stylelint
This bumps stylelint from 15.11.0 to 16.13.2 and stylelint-config-recommended-scss from 13.1.0 to 14.1.0
2025-01-25 17:22:07 -06:00
Michal Gold
771a582916 wizard: add support of TextArea for ssh_key field
this commit add support of TextArea for ssh_key field
2025-01-25 17:07:53 -06:00
Michal Gold
7d34d30b08 wizrad: add validation to ssh key field (HMS-5349)
this commit add validation to ssh key field

JIRA: HMS-5349
2025-01-23 14:08:24 +01:00
regexowl
0f86336af6 Wizard: Services step basics
This adds basic structure of the Services step.
2025-01-23 09:56:24 +01:00
dependabot[bot]
c6bee55544 build(deps-dev): bump @testing-library/user-event from 14.5.2 to 14.6.1
Bumps [@testing-library/user-event](https://github.com/testing-library/user-event) from 14.5.2 to 14.6.1.
- [Release notes](https://github.com/testing-library/user-event/releases)
- [Changelog](https://github.com/testing-library/user-event/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/user-event/compare/v14.5.2...v14.6.1)

---
updated-dependencies:
- dependency-name: "@testing-library/user-event"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-23 09:04:11 +01:00
dependabot[bot]
a7056e89d8 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 8.20.0 to 8.21.0.
- [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/v8.21.0/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>
2025-01-23 08:29:10 +01:00
regexowl
692ba3de0d ESLint: Disable autofix for "no-unnecessary-condition"
This disables autofix specifically for the "no-unnecessary-condition" rule. This allows us to continue using autofix without applying the breaking changes.
2025-01-22 14:10:58 +01:00
regexowl
d41c079567 test: Test error message reset and validation on add button
This tests the updates.
2025-01-22 11:48:10 +01:00