From 1c5e9943c81bd52e06cf9807a25c65784efe447c Mon Sep 17 00:00:00 2001 From: Scott Dickerson Date: Thu, 25 Jul 2024 11:02:24 -0400 Subject: [PATCH] :bug: Fix field alignment on the Repositories>Maven page (#2029) The info text box and the "Clear repository" button is now aligned horizontally and above the switch. Resolves: https://issues.redhat.com/browse/MTA-3149 Signed-off-by: Scott J Dickerson --- client/src/app/pages/repositories/Mvn.tsx | 91 +++++++++++++---------- 1 file changed, 52 insertions(+), 39 deletions(-) diff --git a/client/src/app/pages/repositories/Mvn.tsx b/client/src/app/pages/repositories/Mvn.tsx index 6d62e49ee5..150ce8aed0 100644 --- a/client/src/app/pages/repositories/Mvn.tsx +++ b/client/src/app/pages/repositories/Mvn.tsx @@ -7,6 +7,8 @@ import { CardBody, Form, FormGroup, + Grid, + GridItem, PageSection, PageSectionVariants, Spinner, @@ -30,7 +32,7 @@ export const RepositoriesMvn: React.FC = () => { const { t } = useTranslation(); const [isConfirmDialogOpen, setIsConfirmDialogOpen] = - React.useState(false); + React.useState(false); const mvnInsecureSetting = useSetting("mvn.insecure.enabled"); const mvnInsecureSettingMutation = useSettingMutation("mvn.insecure.enabled"); @@ -49,10 +51,11 @@ export const RepositoriesMvn: React.FC = () => { // mvnForcedSettingMutation.mutate(!mvnForcedSetting.data); // }; - let storageValue: string = ""; const { data: cache, isFetching, isSuccess, refetch } = useFetchCache(); - if (isSuccess) storageValue = `${cache.used} of ${cache.capacity} `; + const cacheUseString = React.useMemo(() => { + return isSuccess ? `${cache.used} of ${cache.capacity} ` : ""; + }, [cache, isSuccess]); const onHandleCleanSuccess = () => { refetch(); @@ -67,6 +70,8 @@ export const RepositoriesMvn: React.FC = () => { onHandleCleanError ); + const inputDisabled = !isRWXSupported || isFetching || isDeleting; + return ( <> @@ -74,48 +79,55 @@ export const RepositoriesMvn: React.FC = () => { {t("terms.mavenConfig")} +
- - - - + + + + + + + + + + + {mvnInsecureSetting.isError && ( { + {isConfirmDialogOpen && (