From 001f61c6a585cfc2116a380230ae4f33d3c03d1e Mon Sep 17 00:00:00 2001 From: Bart K Date: Mon, 9 Dec 2024 09:05:59 +0100 Subject: [PATCH 1/2] fix(portal): Push activity log UI issues --- .../components/PushHistoryModal/index.tsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/kraken-app/kraken-app-portal/src/pages/EnvironmentActivityLog/components/PushHistoryModal/index.tsx b/kraken-app/kraken-app-portal/src/pages/EnvironmentActivityLog/components/PushHistoryModal/index.tsx index fbf85f2f..4eed749c 100644 --- a/kraken-app/kraken-app-portal/src/pages/EnvironmentActivityLog/components/PushHistoryModal/index.tsx +++ b/kraken-app/kraken-app-portal/src/pages/EnvironmentActivityLog/components/PushHistoryModal/index.tsx @@ -1,6 +1,6 @@ import { DatePicker, Flex, Form, Modal, Radio, Spin } from "antd"; import styles from "./index.module.scss"; -import { useCallback } from "react"; +import { useCallback, useMemo } from "react"; import { capitalize } from 'lodash'; import dayjs from 'dayjs'; import { useGetProductEnvActivitiesMutation } from '@/hooks/product'; @@ -76,6 +76,11 @@ const PushHistoryModal = ({ [] ); + const isFormValid = useMemo(() => { + const { envId, requestTime } = form.getFieldsValue(); + return !!(responseData && responseData.data.total > 0 && envId && requestTime) + }, [responseData, form]) + return (
- + - {responseData?.data?.total && + {responseData?.data &&
Number of activity logs filtered
@@ -124,8 +132,6 @@ const PushHistoryModal = ({ }
- -
); From 63c0eea28228ebf219aba325f052e85f9fc9da39 Mon Sep 17 00:00:00 2001 From: Bart K Date: Mon, 9 Dec 2024 09:09:52 +0100 Subject: [PATCH 2/2] fix(portal): remove unused import --- .../components/PushHistoryModal/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kraken-app/kraken-app-portal/src/pages/EnvironmentActivityLog/components/PushHistoryModal/index.tsx b/kraken-app/kraken-app-portal/src/pages/EnvironmentActivityLog/components/PushHistoryModal/index.tsx index 4eed749c..bbd5446f 100644 --- a/kraken-app/kraken-app-portal/src/pages/EnvironmentActivityLog/components/PushHistoryModal/index.tsx +++ b/kraken-app/kraken-app-portal/src/pages/EnvironmentActivityLog/components/PushHistoryModal/index.tsx @@ -30,7 +30,7 @@ const PushHistoryModal = ({ const [form] = Form.useForm(); const { currentProduct } = useAppStore(); - const { data: responseData, mutateAsync: getProductEnvActivities, isPending, isSuccess } = useGetProductEnvActivitiesMutation(); + const { data: responseData, mutateAsync: getProductEnvActivities, isPending } = useGetProductEnvActivitiesMutation(); const { mutateAsync: createPushActivityLog } = usePostPushActivityLog(); const handleOK = () => {