Skip to content

Commit

Permalink
Support releases for CAPA (#4618)
Browse files Browse the repository at this point in the history
* Add support for v25 (and newer) CAPA releases

* Fix uiSchema for CAPZ

* Fix wording
  • Loading branch information
gusevda authored Jul 18, 2024
1 parent cac216f commit 69c27ff
Show file tree
Hide file tree
Showing 6 changed files with 359 additions and 127 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ interface ICreateClusterAppBundlesFormProps {
provider: PrototypeSchemas;
organization: string;
appVersion: string;
releaseVersion?: string;
render: (args: { formDataPreview: React.ReactNode }) => React.ReactNode;
onSubmit: (
e: React.SyntheticEvent<HTMLFormElement, SubmitEvent>,
Expand All @@ -59,6 +60,7 @@ const CreateClusterAppBundlesForm: React.FC<
provider,
organization,
appVersion,
releaseVersion,
onSubmit,
onChange,
children,
Expand All @@ -68,14 +70,19 @@ const CreateClusterAppBundlesForm: React.FC<
const clusterName = useMemo(
() => props.clusterName || generateUID(5),
// eslint-disable-next-line react-hooks/exhaustive-deps
[provider, appVersion]
[provider, appVersion, releaseVersion]
);

const [formProps, setFormProps] = useState<
Pick<FormProps<RJSFSchema>, 'uiSchema' | 'formData'>
>({
...getFormProps(provider, appVersion, clusterName, organization),
...(formData && { formData }),
...getFormProps(
provider,
appVersion,
clusterName,
organization,
releaseVersion
),
});

const [cleanFormData, setCleanFormData] = useState<RJSFSchema>();
Expand Down
Loading

0 comments on commit 69c27ff

Please sign in to comment.