Provisioning: Wait for status check in frontend (#111712)
This commit is contained in:
@@ -46,6 +46,7 @@ export const SynchronizeStep = memo(function SynchronizeStep({
|
|||||||
} = repositoryStatusQuery?.data?.status?.health || {};
|
} = repositoryStatusQuery?.data?.status?.health || {};
|
||||||
|
|
||||||
const hasError = repositoryStatusQuery.isError;
|
const hasError = repositoryStatusQuery.isError;
|
||||||
|
const isLoading = repositoryStatusQuery.isLoading || repositoryStatusQuery.isFetching;
|
||||||
const isButtonDisabled = hasError || (checked !== undefined && isRepositoryHealthy === false);
|
const isButtonDisabled = hasError || (checked !== undefined && isRepositoryHealthy === false);
|
||||||
|
|
||||||
const startSynchronization = async () => {
|
const startSynchronization = async () => {
|
||||||
@@ -56,7 +57,7 @@ export const SynchronizeStep = memo(function SynchronizeStep({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (repositoryStatusQuery.isFetching) {
|
if (isLoading) {
|
||||||
return <Spinner />;
|
return <Spinner />;
|
||||||
}
|
}
|
||||||
if (job) {
|
if (job) {
|
||||||
@@ -151,7 +152,7 @@ export const SynchronizeStep = memo(function SynchronizeStep({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<Field noMargin>
|
<Field noMargin>
|
||||||
{hasError || isRepositoryHealthy === false ? (
|
{hasError || (checked !== undefined && isRepositoryHealthy === false) ? (
|
||||||
<Button variant="destructive" onClick={() => onCancel?.(repoName)} disabled={isCancelling}>
|
<Button variant="destructive" onClick={() => onCancel?.(repoName)} disabled={isCancelling}>
|
||||||
{isCancelling ? (
|
{isCancelling ? (
|
||||||
<Trans i18nKey="provisioning.wizard.button-cancelling">Cancelling...</Trans>
|
<Trans i18nKey="provisioning.wizard.button-cancelling">Cancelling...</Trans>
|
||||||
|
|||||||
Reference in New Issue
Block a user