diff --git a/ui/src/app/applications/components/application-create-panel/application-create-panel.tsx b/ui/src/app/applications/components/application-create-panel/application-create-panel.tsx
index cd60efbe3edb6..8ec019dc59cde 100644
--- a/ui/src/app/applications/components/application-create-panel/application-create-panel.tsx
+++ b/ui/src/app/applications/components/application-create-panel/application-create-panel.tsx
@@ -105,6 +105,7 @@ export const ApplicationCreatePanel = (props: {
const [yamlMode, setYamlMode] = React.useState(false);
const [explicitPathType, setExplicitPathType] = React.useState<{path: string; type: models.AppSourceType}>(null);
const [destFormat, setDestFormat] = React.useState('URL');
+ const [retry, setRetry] = React.useState(false);
function normalizeTypeFields(formApi: FormApi, type: models.AppSourceType) {
const app = formApi.getFormState().values;
@@ -222,7 +223,13 @@ export const ApplicationCreatePanel = (props: {
);
diff --git a/ui/src/app/applications/components/application-retry-options/application-retry-options.tsx b/ui/src/app/applications/components/application-retry-options/application-retry-options.tsx
index cbf165e1389f5..0d621138edfbe 100644
--- a/ui/src/app/applications/components/application-retry-options/application-retry-options.tsx
+++ b/ui/src/app/applications/components/application-retry-options/application-retry-options.tsx
@@ -79,8 +79,20 @@ export const ApplicationRetryForm = ({initValues, field = 'retryStrategy'}: {ini
);
};
-export const ApplicationRetryOptions = ({formApi, initValues, field = 'retryStrategy'}: {formApi: FormApi; field?: string; initValues?: models.RetryStrategy}) => {
- const [retry, setRetry] = React.useState(!!initValues);
+export const ApplicationRetryOptions = ({
+ formApi,
+ initValues,
+ field = 'retryStrategy',
+ retry,
+ setRetry
+}: {
+ formApi: FormApi;
+ field?: string;
+ initValues?: models.RetryStrategy;
+ retry?: boolean;
+ setRetry?: (value: boolean) => any;
+}) => {
+ const [retryInternal, setRetryInternal] = React.useState(!!initValues);
const toggleRetry = (value: boolean) => {
if (!value) {
@@ -97,15 +109,18 @@ export const ApplicationRetryOptions = ({formApi, initValues, field = 'retryStra
errors: newErrors
});
}
-
- setRetry(value);
+ if (setRetry != null) {
+ setRetry(value);
+ } else {
+ setRetryInternal(value);
+ }
};
-
+ const isChecked = setRetry != null ? retry : retryInternal;
return (
-
toggleRetry(val)} />
+ toggleRetry(val)} />
- {retry && }
+ {isChecked && }
);
};