-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added image-builder-frontend repository as a Cockpit package #2424
base: main
Are you sure you want to change the base?
Conversation
d626d14
to
d020097
Compare
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #2424 +/- ##
==========================================
+ Coverage 75.71% 83.18% +7.46%
==========================================
Files 33 156 +123
Lines 597 17374 +16777
Branches 144 1683 +1539
==========================================
+ Hits 452 14452 +14000
- Misses 139 2902 +2763
- Partials 6 20 +14
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Just a general first comment, to make this a little easier to review, could you maybe split it out into several commits? Having a good description for each one? The current commit message doesn't describe all the changes made.
08ce8c7
to
fcdf7eb
Compare
Is this a duplicate of #2412? Can you please close a PR that is not needed anymore? |
@mgold1234 Yup, perfectly fine, thank you! |
fcdf7eb
to
b56aeef
Compare
4987b36
to
de18012
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool that we can reuse the router :) Mostly style comments.
a3a6a8a
to
9e93e2d
Compare
ce6617b
to
ce5cdaa
Compare
7e5c4d2
to
889a6de
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this PR with cockpit, the landing page was rendered as expected in empty mode! 👍 The routing (like opening the wizard) doesn't work though, we need to adjust the prefix insights/image-builder
for links.
c9f827c
to
62e8091
Compare
changes that allow to build and run in both onPremise (Cockpit) and Saas environments. Configured webpack with necessary loaders and plugins. `AppCockpit` file and `cockpit:build` script were added for Cockpit compatibility.
62e8091
to
20a23f9
Compare
We need to integrate a new API service for managing blueprints and update the Redux store to handle blueprint-related data in a Cockpit environment. This will allow us to fetch, store, and manage blueprints effectively within the application. Created a new 'cockpitApi' service to handle the API calls related to blueprints in cockpit env. Added a 'blueprintsReducer' to the Redux store to manage blueprint state. Added a new 'emptyCockpitApi' file for the blueprint API setup, including type definitions and query configurations.
- define isOnPremise boolean variable to check if its onPrem env. - define useGetFeatureFlag hook to return false in on-premise environments and dynamically call the appropriate hook (useFlag or useFlagWithEphemDefault) based on the feature flag name. Improved structure by avoiding hook calls inside conditionals to adhere to React rules
20a23f9
to
8201ab3
Compare
we have issue when running the cockpit:build script- the symbolic link was not created for everyone. fix it by adding a condition that check where the cockpit definition exist in the machine and create the symbolic link there.
8201ab3
to
b6e1d35
Compare
</Provider> | ||
); | ||
|
||
const main = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems very similar to what we do in https://github.com/osbuild/image-builder-frontend/blob/main/src/bootstrap.tsx, could we re-use that code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it is make sense to have entry point for each environment- one for onPrem and one for Saas.
@@ -153,6 +163,81 @@ const ImagesTable = () => { | |||
); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we apply the DRY ("Don't repeat yourself") principle to lines 166 through 240? This is a lot of copy/pasted code. The goal is to not conditionally render anything and to re-use/share as much code as possible between the service and on-prem.
b3044aa
to
c614c65
Compare
2019015
to
c2e1e23
Compare
add alias to webpack config 1) api alias defines the path to onPrem cockpitAp file 2) pathRes alias define path for onPrem env 3) getFeatureFlag alias define the path to file with flags
c2e1e23
to
4be467d
Compare
Added image-builder-frontend repository as a Cockpit package.
it will replace the cockpit-composer with image-builder-frontend for improved functionality and maintainability.