diff --git a/src/Components/Cards/AddressCard.tsx b/src/Components/Cards/AddressCard.tsx new file mode 100644 index 0000000..37adc58 --- /dev/null +++ b/src/Components/Cards/AddressCard.tsx @@ -0,0 +1,28 @@ +import { Divider } from 'antd' +import { useTranslation } from 'react-i18next' +import { RxHome } from "react-icons/rx"; + +const AddressCard = ({ data }: { data: any }) => { + const { t } = useTranslation(); + return ( +
+
{t("practical.address")}
+ +
+ {data?.map((address:any)=>( +
+ + +
{t(`practical.${address?.key}`)}
+

{address?.value}

+
+
+ ))} +
+
+ ) +} + +export default AddressCard + + diff --git a/src/Components/Cards/AttachmentsCard.tsx b/src/Components/Cards/AttachmentsCard.tsx new file mode 100644 index 0000000..ae35427 --- /dev/null +++ b/src/Components/Cards/AttachmentsCard.tsx @@ -0,0 +1,24 @@ +import { Divider } from 'antd'; +import { useTranslation } from 'react-i18next' +import ImageBoxField from '../CustomFields/ImageBoxField/ImageBoxField'; + +const AttachmentsCard = ({data}:{data?:any}) => { + const {t} = useTranslation(); + + return ( +
+
{t("practical.address")}
+ +
+
{t("practical.id_photo")}
+ {/* {data?.map((address:any)=>( */} + + + + {/* ))} */} +
+
+ ) +} + +export default AttachmentsCard \ No newline at end of file diff --git a/src/Components/Cards/InfoCard.tsx b/src/Components/Cards/InfoCard.tsx new file mode 100644 index 0000000..5267683 --- /dev/null +++ b/src/Components/Cards/InfoCard.tsx @@ -0,0 +1,39 @@ +import { Button, Divider } from 'antd' +import { useTranslation } from 'react-i18next' +import { canAddReSeller } from '../../utils/hasAbilityFn'; + +const InfoCard = ({ data, name, status,withButton = false,handleClick}:{ data:any, name:any, status:any,withButton?:boolean,handleClick?:() => void}) => { + const {t} = useTranslation(); + + return ( +
+
+ +
+ {status} +

{name}

+
+
+ +
+ {data?.map((student: any) => ( + +

{student?.key}

+

{student?.value}

+
+ ))} + {withButton ? + canAddReSeller && + + : ""} +
+ +
+ ) +} + +export default InfoCard + + diff --git a/src/Components/Cards/ParamInfo.ts b/src/Components/Cards/ParamInfo.ts new file mode 100644 index 0000000..542abbc --- /dev/null +++ b/src/Components/Cards/ParamInfo.ts @@ -0,0 +1,27 @@ +export const StudentParamInfo = [ + {key:"الحنس" , value:"male"}, + {key:"sex" , value:"male"}, + {key:"sex" , value:"male"}, + {key:"sex" , value:"male"}, + {key:"sex" , value:"male"}, + {key:"sex" , value:"male"} +] + +export const ReSellerParamInfo = [ + {key:"رقم الهوية" , value:"12i9128921019"}, + {key:"تاريخ الإضافة", value:"1/10/2010"}, + {key:"تاريخ الإضافة", value:"1/10/2010"}, + {key:"تاريخ الإضافة", value:"1/10/2010"}, + {key:"تاريخ الإضافة", value:"1/10/2010"}, + {key:"تاريخ الإضافة", value:"1/10/2010"}, + {key:"تاريخ الإضافة", value:"1/10/2010"}, +] + +export const StudentAddressInfo = [ + {key:"address" , value:"moa moamasom aoms omaosm oasm oasm oasm asm aom"}, +] + +export const ReSellerAddressInfo = [ + {key:"governorate" , value:"moa moamasom aoms omaosm oasm oasm oasm asm aom"}, + {key:"address" , value:"moa moamasom aoms omaosm oasm oasm oasm asm aom"}, +] \ No newline at end of file diff --git a/src/Components/CustomFields/ImageBoxField/ImageBoxField.tsx b/src/Components/CustomFields/ImageBoxField/ImageBoxField.tsx index 230058e..27b6787 100644 --- a/src/Components/CustomFields/ImageBoxField/ImageBoxField.tsx +++ b/src/Components/CustomFields/ImageBoxField/ImageBoxField.tsx @@ -10,7 +10,7 @@ import { generateImagePreview } from "./generateImagePreview"; const ImageBoxField = ({ name }: any) => { const formik = useFormikContext(); - const value = getNestedValue(formik.values, name); + const value = getNestedValue(formik?.values, name); const [imagePreview, setImagePreview] = useState(null); const fileInputRef = useRef(null); diff --git a/src/Components/student/AddressCard.tsx b/src/Components/student/AddressCard.tsx deleted file mode 100644 index 558a9aa..0000000 --- a/src/Components/student/AddressCard.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { Divider } from 'antd' -import { useTranslation } from 'react-i18next' -import { RxHome } from "react-icons/rx"; - -const StudentAddressCard = ({address}:{address:string}) => { - const {t} = useTranslation(); - return ( -
-
{t("practical.address")}
- -
- - -
{t("practical.address")}
-

{address}

-
-
-
- ) -} - -export default StudentAddressCard - - diff --git a/src/Components/student/StudentInfoCard.tsx b/src/Components/student/StudentInfoCard.tsx deleted file mode 100644 index 238d48c..0000000 --- a/src/Components/student/StudentInfoCard.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import React from 'react' -import { studentParamInfo } from './StudentParam' -import { Divider } from 'antd' - -const StudentInfoCard = ({data,name,status}:any) => { - return ( -
-
- -
- {status} -

{name}

-
-
- -
- {data?.map((student:any)=>( - -

{student?.key}

-

{student?.value}

-
- ))} -
-
- ) -} - -export default StudentInfoCard - - diff --git a/src/Components/student/StudentParam.ts b/src/Components/student/StudentParam.ts deleted file mode 100644 index 556fff7..0000000 --- a/src/Components/student/StudentParam.ts +++ /dev/null @@ -1,8 +0,0 @@ -export const studentParamInfo = [ - {key:"الحنس" , value:"male"}, - {key:"sex" , value:"male"}, - {key:"sex" , value:"male"}, - {key:"sex" , value:"male"}, - {key:"sex" , value:"male"}, - {key:"sex" , value:"male"} -] \ No newline at end of file diff --git a/src/Pages/Admin/Reseller/Page.tsx b/src/Pages/Admin/Reseller/Page.tsx index fab96da..ee7d105 100644 --- a/src/Pages/Admin/Reseller/Page.tsx +++ b/src/Pages/Admin/Reseller/Page.tsx @@ -1,13 +1,9 @@ -import { FaPlus } from "react-icons/fa"; -import useModalHandler from "../../../utils/useModalHandler"; import { ModalEnum } from "../../../enums/Model"; import { useTranslation } from "react-i18next"; import { lazy, Suspense } from "react"; import { Spin } from "antd"; import { - canAddReport, canAddReSeller, - canAddTags, } from "../../../utils/hasAbilityFn"; import useSetPageTitle from "../../../Hooks/useSetPageTitle"; import { useDeleteTag } from "../../../api/tags"; diff --git a/src/Pages/Admin/Reseller/show/Model/AddModel.tsx b/src/Pages/Admin/Reseller/show/Model/AddModel.tsx new file mode 100644 index 0000000..18de414 --- /dev/null +++ b/src/Pages/Admin/Reseller/show/Model/AddModel.tsx @@ -0,0 +1,33 @@ +import React from "react"; +import { getInitialValues, getValidationSchema } from "./formUtil"; +import { ModalEnum } from "../../../../../enums/Model"; +import LayoutModel from "../../../../../Layout/Dashboard/LayoutModel"; +import { QueryStatusEnum } from "../../../../../enums/QueryStatus"; +import ModelForm from "./ModelForm"; +import { useAddReseller } from "../../../../../api/reseller"; + +const AddModel: React.FC = () => { + const { mutate, status } = useAddReseller(); + + const handleSubmit = (values: any) => { + mutate({ + ...values, + }); + }; + return ( + <> + + + + + ); +}; + +export default AddModel; diff --git a/src/Pages/Admin/Reseller/show/Model/EditModel.tsx b/src/Pages/Admin/Reseller/show/Model/EditModel.tsx new file mode 100644 index 0000000..f366fef --- /dev/null +++ b/src/Pages/Admin/Reseller/show/Model/EditModel.tsx @@ -0,0 +1,36 @@ +import React from "react"; +import { getInitialValues, getValidationSchema } from "./formUtil"; +import { ModalEnum } from "../../../../../enums/Model"; +import LayoutModel from "../../../../../Layout/Dashboard/LayoutModel"; +import ModelForm from "./ModelForm"; +import { QueryStatusEnum } from "../../../../../enums/QueryStatus"; +import { useObjectToEdit } from "../../../../../zustand/ObjectToEditState"; +import { useUpdateReseller } from "../../../../../api/reseller"; + +const EditModel: React.FC = () => { + const { mutate, status } = useUpdateReseller(); + const { objectToEdit } = useObjectToEdit((state) => state); + + const handleSubmit = (values: any) => { + mutate({ + ...values, + }); + }; + return ( + <> + + + + + ); +}; + +export default EditModel; diff --git a/src/Pages/Admin/Reseller/show/Model/FilterForm.tsx b/src/Pages/Admin/Reseller/show/Model/FilterForm.tsx new file mode 100644 index 0000000..ec00bd6 --- /dev/null +++ b/src/Pages/Admin/Reseller/show/Model/FilterForm.tsx @@ -0,0 +1,17 @@ +import ValidationField from "../../../../../Components/ValidationField/ValidationField"; +import { Col, Row } from "reactstrap"; + +const FilterForm = () => { + return ( +
+ + + + + + +
+ ); +}; + +export default FilterForm; diff --git a/src/Pages/Admin/Reseller/show/Model/ModelForm.tsx b/src/Pages/Admin/Reseller/show/Model/ModelForm.tsx new file mode 100644 index 0000000..9440a8d --- /dev/null +++ b/src/Pages/Admin/Reseller/show/Model/ModelForm.tsx @@ -0,0 +1,17 @@ +import { Col, Row } from "reactstrap"; +import ValidationField from "../../../../../Components/ValidationField/ValidationField"; + +const Form = () => { + return ( + + + + + + + + + ); +}; + +export default Form; diff --git a/src/Pages/Admin/Reseller/show/Model/formUtil.ts b/src/Pages/Admin/Reseller/show/Model/formUtil.ts new file mode 100644 index 0000000..0f7ba00 --- /dev/null +++ b/src/Pages/Admin/Reseller/show/Model/formUtil.ts @@ -0,0 +1,19 @@ +import * as Yup from "yup"; +export const getInitialValues = (objectToEdit: any): any => { + return { + id: objectToEdit?.id ?? null, + amount_value: objectToEdit?.amount_value ?? null, + description: objectToEdit?.description ?? null, + date_of_receipt: objectToEdit?.date_of_receipt ?? null, + + }; +}; + +export const getValidationSchema = () => { + return Yup.object().shape({ + amount_value: Yup.string().required("validation.required"), + description: Yup.string().required("validation.required"), + date_of_receipt: Yup.string().required("validation.required"), + + }); +}; diff --git a/src/Pages/Admin/Reseller/show/Page.tsx b/src/Pages/Admin/Reseller/show/Page.tsx new file mode 100644 index 0000000..d433cfa --- /dev/null +++ b/src/Pages/Admin/Reseller/show/Page.tsx @@ -0,0 +1,72 @@ +import { useTranslation } from "react-i18next"; +import { lazy, Suspense } from "react"; +import { Spin } from "antd"; +import useSetPageTitle from "../../../../Hooks/useSetPageTitle"; +import PageHeader from "../../../../Layout/Dashboard/PageHeader"; +import InfoCard from "../../../../Components/Cards/InfoCard"; +import AddressCard from "../../../../Components/Cards/AddressCard"; +import { ReSellerAddressInfo, ReSellerParamInfo } from "../../../../Components/Cards/ParamInfo"; +import StudentTabs from "./ReSellerTabs"; +import { useParams } from "react-router-dom"; +import { ParamsEnum } from "../../../../enums/params"; +import AttachmentsCard from "../../../../Components/Cards/AttachmentsCard"; +import { ModalEnum } from "../../../../enums/Model"; +import { useDeleteReseller } from "../../../../api/reseller"; +import { useObjectToEdit } from "../../../../zustand/ObjectToEditState"; +import useModalHandler from "../../../../utils/useModalHandler"; +const DeleteModalForm = lazy( + () => import("../../../../Layout/Dashboard/DeleteModels"),); + const EditModalForm = lazy(() => import("./Model/EditModel")); + const AddModalForm = lazy(() => import("./Model/AddModel")); + +const TableHeader = () => { + const [t] = useTranslation(); + const { re_seller_id } = useParams() + + useSetPageTitle([ + { name: `${t(`page_header.home`)}`, path: "/" }, + { name: `${t(`page_header.reseller`)}`, path: "reseller" }, + { name: `${t(`page_header.reseller_details`)}`, path: `reseller/${re_seller_id}` }, + ]); + const { handel_open_model } = useModalHandler(); + + const handleOpenModel = () =>{ + handel_open_model(ModalEnum?.RE_SELLER_COLLECTION_ADD); + + } + const deleteMutation = useDeleteReseller(); + + return ( +
+ }> + +
+
+ + + +
+
+ + + + +
+ +
+
+
+ ); +}; + +export default TableHeader; diff --git a/src/Pages/Admin/Reseller/show/ReSellerTabs.tsx b/src/Pages/Admin/Reseller/show/ReSellerTabs.tsx new file mode 100644 index 0000000..1da4ef2 --- /dev/null +++ b/src/Pages/Admin/Reseller/show/ReSellerTabs.tsx @@ -0,0 +1,60 @@ +import { useTranslation } from 'react-i18next'; +import { Tabs } from 'antd'; +import type { TabsProps } from 'antd'; +import FilterLayout from '../../../../Layout/Dashboard/FilterLayout'; +import FilterForm from './Model/FilterForm'; +import { lazy } from 'react'; +import { FaMoneyBills } from "react-icons/fa6"; +import useSearchQuery from '../../../../api/utils/useSearchQuery'; +import { useFilterState } from '../../../../Components/Utils/Filter/FilterState'; +import { useGetAllReseller } from '../../../../api/reseller'; + +const Table = lazy(() => import("./Table")); + +const ReSellerTabs = () => { + const {t} = useTranslation(); + + const [searchQuery] = useSearchQuery("name"); + const { filterState } = useFilterState(); + const response = useGetAllReseller({ + name: searchQuery, + pagination: true, + ...filterState, + }); + + const items: TabsProps['items'] = [ + { + key: '1', + label: t("practical.sales"), + icon:, + children: + <> + } + filterTitle="practical.sales" + /> + + , + }, + { + key: '2', + label: t("practical.collections"), + icon:, + children: + <> + } + filterTitle="practical.collections" + /> +
+ , + }, + ]; + return ( + <> + + +) +} + +export default ReSellerTabs \ No newline at end of file diff --git a/src/Pages/Admin/Reseller/show/Table.tsx b/src/Pages/Admin/Reseller/show/Table.tsx new file mode 100644 index 0000000..ffebfbf --- /dev/null +++ b/src/Pages/Admin/Reseller/show/Table.tsx @@ -0,0 +1,14 @@ +import DataTable from "../../../../Layout/Dashboard/Table/DataTable"; +import { useColumns } from "./useTableColumns"; +import { useColumnsCollection } from "./useTableColumnsCollections"; + +const App = ({salesTable = false ,response}:{salesTable?:boolean,response:any}) => { + if (salesTable) { + return ; + } else { + return ; + } + +}; + +export default App; diff --git a/src/Pages/Admin/Reseller/show/index.tsx b/src/Pages/Admin/Reseller/show/index.tsx new file mode 100644 index 0000000..7f045ab --- /dev/null +++ b/src/Pages/Admin/Reseller/show/index.tsx @@ -0,0 +1,9 @@ +import { useColumns } from "./useTableColumns"; +import Table from "./Table"; +import { FaPlus } from "react-icons/fa"; + +export { + Table, + useColumns, + FaPlus, +}; diff --git a/src/Pages/Admin/Reseller/show/useTableColumns.tsx b/src/Pages/Admin/Reseller/show/useTableColumns.tsx new file mode 100644 index 0000000..c10eef2 --- /dev/null +++ b/src/Pages/Admin/Reseller/show/useTableColumns.tsx @@ -0,0 +1,43 @@ +import { TableColumnsType } from "antd"; +import { user } from "../../../../types/Item"; +import { useTranslation } from "react-i18next"; +import { ReSeller } from "../../../../types/ReSeller"; + +export const useColumns = () => { + const [t] = useTranslation(); + + const columns: TableColumnsType = [ + { + title: t("columns.student_full_name"), + dataIndex: "student_full_name", + key: "student_full_name", + align: "center", + }, + { + title: t("columns.grade"), + dataIndex: "grade", + key: "grade", + align: "center", + }, + { + title: t("columns.package"), + dataIndex: "package", + key: "package", + align: "center", + }, + { + title: t("columns.amount_paid"), + dataIndex: "amount_paid", + key: "amount_paid", + align: "center", + }, + { + title: t("columns.sale_date"), + dataIndex: "sale_date", + key: "sale_date", + align: "center", + }, + ]; + + return columns; +}; diff --git a/src/Pages/Admin/Reseller/show/useTableColumnsCollections.tsx b/src/Pages/Admin/Reseller/show/useTableColumnsCollections.tsx new file mode 100644 index 0000000..106e694 --- /dev/null +++ b/src/Pages/Admin/Reseller/show/useTableColumnsCollections.tsx @@ -0,0 +1,82 @@ +import { TableColumnsType } from "antd"; +import { useTranslation } from "react-i18next"; +import ActionButtons from "../../../../Components/Table/ActionButtons"; +import { canDeleteReSeller, canEditReSeller, canShowReSeller } from "../../../../utils/hasAbilityFn"; +import { ReSeller } from "../../../../types/ReSeller"; +import useModalHandler from "../../../../utils/useModalHandler"; +import { useObjectToEdit } from "../../../../zustand/ObjectToEditState"; +import { ModalEnum } from "../../../../enums/Model"; + +export const useColumnsCollection = () => { + const { handel_open_model } = useModalHandler(); + + const { setObjectToEdit } = useObjectToEdit((state) => state); + + const [t] = useTranslation(); + const handelDelete = (data: ReSeller) => { + setObjectToEdit(data); + handel_open_model(ModalEnum?.RE_SELLER_DELETE); + }; + + const handleEdit = (record: ReSeller) => { + setObjectToEdit(record); + handel_open_model(ModalEnum?.RE_SELLER_EDIT); + }; + const columns: TableColumnsType = [ + { + title: t("columns.ID"), + dataIndex: "ID", + key: "ID", + align: "center", + }, + { + title: t("columns.amount"), + dataIndex: "amount", + key: "amount", + align: "center", + }, + { + title: t("columns.date_of_receipt"), + dataIndex: "date_of_receipt", + key: "date_of_receipt", + align: "center", + }, + { + title: t("columns.description"), + dataIndex: "description", + key: "description", + align: "center", + }, + { + title: t("columns.residual"), + dataIndex: "residual", + key: "residual", + align: "center", + }, + { + title: t("columns.procedure"), + dataIndex: "procedure", + key: "procedure", + align: "center", + }, + { + title: t("columns.procedure"), + + key: "actions", + align: "center", + render: (_text, record, index) => { + return ( + handelDelete(record)} + onEdit={() => handleEdit(record)} + /> + ); + }, + }, + ]; + + return columns; +}; diff --git a/src/Pages/Admin/Reseller/useTableColumns.tsx b/src/Pages/Admin/Reseller/useTableColumns.tsx index 09a7394..9de525b 100644 --- a/src/Pages/Admin/Reseller/useTableColumns.tsx +++ b/src/Pages/Admin/Reseller/useTableColumns.tsx @@ -1,19 +1,16 @@ import { TableColumnsType } from "antd"; import { ReSeller } from "../../../types/ReSeller"; -import { FaPlus } from "react-icons/fa"; import useModalHandler from "../../../utils/useModalHandler"; import { ModalEnum } from "../../../enums/Model"; import { useObjectToEdit } from "../../../zustand/ObjectToEditState"; import { useTranslation } from "react-i18next"; -import { ABILITIES_ENUM } from "../../../enums/abilities"; import { useNavigate } from "react-router-dom"; import { - canAddReSeller, canDeleteReSeller, canEditReSeller, + canShowReSeller, } from "../../../utils/hasAbilityFn"; import ActionButtons from "../../../Components/Table/ActionButtons"; -import ColumnsImage from "../../../Components/Columns/ColumnsImage"; export const useColumns = () => { const { handel_open_model } = useModalHandler(); @@ -21,6 +18,10 @@ export const useColumns = () => { const { setObjectToEdit } = useObjectToEdit((state) => state); const navigate = useNavigate(); + const handelShow = (record: ReSeller) => { + navigate(`${record?.id}`); + }; + const handelDelete = (data: ReSeller) => { setObjectToEdit(data); handel_open_model(ModalEnum?.RE_SELLER_DELETE); @@ -62,8 +63,7 @@ export const useColumns = () => { render: (_text, record) => record?.user?.username, }, { - title: "", - + title: t("columns.procedure"), key: "actions", align: "center", render: (_text, record, index) => { @@ -71,7 +71,9 @@ export const useColumns = () => { handelShow(record)} onDelete={() => handelDelete(record)} onEdit={() => handleEdit(record)} /> diff --git a/src/Pages/Admin/Student/show/Page.tsx b/src/Pages/Admin/Student/show/Page.tsx index d5ad396..f597de2 100644 --- a/src/Pages/Admin/Student/show/Page.tsx +++ b/src/Pages/Admin/Student/show/Page.tsx @@ -5,21 +5,23 @@ import useSetPageTitle from "../../../../Hooks/useSetPageTitle"; import PageHeader from "../../../../Layout/Dashboard/PageHeader"; import FilterLayout from "../../../../Layout/Dashboard/FilterLayout"; import FilterForm from "./Model/FilterForm"; -import StudentInfoCard from "../../../../Components/student/StudentInfoCard"; -import StudentAddressCard from "../../../../Components/student/AddressCard"; -import { studentParamInfo } from "../../../../Components/student/StudentParam"; +import InfoCard from "../../../../Components/Cards/InfoCard"; +import AddressCard from "../../../../Components/Cards/AddressCard"; +import { StudentAddressInfo, StudentParamInfo } from "../../../../Components/Cards/ParamInfo"; import StudentTabs from "./StudentTabs"; +import { useParams } from "react-router-dom"; +import { ParamsEnum } from "../../../../enums/params"; const TableHeader = () => { const [t] = useTranslation(); - useSetPageTitle( - t(`page_header.users`) + - "/ " + - t(`PageTitle.students`) - + - " / " + - t(`PageTitle.students_details`), - ); + const {student_id} = useParams(); + + useSetPageTitle([ + { name: `${t(`page_header.users`)}`, path: "/" }, + { name: `${t(`PageTitle.students`)}`, path: "students" }, + { name: `${t(`PageTitle.students_details`)}`, path: `reseller/${student_id}` }, + ]); + return (
}> @@ -28,11 +30,11 @@ const TableHeader = () => { />
- - + +
- +
diff --git a/src/Pages/Admin/Student/show/StudentTabs.tsx b/src/Pages/Admin/Student/show/StudentTabs.tsx index 3ff820c..0f2e3ac 100644 --- a/src/Pages/Admin/Student/show/StudentTabs.tsx +++ b/src/Pages/Admin/Student/show/StudentTabs.tsx @@ -26,8 +26,8 @@ const StudentTabs = () => { const items: TabsProps['items'] = [ { key: '1', - label: {t("practical.quiz")} , - icon:, + label: t("practical.quiz"), + icon:, children: <> { }, { key: '2', - label: {t("practical.hightes_quiz")} , - icon:, + label: t("practical.hightes_quiz"), + icon:, children: <> import("./Pages/Admin/Student/Page")); const ShowStudent = React.lazy(() => import("./Pages/Admin/Student/show/Page")); const ReSeller = React.lazy(() => import("./Pages/Admin/Reseller/Page")); +const ShowReSeller = React.lazy(() => import("./Pages/Admin/Reseller/show/Page")); const AddReSeller = React.lazy(() => import("./Pages/Admin/Reseller/Add/Page")); const EditReSeller = React.lazy( () => import("./Pages/Admin/Reseller/Edit/Page"), @@ -221,7 +222,15 @@ export const CrudRoute: TCrudRoute[] = [ { header: "page_header.edit_reseller", element: , - path: `/${ABILITIES_ENUM?.RE_SELLER}/:id`, + path: `/${ABILITIES_ENUM?.RE_SELLER}/:${ParamsEnum?.RE_SELLER_ID}/edit`, + abilities: ABILITIES_ENUM?.RE_SELLER, + abilities_value: ABILITIES_VALUES_ENUM.INDEX, + prevPath: 0, + }, + { + header: "page_header.reSeller", + element: , + path: `/${ABILITIES_ENUM?.RE_SELLER}/:${ParamsEnum?.RE_SELLER_ID}`, abilities: ABILITIES_ENUM?.RE_SELLER, abilities_value: ABILITIES_VALUES_ENUM.INDEX, prevPath: 0, @@ -229,7 +238,7 @@ export const CrudRoute: TCrudRoute[] = [ { header: "page_header.student", element: , - path: `/${ABILITIES_ENUM?.STUDENT}/:id`, + path: `/${ABILITIES_ENUM?.STUDENT}/:${ParamsEnum?.STUDENT_ID}`, abilities: ABILITIES_ENUM?.STUDENT, abilities_value: ABILITIES_VALUES_ENUM.INDEX, prevPath: 0, diff --git a/src/Styles/Pages/InfoCard.scss b/src/Styles/Pages/InfoCard.scss new file mode 100644 index 0000000..878a3a4 --- /dev/null +++ b/src/Styles/Pages/InfoCard.scss @@ -0,0 +1,136 @@ +.single_student { + display: flex; + + .single_student_body { + display: flex; + width: 100%; + + .student_info { + width: 32%; + } + + .student_table { + width: 68%; + } + } +} + + + + + +.info_card, +.address_card, +.attachments_card { + width: 24vw; + box-shadow: 2px 2px 8px 3px rgba(0, 0, 0, 0.1); + border-radius: 10px; + padding: 20px 15px; + + p { + color: #6A7287; + } + + .info_card_header { + display: flex; + gap: 10px; + + img { + width: 24%; + } + + .student_name_and_sub { + display: flex; + flex-direction: column; + justify-content: center; + + span { + color: greenyellow; + } + + h2 { + font-size: 22px; + } + } + } + + .info_card_body { + display: flex; + flex-direction: column; + gap: 30px; + + span { + display: flex; + justify-content: space-between; + + h4 { + color: #202C4B; + font-size: 20px; + } + } + .info_card_button{ + background: var(--primary); + color: var(--white); + padding: 25px 0px; + border-radius: 9px; + } + } +} + + +.address_card { + margin-block: 30px; + .address_card_body { + display: flex; + flex-direction: column; + align-items: center; + div{ + margin-block: 20px; + gap: 15px; + display: flex !important; + } + svg { + @include Flex; + border-radius: 5px; + background: #F2F4F8; + width: 40px; + height: 40px; + padding: 7px; + } + } +} +.tab_icon{ + font-size: 30px ; +} + +@media screen and (max-width:1250px) { + .single_student { + display: flex; + + .single_student_body { + display: flex; + flex-direction: column !important; + width: 100%; + + .student_info { + display: flex; + width: 100%; + gap: 20px; + + .address_card { + width: 50%; + margin-block: 0 !important; + max-height: 17vw; + } + + .info_card { + width: 50%; + } + } + + .student_table { + width: 100%; + } + } + } +} \ No newline at end of file diff --git a/src/Styles/Pages/StudentInfoCard.scss b/src/Styles/Pages/StudentInfoCard.scss deleted file mode 100644 index efe2635..0000000 --- a/src/Styles/Pages/StudentInfoCard.scss +++ /dev/null @@ -1,101 +0,0 @@ -.single_student{ - display: flex; - .single_student_body{ - display: flex; - width: 100%; - .student_info{ - width: 32%; - } - .student_table{ - width: 68%; - } - } -} - - -.student_info_card{ - width: 24vw; - box-shadow: 2px 2px 8px 3px rgba(0, 0, 0, 0.1); - border-radius: 10px; - padding: 20px 15px ; - .student_info_card_header{ - display: flex; - gap: 10px; - img{ - width: 24%; - } - .student_name_and_sub{ - display: flex; flex-direction: column;justify-content: center; - span{ - color: greenyellow; - } - h2{ - font-size: 22px; - } - } - } - .student_info_card_body{ - display: flex; flex-direction: column; - gap: 30px; - span{ - display: flex;justify-content: space-between; - h4{ - color: #202C4B; - font-size: 20px; - } - p{ - color: #6A7287; - } - } - } -} - -.student_address_card{ - width: 24vw; - box-shadow: 2px 2px 8px 3px rgba(0, 0, 0, 0.1); - border-radius: 10px; - padding: 20px 15px ; - margin-top: 30px; - .student_address_card_body{ - display: flex;align-items: center; - gap: 15px; - svg{ - @include Flex; - border-radius: 5px; - background: #F2F4F8; - width: 40px;height: 40px; - padding: 7px; - } - p{ - color: #6A7287; - } - } -} - - - -@media screen and (max-width:1250px) { - .single_student{ - display: flex; - .single_student_body{ - display: flex;flex-direction: column !important; - width: 100%; - .student_info{ - display: flex; - width: 100%; - gap: 20px; - .student_address_card{ - width: 50%; - margin-top: 0 !important; - max-height: 17vw ; - } - .student_info_card{ - width: 50%; - } - } - .student_table{ - width: 100%; - } - } - } -} diff --git a/src/Styles/Pages/index.scss b/src/Styles/Pages/index.scss index fb57c55..1f410e0 100644 --- a/src/Styles/Pages/index.scss +++ b/src/Styles/Pages/index.scss @@ -10,4 +10,4 @@ @import "./Marks.scss"; @import "./exercise.scss"; @import './reSeller.scss'; -@import './StudentInfoCard.scss'; +@import './InfoCard.scss'; \ No newline at end of file diff --git a/src/Styles/Tables/Table.scss b/src/Styles/Tables/Table.scss index 026cd85..3b59b1a 100644 --- a/src/Styles/Tables/Table.scss +++ b/src/Styles/Tables/Table.scss @@ -55,10 +55,10 @@ margin-left: 29px; } -/* Ant tabs nav list */ -.ant-tabs-nav .ant-tabs-nav-wrap .ant-tabs-nav-list { - width: 100%; -} +// /* Ant tabs nav list */ +// .ant-tabs-nav .ant-tabs-nav-wrap .ant-tabs-nav-list { +// width: 100%; +// } .ant-tabs > .ant-tabs-nav, .ant-tabs > div > .ant-tabs-nav { diff --git a/src/enums/Model.ts b/src/enums/Model.ts index de37336..75f16b5 100644 --- a/src/enums/Model.ts +++ b/src/enums/Model.ts @@ -176,6 +176,11 @@ export enum ModalEnum { RE_SELLER_ADD = "ReSeller.add", RE_SELLER_DELETE = "ReSeller.delete", + /// ReSeller + RE_SELLER_COLLECTION_EDIT = "ReSeller.edit", + RE_SELLER_COLLECTION_ADD = "ReSeller.add", + RE_SELLER_COLLECTION_DELETE = "ReSeller.delete", + /// Param Param_EDIT = "Param.edit", Param_ADD = "Param.add", diff --git a/src/enums/params.ts b/src/enums/params.ts index 0214cda..c16b172 100644 --- a/src/enums/params.ts +++ b/src/enums/params.ts @@ -11,4 +11,5 @@ export enum ParamsEnum { LESSON_ID = "lesson_id", QUESTION_ID = "question_id", CHILDREN_QUESTION_ID = "children_question_id", + RE_SELLER_ID = "re_seller_id", } diff --git a/src/translate/ar.json b/src/translate/ar.json index 6eeccf4..ff51939 100644 --- a/src/translate/ar.json +++ b/src/translate/ar.json @@ -193,7 +193,16 @@ "normal_question": " تمرين عادي", "hint":"شرح ", "tags":"كلمات مفتاحية", - "course":" الصفوف" + "course":" الصفوف", + "student_full_name":"اسم الطالب الثلاثي", + "amount_paid":"المبلغ المدفوع", + "sale_date":"تاريخ البيع", + "grade":"الصف", + "package":"حزمة", + "ID":"ID", + "residual":"المتبقي", + "date_of_receipt":"تاريخ الاستلام", + "amount":"مبلغ" }, "practical": { "to_confirm_deletion_please_re_enter": "لتأكيد الحذف، يرجى إعادة الإدخال", @@ -243,7 +252,12 @@ "Abbreviations": "الاختصارات", "address":"العنوان", "quiz":"الاختبارات", - "hightes_quiz":"اعلى اختبار" + "hightes_quiz":"اعلى اختبار", + "sales":"المبيعات", + "collections":"التحصيلات", + "collecting_an_amount":"تحصيل مبلغ", + "governorate":"المحافظة", + "id_photo":"صورة الهوية" }, "Table": { "header": "", @@ -314,8 +328,9 @@ "user_details": "تفاصيل المستخدم", "reseller_details": "تفاصيل اعادة البيع", "reseller": "البائعين", - "student_package": "حزمة الطالب" - }, + "student_package": "حزمة الطالب", + "collection":"تحصيل" + }, "education_class_actions": { "Student_Records": "سجلات الطلاب", "Attendance": "الحضور", @@ -433,7 +448,9 @@ "grade":"الصفوف", "subject":"المادة", "unit":"الوحدة", - "lesson":"الدرس" + "lesson":"الدرس", + "date_of_receipt":"تاريخ الاستلام", + "amount_value":"قيمة المبلغ" }, "select": { "enums": { @@ -800,7 +817,8 @@ "report": "تقرير", "tags": "كلمات مفتاحية", "reseller":"البائعين", - "QuestionBank":"بنك الأسئلة" + "QuestionBank":"بنك الأسئلة", + "reseller_details":"تفاصيل البائع" }, "page_header": { "home": "لوحة القيادة", @@ -838,7 +856,8 @@ "add_reseller": " البائعين / إضافة بائع ", "param": "معامل", "student_package": "حزمة الطالب", - "QuestionBank":"بنك الأسئلة" + "QuestionBank":"بنك الأسئلة", + "reseller_details":"تفاصيل البائع" }, "table": { "student": "قائمة الطلاب",