update bug
This commit is contained in:
@@ -1,19 +1,21 @@
|
||||
import React from "react";
|
||||
import './FullscreenLoaders.css'
|
||||
import { Spinner } from "@chakra-ui/react";
|
||||
|
||||
const Loader01 = () => {
|
||||
return (
|
||||
|
||||
<div className="dot-spinner">
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
</div>
|
||||
// <div className="dot-spinner">
|
||||
// <div className="dot-spinner__dot"></div>
|
||||
// <div className="dot-spinner__dot"></div>
|
||||
// <div className="dot-spinner__dot"></div>
|
||||
// <div className="dot-spinner__dot"></div>
|
||||
// <div className="dot-spinner__dot"></div>
|
||||
// <div className="dot-spinner__dot"></div>
|
||||
// <div className="dot-spinner__dot"></div>
|
||||
// <div className="dot-spinner__dot"></div>
|
||||
// </div>
|
||||
<Spinner color='green.900' />
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -231,14 +231,14 @@ const DashboardLayout = ({ isOnline }) => {
|
||||
return (
|
||||
<span className="d-flex align-items-end gap-2">
|
||||
<RiMoneyDollarBoxLine className="h4 m-0 fw-normal" />
|
||||
Deposit pending request
|
||||
Deposit Pending Request
|
||||
</span>
|
||||
);
|
||||
case path.startsWith("/deposit-history"):
|
||||
return (
|
||||
<span className="d-flex align-items-end gap-2">
|
||||
<RiExchangeBoxLine className="h4 m-0 fw-normal" />
|
||||
Deposite request
|
||||
Deposite Request
|
||||
</span>
|
||||
);
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ const InvestorComment = ({ isOpen, onClose }) => {
|
||||
fontSize="sm"
|
||||
type="textarea"
|
||||
size="md"
|
||||
placeholder={"Enter your comments...."}
|
||||
placeholder={"Enter your comment...."}
|
||||
rounded={"md"}
|
||||
resize={"none"}
|
||||
/>
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
Button,
|
||||
FormControl,
|
||||
FormErrorMessage,
|
||||
FormHelperText,
|
||||
FormLabel,
|
||||
Input,
|
||||
Modal,
|
||||
@@ -35,7 +36,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().notRequired(),
|
||||
comment: yup.string().notRequired() .max(200, "Approve Comment cannot be more than 200 characters"),
|
||||
supporting_FileName: yup.mixed().required("File is required"),
|
||||
// .test("fileType", "Unsupported File Format", (value) => {
|
||||
// return value && FILE_TYPES.includes(value.type);
|
||||
@@ -192,7 +193,7 @@ const DepositRequestApprove = ({
|
||||
)}
|
||||
</FormControl>
|
||||
<FormControl mb={4}>
|
||||
<FormLabel fontSize="sm">Comments</FormLabel>
|
||||
<FormLabel fontSize="sm">Comment</FormLabel>
|
||||
<Textarea
|
||||
rows={5}
|
||||
focusBorderColor="green.400"
|
||||
@@ -201,14 +202,19 @@ const DepositRequestApprove = ({
|
||||
fontSize="sm"
|
||||
type="textarea"
|
||||
size="sm"
|
||||
placeholder={"Enter your comments...."}
|
||||
placeholder={"Enter your comment...."}
|
||||
resize={"none"}
|
||||
maxLength={200}
|
||||
/>
|
||||
{errors.comment && (
|
||||
<Text fontSize="xs" color="red">
|
||||
{errors.comment.message}
|
||||
</Text>
|
||||
)}
|
||||
<FormHelperText fontSize="xs" color="gray.500">
|
||||
<Box as="span" me={1}>Maximum length should be 200 characters. You have entered </Box>
|
||||
{watch("comment")?.length || 0} characters.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
|
||||
@@ -2,6 +2,7 @@ import {
|
||||
Box,
|
||||
Button,
|
||||
FormControl,
|
||||
FormHelperText,
|
||||
FormLabel,
|
||||
Input,
|
||||
Modal,
|
||||
@@ -24,7 +25,8 @@ import { useDepositRejectMutation } from "../../../Services/deposit.request.serv
|
||||
import ToastBox from "../../../Components/ToastBox";
|
||||
|
||||
export const conformModalSchema = yup.object().shape({
|
||||
comments: yup.string().required("Comment is required"),
|
||||
comments: yup.string().required("Comment is required")
|
||||
.max(200, "Approve Comment cannot be more than 200 characters"),
|
||||
});
|
||||
|
||||
const DepositRequestReject = ({ isOpen, onClose, firstField ,id}) => {
|
||||
@@ -35,6 +37,7 @@ const DepositRequestReject = ({ isOpen, onClose, firstField ,id}) => {
|
||||
const {
|
||||
register,
|
||||
reset,
|
||||
watch,
|
||||
handleSubmit,
|
||||
formState: { errors },
|
||||
} = useForm({
|
||||
@@ -121,15 +124,20 @@ const DepositRequestReject = ({ isOpen, onClose, firstField ,id}) => {
|
||||
fontSize="sm"
|
||||
type="textarea"
|
||||
size="md"
|
||||
placeholder={"Enter your comments...."}
|
||||
placeholder={"Enter your comment...."}
|
||||
rounded={"md"}
|
||||
resize={"none"}
|
||||
maxLength={200}
|
||||
/>
|
||||
{errors.comments && (
|
||||
<Text fontSize="xs" color="red">
|
||||
{errors.comments.message}
|
||||
</Text>
|
||||
)}
|
||||
<FormHelperText fontSize="xs" color="gray.500">
|
||||
<Box as="span" me={1}>Maximum length should be 200 characters. You have entered </Box>
|
||||
{watch("comments")?.length || 0} characters.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
</ModalBody>
|
||||
<ModalFooter>
|
||||
|
||||
@@ -45,7 +45,7 @@ const validationSchema = Yup.object().shape({
|
||||
.typeError("Transaction amount must be a number") // Custom error message if it's not a number
|
||||
.positive("Transaction amount must be greater than zero"),
|
||||
spportFile_path: Yup.mixed().required("Support file is required"),
|
||||
makerComment: Yup.string(),
|
||||
makerComment: Yup.string() .max(200, "Approve Comment cannot be more than 50 characters"),
|
||||
});
|
||||
|
||||
const CreateRequest = () => {
|
||||
@@ -62,6 +62,7 @@ const CreateRequest = () => {
|
||||
const {
|
||||
control,
|
||||
register,
|
||||
watch,
|
||||
handleSubmit,
|
||||
setValue,
|
||||
reset,
|
||||
@@ -393,6 +394,7 @@ const CreateRequest = () => {
|
||||
rounded={"sm"}
|
||||
placeholder={"Description"}
|
||||
{...register("makerComment")}
|
||||
maxLength={200}
|
||||
/>
|
||||
<FormHelperText
|
||||
fontSize={"xs"}
|
||||
@@ -401,6 +403,12 @@ const CreateRequest = () => {
|
||||
>
|
||||
{errors.makerComment?.message}
|
||||
</FormHelperText>
|
||||
<FormHelperText fontSize="xs" color="gray.500">
|
||||
<Box as="span" me={1}>
|
||||
Maximum length should be 200 characters. You have entered
|
||||
</Box>
|
||||
{watch("makerComment")?.length || 0} characters.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
{/* Submit Button */}
|
||||
|
||||
@@ -116,7 +116,7 @@ const IOArtifacts = ({ enableNextTab, index, data }) => {
|
||||
setDeleteAlertVideo(false);
|
||||
setIsLoadingBtn(false);
|
||||
toast({
|
||||
render: () => <ToastBox message={res?.data?.message} status="error" />,
|
||||
render: () => <ToastBox message={res?.data?.message} status="success" />,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -134,7 +134,7 @@ const IOArtifacts = ({ enableNextTab, index, data }) => {
|
||||
setDeleteAlertImage(false);
|
||||
setIsLoadingBtn(false);
|
||||
toast({
|
||||
render: () => <ToastBox message={res?.data?.message} status="error" />,
|
||||
render: () => <ToastBox message={res?.data?.message} status="success" />,
|
||||
});
|
||||
|
||||
}
|
||||
@@ -372,7 +372,7 @@ const sortedDataVideo = [...(IObyID?.data?.artifactsVideo || [])]?.sort(
|
||||
Manage IO Images
|
||||
</Box>
|
||||
<HStack>
|
||||
|
||||
|
||||
|
||||
{IObyID?.data?.artifactsImage?.length !== 0 &&<SetDisplayOrderIOArtifactsImages data={sortedDataImage} />}
|
||||
<Button
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
DrawerOverlay,
|
||||
FormControl,
|
||||
FormErrorMessage,
|
||||
FormHelperText,
|
||||
FormLabel,
|
||||
Input,
|
||||
Stack,
|
||||
@@ -26,7 +27,8 @@ import { useParams } from "react-router-dom";
|
||||
import ToastBox from "../../../Components/ToastBox";
|
||||
|
||||
const investmentVideoSchema = yup.object().shape({
|
||||
artifactName: yup.string().required("Artifact name is required"),
|
||||
artifactName: yup.string().required("Artifact name is required")
|
||||
.max(50, "Approve Comment cannot be more than 50 characters"),
|
||||
artifactStreamingURL: yup.string()
|
||||
.required("Artifact streaming URL is required")
|
||||
.url("Invalid URL format"),
|
||||
@@ -158,12 +160,16 @@ const IOArtifactsAdd = ({ isOpen, onClose, firstField, actionId, setActionId, da
|
||||
name="artifactName"
|
||||
control={control}
|
||||
render={({ field }) => (
|
||||
<Input {...field} fontSize={"sm"} type="text" size={"sm"} />
|
||||
<Input {...field} fontSize={"sm"} type="text" size={"sm"} maxLength={50} />
|
||||
)}
|
||||
/>
|
||||
<FormErrorMessage fontSize={"xs"} fontWeight={500}>
|
||||
{errors.artifactName?.message}
|
||||
</FormErrorMessage>
|
||||
<FormHelperText fontSize="xs" color="gray.500">
|
||||
<Box as="span" me={1}>Maximum length should be 50 characters. You have entered </Box>
|
||||
{watch("artifactName")?.length || 0} characters.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
<FormControl isInvalid={errors.artifactStreamingURL} isRequired>
|
||||
@@ -211,7 +217,7 @@ const IOArtifactsAdd = ({ isOpen, onClose, firstField, actionId, setActionId, da
|
||||
isOpen={alert}
|
||||
onClose={() => setAlert(false)}
|
||||
alertHandler={handleSave}
|
||||
message={"Are you sure you want to add this artifact?"}
|
||||
message={"Are you sure you want to update this artifact?"}
|
||||
isLoading={isLoading}
|
||||
/>
|
||||
</>
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
DrawerOverlay,
|
||||
FormControl,
|
||||
FormErrorMessage,
|
||||
FormHelperText,
|
||||
FormLabel,
|
||||
Input,
|
||||
Select,
|
||||
@@ -33,7 +34,8 @@ const cashDetails = yup.object().shape({
|
||||
transactionDate: yup.string().required("Date is required"),
|
||||
ioTransType_xid: yup.number().required("Cash transaction is required"),
|
||||
transactionAmount: yup.number().required("Transaction Amount is required"),
|
||||
comments: yup.string().notRequired(),
|
||||
comments: yup.string().notRequired()
|
||||
.max(200, "Approve Comment cannot be more than 200 characters"),
|
||||
});
|
||||
|
||||
const AddCaseDetails = ({ isOpen, onClose, firstField, actionId, setActionId, data, setActiveTab }) => {
|
||||
@@ -199,18 +201,23 @@ const AddCaseDetails = ({ isOpen, onClose, firstField, actionId, setActionId, da
|
||||
|
||||
|
||||
<FormControl isInvalid={errors.comments}>
|
||||
<FormLabel fontSize={"sm"}>Comments</FormLabel>
|
||||
<FormLabel fontSize={"sm"}>Comment</FormLabel>
|
||||
<Controller
|
||||
name="comments"
|
||||
control={control}
|
||||
control={control}
|
||||
render={({ field }) => (
|
||||
<Textarea {...field} textAlign={'left'}
|
||||
<Textarea {...field} textAlign={'left'}
|
||||
maxLength={200}
|
||||
focusBorderColor="forestGreen.300" fontSize={"sm"} type="text" size={"sm"} />
|
||||
)}
|
||||
/>
|
||||
<FormErrorMessage fontSize={"xs"} fontWeight={500}>
|
||||
{errors.comments?.message}
|
||||
</FormErrorMessage>
|
||||
<FormHelperText fontSize="xs" color="gray.500">
|
||||
<Box as="span" me={1}>Maximum length should be 200 characters. You have entered </Box>
|
||||
{watch("comments")?.length || 0} characters.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
</Stack>
|
||||
|
||||
@@ -82,11 +82,11 @@ const Approved = () => {
|
||||
|
||||
const tableHeadRow = [
|
||||
"Sr No.",
|
||||
"Transaction date",
|
||||
"Transaction Date",
|
||||
"Transaction Type",
|
||||
"Amount",
|
||||
"Comments",
|
||||
"Update by",
|
||||
"Update By",
|
||||
"Update On",
|
||||
];
|
||||
|
||||
@@ -97,7 +97,7 @@ const Approved = () => {
|
||||
{index + 1}.
|
||||
</Text>
|
||||
),
|
||||
"Transaction date": (
|
||||
"Transaction Date": (
|
||||
<Text as={"span"} color={"gray.600"} fontWeight={"500"}>
|
||||
{formatDate(item?.transactionDate)}
|
||||
</Text>
|
||||
@@ -123,7 +123,7 @@ const Approved = () => {
|
||||
{item?.comments ? item?.comments : "---"}
|
||||
</Text>
|
||||
),
|
||||
"Update by": (
|
||||
"Update By": (
|
||||
<Text
|
||||
w={"100px"}
|
||||
as={"span"}
|
||||
|
||||
@@ -84,10 +84,10 @@ const IOCashDetails = () => {
|
||||
borderBottom: "2px solid #38a169",
|
||||
}}
|
||||
>
|
||||
Pending{" "}
|
||||
Pending
|
||||
{IODetails?.ioCashStatusHistory?.Pending.length > 0 && (
|
||||
<Badge rounded={"sm"} colorScheme="forestGreen" ms={2}>
|
||||
{IODetails?.ioCashStatusHistory?.Pending.length || 0}
|
||||
{IODetails?.ioCashStatusHistory?.Pending.length !== 0 && IODetails?.ioCashStatusHistory?.Pending.length}
|
||||
</Badge>
|
||||
)}
|
||||
{/* <Badge rounded={"sm"} colorScheme="forestGreen" ms={2}>
|
||||
|
||||
@@ -98,11 +98,11 @@ const Pending = () => {
|
||||
|
||||
const tableHeadRow = [
|
||||
"Sr No.",
|
||||
"Transaction date",
|
||||
"Transaction Date",
|
||||
"Transaction Type",
|
||||
"Amount",
|
||||
"Comments",
|
||||
"Update by",
|
||||
"Update By",
|
||||
"Update On",
|
||||
...(localStorage?.getItem('role')!=="Maker" ? ["Actions"] : []),
|
||||
|
||||
@@ -115,7 +115,7 @@ const Pending = () => {
|
||||
{index + 1}.
|
||||
</Text>
|
||||
),
|
||||
"Transaction date": (
|
||||
"Transaction Date": (
|
||||
<Text as={"span"} color={"gray.600"} fontWeight={"500"}>
|
||||
{formatDate(item?.transactionDate)}
|
||||
</Text>
|
||||
@@ -141,7 +141,7 @@ const Pending = () => {
|
||||
{item?.comments}
|
||||
</Text>
|
||||
),
|
||||
"Update by": (
|
||||
"Update By": (
|
||||
<Text
|
||||
w={"100px"}
|
||||
as={"span"}
|
||||
|
||||
@@ -77,11 +77,11 @@ import AddCaseDetails from "./AddCaseDetails";
|
||||
|
||||
const tableHeadRow = [
|
||||
"Sr No.",
|
||||
"Transaction date",
|
||||
"Transaction Date",
|
||||
"Transaction Type",
|
||||
"Amount",
|
||||
"Comments",
|
||||
"Update by",
|
||||
"Update By",
|
||||
"Update On",
|
||||
];
|
||||
|
||||
@@ -96,7 +96,7 @@ import AddCaseDetails from "./AddCaseDetails";
|
||||
{index + 1}.
|
||||
</Text>
|
||||
),
|
||||
"Transaction date": (
|
||||
"Transaction Date": (
|
||||
<Text
|
||||
as={"span"}
|
||||
color={"gray.600"}
|
||||
@@ -135,7 +135,7 @@ import AddCaseDetails from "./AddCaseDetails";
|
||||
{item?.comments}
|
||||
</Text>
|
||||
),
|
||||
"Update by": (
|
||||
"Update By": (
|
||||
<Text
|
||||
w={"100px"}
|
||||
as={"span"}
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
DrawerOverlay,
|
||||
FormControl,
|
||||
FormErrorMessage,
|
||||
FormHelperText,
|
||||
FormLabel,
|
||||
HStack,
|
||||
Input,
|
||||
@@ -36,7 +37,8 @@ import { formatDatee } from "../../../../Components/FormField";
|
||||
const ioNav = yup.object().shape({
|
||||
transactionDate: yup.string().required("Date is required"),
|
||||
transactionAmount: yup.number().required("New NAV is required"),
|
||||
comments: yup.string().notRequired(),
|
||||
comments: yup.string().notRequired()
|
||||
.max(200, "Approve Comment cannot be more than 200 characters"),
|
||||
});
|
||||
|
||||
const AddNavDetails = ({ isOpen, onClose, firstField, actionId, setActionId, data }) => {
|
||||
@@ -204,17 +206,21 @@ console.log(calculatePercentage(1092500, 976070));
|
||||
|
||||
|
||||
<FormControl isInvalid={errors.comments}>
|
||||
<FormLabel fontSize={"sm"}>Comments</FormLabel>
|
||||
<FormLabel fontSize={"sm"}>Comment</FormLabel>
|
||||
<Controller
|
||||
name="comments"
|
||||
control={control}
|
||||
render={({ field }) => (
|
||||
<Textarea {...field} fontSize={"sm"} type="text" size={"sm"} />
|
||||
<Textarea {...field} maxLength={200} fontSize={"sm"} type="text" size={"sm"} />
|
||||
)}
|
||||
/>
|
||||
<FormErrorMessage fontSize={"xs"} fontWeight={500}>
|
||||
{errors.comments?.message}
|
||||
</FormErrorMessage>
|
||||
<FormHelperText fontSize="xs" color="gray.500">
|
||||
<Box as="span" me={1}>Maximum length should be 200 characters. You have entered </Box>
|
||||
{watch("comments")?.length || 0} characters.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
</Stack>
|
||||
|
||||
@@ -363,7 +363,7 @@ const InvestmentDocument = ({ control, errors, enableNextTab, index, }) => {
|
||||
<CustomAlertDialog
|
||||
onClose={() => setDeleteAlert(false)}
|
||||
isOpen={deleteAlert}
|
||||
message="Are you sure you want to delete the sponsor?"
|
||||
message="Are you sure you want to delete the Investment?"
|
||||
alertHandler={handleDelete}
|
||||
isLoading={isLoading}
|
||||
/>
|
||||
|
||||
@@ -103,16 +103,16 @@ const Investors = ({ data }) => {
|
||||
// Table setup
|
||||
const tableHeadRow = [
|
||||
"Client ID",
|
||||
"First name",
|
||||
"Last name",
|
||||
"Investment amount",
|
||||
"First Name",
|
||||
"Last Name",
|
||||
"Investment Amount",
|
||||
"Percentage",
|
||||
"Market Value",
|
||||
"Return on Investment",
|
||||
"Distribution",
|
||||
"Distribution Percent",
|
||||
"Total Return",
|
||||
"Total return on Investment",
|
||||
"Total Return on Investment",
|
||||
];
|
||||
|
||||
const handleUpdateStatus = debounce((id) => {
|
||||
@@ -164,7 +164,7 @@ const Investors = ({ data }) => {
|
||||
"Distribution": parseFloat(item?.Distribution_Amt) || 0, // Convert to float
|
||||
"Distribution Percent": parseFloat(item?.Distribution_Per) || 0, // Convert to float
|
||||
"Total Return": parseFloat(item?.Total_Return) || 0, // Convert to float
|
||||
"Total return on Investment": parseFloat(item?.Total_Return_On_Investment) || 0, // Convert to float
|
||||
"Total Return on Investment": parseFloat(item?.Total_Return_On_Investment) || 0, // Convert to float
|
||||
}));
|
||||
|
||||
console.log(exportInvestorDetails);
|
||||
|
||||
@@ -89,7 +89,7 @@ const KeyMerits = ({ enableNextTab, index, data: prepopData }) => {
|
||||
const res = await deleteKeyMerits(actionId);
|
||||
if (res?.data?.statusCode === 200) {
|
||||
toast({
|
||||
render: () => <ToastBox message={res?.data?.message} />,
|
||||
render: () => <ToastBox message={res?.data?.message} status={"success"} />,
|
||||
});
|
||||
setIsBtnLoading(false);
|
||||
setDeleteAlert(false);
|
||||
|
||||
@@ -297,7 +297,7 @@ const InvestmentEdit = ({ isOpen, onClose, thirdField, id, data }) => {
|
||||
onClose={() => setAlert(false)}
|
||||
alertHandler={handleConfirm}
|
||||
isLoading={isLoading}
|
||||
message="Are you sure you want to add this document?"
|
||||
message="Are you sure you want to add this Investment?"
|
||||
/>
|
||||
</Drawer>
|
||||
);
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
DrawerOverlay,
|
||||
FormControl,
|
||||
FormErrorMessage,
|
||||
FormHelperText,
|
||||
FormLabel,
|
||||
Icon,
|
||||
Image,
|
||||
@@ -35,7 +36,7 @@ import { IoMdRemoveCircleOutline } from "react-icons/io";
|
||||
|
||||
const investmentImageSchema = yup.object().shape({
|
||||
artifactName: yup.string().required("Artifact image name is required")
|
||||
.max(25, "File name must be at most 25 characters"),
|
||||
.max(50, "Approve Comment cannot be more than 50 characters"),
|
||||
artifactPathName: yup.mixed().required("Artifact image is required"),
|
||||
});
|
||||
|
||||
@@ -226,19 +227,24 @@ const IOArtifactsAdd = ({
|
||||
<Controller
|
||||
name="artifactName"
|
||||
control={control}
|
||||
// maxLength={50}
|
||||
render={({ field }) => (
|
||||
<Input
|
||||
{...field}
|
||||
fontSize={"sm"}
|
||||
type="text"
|
||||
size={"sm"}
|
||||
maxLength={25}
|
||||
maxLength={50}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
/>
|
||||
<FormErrorMessage fontSize={"xs"} fontWeight={500}>
|
||||
{errors.artifactName?.message}
|
||||
</FormErrorMessage>
|
||||
<FormHelperText fontSize="xs" color="gray.500">
|
||||
<Box as="span" me={1}>Maximum length should be 50 characters. You have entered </Box>
|
||||
{watch("artifactName")?.length || 0} characters.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
<FormControl
|
||||
@@ -354,7 +360,7 @@ const IOArtifactsAdd = ({
|
||||
isOpen={alert}
|
||||
onClose={handleAlertClose}
|
||||
alertHandler={handleSave}
|
||||
message={"Are you sure you want to add this artifact?"}
|
||||
message={"Are you sure you want to update this artifact?"}
|
||||
isLoading={loading}
|
||||
/>
|
||||
</>
|
||||
|
||||
@@ -60,7 +60,7 @@ export const investmentDocSchema = yup.object().shape({
|
||||
// return value && value.size <= 2 * 1024 * 1024; // 2MB in bytes
|
||||
// })
|
||||
fileName: yup.string().required("File name is required")
|
||||
.max(25, "File name must be at most 25 characters"), // Maximum length validation,
|
||||
.max(30, "File name must be at most 30 characters"), // Maximum length validation,
|
||||
documentNameArabic: yup.string().required("File name Arabic is required")
|
||||
.max(25, "File name must be at most 30 characters"),
|
||||
});
|
||||
@@ -91,6 +91,7 @@ const InvestmentDocuments = ({
|
||||
const {
|
||||
register,
|
||||
handleSubmit,
|
||||
watch,
|
||||
reset,
|
||||
formState: { errors },
|
||||
} = useForm({
|
||||
@@ -210,13 +211,17 @@ const InvestmentDocuments = ({
|
||||
fontSize="sm"
|
||||
type="text"
|
||||
size="sm"
|
||||
maxLength={25} // Maximum length constraint in the input field
|
||||
maxLength={30} // Maximum length constraint in the input field
|
||||
/>
|
||||
{errors.fileName && (
|
||||
<Text mt={1} fontSize="xs" fontWeight={500} color="red">
|
||||
{errors.fileName.message}
|
||||
</Text>
|
||||
)}
|
||||
<FormHelperText fontSize="xs" color="gray.500">
|
||||
<Box as="span" me={1}>Maximum length should be 30 characters. You have entered </Box>
|
||||
{watch("fileName")?.length || 0} characters.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
|
||||
@@ -229,13 +234,17 @@ const InvestmentDocuments = ({
|
||||
type="text"
|
||||
size="sm"
|
||||
textAlign={'right'}
|
||||
maxLength={30} // Maximum length constraint in the input field
|
||||
maxLength={35} // Maximum length constraint in the input field
|
||||
/>
|
||||
{errors.documentNameArabic && (
|
||||
<Text mt={1} fontSize="xs" fontWeight={500} color="red">
|
||||
{errors.documentNameArabic.message}
|
||||
</Text>
|
||||
)}
|
||||
<FormHelperText fontSize="xs" color="gray.500">
|
||||
<Box as="span" me={1}>Maximum length should be 35 characters. You have entered </Box>
|
||||
{watch("documentNameArabic")?.length || 0} characters.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
|
||||
|
||||
|
||||
@@ -360,7 +360,7 @@ const KeyMeritsAdd = ({ isOpen, onClose, firstField, id, icons }) => {
|
||||
onClose={handleClose}
|
||||
// alertHandler={handleSave}
|
||||
alertHandler={handleConfirm}
|
||||
message={"Are you sure you want to add this key merit?"}
|
||||
message={"Are you sure you want to add this key merits?"}
|
||||
isLoading={isLoading}
|
||||
/>
|
||||
</>
|
||||
|
||||
@@ -367,7 +367,7 @@ const KeyMeritsEdit = ({
|
||||
isOpen={alert}
|
||||
onClose={() => setAlert(false)}
|
||||
alertHandler={handleSave}
|
||||
message={"Are you sure you want to add this key merit?"}
|
||||
message={"Are you sure you want to update this key merits?"}
|
||||
isLoading={isLoading}
|
||||
/>
|
||||
</>
|
||||
|
||||
@@ -24,7 +24,7 @@ export const addInvestmentType = yup.object().shape({
|
||||
.string()
|
||||
.required("Investment type is required")
|
||||
.max(50, "Investment name cannot be more than 50 characters"),
|
||||
note: yup.string().optional().max(255, "Note cannot exceed 255 characters"),
|
||||
// note: yup.string().optional().max(255, "Note cannot exceed 255 characters"),
|
||||
investmentTypeNameArabic: yup
|
||||
.string()
|
||||
.required("Investment type in required"),
|
||||
@@ -199,7 +199,7 @@ const AddInvestmentType = () => {
|
||||
placeHolder: " ",
|
||||
name: "note",
|
||||
type: "textarea",
|
||||
// isRequired: true,
|
||||
isRequired: false,
|
||||
section: "",
|
||||
maxLength: 255,
|
||||
helperText: `Maximum length should be 255 characters. You have entered ${
|
||||
@@ -211,7 +211,7 @@ const AddInvestmentType = () => {
|
||||
placeHolder: " ",
|
||||
name: "noteArabic",
|
||||
type: "textarea",
|
||||
// isRequired: true,
|
||||
isRequired: false,
|
||||
arabic: true,
|
||||
section: "",
|
||||
maxLength: 255,
|
||||
@@ -254,7 +254,7 @@ const AddInvestmentType = () => {
|
||||
placeHolder: " ",
|
||||
name: "note",
|
||||
type: "textarea",
|
||||
// isRequired: true,
|
||||
isRequired: false,
|
||||
section: "",
|
||||
maxLength: 255,
|
||||
helperText: `Maximum length should be 255 characters. You have entered ${
|
||||
@@ -266,7 +266,7 @@ const AddInvestmentType = () => {
|
||||
placeHolder: " ",
|
||||
name: "noteArabic",
|
||||
type: "textarea",
|
||||
// isRequired: true,
|
||||
isRequired: false,
|
||||
arabic: true,
|
||||
section: "",
|
||||
maxLength: 255,
|
||||
@@ -338,7 +338,7 @@ 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 Investment Type?" : " Are you sure you want to add this Investment Type?"}
|
||||
isLoading={isLoadingBtn}
|
||||
/>
|
||||
</Box>
|
||||
|
||||
@@ -232,16 +232,49 @@ const InvestmentType = () => {
|
||||
|
||||
// ==================== [Delete Function] =======================
|
||||
|
||||
// const handleDelete = async () => {
|
||||
// console.log(actionId);
|
||||
// setIsLoading(true);
|
||||
// try {
|
||||
// const response = await deleteInvestmentType(actionId);
|
||||
// console.log(response);
|
||||
// setIsLoading(false);
|
||||
// setDeleteAlert(false);
|
||||
// } catch (error) {}
|
||||
// };
|
||||
|
||||
const handleDelete = async () => {
|
||||
console.log(actionId);
|
||||
setIsLoading(true);
|
||||
try {
|
||||
const response = await deleteInvestmentType(actionId);
|
||||
console.log(response);
|
||||
console.log(response?.data);
|
||||
|
||||
if (response?.error?.data?.code === 400) {
|
||||
toast({
|
||||
render: () => (
|
||||
<ToastBox message={response?.error?.data?.message} status="error" />
|
||||
),
|
||||
});
|
||||
} else if (
|
||||
response?.data?.statusCode === 201 ||
|
||||
response?.data?.statusCode === 200
|
||||
) {
|
||||
toast({
|
||||
render: () => (
|
||||
<ToastBox message={response?.data?.message} status="success" />
|
||||
),
|
||||
});
|
||||
}
|
||||
setIsLoading(false);
|
||||
setDeleteAlert(false);
|
||||
} catch (error) {}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
setIsLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<Box {...OPACITY_ON_LOAD} overflowY={"scroll"} height={"100vh"} pb={38}>
|
||||
@@ -315,7 +348,7 @@ const InvestmentType = () => {
|
||||
<CustomAlertDialog
|
||||
onClose={() => setDeleteAlert(false)}
|
||||
isOpen={deleteAlert}
|
||||
message={"Are you sure you want to delete sponers?"}
|
||||
message={"Are you sure you want to delete Investment Type?"}
|
||||
alertHandler={handleDelete}
|
||||
isLoading={isLoading}
|
||||
/>
|
||||
|
||||
@@ -187,13 +187,13 @@ const Sponser = () => {
|
||||
console.log(response?.data);
|
||||
if(response?.error?.data?.code === 400){
|
||||
toast({
|
||||
render: () => <ToastBox message={response?.error?.data?.message} status={'warn'} />,
|
||||
render: () => <ToastBox message={response?.error?.data?.message} status={'error'} />,
|
||||
});
|
||||
setIsLoading(false);
|
||||
setDeleteAlert(false);
|
||||
} else if(response?.data?.statusCode === 201 || response?.data?.statusCode === 200){
|
||||
toast({
|
||||
render: () => <ToastBox message={response?.data?.message} status={'error'} />,
|
||||
render: () => <ToastBox message={response?.data?.message} status={'success'} />,
|
||||
});
|
||||
setIsLoading(false);
|
||||
setDeleteAlert(false);
|
||||
@@ -201,7 +201,7 @@ const Sponser = () => {
|
||||
}
|
||||
} catch (error) {}
|
||||
};
|
||||
|
||||
|
||||
console.log(isSponserLoading);
|
||||
|
||||
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
import { Box, Image, Spinner, Text } from '@chakra-ui/react'
|
||||
import React from 'react'
|
||||
import logo from '../assets/logo2.png'
|
||||
import { Box, Image, Spinner, Text } from "@chakra-ui/react";
|
||||
import React from "react";
|
||||
import logo from "../assets/logo2.png";
|
||||
|
||||
const SplashScreen = () => {
|
||||
return (
|
||||
<Box
|
||||
h={'100vh'}
|
||||
display={'flex'}
|
||||
justifyContent={'center'}
|
||||
alignItems={'center'}
|
||||
flexDirection={'column'}
|
||||
gap={10}
|
||||
h={"100vh"}
|
||||
display={"flex"}
|
||||
justifyContent={"center"}
|
||||
alignItems={"center"}
|
||||
flexDirection={"column"}
|
||||
gap={10}
|
||||
>
|
||||
<Image src={logo} />
|
||||
{/* <Spinner color='green.900' size='md' /> */}
|
||||
<div className="dot-spinner">
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
</div>
|
||||
<Image src={logo} />
|
||||
<Spinner color='green.900' size='md' />
|
||||
{/* <div className="dot-spinner">
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
<div className="dot-spinner__dot"></div>
|
||||
</div> */}
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
export default SplashScreen
|
||||
export default SplashScreen;
|
||||
|
||||
@@ -113,7 +113,7 @@ import { useDepositRejectMutation } from "../../../Services/drawal.request.servi
|
||||
)}
|
||||
<FormHelperText fontSize="xs" color="gray.500">
|
||||
<Text as={"span"} me={1}>Maximum length should be 200 characters. You have entered</Text>
|
||||
{watch("checkerComment")?.length || 0} characters.
|
||||
{watch("comments")?.length || 0} characters.
|
||||
</FormHelperText>
|
||||
</FormControl>
|
||||
</ModalBody>
|
||||
|
||||
Reference in New Issue
Block a user