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..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 @@ -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'; @@ -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 = () => { @@ -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 = ({ }
- -
);