Refactor ConfirmUpgradeResource to use ResourceForm#2
Conversation
I've refactored `ConfirmUpgradeResource` to use the more generic `ResourceForm` component. This simplifies the `ConfirmUpgradeResource` component by removing the manual schema fetching and processing logic. The `ResourceForm` component has been enhanced to support the upgrade scenario by adding the following props: - `formRef`: To expose a method for programmatic form handling. - `hideSubmitButton`: To hide the default action button. - `overrideTemplateVersion`: To fetch a specific version of the template. - `isUpgrade`: To adjust the request payload for upgrades. The `createUpdateResource` function in `ResourceForm` has been modified to ensure that read-only properties are always removed from the payload, for both updates and upgrades, to prevent potential API errors.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
feat: Refactor ConfirmUpgradeResource to use ResourceForm I have refactored `ConfirmUpgradeResource` to use the more generic `ResourceForm` component. This simplifies the `ConfirmUpgradeResource` component by delegating form rendering and data handling logic to `ResourceForm`. The `ResourceForm` component has been enhanced to support the upgrade scenario by adding the following props: - `schema`: To allow passing a pre-defined schema. - `formRef`: To expose a method for programmatic completion. - `hideSubmitButton`: To hide the default action button. - `overrideTemplateVersion`: To fetch a specific version of the template. - `isUpgrade`: To adjust the data payload for upgrades. - `onFormValidated`: To report the form's validation status to the parent component. The `CreateUpdateResource` component has also been updated to accommodate the new signature of the `onCreateResource` prop in `ResourceForm`.
The
ConfirmUpgradeResourcecomponent has been refactored to use theResourceFormcomponent, simplifying the code and improving maintainability. TheResourceFormcomponent has been made more flexible to support the upgrade scenario.PR created automatically by Jules for task 4513797011353263012 started by @JC-wk