-
-
-
-
+
+
);
};
diff --git a/src/Pages/Deposit/DepositRequest/DepositRequest.jsx b/src/Pages/Deposit/DepositRequest/DepositRequest.jsx
index e22c959..0490be4 100644
--- a/src/Pages/Deposit/DepositRequest/DepositRequest.jsx
+++ b/src/Pages/Deposit/DepositRequest/DepositRequest.jsx
@@ -328,6 +328,7 @@ const DepositRequest = () => {
isLoading={isLoading}
/>
{
+const DepositRequestApprove = ({ isOpen, onClose, firstField, id, data:requestData }) => {
const toast = useToast()
const [file, setFile] = useState();
const [isBtnLoading , setIsBtnLoading] = useState(false)
+ const fileredData = requestData?.find((item)=> item?.id === id)
+ console.log(fileredData);
+
+
+
const [ updateDepositRequest ] = useUpdateDepositRequestMutation()
const {
@@ -51,6 +56,18 @@ const DepositRequestApprove = ({ isOpen, onClose, firstField, id }) => {
resolver: yupResolver(conformModalSchema),
});
+ useEffect(() => {
+ reset({
+ investorAmount:fileredData?.investorAmount
+ })
+
+
+ }, [requestData, id])
+
+
+
+
+
const onSubmit = async(data) => {
setIsBtnLoading(true)
const formData = new FormData();
diff --git a/src/Pages/IO_Management/CreateIO/CreateIO.jsx b/src/Pages/IO_Management/CreateIO/CreateIO.jsx
index c7e223b..9d0ca4c 100644
--- a/src/Pages/IO_Management/CreateIO/CreateIO.jsx
+++ b/src/Pages/IO_Management/CreateIO/CreateIO.jsx
@@ -91,7 +91,9 @@ const CreateIO = () => {
height={"100vh"}
pb={10}
>
- {id &&
+ {id &&
{/* navigate(-1)}
style={{ fontSize: "15px", cursor: "pointer" }}
@@ -104,6 +106,8 @@ const CreateIO = () => {
index={activeIndex}
onChange={(index) => setActiveIndex(index)}
mt={2}
+ ps={1}
+ pe={2}
>
{tabs?.map(({ label, isDisabled }, index) => (
diff --git a/src/Pages/IO_Management/CreateIO/IOArtifacts.jsx b/src/Pages/IO_Management/CreateIO/IOArtifacts.jsx
index 850aed0..3e2695f 100644
--- a/src/Pages/IO_Management/CreateIO/IOArtifacts.jsx
+++ b/src/Pages/IO_Management/CreateIO/IOArtifacts.jsx
@@ -340,7 +340,9 @@ const IOArtifacts = ({ enableNextTab, index, data }) => {
Manage IO Images
-
+
+
+ {IObyID?.data?.artifactsImage?.length !== 0 &&}
}
onClick={onOpen}
@@ -376,7 +378,7 @@ const IOArtifacts = ({ enableNextTab, index, data }) => {
Manage IO videos
-
+ {IObyID?.data?.artifactsVideo?.length !== 0 &&}
}
onClick={onOpenVideo}
diff --git a/src/Pages/IO_Management/CreateIO/IODetails.jsx b/src/Pages/IO_Management/CreateIO/IODetails.jsx
index 2c0163e..7afc83c 100644
--- a/src/Pages/IO_Management/CreateIO/IODetails.jsx
+++ b/src/Pages/IO_Management/CreateIO/IODetails.jsx
@@ -40,7 +40,7 @@ const schema = yup.object().shape({
.string()
.required("IO name in English is required")
.min(3, "IO name in English must be at least 3 characters long")
- .max(50, "IO name in English must be at most 50 characters long"),
+ .max(150, "IO name in English must be at most 150 characters long"),
investmentNameArabic: yup
.string()
@@ -61,15 +61,13 @@ const schema = yup.object().shape({
.max(2000, "Description in Arabic must be at most 500 characters long"),
expectedReturnArabic: yup
.string()
- .required("Expected return in Arabic is required")
- .min(10, "Expected return in Arabic must be at least 10 characters long")
- .max(2000, "Expected return in Arabic must be at most 500 characters long"),
+ .required("Expected return in Arabic is required"),
- goalAmount: yup
- .number()
- .required("Goal amount is required")
- .positive("Goal amount must be a positive number")
- .min(1, "Goal amount must be at least 1"),
+ goalAmount: yup
+ .number()
+ .typeError("Goal Amount is must be number")
+ .required('Goal amount is required')
+ .positive('Goal amount must be a positive number'),
closingDate: yup
.date()
@@ -189,6 +187,7 @@ const IODetails = ({ enableNextTab, index, data }) => {
const {
control,
reset,
+ watch,
setValue,
handleSubmit,
formState: { errors },
@@ -239,6 +238,8 @@ const IODetails = ({ enableNextTab, index, data }) => {
isRequired: true,
section: " ",
width: "49%",
+ maxLength:150,
+ helperText:`Maximum length should be 150 characters. You have entered ${watch()?.investmentNameEnglish?.length || 0} characters.`
},
{
label: "IO Name (Arabic)",
@@ -249,6 +250,8 @@ const IODetails = ({ enableNextTab, index, data }) => {
arabic: true,
section: " ",
width: "49%",
+ maxLength:150,
+ helperText:`Maximum length should be 150 characters. You have entered ${watch()?.investmentNameArabic?.length || 0} characters.`
},
{
label: "Description",
@@ -258,7 +261,8 @@ const IODetails = ({ enableNextTab, index, data }) => {
isRequired: true,
section: " ",
width: "49%",
- maxLength:1000
+ maxLength:1000,
+ helperText:`Maximum length should be 1000 characters. You have entered ${watch()?.descriptionEnglish?.length || 0} characters.`
},
{
label: "Description (Arabic)",
@@ -269,6 +273,8 @@ const IODetails = ({ enableNextTab, index, data }) => {
arabic: true,
section: " ",
width: "49%",
+ maxLength:1000,
+ helperText:`Maximum length should be 1000 characters. You have entered ${watch()?.descriptionArabic?.length || 0} characters.`
},
{
@@ -400,7 +406,8 @@ const IODetails = ({ enableNextTab, index, data }) => {
width: "100%",
options: investmentTypeOptions,
value: IObyID?.data?.comment,
- maxLength:100
+ maxLength:100,
+ helperText:`Maximum length should be 100 characters. You have entered ${watch()?.comment?.length || 0} characters.`
},
];
//=======================[ Editor ]
diff --git a/src/Pages/IO_Management/CreateIO/InvestmentDocument.jsx b/src/Pages/IO_Management/CreateIO/InvestmentDocument.jsx
index 4ab2590..2445b43 100644
--- a/src/Pages/IO_Management/CreateIO/InvestmentDocument.jsx
+++ b/src/Pages/IO_Management/CreateIO/InvestmentDocument.jsx
@@ -298,7 +298,9 @@ const InvestmentDocument = ({ control, errors, enableNextTab, index, }) => {
return (
-
+
+
+ {filteredData?.length !== 0 &&}
}
onClick={onOpen}
diff --git a/src/Pages/IO_Management/CreateIO/KeyMerits.jsx b/src/Pages/IO_Management/CreateIO/KeyMerits.jsx
index 464049f..38defd1 100644
--- a/src/Pages/IO_Management/CreateIO/KeyMerits.jsx
+++ b/src/Pages/IO_Management/CreateIO/KeyMerits.jsx
@@ -230,7 +230,9 @@ const KeyMerits = ({ enableNextTab, index, data: prepopData }) => {
/> */}
-
+
+
+ {filteredData?.length !== 0 &&}
}
onClick={onOpen}
diff --git a/src/Pages/IO_Management/InvestmentDocuments.jsx b/src/Pages/IO_Management/InvestmentDocuments.jsx
index 587c5a1..abd0281 100644
--- a/src/Pages/IO_Management/InvestmentDocuments.jsx
+++ b/src/Pages/IO_Management/InvestmentDocuments.jsx
@@ -9,6 +9,7 @@ import {
DrawerHeader,
DrawerOverlay,
FormControl,
+ FormHelperText,
FormLabel,
Input,
Text,
@@ -252,6 +253,8 @@ const InvestmentDocuments = ({
{errors.document.message}
)}
+
+ File size should be max 2mb
{file && (
diff --git a/src/Pages/IO_Management/ViewIO/ViewIOTable.jsx b/src/Pages/IO_Management/ViewIO/ViewIOTable.jsx
index bd4b0e3..b8ea2a1 100644
--- a/src/Pages/IO_Management/ViewIO/ViewIOTable.jsx
+++ b/src/Pages/IO_Management/ViewIO/ViewIOTable.jsx
@@ -205,9 +205,9 @@ const ViewIOTable = () => {
+ :
+
+
);
};
diff --git a/src/Pages/Login.jsx b/src/Pages/Login.jsx
index e661667..b3b4200 100644
--- a/src/Pages/Login.jsx
+++ b/src/Pages/Login.jsx
@@ -31,7 +31,9 @@ import * as Yup from "yup";
const validationSchema = Yup.object().shape({
- emailAddress: Yup.string().required("Email address is required"),
+ emailAddress: Yup.string()
+ .email("Invalid email address")
+ .required("Email address is required"),
password_hash: Yup.string().required("Password is required"),
});
@@ -51,7 +53,7 @@ const Login = () => {
useEffect(() => {
if (isAuthenticate) {
- navigate("/");
+ navigate("/sponser");
}
}, [navigate, isAuthenticate]);
@@ -69,7 +71,7 @@ const Login = () => {
setIsLoading(false);
setIsAuthenticate(true);
Cookies.set("isAuthenticated", true, { expires: 7 });
- navigate("/");
+ navigate("/sponser");
reset();
}
diff --git a/src/Pages/Master/InvestmentType/AddInvestmentType.jsx b/src/Pages/Master/InvestmentType/AddInvestmentType.jsx
index d3ab2a9..fb6e01c 100644
--- a/src/Pages/Master/InvestmentType/AddInvestmentType.jsx
+++ b/src/Pages/Master/InvestmentType/AddInvestmentType.jsx
@@ -22,8 +22,10 @@ export const addInvestmentType = yup.object().shape({
investmentTypeName: yup.string()
.required('Investment type is required')
.max(50, 'Investment name cannot be more than 50 characters'),
- note: yup.string().notRequired(),
- investmentTypeNameArabic: yup.string().required(),
+ note: yup.string()
+ .optional()
+ .max(255, 'Note cannot exceed 255 characters'),
+ investmentTypeNameArabic: yup.string().required("Investment type in arabic required"),
noteArabic: yup.string().notRequired(),
});
@@ -62,6 +64,7 @@ const AddInvestmentType = () => {
const {
control,
handleSubmit,
+ watch,
formState: { errors },
reset,
} = useForm({
@@ -172,7 +175,8 @@ const AddInvestmentType = () => {
type: "text",
isRequired: true,
section: "Add Details",
- maxLength: 50
+ maxLength: 50,
+ helperText:`Maximum length should be 50 characters. You have entered ${watch()?.investmentTypeName?.length || 0} characters.`
},
{
label: "Investment Type (Arabic) ",
@@ -182,7 +186,8 @@ const AddInvestmentType = () => {
isRequired: true,
section: "Add Details",
arabic: true,
- maxLength: 255
+ maxLength: 255,
+ helperText:`Maximum length should be 255 characters. You have entered ${watch()?.investmentTypeNameArabic?.length || 0} characters.`
},
{
label: "Description (English)",
@@ -191,7 +196,8 @@ const AddInvestmentType = () => {
type: "textarea",
// isRequired: true,
section: "Add Details",
- maxLength: 255
+ maxLength: 255,
+ helperText:`Maximum length should be 255 characters. You have entered ${watch()?.note?.length || 0} characters.`
},
{
label: "Description (Arabic)",
@@ -201,7 +207,8 @@ const AddInvestmentType = () => {
// isRequired: true,
arabic: true,
section: "Add Details",
- maxLength: 255
+ maxLength: 255,
+ helperText:`Maximum length should be 255 characters. You have entered ${watch()?.noteArabic?.length || 0} characters.`
},
];
@@ -215,6 +222,8 @@ const AddInvestmentType = () => {
type: "text",
isRequired: true,
section: "Add Details",
+ maxLength: 50,
+ helperText:`Maximum length should be 50 characters. You have entered ${watch()?.investmentTypeName?.length || 0} characters.`
},
{
label: "Investment Type (Arabic)",
@@ -224,6 +233,8 @@ const AddInvestmentType = () => {
isRequired: true,
section: "Add Details",
arabic: true,
+ maxLength: 255,
+ helperText:`Maximum length should be 255 characters. You have entered ${watch()?.investmentTypeNameArabic?.length || 0} characters.`
},
{
label: "Description (English)",
@@ -232,6 +243,8 @@ const AddInvestmentType = () => {
type: "textarea",
// isRequired: true,
section: "Add Details",
+ maxLength: 255,
+ helperText:`Maximum length should be 255 characters. You have entered ${watch()?.note?.length || 0} characters.`
},
{
label: "Description (Arabic)",
@@ -241,6 +254,8 @@ const AddInvestmentType = () => {
// isRequired: true,
arabic: true,
section: "Add Details",
+ maxLength: 255,
+ helperText:`Maximum length should be 255 characters. You have entered ${watch()?.noteArabic?.length || 0} characters.`
},
];
diff --git a/src/Pages/Master/Sponser/AddSponser.jsx b/src/Pages/Master/Sponser/AddSponser.jsx
index a4fdeb3..3859537 100644
--- a/src/Pages/Master/Sponser/AddSponser.jsx
+++ b/src/Pages/Master/Sponser/AddSponser.jsx
@@ -17,9 +17,13 @@ import DummyComponent from "../../../Components/DummyComponent";
// ======================= [validation] =========================
export const addSponser = yup.object().shape({
- sponsorName: yup.string().required("Sponser name is required"),
- sponsorNameArabic: yup.string().required("Sponser name is required"),
- email: yup.string().email("Must be a valid email").notRequired(),
+ sponsorName: yup.
+ string()
+ .required('Sponsor Name is required')
+ .min(3, 'Sponsor Name must be at least 3 characters long')
+ .max(50, 'Investment Type Name cannot exceed 50 characters'),
+ sponsorNameArabic: yup.string().required("Sponser name in arabic is required"),
+ email: yup.string().email("Invalid email address").notRequired(),
// .test("emailValidity", "Email address is invalid", async function (value) {
// if (!value) {
// return true; // Allow if the field is empty
@@ -65,6 +69,7 @@ const AddSponser = () => {
const {
control,
+ watch,
handleSubmit,
formState: { errors },
reset,
@@ -158,7 +163,7 @@ const AddSponser = () => {
});
setIsLoadingBtn(false);
- navigate("/sponser");
+ setAlert(false)
}
});
} catch (error) {
@@ -180,7 +185,8 @@ const AddSponser = () => {
type: "text",
isRequired: true,
section: "Add Details",
- maxLength:50
+ maxLength:50,
+ helperText:`Maximum length should be 50 characters. You have entered ${watch()?.sponsorName?.length || 0} characters.`
},
{
label: "Sponser name (Arabic)",
@@ -191,7 +197,8 @@ const AddSponser = () => {
section: "Add Details",
arabic: true,
right: true,
- maxLength:255
+ maxLength:55,
+ helperText:`Maximum length should be 55 characters. You have entered ${watch()?.sponsorNameArabic?.length || 0} characters.`
},
{
label: "Email address",
@@ -213,7 +220,8 @@ const AddSponser = () => {
type: "text",
isRequired: true,
section: "Add Details",
- maxLength:50
+ maxLength:55,
+ helperText:`Maximum length should be 55 characters. You have entered ${watch()?.sponsorName?.length || 0} characters.`
},
{
label: "Sponser name (Arabic)",
@@ -223,7 +231,8 @@ const AddSponser = () => {
isRequired: true,
section: "Add Details",
arabic: true,
- maxLength:255
+ maxLength:55,
+ helperText:`Maximum length should be 55 characters. You have entered ${watch()?.sponsorNameArabic?.length || 0} characters.`
},
{
label: "Email adress",
@@ -297,7 +306,7 @@ const AddSponser = () => {
isLoading={isLoadingBtn}
/>
-
+{/* */}
);
};
diff --git a/src/Routes/Routes.js b/src/Routes/Routes.js
index 5f7cf65..3a35262 100644
--- a/src/Routes/Routes.js
+++ b/src/Routes/Routes.js
@@ -39,7 +39,7 @@ export const RouteLink = [
// =============[ Tanami ]================
// ===============[ Management]===============
- { path: "/", Component: Dashbaord },
+ // { path: "/", Component: Dashbaord },
{ path: "/sponser", Component: Sponser },
{ path: "/sponser/add-sponser/:id", Component: AddSponser },
{ path: "/sponser/add-sponser", Component: AddSponser },
diff --git a/src/Services/io.service.js b/src/Services/io.service.js
index d38dd7c..5b7049e 100644
--- a/src/Services/io.service.js
+++ b/src/Services/io.service.js
@@ -50,7 +50,7 @@ export const ioService = createApi({
method: "PATCH",
body: data,
}),
- invalidatesTags: ["getIOById"],
+ invalidatesTags: ["getIOById", "getIO"],
}),
// =====[Key Merits]
@@ -58,6 +58,7 @@ export const ioService = createApi({
query: (id) => `/io/admin/key-merits/${id}`,
providesTags: ["getKeyMerits"],
}),
+
createKeyMerits: builder.mutation({
query: ({ data, id }) => ({
url: `/io/admin/key-merits/${id}`,
@@ -75,6 +76,7 @@ export const ioService = createApi({
}),
invalidatesTags: ["getIOById"],
}),
+
updateKeyMerits: builder.mutation({
query: ({ data, id }) => ({
url: `/io/admin/key-merits/byId/${id}`,
@@ -126,20 +128,20 @@ export const ioService = createApi({
- // =====[createImageArtifacts]
- createImageArtifacts: builder.mutation({
- query: ({ data, id }) => ({
- url: `/io/admin/artifact/image/${id}`,
- method: "POST",
- body: data,
- }),
-
- invalidatesTags: ["getIOById"],
- }),
+ // =====[createImageArtifacts]
+ createImageArtifacts: builder.mutation({
+ query: ({ data, id }) => ({
+ url: `/io/admin/artifact/image/${id}`,
+ method: "POST",
+ body: data,
+ }),
+
+ invalidatesTags: ["getIOById"],
+ }),
+
-
updateImageArtifacts: builder.mutation({
query: ({ data, id }) => ({
url: `/io/admin/artifact/image/byId/${id}`,
@@ -148,10 +150,10 @@ export const ioService = createApi({
}),
invalidatesTags: ["getIOById"],
}),
-
-
+
+
// =====[createVideoArtifacts]
createVideoArtifacts: builder.mutation({
query: ({ data, id }) => ({
@@ -178,7 +180,7 @@ export const ioService = createApi({
}),
invalidatesTags: ["getIOById"],
}),
-
+
updateVideoArtifacts: builder.mutation({
query: ({ data, id }) => ({
url: `/io/admin/artifact/video/byId/${id}`,
@@ -196,7 +198,7 @@ export const ioService = createApi({
}),
invalidatesTags: ["getIOById"],
}),
-
+
updateStatusIo: builder.mutation({
query: ({ data, id }) => ({
url: `/io/admin/update-status/${id}`,
@@ -206,7 +208,7 @@ export const ioService = createApi({
invalidatesTags: ["getIOById", 'getIO'],
}),
- createIoCash : builder.mutation({
+ createIoCash: builder.mutation({
query: ({ data, id }) => ({
url: `/io/admin/io-cash/${id}`,
method: "POST",
@@ -217,7 +219,7 @@ export const ioService = createApi({
}),
- createIoNav : builder.mutation({
+ createIoNav: builder.mutation({
query: ({ data, id }) => ({
url: `/io/admin/io-nav/${id}`,
method: "POST",
diff --git a/src/Services/sponser.service.js b/src/Services/sponser.service.js
index d56f747..5951e8b 100644
--- a/src/Services/sponser.service.js
+++ b/src/Services/sponser.service.js
@@ -17,7 +17,7 @@ import { ioService } from "./io.service";
export const sponserMaster = createApi({
reducerPath: "sponserMaster",
baseQuery: baseQuery,
- tagTypes: ["getSponser"],
+ tagTypes: ["getSponser", "prePopulate"],
endpoints: (builder) => ({
@@ -65,7 +65,7 @@ export const sponserMaster = createApi({
method: "POST",
body: data,
}),
- invalidatesTags: ["getSponser"],
+ invalidatesTags: ["getSponser","prePopulate"],
}),
// ========[Update Sponser]========