Compare commits
4 Commits
Testing
...
Sprint7.1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
28f84b178a | ||
|
|
b518e5fb8b | ||
|
|
5b2efcd292 | ||
|
|
f2023cf7b3 |
@@ -90,9 +90,9 @@ const AddCashDetails = ({ isOpen, onClose, firstField, actionId, setActionId, da
|
||||
toast({
|
||||
render: () => <ToastBox message={res?.error?.data?.message } status={"error"} />,
|
||||
});
|
||||
setAlert(false);
|
||||
}
|
||||
|
||||
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ const IOArtifactsAdd = ({ isOpen, onClose, firstField, actionId, setActionId, da
|
||||
|
||||
<DrawerBody>
|
||||
<Stack spacing={4}>
|
||||
<FormControl isInvalid={errors.artifactName}>
|
||||
<FormControl isInvalid={errors.artifactName} isRequired={true}>
|
||||
<FormLabel fontSize={"sm"}>Artifact Name</FormLabel>
|
||||
<Controller
|
||||
name="artifactName"
|
||||
@@ -166,7 +166,7 @@ const IOArtifactsAdd = ({ isOpen, onClose, firstField, actionId, setActionId, da
|
||||
</FormErrorMessage>
|
||||
</FormControl>
|
||||
|
||||
<FormControl isInvalid={errors.artifactStreamingURL}>
|
||||
<FormControl isInvalid={errors.artifactStreamingURL} isRequired={true}>
|
||||
<FormLabel fontSize={"sm"}>Artifact Streaming URL</FormLabel>
|
||||
<Controller
|
||||
name="artifactStreamingURL"
|
||||
|
||||
@@ -75,7 +75,7 @@ const IOCashDetails = () => {
|
||||
"Update by ",
|
||||
"Update On",
|
||||
];
|
||||
|
||||
|
||||
const handleUpdateStatus = debounce((id) => {
|
||||
setCaseDetails((prevSponser) =>
|
||||
prevSponser.map((sponsor) =>
|
||||
|
||||
@@ -70,7 +70,7 @@ const schema = yup.object().shape({
|
||||
InvestmentDetails: 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"),
|
||||
|
||||
expectedReturn: yup
|
||||
|
||||
@@ -82,12 +82,16 @@ const KeyMeritsEdit = ({
|
||||
meritsDescription: found?.meritsDescription,
|
||||
meritsHeaderArabic: found?.meritsHeaderArabic,
|
||||
meritsDescriptionArabic: found?.meritsDescriptionArabic,
|
||||
iconImage: null,
|
||||
icon_xid: found?.icon_xid,
|
||||
});
|
||||
console.log("==============",found);
|
||||
|
||||
}
|
||||
}, [found, reset]);
|
||||
|
||||
const onSubmit = async (data) => {
|
||||
console.log(data);
|
||||
|
||||
setIsLoading(true);
|
||||
try {
|
||||
const id = actionId;
|
||||
@@ -97,6 +101,9 @@ const KeyMeritsEdit = ({
|
||||
render: () => <ToastBox message={res?.data?.message} />,
|
||||
});
|
||||
handleClose()
|
||||
reset({
|
||||
meritsHeader: "",
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (res?.error?.data?.code === 400) {
|
||||
@@ -106,6 +113,7 @@ const KeyMeritsEdit = ({
|
||||
),
|
||||
});
|
||||
handleClose()
|
||||
reset();
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -288,7 +296,7 @@ const KeyMeritsEdit = ({
|
||||
alt={selectedImageIcon}
|
||||
boxSize="1rem"
|
||||
mr="12px"
|
||||
/>}{" "}
|
||||
/>}
|
||||
<Text as={"span"} fontSize={"sm"} fontWeight={500}>
|
||||
{selectedIcon}
|
||||
</Text>
|
||||
|
||||
@@ -74,6 +74,11 @@ const DistributionInvestor = ({ isOpen, onClose }) => {
|
||||
amount: yup
|
||||
.string()
|
||||
.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(
|
||||
"max",
|
||||
`Distribution amount should not be greater than IO cash amount ${IODetails?.ioCash}`,
|
||||
@@ -86,6 +91,7 @@ const DistributionInvestor = ({ isOpen, onClose }) => {
|
||||
}
|
||||
),
|
||||
});
|
||||
|
||||
|
||||
const investor = yup.object().shape({
|
||||
amount: yup.string().required("Amount is required"),
|
||||
|
||||
@@ -361,7 +361,7 @@ const ViewIOdetails = () => {
|
||||
colorScheme="forestGreen"
|
||||
rounded={"sm"}
|
||||
size={"xs"}
|
||||
>
|
||||
>
|
||||
Edit IO
|
||||
</Button>
|
||||
<FormInputView groupedFields={groupedFields} />
|
||||
|
||||
@@ -216,13 +216,14 @@ const InvestorDetails = () => {
|
||||
as={'span'}
|
||||
fontWeight={"700"}
|
||||
textTransform={"none"}
|
||||
color={item.ioStatus ? "gray.500":item.kycStatus ? "blue.500" : "red.500"}
|
||||
color={item?.KYCStatus === true ? "green" : "yellow.500"}
|
||||
px={2}
|
||||
py={0.5}
|
||||
variant={'solid'}
|
||||
|
||||
>
|
||||
{item.KYCStatus ? "Completed" : "Not complete"}
|
||||
{/* {item.KYCStatus ? "Completed" : "Not complete"} */}
|
||||
{item?.KYCStatus === true ? "Completed" : "Not Completed"}
|
||||
</Text>
|
||||
</Box>
|
||||
),
|
||||
|
||||
@@ -107,23 +107,27 @@ const AddInvestmentType = () => {
|
||||
isActive: isSwitchOn,
|
||||
};
|
||||
await updateInvestmentType({ data: formData, id }).then((response) => {
|
||||
if (response?.data?.statusCode === 200) {
|
||||
if (response?.data) {
|
||||
toast({
|
||||
render: () => <ToastBox message={response?.data?.message} />,
|
||||
render: () => (
|
||||
<ToastBox
|
||||
status={"success"}
|
||||
message={response?.data?.message}
|
||||
/>
|
||||
),
|
||||
});
|
||||
|
||||
setIsLoadingBtn(false);
|
||||
setAlert(false);
|
||||
navigate("/investment-type");
|
||||
} else {
|
||||
} else if (response?.error) {
|
||||
toast({
|
||||
render: () => (
|
||||
<ToastBox message={"Something Went Wrong"} status={"error"} />
|
||||
<ToastBox
|
||||
status={"error"}
|
||||
message={response?.error?.data?.message}
|
||||
/>
|
||||
),
|
||||
});
|
||||
|
||||
setIsLoadingBtn(false);
|
||||
navigate("/investment-type");
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
@@ -139,22 +143,50 @@ const AddInvestmentType = () => {
|
||||
};
|
||||
|
||||
await createInvestmentType(formData).then((response) => {
|
||||
if (response?.data?.statusCode === 201) {
|
||||
toast({
|
||||
render: () => <ToastBox message={response?.data?.message} />,
|
||||
});
|
||||
// if (response?.data?.statusCode === 201) {
|
||||
// toast({
|
||||
// render: () => <ToastBox message={response?.data?.message} />,
|
||||
// });
|
||||
|
||||
setIsLoadingBtn(false);
|
||||
navigate("/investment-type");
|
||||
} else {
|
||||
// setIsLoadingBtn(false);
|
||||
// navigate("/investment-type");
|
||||
// } else {
|
||||
// toast({
|
||||
// render: () => (
|
||||
// <ToastBox message={"Something Went Wrong"} status={"error"} />
|
||||
// ),
|
||||
// });
|
||||
|
||||
// setIsLoadingBtn(false);
|
||||
// navigate("/investment-type");
|
||||
// }
|
||||
|
||||
if (response?.data) {
|
||||
toast({
|
||||
render: () => (
|
||||
<ToastBox message={"Something Went Wrong"} status={"error"} />
|
||||
<ToastBox
|
||||
status={"success"}
|
||||
message={response?.data?.message}
|
||||
/>
|
||||
),
|
||||
});
|
||||
|
||||
setAlert(false);
|
||||
setIsLoadingBtn(false);
|
||||
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) {
|
||||
@@ -314,9 +346,22 @@ const AddInvestmentType = () => {
|
||||
<Box {...OPACITY_ON_LOAD} overflowY={"scroll"} height={"100vh"} pb={14}>
|
||||
{/* ===================== [Switch Button] ======================== */}
|
||||
|
||||
<Box display={"flex"} 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
|
||||
<Box
|
||||
display={"flex"}
|
||||
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>
|
||||
<SwitchButton isSwitchOn={isSwitchOn} setIsSwitchOn={setIsSwitchOn} />
|
||||
</Box>
|
||||
@@ -338,7 +383,11 @@ const AddInvestmentType = () => {
|
||||
isOpen={alert}
|
||||
onClose={() => setAlert(false)}
|
||||
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}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user