diff --git a/src/Layout/DefaultLayout.jsx b/src/Layout/DefaultLayout.jsx index 2995343..a0c05f8 100644 --- a/src/Layout/DefaultLayout.jsx +++ b/src/Layout/DefaultLayout.jsx @@ -136,7 +136,7 @@ const DashboardLayout = ({ isOnline }) => { case path.startsWith("/sponser"): return ( - Sponsorer + Sponsor ); case path.startsWith("/investment-type"): diff --git a/src/Pages/Deposit/DepositRequest/DepositRequest.jsx b/src/Pages/Deposit/DepositRequest/DepositRequest.jsx index b84279c..d04fc0e 100644 --- a/src/Pages/Deposit/DepositRequest/DepositRequest.jsx +++ b/src/Pages/Deposit/DepositRequest/DepositRequest.jsx @@ -70,15 +70,6 @@ const DepositRequest = () => { } = useGetDepositRequestQuery({ page: currentPage, size: pageSize }); - useEffect(() => { - // Simulate loading - const timer = setTimeout(() => { - setIsLoading(false); - }, 1500); - - // Cleanup the timer on component unmount - return () => clearTimeout(timer); - }, []); // ====================================================[Table Setup]================================================================ const tableHeadRow = [ @@ -311,7 +302,7 @@ const DepositRequest = () => { emptyMessage={`We don't have any Investment type `} tableHeadRow={tableHeadRow} data={extractedArray} - isLoading={isLoading} + isLoading={depositRequestLoading} viewActionId={actionId} setViewActionId={setActionId} // totalPages={10} diff --git a/src/Pages/Deposit/DepositRequest/DepositRequestApprove.jsx b/src/Pages/Deposit/DepositRequest/DepositRequestApprove.jsx index dc21c41..2df842d 100644 --- a/src/Pages/Deposit/DepositRequest/DepositRequestApprove.jsx +++ b/src/Pages/Deposit/DepositRequest/DepositRequestApprove.jsx @@ -28,7 +28,7 @@ const FILE_TYPES = ["image/jpeg", "image/png", "image/gif"]; export const conformModalSchema = yup.object().shape({ investorAmount: yup.string().required("Investor amount is required"), - comment: yup.string().required("Comment is required"), + comment: yup.string().notRequired(), supporting_FileName: yup.mixed().required("File is required"), // .test("fileType", "Unsupported File Format", (value) => { // return value && FILE_TYPES.includes(value.type); diff --git a/src/Pages/Deposit/DepositViewHistory/DepositHistory.jsx b/src/Pages/Deposit/DepositViewHistory/DepositHistory.jsx index e44b2e8..46016d5 100644 --- a/src/Pages/Deposit/DepositViewHistory/DepositHistory.jsx +++ b/src/Pages/Deposit/DepositViewHistory/DepositHistory.jsx @@ -64,15 +64,6 @@ const DepositHistory = () => { } = useGetDepositHistoryQuery({ page: currentPage, size: pageSize }); - useEffect(() => { - // Simulate loading - const timer = setTimeout(() => { - setIsLoading(false); - }, 1500); - - // Cleanup the timer on component unmount - return () => clearTimeout(timer); - }, []); // ====================================================[Table Setup]================================================================ const tableHeadRow = [ @@ -304,7 +295,7 @@ const filteredData = data?.data?.rows.filter((item) => { tableHeadRow={tableHeadRow} // setData={setExtractedArray} data={extractedArray} - isLoading={isLoading} + isLoading={depositHistoryLoading} viewActionId={actionId} setViewActionId={setActionId} setMouseEnteredId={setMouseEnteredId} diff --git a/src/Pages/IO_Management/CreateIO/IOArtifactsVideo.jsx b/src/Pages/IO_Management/CreateIO/IOArtifactsVideo.jsx index 52d91d2..5416043 100644 --- a/src/Pages/IO_Management/CreateIO/IOArtifactsVideo.jsx +++ b/src/Pages/IO_Management/CreateIO/IOArtifactsVideo.jsx @@ -27,7 +27,10 @@ import ToastBox from "../../../Components/ToastBox"; const investmentVideoSchema = yup.object().shape({ artifactName: yup.string().required("Artifact name is required"), - artifactStreamingURL: yup.string().required("Artifact streaming URL is required").url("Invalid URL format"), + artifactStreamingURL: yup.string() + .required("Artifact streaming URL is required") + .url("Invalid URL format") + .matches(/\.mp4$/, "URL must end with .mp4"), }); const IOArtifactsAdd = ({ isOpen, onClose, firstField, actionId, setActionId, data }) => { diff --git a/src/Pages/IO_Management/CreateIO/IODetails.jsx b/src/Pages/IO_Management/CreateIO/IODetails.jsx index 7afc83c..e828255 100644 --- a/src/Pages/IO_Management/CreateIO/IODetails.jsx +++ b/src/Pages/IO_Management/CreateIO/IODetails.jsx @@ -286,6 +286,8 @@ const IODetails = ({ enableNextTab, index, data }) => { section: " ", width: "49%", value: IObyID?.data?.holdingPeriod, + maxLength:20, + helperText:`Maximum length should be 20 characters. You have entered ${watch()?.holdingPeriod?.length || 0} characters.` }, { label: "Holding Period (Arabic)", @@ -297,6 +299,8 @@ const IODetails = ({ enableNextTab, index, data }) => { section: " ", width: "49%", value: IObyID?.data?.holdingPeriodArabic, + maxLength:20, + helperText:`Maximum length should be 20 characters. You have entered ${watch()?.holdingPeriodArabic?.length || 0} characters.` }, diff --git a/src/Pages/IO_Management/KeyMeritsAdd.jsx b/src/Pages/IO_Management/KeyMeritsAdd.jsx index eb44428..2ce992b 100644 --- a/src/Pages/IO_Management/KeyMeritsAdd.jsx +++ b/src/Pages/IO_Management/KeyMeritsAdd.jsx @@ -136,6 +136,7 @@ const KeyMeritsAdd = ({ isOpen, onClose, firstField, id, icons }) => { const handleClose = () => { onClose(); + setIsLoading(false); setAlert(false); reset(); setFile(null); diff --git a/src/Pages/IO_Management/ViewIO/ViewIOdataHeader.jsx b/src/Pages/IO_Management/ViewIO/ViewIOdataHeader.jsx index 4399d1f..a0c3a2d 100644 --- a/src/Pages/IO_Management/ViewIO/ViewIOdataHeader.jsx +++ b/src/Pages/IO_Management/ViewIO/ViewIOdataHeader.jsx @@ -158,7 +158,9 @@ const filteredMenu = menu?.filter(item => apiTransactionTitles?.includes(item.id -console.log(isLoading); +console.log(IODetails?.ioNAV); +console.log(IODetails?.ioCash); +console.log(IODetails?.ioMVNAV); @@ -305,7 +307,7 @@ console.log(isLoading); IO cash - {IODetails?.ioCash ? formatCurrency(IODetails?.ioCash) : "00.00"} + {IODetails?.ioCash ? IODetails?.ioCash : "00.00"} diff --git a/src/Pages/Master/Sponser/AddSponser.jsx b/src/Pages/Master/Sponser/AddSponser.jsx index 3859537..7f706b3 100644 --- a/src/Pages/Master/Sponser/AddSponser.jsx +++ b/src/Pages/Master/Sponser/AddSponser.jsx @@ -54,7 +54,7 @@ const AddSponser = () => { const [isLoadingBtn, setIsLoadingBtn] = useState(false); const [alert, setAlert] = useState(false); const [form, setForm] = useState(); - const [isSwitchOn, setIsSwitchOn] = useState(); + const [isSwitchOn, setIsSwitchOn] = useState(true); const [createSponser] = useCreateSponserMutation(); const [updateSponser] = useUpdateSponserMutation(); @@ -62,9 +62,6 @@ const AddSponser = () => { // Fetch sponsor data only if id exists const {data: sponserByIdData,error,isLoading,} = useGetSponserByIdQuery(id, {skip: !id,}); - console.log(sponserByIdData); - - // ======================== [validators] =========================== const { @@ -124,15 +121,15 @@ const AddSponser = () => { setIsLoadingBtn(false); setAlert(false); navigate("/sponser"); - } else { + } else if(response?.error?.status === 400) { toast({ render: () => ( - + ), }); setIsLoadingBtn(false); - navigate("/sponser"); + setAlert(false) } }); } catch (error) { @@ -179,22 +176,22 @@ const AddSponser = () => { const formFields = [ { - label: "Sponser name (English)", + label: "Sponsor name (English)", placeHolder: " ", name: "sponsorName", type: "text", isRequired: true, - section: "Add Details", + section: "", maxLength:50, helperText:`Maximum length should be 50 characters. You have entered ${watch()?.sponsorName?.length || 0} characters.` }, { - label: "Sponser name (Arabic)", + label: "Sponsor name (Arabic)", name: "sponsorNameArabic", placeHolder: " ", type: "text", isRequired: true, - section: "Add Details", + section: "", arabic: true, right: true, maxLength:55, @@ -206,7 +203,7 @@ const AddSponser = () => { placeHolder: " ", type: "email", // isRequired: true, - section: "Add Details", + section: "", }, ]; @@ -214,22 +211,22 @@ const AddSponser = () => { const formEditFields = [ { - label: "Sponser name", + label: "Sponsor name", placeHolder: " ", name: "sponsorName", type: "text", isRequired: true, - section: "Add Details", + section: "", maxLength:55, helperText:`Maximum length should be 55 characters. You have entered ${watch()?.sponsorName?.length || 0} characters.` }, { - label: "Sponser name (Arabic)", + label: "Sponsor name (Arabic)", name: "sponsorNameArabic", placeHolder: " ", type: "text", isRequired: true, - section: "Add Details", + section: "", arabic: true, maxLength:55, helperText:`Maximum length should be 55 characters. You have entered ${watch()?.sponsorNameArabic?.length || 0} characters.` @@ -240,7 +237,7 @@ const AddSponser = () => { placeHolder: " ", type: "email", // isRequired: true, - section: "Add Details", + section: "", }, ];