-
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
9b32e44
to
0602a7f
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`, `cockpit:install` scripts were added for Cockpit compatibility. added alias to fec.config.js to seperate Saas modules
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
3802aa7
to
68310a9
Compare
68310a9
to
fb07925
Compare
} from './imageBuilderApi'; | ||
|
||
// Injects API endpoints into the service for querying blueprints | ||
export const blueprintsReducer = api.injectEndpoints({ |
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 looks good, but we need to teach it how to actually return a GetBlueprintsApiResponse object.
You'll want to use a queryFn, check the RTKQ docs here:
https://redux-toolkit.js.org/rtk-query/usage/customizing-queries#customizing-queries-with-queryfn
You might want to use the Cockpit Files API to read in the blueprints from a directory, docs here: https://cockpit-project.org/guide/latest/cockpit-file
We haven't 100% decided on the directory yet, but perhaps ~/.local/share/image-builder/blueprints
.
227e7bd
to
6a5e029
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.
This is looking quite good I think, some compiler errors however, but I like the usage of queryFn!
if (isOnPremise) { | ||
return false; | ||
} | ||
if ( |
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 wonder if a switch statement makes it easier to read here.
b75bf5a
to
d510a1e
Compare
d510a1e
to
7c13f5e
Compare
Align Insights IB Service and IB On-Prem UI with Unified Blueprint and Image Functionality
image-builder
(service) andcloud-api
(on-prem).