Compare commits
4 Commits
Testing
...
hot-fix-sp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
28f84b178a | ||
|
|
b518e5fb8b | ||
|
|
5b2efcd292 | ||
|
|
f2023cf7b3 |
@@ -90,9 +90,9 @@ const AddCashDetails = ({ isOpen, onClose, firstField, actionId, setActionId, da
|
|||||||
toast({
|
toast({
|
||||||
render: () => <ToastBox message={res?.error?.data?.message } status={"error"} />,
|
render: () => <ToastBox message={res?.error?.data?.message } status={"error"} />,
|
||||||
});
|
});
|
||||||
|
setAlert(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ const IOArtifactsAdd = ({ isOpen, onClose, firstField, actionId, setActionId, da
|
|||||||
|
|
||||||
<DrawerBody>
|
<DrawerBody>
|
||||||
<Stack spacing={4}>
|
<Stack spacing={4}>
|
||||||
<FormControl isInvalid={errors.artifactName}>
|
<FormControl isInvalid={errors.artifactName} isRequired={true}>
|
||||||
<FormLabel fontSize={"sm"}>Artifact Name</FormLabel>
|
<FormLabel fontSize={"sm"}>Artifact Name</FormLabel>
|
||||||
<Controller
|
<Controller
|
||||||
name="artifactName"
|
name="artifactName"
|
||||||
@@ -166,7 +166,7 @@ const IOArtifactsAdd = ({ isOpen, onClose, firstField, actionId, setActionId, da
|
|||||||
</FormErrorMessage>
|
</FormErrorMessage>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
|
||||||
<FormControl isInvalid={errors.artifactStreamingURL}>
|
<FormControl isInvalid={errors.artifactStreamingURL} isRequired={true}>
|
||||||
<FormLabel fontSize={"sm"}>Artifact Streaming URL</FormLabel>
|
<FormLabel fontSize={"sm"}>Artifact Streaming URL</FormLabel>
|
||||||
<Controller
|
<Controller
|
||||||
name="artifactStreamingURL"
|
name="artifactStreamingURL"
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ const schema = yup.object().shape({
|
|||||||
InvestmentDetails: yup.string().notRequired(),
|
InvestmentDetails: yup.string().notRequired(),
|
||||||
|
|
||||||
comment: yup.string().notRequired()
|
comment: yup.string().notRequired()
|
||||||
.min(10, "Comment must be at least 10 characters long")
|
// .min(10, "Comment must be at least 10 characters long")
|
||||||
.max(100, "Comment must be at most 100 characters long"),
|
.max(100, "Comment must be at most 100 characters long"),
|
||||||
|
|
||||||
expectedReturn: yup
|
expectedReturn: yup
|
||||||
|
|||||||
@@ -82,12 +82,16 @@ const KeyMeritsEdit = ({
|
|||||||
meritsDescription: found?.meritsDescription,
|
meritsDescription: found?.meritsDescription,
|
||||||
meritsHeaderArabic: found?.meritsHeaderArabic,
|
meritsHeaderArabic: found?.meritsHeaderArabic,
|
||||||
meritsDescriptionArabic: found?.meritsDescriptionArabic,
|
meritsDescriptionArabic: found?.meritsDescriptionArabic,
|
||||||
iconImage: null,
|
icon_xid: found?.icon_xid,
|
||||||
});
|
});
|
||||||
|
console.log("==============",found);
|
||||||
|
|
||||||
}
|
}
|
||||||
}, [found, reset]);
|
}, [found, reset]);
|
||||||
|
|
||||||
const onSubmit = async (data) => {
|
const onSubmit = async (data) => {
|
||||||
|
console.log(data);
|
||||||
|
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
try {
|
try {
|
||||||
const id = actionId;
|
const id = actionId;
|
||||||
@@ -97,6 +101,9 @@ const KeyMeritsEdit = ({
|
|||||||
render: () => <ToastBox message={res?.data?.message} />,
|
render: () => <ToastBox message={res?.data?.message} />,
|
||||||
});
|
});
|
||||||
handleClose()
|
handleClose()
|
||||||
|
reset({
|
||||||
|
meritsHeader: "",
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (res?.error?.data?.code === 400) {
|
if (res?.error?.data?.code === 400) {
|
||||||
@@ -106,6 +113,7 @@ const KeyMeritsEdit = ({
|
|||||||
),
|
),
|
||||||
});
|
});
|
||||||
handleClose()
|
handleClose()
|
||||||
|
reset();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -288,7 +296,7 @@ const KeyMeritsEdit = ({
|
|||||||
alt={selectedImageIcon}
|
alt={selectedImageIcon}
|
||||||
boxSize="1rem"
|
boxSize="1rem"
|
||||||
mr="12px"
|
mr="12px"
|
||||||
/>}{" "}
|
/>}
|
||||||
<Text as={"span"} fontSize={"sm"} fontWeight={500}>
|
<Text as={"span"} fontSize={"sm"} fontWeight={500}>
|
||||||
{selectedIcon}
|
{selectedIcon}
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
@@ -74,6 +74,11 @@ const DistributionInvestor = ({ isOpen, onClose }) => {
|
|||||||
amount: yup
|
amount: yup
|
||||||
.string()
|
.string()
|
||||||
.required("Amount is required")
|
.required("Amount is required")
|
||||||
|
.test(
|
||||||
|
"is-positive",
|
||||||
|
"Amount should be greater than zero",
|
||||||
|
(value) => parseFloat(value) > 0 // Check if the amount is greater than zero
|
||||||
|
)
|
||||||
.test(
|
.test(
|
||||||
"max",
|
"max",
|
||||||
`Distribution amount should not be greater than IO cash amount ${IODetails?.ioCash}`,
|
`Distribution amount should not be greater than IO cash amount ${IODetails?.ioCash}`,
|
||||||
@@ -87,6 +92,7 @@ const DistributionInvestor = ({ isOpen, onClose }) => {
|
|||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const investor = yup.object().shape({
|
const investor = yup.object().shape({
|
||||||
amount: yup.string().required("Amount is required"),
|
amount: yup.string().required("Amount is required"),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -216,13 +216,14 @@ const InvestorDetails = () => {
|
|||||||
as={'span'}
|
as={'span'}
|
||||||
fontWeight={"700"}
|
fontWeight={"700"}
|
||||||
textTransform={"none"}
|
textTransform={"none"}
|
||||||
color={item.ioStatus ? "gray.500":item.kycStatus ? "blue.500" : "red.500"}
|
color={item?.KYCStatus === true ? "green" : "yellow.500"}
|
||||||
px={2}
|
px={2}
|
||||||
py={0.5}
|
py={0.5}
|
||||||
variant={'solid'}
|
variant={'solid'}
|
||||||
|
|
||||||
>
|
>
|
||||||
{item.KYCStatus ? "Completed" : "Not complete"}
|
{/* {item.KYCStatus ? "Completed" : "Not complete"} */}
|
||||||
|
{item?.KYCStatus === true ? "Completed" : "Not Completed"}
|
||||||
</Text>
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -107,23 +107,27 @@ const AddInvestmentType = () => {
|
|||||||
isActive: isSwitchOn,
|
isActive: isSwitchOn,
|
||||||
};
|
};
|
||||||
await updateInvestmentType({ data: formData, id }).then((response) => {
|
await updateInvestmentType({ data: formData, id }).then((response) => {
|
||||||
if (response?.data?.statusCode === 200) {
|
if (response?.data) {
|
||||||
toast({
|
toast({
|
||||||
render: () => <ToastBox message={response?.data?.message} />,
|
render: () => (
|
||||||
|
<ToastBox
|
||||||
|
status={"success"}
|
||||||
|
message={response?.data?.message}
|
||||||
|
/>
|
||||||
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoadingBtn(false);
|
setIsLoadingBtn(false);
|
||||||
setAlert(false);
|
setAlert(false);
|
||||||
navigate("/investment-type");
|
navigate("/investment-type");
|
||||||
} else {
|
} else if (response?.error) {
|
||||||
toast({
|
toast({
|
||||||
render: () => (
|
render: () => (
|
||||||
<ToastBox message={"Something Went Wrong"} status={"error"} />
|
<ToastBox
|
||||||
|
status={"error"}
|
||||||
|
message={response?.error?.data?.message}
|
||||||
|
/>
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
setIsLoadingBtn(false);
|
|
||||||
navigate("/investment-type");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -139,22 +143,50 @@ const AddInvestmentType = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
await createInvestmentType(formData).then((response) => {
|
await createInvestmentType(formData).then((response) => {
|
||||||
if (response?.data?.statusCode === 201) {
|
// if (response?.data?.statusCode === 201) {
|
||||||
toast({
|
// toast({
|
||||||
render: () => <ToastBox message={response?.data?.message} />,
|
// render: () => <ToastBox message={response?.data?.message} />,
|
||||||
});
|
// });
|
||||||
|
|
||||||
setIsLoadingBtn(false);
|
// setIsLoadingBtn(false);
|
||||||
navigate("/investment-type");
|
// navigate("/investment-type");
|
||||||
} else {
|
// } else {
|
||||||
|
// toast({
|
||||||
|
// render: () => (
|
||||||
|
// <ToastBox message={"Something Went Wrong"} status={"error"} />
|
||||||
|
// ),
|
||||||
|
// });
|
||||||
|
|
||||||
|
// setIsLoadingBtn(false);
|
||||||
|
// navigate("/investment-type");
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (response?.data) {
|
||||||
toast({
|
toast({
|
||||||
render: () => (
|
render: () => (
|
||||||
<ToastBox message={"Something Went Wrong"} status={"error"} />
|
<ToastBox
|
||||||
|
status={"success"}
|
||||||
|
message={response?.data?.message}
|
||||||
|
/>
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
setAlert(false);
|
||||||
setIsLoadingBtn(false);
|
setIsLoadingBtn(false);
|
||||||
navigate("/investment-type");
|
navigate("/investment-type");
|
||||||
|
} else if (response?.error) {
|
||||||
|
|
||||||
|
toast({
|
||||||
|
render: () => (
|
||||||
|
<ToastBox
|
||||||
|
status={"error"}
|
||||||
|
message={response?.error.data.message}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
});
|
||||||
|
setAlert(false);
|
||||||
|
setIsLoadingBtn(false);
|
||||||
|
|
||||||
|
// navigate("/investment-type");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -314,9 +346,22 @@ const AddInvestmentType = () => {
|
|||||||
<Box {...OPACITY_ON_LOAD} overflowY={"scroll"} height={"100vh"} pb={14}>
|
<Box {...OPACITY_ON_LOAD} overflowY={"scroll"} height={"100vh"} pb={14}>
|
||||||
{/* ===================== [Switch Button] ======================== */}
|
{/* ===================== [Switch Button] ======================== */}
|
||||||
|
|
||||||
<Box display={"flex"} justifyContent={"space-between"} alignItems={"center"} mt={5} px={4} mb={5}>
|
<Box
|
||||||
<Text fontSize={"sm"} mb={0} onClick={() => navigate(-1)} cursor={"pointer"}>
|
display={"flex"}
|
||||||
<ArrowBackIcon fontSize={"xl"} me={2} />Add Details
|
justifyContent={"space-between"}
|
||||||
|
alignItems={"center"}
|
||||||
|
mt={5}
|
||||||
|
px={4}
|
||||||
|
mb={5}
|
||||||
|
>
|
||||||
|
<Text
|
||||||
|
fontSize={"sm"}
|
||||||
|
mb={0}
|
||||||
|
onClick={() => navigate(-1)}
|
||||||
|
cursor={"pointer"}
|
||||||
|
>
|
||||||
|
<ArrowBackIcon fontSize={"xl"} me={2} />
|
||||||
|
Add Details
|
||||||
</Text>
|
</Text>
|
||||||
<SwitchButton isSwitchOn={isSwitchOn} setIsSwitchOn={setIsSwitchOn} />
|
<SwitchButton isSwitchOn={isSwitchOn} setIsSwitchOn={setIsSwitchOn} />
|
||||||
</Box>
|
</Box>
|
||||||
@@ -338,7 +383,11 @@ const AddInvestmentType = () => {
|
|||||||
isOpen={alert}
|
isOpen={alert}
|
||||||
onClose={() => setAlert(false)}
|
onClose={() => setAlert(false)}
|
||||||
alertHandler={handleConfirm}
|
alertHandler={handleConfirm}
|
||||||
message={id ? "Are you sure you want to update this document?" : " Are you sure you want to add this document?"}
|
message={
|
||||||
|
id
|
||||||
|
? "Are you sure you want to update this document?"
|
||||||
|
: " Are you sure you want to add this document?"
|
||||||
|
}
|
||||||
isLoading={isLoadingBtn}
|
isLoading={isLoadingBtn}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
Reference in New Issue
Block a user