formate
This commit is contained in:
parent
bd59108fdc
commit
9f433d3f9b
|
|
@ -11,7 +11,6 @@ import { RoleByType } from "./utils/RoleByType";
|
||||||
const Page404 = lazy(() => import("./Layout/Ui/NotFoundPage"));
|
const Page404 = lazy(() => import("./Layout/Ui/NotFoundPage"));
|
||||||
const Auth = lazy(() => import("./Pages/Auth/Page"));
|
const Auth = lazy(() => import("./Pages/Auth/Page"));
|
||||||
const App = () => {
|
const App = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route
|
<Route
|
||||||
|
|
@ -36,10 +35,10 @@ const App = () => {
|
||||||
{renderRoutesRecursively(menuItems)}
|
{renderRoutesRecursively(menuItems)}
|
||||||
|
|
||||||
{CrudRoute.map((route) => {
|
{CrudRoute.map((route) => {
|
||||||
const useAbility = hasAbility(route.abilities, route.abilities_value);
|
const useAbility = hasAbility(route.abilities, route.abilities_value);
|
||||||
if(!RoleByType(route)){
|
if (!RoleByType(route)) {
|
||||||
return false ;
|
return false;
|
||||||
}
|
}
|
||||||
if (!useAbility) {
|
if (!useAbility) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ const PdfUploader = ({
|
||||||
}: any) => {
|
}: any) => {
|
||||||
const { formik, t, isError } = useFormField(name, props);
|
const { formik, t, isError } = useFormField(name, props);
|
||||||
let FormikName = formik.values[name];
|
let FormikName = formik.values[name];
|
||||||
const imageUrl = formik.values[name] ? FormikName : "";
|
const imageUrl = formik.values[name] ? FormikName : "";
|
||||||
const [Imageurl, setImageurl] = useState(null);
|
const [Imageurl, setImageurl] = useState(null);
|
||||||
|
|
||||||
const FilehandleChange = (value: any) => {
|
const FilehandleChange = (value: any) => {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { useFormikContext } from "formik";
|
||||||
|
|
||||||
const SelectTag: React.FC = () => {
|
const SelectTag: React.FC = () => {
|
||||||
const [searchValue, setSearchValue] = useState<string>("");
|
const [searchValue, setSearchValue] = useState<string>("");
|
||||||
|
|
||||||
const [fieldValue, setFieldValue] = useState<string>("");
|
const [fieldValue, setFieldValue] = useState<string>("");
|
||||||
const formik = useFormikContext<any>();
|
const formik = useFormikContext<any>();
|
||||||
const handleChange = (value: string[]) => {
|
const handleChange = (value: string[]) => {
|
||||||
|
|
@ -38,18 +38,16 @@ const SelectTag: React.FC = () => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
const options = data?.data ?? [];
|
const options = data?.data ?? [];
|
||||||
const additionalData =
|
const additionalData =
|
||||||
options.length < 1 && searchValue.length > 1 && !isLoading
|
options.length < 1 && searchValue.length > 1 && !isLoading
|
||||||
? [{ id: searchValue, name: searchValue }]
|
? [{ id: searchValue, name: searchValue }]
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
|
const value =
|
||||||
|
formik?.values?.tags?.map((item: any) => item?.id ?? item) ?? [];
|
||||||
|
|
||||||
|
const AllOptions = [...options, ...additionalData];
|
||||||
|
|
||||||
const value = formik?.values?.tags?.map((item: any) => item?.id ?? item) ?? [];
|
|
||||||
|
|
||||||
|
|
||||||
const AllOptions = [...options, ...additionalData]
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="SelectTag">
|
<div className="SelectTag">
|
||||||
<label htmlFor="">{t("models.tag")}</label>
|
<label htmlFor="">{t("models.tag")}</label>
|
||||||
|
|
|
||||||
|
|
@ -15,22 +15,17 @@ const SearchField: React.FC<Props> = ({ placeholder, searchBy }) => {
|
||||||
const [searchQuery, setSearchQuery] = useState<string>("");
|
const [searchQuery, setSearchQuery] = useState<string>("");
|
||||||
const inputRef = useRef<HTMLInputElement>(null);
|
const inputRef = useRef<HTMLInputElement>(null);
|
||||||
|
|
||||||
|
const { setFilter } = useFilterStateState();
|
||||||
|
|
||||||
const {setFilter} = useFilterStateState()
|
|
||||||
|
|
||||||
const handleInputChange = (value: string) => {
|
const handleInputChange = (value: string) => {
|
||||||
setSearchQuery(value);
|
setSearchQuery(value);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleInputChangeWithDebounce = useDebounce(
|
const handleInputChangeWithDebounce = useDebounce((value: string) => {
|
||||||
(value: string) => {
|
setFilter({
|
||||||
setFilter({
|
name: value,
|
||||||
name:value
|
});
|
||||||
})
|
});
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
const handleToggleDropdown = () => {
|
const handleToggleDropdown = () => {
|
||||||
setIsOpen(!isOpen);
|
setIsOpen(!isOpen);
|
||||||
|
|
@ -60,7 +55,10 @@ const SearchField: React.FC<Props> = ({ placeholder, searchBy }) => {
|
||||||
className="search__input"
|
className="search__input"
|
||||||
placeholder={t(placeholder)}
|
placeholder={t(placeholder)}
|
||||||
value={searchQuery}
|
value={searchQuery}
|
||||||
onChange={(e) => {handleInputChange(e.target.value) ; handleInputChangeWithDebounce(e.target.value)}}
|
onChange={(e) => {
|
||||||
|
handleInputChange(e.target.value);
|
||||||
|
handleInputChangeWithDebounce(e.target.value);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,11 @@ import { useFilterStateState } from "../../zustand/Filter";
|
||||||
|
|
||||||
const OrderBySelect = () => {
|
const OrderBySelect = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const {setFilter} = useFilterStateState()
|
const { setFilter } = useFilterStateState();
|
||||||
const handleChange = (value: string) => {
|
const handleChange = (value: string) => {
|
||||||
setFilter({
|
setFilter({
|
||||||
sort_by:value
|
sort_by: value,
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -29,8 +29,14 @@ const OrderBySelect = () => {
|
||||||
options={[
|
options={[
|
||||||
{ value: "ascending", label: t("select.array.order.ascending") },
|
{ value: "ascending", label: t("select.array.order.ascending") },
|
||||||
{ value: "descending", label: t("select.array.order.descending") },
|
{ value: "descending", label: t("select.array.order.descending") },
|
||||||
{ value: "recently_viewed", label: t("select.array.order.recently_viewed") },
|
{
|
||||||
{ value: "recently_arrived", label: t("select.array.order.recently_arrived") },
|
value: "recently_viewed",
|
||||||
|
label: t("select.array.order.recently_viewed"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "recently_arrived",
|
||||||
|
label: t("select.array.order.recently_arrived"),
|
||||||
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import { Divider, Select } from "antd";
|
||||||
import usePagination from "../../Layout/Dashboard/usePagination";
|
import usePagination from "../../Layout/Dashboard/usePagination";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
|
|
||||||
const PaginationColumn = () => {
|
const PaginationColumn = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
@ -13,7 +12,6 @@ const PaginationColumn = () => {
|
||||||
navigate(`?per_page=${value}`);
|
navigate(`?per_page=${value}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="pagination_column">
|
<div className="pagination_column">
|
||||||
<Select
|
<Select
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,20 @@
|
||||||
import React from 'react'
|
import React from "react";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
interface IFilterBody {
|
interface IFilterBody {
|
||||||
children:React.ReactNode
|
children: React.ReactNode;
|
||||||
}
|
}
|
||||||
const useFilter = () => {
|
const useFilter = () => {
|
||||||
|
const FilterButton = () => {
|
||||||
|
return <div>FilterButton</div>;
|
||||||
|
};
|
||||||
|
const FilterBody = ({ children }: IFilterBody) => {
|
||||||
|
return <div>FilterBody</div>;
|
||||||
|
};
|
||||||
|
|
||||||
const FilterButton = ()=>{
|
return {
|
||||||
return (
|
FilterButton,
|
||||||
<div>
|
FilterBody,
|
||||||
FilterButton
|
};
|
||||||
</div>
|
};
|
||||||
)
|
|
||||||
}
|
|
||||||
const FilterBody = ({children}:IFilterBody)=>{
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
FilterBody
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
export default useFilter;
|
||||||
FilterButton , FilterBody
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default useFilter
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
export enum FilterEnum {
|
export enum FilterEnum {
|
||||||
FILTER="FILTER"
|
FILTER = "FILTER",
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,14 +21,6 @@ export const useFilterState = create<FilterState>((set, get) => ({
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// import { create } from "zustand";
|
// import { create } from "zustand";
|
||||||
|
|
||||||
// interface FilterState {
|
// interface FilterState {
|
||||||
|
|
@ -66,7 +58,7 @@ export const useFilterState = create<FilterState>((set, get) => ({
|
||||||
// ...data,
|
// ...data,
|
||||||
// starting_date: formatDate(data.starting_date),
|
// starting_date: formatDate(data.starting_date),
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// set(() => ({ filterState: formattedData }));
|
// set(() => ({ filterState: formattedData }));
|
||||||
// },
|
// },
|
||||||
// }));
|
// }));
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,12 @@
|
||||||
import React, { ReactNode, useEffect, useState } from "react";
|
import React, { ReactNode, useEffect, useState } from "react";
|
||||||
import { FaFilter } from "react-icons/fa";
|
import { FaFilter } from "react-icons/fa";
|
||||||
import { Form, Formik, FormikConfig, FormikHelpers, useFormikContext } from "formik";
|
import {
|
||||||
|
Form,
|
||||||
|
Formik,
|
||||||
|
FormikConfig,
|
||||||
|
FormikHelpers,
|
||||||
|
useFormikContext,
|
||||||
|
} from "formik";
|
||||||
import { Button, ButtonProps, Divider, Modal } from "antd";
|
import { Button, ButtonProps, Divider, Modal } from "antd";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useModalState } from "./Modal";
|
import { useModalState } from "./Modal";
|
||||||
|
|
@ -38,12 +44,12 @@ const useFilter = () => {
|
||||||
const { filterState, setFilterState, clearFilterState } = useFilterState();
|
const { filterState, setFilterState, clearFilterState } = useFilterState();
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const [formValues, setFormValues] = useState({});
|
const [formValues, setFormValues] = useState({});
|
||||||
const formik = useFormikContext()
|
const formik = useFormikContext();
|
||||||
// Define the type for the callback
|
// Define the type for the callback
|
||||||
type SubmitCallback = () => void;
|
type SubmitCallback = () => void;
|
||||||
// console.log(formik?.values);
|
// console.log(formik?.values);
|
||||||
// console.log(InitialValue);
|
// console.log(InitialValue);
|
||||||
|
|
||||||
const FilterButton = () => {
|
const FilterButton = () => {
|
||||||
const handleState = () => {
|
const handleState = () => {
|
||||||
if (isOpen === ModalEnum?.FILTER) {
|
if (isOpen === ModalEnum?.FILTER) {
|
||||||
|
|
@ -61,15 +67,12 @@ const useFilter = () => {
|
||||||
{t("Filter")}
|
{t("Filter")}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setFormValues({})
|
setFormValues({});
|
||||||
setFilterState({})
|
setFilterState({});
|
||||||
}, [])
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const FilterBody = ({
|
const FilterBody = ({
|
||||||
onSubmit,
|
onSubmit,
|
||||||
children,
|
children,
|
||||||
|
|
@ -83,7 +86,7 @@ const useFilter = () => {
|
||||||
isOpen,
|
isOpen,
|
||||||
...formikProps
|
...formikProps
|
||||||
}: FormikFormProps) => {
|
}: FormikFormProps) => {
|
||||||
const handleSubmit = (values: any) => {
|
const handleSubmit = (values: any) => {
|
||||||
setFilterState(values);
|
setFilterState(values);
|
||||||
setFormValues(values);
|
setFormValues(values);
|
||||||
if (onSubmit) {
|
if (onSubmit) {
|
||||||
|
|
@ -93,76 +96,85 @@ const useFilter = () => {
|
||||||
setIsOpen("");
|
setIsOpen("");
|
||||||
};
|
};
|
||||||
const handleCancel = (isCancel = false) => {
|
const handleCancel = (isCancel = false) => {
|
||||||
|
if (isCancel) {
|
||||||
if(isCancel){
|
|
||||||
setIsOpen("");
|
setIsOpen("");
|
||||||
return ;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setIsOpen("");
|
setIsOpen("");
|
||||||
clearFilterState();
|
clearFilterState();
|
||||||
setFormValues({});
|
setFormValues({});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleOpen = () => {
|
const handleOpen = () => {
|
||||||
setIsOpen(true);
|
setIsOpen(true);
|
||||||
// setObjectToEdit({});
|
// setObjectToEdit({});
|
||||||
};
|
};
|
||||||
|
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Modal
|
<Modal
|
||||||
className={"ModalForm " + ModelClassName}
|
className={"ModalForm " + ModelClassName}
|
||||||
centered
|
centered
|
||||||
width={width}
|
width={width}
|
||||||
footer={null}
|
footer={null}
|
||||||
open={isOpen}
|
open={isOpen}
|
||||||
onOk={handleOpen}
|
onOk={handleOpen}
|
||||||
onCancel={()=>{}}
|
onCancel={() => {}}
|
||||||
mask={false}
|
mask={false}
|
||||||
style={{ position: "absolute", top: "31.4%", left: "16.7%" }}
|
style={{ position: "absolute", top: "31.4%", left: "16.7%" }}
|
||||||
>
|
|
||||||
<Formik
|
|
||||||
enableReinitialize={true}
|
|
||||||
onSubmit={handleSubmit}
|
|
||||||
initialValues={formValues}
|
|
||||||
onReset={()=>{handleCancel(false)}}
|
|
||||||
{...formikProps}
|
|
||||||
>
|
>
|
||||||
{(formik) => {
|
<Formik
|
||||||
|
enableReinitialize={true}
|
||||||
return (
|
onSubmit={handleSubmit}
|
||||||
<Form>
|
initialValues={formValues}
|
||||||
|
onReset={() => {
|
||||||
<div>
|
handleCancel(false);
|
||||||
<header> {t("models.filter")} <FaXmark onClick={()=>handleCancel(true)} /> </header>
|
}}
|
||||||
<Divider />
|
{...formikProps}
|
||||||
<main className="main_modal">
|
>
|
||||||
{isLoading ? <SpinContainer /> : children}
|
{(formik) => {
|
||||||
<Divider />
|
return (
|
||||||
</main>
|
<Form>
|
||||||
</div>
|
<div>
|
||||||
</Form>
|
<header>
|
||||||
)
|
{" "}
|
||||||
}}
|
{t("models.filter")}{" "}
|
||||||
|
<FaXmark onClick={() => handleCancel(true)} />{" "}
|
||||||
</Formik>
|
</header>
|
||||||
</Modal>
|
<Divider />
|
||||||
</>
|
<main className="main_modal">
|
||||||
|
{isLoading ? <SpinContainer /> : children}
|
||||||
|
<Divider />
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</Form>
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
</Formik>
|
||||||
|
</Modal>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
interface SubmitButtonProps extends Omit<ButtonProps, "loading"> {
|
interface SubmitButtonProps extends Omit<ButtonProps, "loading"> {}
|
||||||
}
|
|
||||||
const FilterSubmit = ({ ...buttonProps }: SubmitButtonProps) => {
|
const FilterSubmit = ({ ...buttonProps }: SubmitButtonProps) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="filter-submit-buttons buttons">
|
<div className="filter-submit-buttons buttons">
|
||||||
<Button className="back_button filter_modal_add_button" type="default" htmlType="reset">
|
<Button
|
||||||
|
className="back_button filter_modal_add_button"
|
||||||
|
type="default"
|
||||||
|
htmlType="reset"
|
||||||
|
>
|
||||||
{t("practical.reset")}
|
{t("practical.reset")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button className="add_button pointer filter_modal_add_button" type="primary" {...buttonProps} htmlType="submit">
|
<Button
|
||||||
|
className="add_button pointer filter_modal_add_button"
|
||||||
|
type="primary"
|
||||||
|
{...buttonProps}
|
||||||
|
htmlType="submit"
|
||||||
|
>
|
||||||
{t(`practical.submit`)}
|
{t(`practical.submit`)}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -186,5 +198,4 @@ const useFilter = () => {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export default useFilter;
|
export default useFilter;
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ const Default = ({
|
||||||
label_icon,
|
label_icon,
|
||||||
...props
|
...props
|
||||||
}: any) => {
|
}: any) => {
|
||||||
const { errorMsg, isError, t,formik } = useFormField(name, props);
|
const { errorMsg, isError, t, formik } = useFormField(name, props);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="ValidationField w-100">
|
<div className="ValidationField w-100">
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ const SelectField = ({
|
||||||
};
|
};
|
||||||
const options = translateOptions(option, t);
|
const options = translateOptions(option, t);
|
||||||
console.log(options);
|
console.log(options);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="ValidationField w-100">
|
<div className="ValidationField w-100">
|
||||||
<ValidationFieldLabel
|
<ValidationFieldLabel
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
export const translateOptions = (options: any, t: any) => {
|
export const translateOptions = (options: any, t: any) => {
|
||||||
console.log(options);
|
console.log(options);
|
||||||
|
|
||||||
return options?.map((opt: any) => ({
|
return options?.map((opt: any) => ({
|
||||||
...opt,
|
...opt,
|
||||||
label: t(`${opt?.label}`),
|
label: t(`${opt?.label}`),
|
||||||
|
|
|
||||||
|
|
@ -26,23 +26,27 @@ const Header = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const content = (
|
||||||
const content = (
|
<div>
|
||||||
<div>
|
<p>
|
||||||
<p> (CTRL + SHIFT + {CombinationKeyEnum.CHOICE}) {t("header.add_choice")} </p>
|
{" "}
|
||||||
<p> (CTRL + SHIFT + {CombinationKeyEnum.QUESTION}) {t("header.add_question")} </p>
|
(CTRL + SHIFT + {CombinationKeyEnum.CHOICE}) {t("header.add_choice")}{" "}
|
||||||
</div>
|
</p>
|
||||||
);
|
<p>
|
||||||
|
{" "}
|
||||||
|
(CTRL + SHIFT + {CombinationKeyEnum.QUESTION}){" "}
|
||||||
|
{t("header.add_question")}{" "}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<header className="exercise_add_header mb-4">
|
<header className="exercise_add_header mb-4">
|
||||||
<article>
|
<article>
|
||||||
|
|
||||||
|
|
||||||
<Popover content={content} title={t("practical.Abbreviations")}>
|
<Popover content={content} title={t("practical.Abbreviations")}>
|
||||||
<img src="/Icon/QuestionIcon.svg" alt="" />
|
<img src="/Icon/QuestionIcon.svg" alt="" />
|
||||||
</Popover>
|
</Popover>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
{t("practical.add")} {t("models.exercise")}{" "}
|
{t("practical.add")} {t("models.exercise")}{" "}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,35 @@
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from "react";
|
||||||
|
|
||||||
type KeyCombination = {
|
type KeyCombination = {
|
||||||
ctrlKey?: boolean;
|
ctrlKey?: boolean;
|
||||||
shiftKey?: boolean;
|
shiftKey?: boolean;
|
||||||
code: string; // Use string here for flexibility
|
code: string; // Use string here for flexibility
|
||||||
};
|
};
|
||||||
|
|
||||||
const useKeyCombination = (keyCombination: KeyCombination, callback: () => void) => {
|
const useKeyCombination = (
|
||||||
|
keyCombination: KeyCombination,
|
||||||
|
callback: () => void,
|
||||||
|
) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyDown = (event: KeyboardEvent) => {
|
const handleKeyDown = (event: KeyboardEvent) => {
|
||||||
const matches =
|
const matches =
|
||||||
(keyCombination.ctrlKey === undefined || event.ctrlKey === keyCombination.ctrlKey) &&
|
(keyCombination.ctrlKey === undefined ||
|
||||||
(keyCombination.shiftKey === undefined || event.shiftKey === keyCombination.shiftKey) &&
|
event.ctrlKey === keyCombination.ctrlKey) &&
|
||||||
|
(keyCombination.shiftKey === undefined ||
|
||||||
|
event.shiftKey === keyCombination.shiftKey) &&
|
||||||
event.code === keyCombination.code;
|
event.code === keyCombination.code;
|
||||||
|
|
||||||
if (matches) {
|
if (matches) {
|
||||||
callback();
|
callback();
|
||||||
event.preventDefault(); // Prevent the default action for the event
|
event.preventDefault(); // Prevent the default action for the event
|
||||||
event.stopPropagation(); // Stop the event from propagating further
|
event.stopPropagation(); // Stop the event from propagating further
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
window.addEventListener('keydown', handleKeyDown);
|
window.addEventListener("keydown", handleKeyDown);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
window.removeEventListener('keydown', handleKeyDown);
|
window.removeEventListener("keydown", handleKeyDown);
|
||||||
};
|
};
|
||||||
}, [keyCombination, callback]);
|
}, [keyCombination, callback]);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,14 @@ interface ModalFormProps {
|
||||||
deleteMutation: any;
|
deleteMutation: any;
|
||||||
ModelEnum: any;
|
ModelEnum: any;
|
||||||
isNavigate?: boolean;
|
isNavigate?: boolean;
|
||||||
idVerify?:boolean
|
idVerify?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DeleteModels: React.FC<ModalFormProps> = ({
|
const DeleteModels: React.FC<ModalFormProps> = ({
|
||||||
deleteMutation,
|
deleteMutation,
|
||||||
ModelEnum,
|
ModelEnum,
|
||||||
isNavigate = false,
|
isNavigate = false,
|
||||||
idVerify = true
|
idVerify = true,
|
||||||
}) => {
|
}) => {
|
||||||
const { isOpen, setIsOpen } = useModalState((state) => state);
|
const { isOpen, setIsOpen } = useModalState((state) => state);
|
||||||
const [inputValue, setInputValue] = useState("");
|
const [inputValue, setInputValue] = useState("");
|
||||||
|
|
@ -27,10 +27,9 @@ const DeleteModels: React.FC<ModalFormProps> = ({
|
||||||
console.log(objectToEdit?.key);
|
console.log(objectToEdit?.key);
|
||||||
console.log(inputValue);
|
console.log(inputValue);
|
||||||
|
|
||||||
const iaDisabled =
|
const iaDisabled = idVerify
|
||||||
idVerify ?
|
? Number(objectToEdit?.id) !== Number(inputValue) || isLoading
|
||||||
Number(objectToEdit?.id) !== Number(inputValue) || isLoading
|
: objectToEdit?.key !== inputValue || isLoading;
|
||||||
: objectToEdit?.key !== inputValue || isLoading;
|
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -44,13 +43,13 @@ const DeleteModels: React.FC<ModalFormProps> = ({
|
||||||
}, [isSuccess, setIsOpen]);
|
}, [isSuccess, setIsOpen]);
|
||||||
|
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
idVerify?
|
idVerify
|
||||||
mutate({
|
? mutate({
|
||||||
id: Number(objectToEdit?.id),
|
id: Number(objectToEdit?.id),
|
||||||
})
|
})
|
||||||
: mutate({
|
: mutate({
|
||||||
id:objectToEdit?.key,
|
id: objectToEdit?.key,
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,9 @@ const FilterLayout = ({
|
||||||
// type: type,
|
// type: type,
|
||||||
// page: currentPage,
|
// page: currentPage,
|
||||||
|
|
||||||
const { FilterBody , FilterSubmit} = useFilter();
|
const { FilterBody, FilterSubmit } = useFilter();
|
||||||
return (
|
return (
|
||||||
<div className="filter_header">
|
<div className="filter_header">
|
||||||
|
|
||||||
<div className="filter_header_top">
|
<div className="filter_header_top">
|
||||||
<h4>{t(filterTitle)}</h4>
|
<h4>{t(filterTitle)}</h4>
|
||||||
|
|
||||||
|
|
@ -40,7 +39,7 @@ const FilterLayout = ({
|
||||||
setIsOpen={setIsOpen}
|
setIsOpen={setIsOpen}
|
||||||
>
|
>
|
||||||
<div className="model_sub_children">{sub_children}</div>
|
<div className="model_sub_children">{sub_children}</div>
|
||||||
<FilterSubmit/>
|
<FilterSubmit />
|
||||||
</FilterBody>
|
</FilterBody>
|
||||||
<div className="filter_button" onClick={() => setIsOpen(true)}>
|
<div className="filter_button" onClick={() => setIsOpen(true)}>
|
||||||
<span>
|
<span>
|
||||||
|
|
@ -55,7 +54,6 @@ const FilterLayout = ({
|
||||||
<OrderBySelect />
|
<OrderBySelect />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
@ -70,7 +68,6 @@ const FilterLayout = ({
|
||||||
<div className="header_search">
|
<div className="header_search">
|
||||||
<SearchField searchBy="" placeholder={t("practical.search_here")} />
|
<SearchField searchBy="" placeholder={t("practical.search_here")} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ const FormikFormModel: React.FC<FormikFormProps> = ({
|
||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
validationSchema={validationSchema}
|
validationSchema={validationSchema}
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
|
|
||||||
>
|
>
|
||||||
{(formik) => {
|
{(formik) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ const PageHeader = ({
|
||||||
navigate(location);
|
navigate(location);
|
||||||
};
|
};
|
||||||
console.log();
|
console.log();
|
||||||
const {PageTitle} = usePageTitleState()
|
const { PageTitle } = usePageTitleState();
|
||||||
return (
|
return (
|
||||||
<div className="page_header">
|
<div className="page_header">
|
||||||
<header className="d-flex justify-content-between">
|
<header className="d-flex justify-content-between">
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ const DataTable: React.FC<DataTableProps> = ({
|
||||||
rowClassName={(record, index) => getRowClassName(record, index)}
|
rowClassName={(record, index) => getRowClassName(record, index)}
|
||||||
className="DataTable"
|
className="DataTable"
|
||||||
loading={{
|
loading={{
|
||||||
spinning: isLoading || isRefetching ,
|
spinning: isLoading || isRefetching,
|
||||||
indicator: (
|
indicator: (
|
||||||
<Suspense fallback={<></>}>
|
<Suspense fallback={<></>}>
|
||||||
<LoadingLottie />
|
<LoadingLottie />
|
||||||
|
|
|
||||||
|
|
@ -50,10 +50,9 @@ const SideBar = ({
|
||||||
if (!useAbility) {
|
if (!useAbility) {
|
||||||
return <React.Fragment key={index}></React.Fragment>;
|
return <React.Fragment key={index}></React.Fragment>;
|
||||||
}
|
}
|
||||||
if(!RoleByType(item)){
|
if (!RoleByType(item)) {
|
||||||
|
return <React.Fragment key={index}></React.Fragment>;
|
||||||
return <React.Fragment key={index}></React.Fragment> ;
|
}
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
key={index}
|
key={index}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { useFormikContext } from "formik";
|
||||||
|
|
||||||
const FilterForm = () => {
|
const FilterForm = () => {
|
||||||
const formik = useFormikContext();
|
const formik = useFormikContext();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Row>
|
<Row>
|
||||||
|
|
@ -17,4 +17,4 @@ const FilterForm = () => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default FilterForm;
|
export default FilterForm;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ const DeleteModalForm = lazy(
|
||||||
const TableHeader = () => {
|
const TableHeader = () => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const deleteMutation = useDeleteGrade();
|
const deleteMutation = useDeleteGrade();
|
||||||
|
|
||||||
useSetPageTitle(t(`page_header.grade`));
|
useSetPageTitle(t(`page_header.grade`));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -30,10 +30,7 @@ const TableHeader = () => {
|
||||||
ModelAbility={ModalEnum?.GRADE_ADD}
|
ModelAbility={ModalEnum?.GRADE_ADD}
|
||||||
canAdd={canAddGrade}
|
canAdd={canAddGrade}
|
||||||
/>
|
/>
|
||||||
<FilterLayout
|
<FilterLayout sub_children={<FilterForm />} filterTitle="table.grade" />
|
||||||
sub_children={<FilterForm />}
|
|
||||||
filterTitle="table.grade"
|
|
||||||
/>
|
|
||||||
<Table />
|
<Table />
|
||||||
<AddModalForm />
|
<AddModalForm />
|
||||||
<EditModalForm />
|
<EditModalForm />
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@ import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
const { filterState } = useFilterState();
|
const { filterState } = useFilterState();
|
||||||
|
|
||||||
const response = useGetAllGrade({
|
const response = useGetAllGrade({
|
||||||
pagination: true,
|
pagination: true,
|
||||||
...filterState,
|
...filterState,
|
||||||
});
|
});
|
||||||
|
|
||||||
return <DataTable response={response} useColumns={useColumns} />;
|
return <DataTable response={response} useColumns={useColumns} />;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ export const useColumns = () => {
|
||||||
const { setObjectToEdit } = useObjectToEdit((state) => state);
|
const { setObjectToEdit } = useObjectToEdit((state) => state);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const handelShow = (record: Grade) => {
|
const handelShow = (record: Grade) => {
|
||||||
navigate(`${record?.id}`);
|
navigate(`${record?.id}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,16 @@
|
||||||
import { Col, Row } from "reactstrap";
|
import { Col, Row } from "reactstrap";
|
||||||
import ValidationField from "../../../../Components/ValidationField/ValidationField";
|
import ValidationField from "../../../../Components/ValidationField/ValidationField";
|
||||||
|
|
||||||
const Form = ({isEdit}:{isEdit?:boolean}) => {
|
const Form = ({ isEdit }: { isEdit?: boolean }) => {
|
||||||
return (
|
return (
|
||||||
<Row className="w-100">
|
<Row className="w-100">
|
||||||
<Col>
|
<Col>
|
||||||
<ValidationField placeholder="key" label="key" name="key" disabled={isEdit? true : false} />
|
<ValidationField
|
||||||
|
placeholder="key"
|
||||||
|
label="key"
|
||||||
|
name="key"
|
||||||
|
disabled={isEdit ? true : false}
|
||||||
|
/>
|
||||||
<ValidationField placeholder="value" label="value" name="value" />
|
<ValidationField placeholder="value" label="value" name="value" />
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
|
||||||
|
|
@ -12,4 +12,4 @@ export const getValidationSchema = () => {
|
||||||
key: Yup.mixed().required("validation.required"),
|
key: Yup.mixed().required("validation.required"),
|
||||||
value: Yup.mixed().required("validation.required"),
|
value: Yup.mixed().required("validation.required"),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,7 @@ const DeleteModalForm = lazy(
|
||||||
|
|
||||||
const TableHeader = () => {
|
const TableHeader = () => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
useSetPageTitle(
|
useSetPageTitle(t(`page_header.param`));
|
||||||
t(`page_header.param`),
|
|
||||||
);
|
|
||||||
const deleteMutation = useDeleteParam();
|
const deleteMutation = useDeleteParam();
|
||||||
return (
|
return (
|
||||||
<div className="TableWithHeader">
|
<div className="TableWithHeader">
|
||||||
|
|
|
||||||
|
|
@ -15,21 +15,27 @@ const App: React.FC = () => {
|
||||||
pagination: true,
|
pagination: true,
|
||||||
...filterState,
|
...filterState,
|
||||||
});
|
});
|
||||||
const [t] = useTranslation()
|
const [t] = useTranslation();
|
||||||
const transformedData = response?.data?.data && typeof response.data.data === 'object'
|
const transformedData =
|
||||||
? Object.entries(response.data.data).map(([key, value]) => ({
|
response?.data?.data && typeof response.data.data === "object"
|
||||||
key: key,
|
? Object.entries(response.data.data).map(([key, value]) => ({
|
||||||
value: value
|
key: key,
|
||||||
}))
|
value: value,
|
||||||
: [];
|
}))
|
||||||
|
: [];
|
||||||
return <DataTable response={response} useColumns={useColumns} dataSource={transformedData}
|
|
||||||
pagination={{
|
return (
|
||||||
nextIcon: <>{t("practical.next")}</>,
|
<DataTable
|
||||||
prevIcon: <> {t("practical.prev")} </>,
|
response={response}
|
||||||
className: "pagination_antd",
|
useColumns={useColumns}
|
||||||
}}
|
dataSource={transformedData}
|
||||||
/>;
|
pagination={{
|
||||||
|
nextIcon: <>{t("practical.next")}</>,
|
||||||
|
prevIcon: <> {t("practical.prev")} </>,
|
||||||
|
className: "pagination_antd",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,12 @@ import { ModalEnum } from "../../../enums/Model";
|
||||||
import { useObjectToEdit } from "../../../zustand/ObjectToEditState";
|
import { useObjectToEdit } from "../../../zustand/ObjectToEditState";
|
||||||
import { useModalState } from "../../../zustand/Modal";
|
import { useModalState } from "../../../zustand/Modal";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { canDeleteParam, canDeleteUser, canEditParam, canEditUser } from "../../../utils/hasAbilityFn";
|
import {
|
||||||
|
canDeleteParam,
|
||||||
|
canDeleteUser,
|
||||||
|
canEditParam,
|
||||||
|
canEditUser,
|
||||||
|
} from "../../../utils/hasAbilityFn";
|
||||||
import ActionButtons from "../../../Components/Table/ActionButtons";
|
import ActionButtons from "../../../Components/Table/ActionButtons";
|
||||||
|
|
||||||
export const useColumns = () => {
|
export const useColumns = () => {
|
||||||
|
|
@ -56,5 +61,3 @@ export const useColumns = () => {
|
||||||
|
|
||||||
return columns;
|
return columns;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,20 +6,17 @@ import { Spin } from "antd";
|
||||||
import { ModalEnum } from "../../../../enums/Model";
|
import { ModalEnum } from "../../../../enums/Model";
|
||||||
import { canAddReSeller } from "../../../../utils/hasAbilityFn";
|
import { canAddReSeller } from "../../../../utils/hasAbilityFn";
|
||||||
import PersonalDetailsForm from "../Form/PersonalDetailsForm";
|
import PersonalDetailsForm from "../Form/PersonalDetailsForm";
|
||||||
import { Formik ,Form} from "formik";
|
import { Formik, Form } from "formik";
|
||||||
import { getInitialValues, getValidationSchema } from "../Form/formUtils";
|
import { getInitialValues, getValidationSchema } from "../Form/formUtils";
|
||||||
import TitleDetailsForm from "../Form/TitleDetailsForm";
|
import TitleDetailsForm from "../Form/TitleDetailsForm";
|
||||||
import AttachmentForm from "../Form/AttachmentForm";
|
import AttachmentForm from "../Form/AttachmentForm";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const TableHeader = () => {
|
const TableHeader = () => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
useSetPageTitle(t(`page_header.add_reseller`));
|
useSetPageTitle(t(`page_header.add_reseller`));
|
||||||
const handelSubmit = (values:any)=>{
|
const handelSubmit = (values: any) => {
|
||||||
console.log(values,"values");
|
console.log(values, "values");
|
||||||
|
};
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
<div className="TableWithHeader">
|
<div className="TableWithHeader">
|
||||||
<Suspense fallback={<Spin />}>
|
<Suspense fallback={<Spin />}>
|
||||||
|
|
@ -28,21 +25,22 @@ const TableHeader = () => {
|
||||||
ModelAbility={ModalEnum?.RE_SELLER_ADD}
|
ModelAbility={ModalEnum?.RE_SELLER_ADD}
|
||||||
canAdd={false}
|
canAdd={false}
|
||||||
/>
|
/>
|
||||||
<div className="bg2" >
|
<div className="bg2">
|
||||||
<Formik initialValues={getInitialValues({})} validationSchema={getValidationSchema} onSubmit={handelSubmit} >
|
<Formik
|
||||||
|
initialValues={getInitialValues({})}
|
||||||
|
validationSchema={getValidationSchema}
|
||||||
|
onSubmit={handelSubmit}
|
||||||
|
>
|
||||||
<Form>
|
<Form>
|
||||||
<PersonalDetailsForm/>
|
<PersonalDetailsForm />
|
||||||
<TitleDetailsForm/>
|
<TitleDetailsForm />
|
||||||
<AttachmentForm/>
|
<AttachmentForm />
|
||||||
<div className="resellerButton">
|
<div className="resellerButton">
|
||||||
<button type="button">
|
<button type="button">{t("practical.cancel")}</button>
|
||||||
{t("practical.cancel")}
|
<button type="submit">
|
||||||
</button>
|
{t("practical.add")} {t("models.reseller")}
|
||||||
<button type="submit">
|
</button>
|
||||||
{t("practical.add")} {t("models.reseller")}
|
</div>
|
||||||
</button>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</Form>
|
</Form>
|
||||||
</Formik>
|
</Formik>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
import React from 'react'
|
import React from "react";
|
||||||
|
|
||||||
const Page = () => {
|
const Page = () => {
|
||||||
return (
|
return <div>Page</div>;
|
||||||
<div>Page</div>
|
};
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Page
|
export default Page;
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,23 @@
|
||||||
import React from 'react'
|
import React from "react";
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from "react-i18next";
|
||||||
import { FaImage } from 'react-icons/fa'
|
import { FaImage } from "react-icons/fa";
|
||||||
import ImageBoxField from './ImageBoxField/ImageBoxField';
|
import ImageBoxField from "./ImageBoxField/ImageBoxField";
|
||||||
|
|
||||||
const AttachmentForm = () => {
|
const AttachmentForm = () => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='AttachmentForm'>
|
<div className="AttachmentForm">
|
||||||
<header className='header_form'>
|
<header className="header_form">
|
||||||
<FaImage />
|
<FaImage />
|
||||||
<h4>{t("header.attachment")}</h4>
|
<h4>{t("header.attachment")}</h4>
|
||||||
</header>
|
</header>
|
||||||
<main className='main_form_body'>
|
<main className="main_form_body">
|
||||||
|
<ImageBoxField name="personal_image" />
|
||||||
<ImageBoxField name="personal_image" />
|
<ImageBoxField name="id_image" />
|
||||||
<ImageBoxField name="id_image" />
|
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
export default AttachmentForm
|
export default AttachmentForm;
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,11 @@ const FilterForm = () => {
|
||||||
<div>
|
<div>
|
||||||
<Row>
|
<Row>
|
||||||
<Col>
|
<Col>
|
||||||
<ValidationField placeholder="first_name" label="first_name" name="first_name" />
|
<ValidationField
|
||||||
|
placeholder="first_name"
|
||||||
|
label="first_name"
|
||||||
|
name="first_name"
|
||||||
|
/>
|
||||||
{/* <ValidationField placeholder="last_name" label="last_name" name="last_name" /> */}
|
{/* <ValidationField placeholder="last_name" label="last_name" name="last_name" /> */}
|
||||||
</Col>
|
</Col>
|
||||||
{/* <Col>
|
{/* <Col>
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ const ImageBoxField = ({ name }: any) => {
|
||||||
fileInputRef.current.value = "";
|
fileInputRef.current.value = "";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const [t] = useTranslation()
|
const [t] = useTranslation();
|
||||||
return (
|
return (
|
||||||
<div className="ImageBoxField">
|
<div className="ImageBoxField">
|
||||||
<header>{t(`input.${name}`)}</header>
|
<header>{t(`input.${name}`)}</header>
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,76 @@
|
||||||
import React from 'react'
|
import React from "react";
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from "react-i18next";
|
||||||
import { FaStore } from 'react-icons/fa'
|
import { FaStore } from "react-icons/fa";
|
||||||
import ValidationField from '../../../../Components/ValidationField/ValidationField';
|
import ValidationField from "../../../../Components/ValidationField/ValidationField";
|
||||||
import { convert_data_to_select } from '../../../../Layout/app/Const';
|
import { convert_data_to_select } from "../../../../Layout/app/Const";
|
||||||
import { userTypeOptions } from '../../../../config/userTypeOptions';
|
import { userTypeOptions } from "../../../../config/userTypeOptions";
|
||||||
import { statusType } from '../../../../config/statusType';
|
import { statusType } from "../../../../config/statusType";
|
||||||
|
|
||||||
const PersonalDetailsForm = () => {
|
const PersonalDetailsForm = () => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
return (
|
return (
|
||||||
<div className='PersonalDetailsForm'>
|
<div className="PersonalDetailsForm">
|
||||||
<header className='header_form'>
|
<header className="header_form">
|
||||||
<FaStore />
|
<FaStore />
|
||||||
<h4>{t("header.personal_information")}</h4>
|
<h4>{t("header.personal_information")}</h4>
|
||||||
</header>
|
</header>
|
||||||
<main className='main_form_body'>
|
<main className="main_form_body">
|
||||||
<ValidationField name={"id_number"} placeholder={"_"} label={"ID Number"} />
|
<ValidationField
|
||||||
<ValidationField name={"addition_date"} placeholder={"_"} type='Date' label={"Addition Date"} />
|
name={"id_number"}
|
||||||
<ValidationField name={"status"} placeholder={"_"} label={"Status"} type='Select' option={statusType} />
|
placeholder={"_"}
|
||||||
|
label={"ID Number"}
|
||||||
|
/>
|
||||||
|
<ValidationField
|
||||||
|
name={"addition_date"}
|
||||||
|
placeholder={"_"}
|
||||||
|
type="Date"
|
||||||
|
label={"Addition Date"}
|
||||||
|
/>
|
||||||
|
<ValidationField
|
||||||
|
name={"status"}
|
||||||
|
placeholder={"_"}
|
||||||
|
label={"Status"}
|
||||||
|
type="Select"
|
||||||
|
option={statusType}
|
||||||
|
/>
|
||||||
|
|
||||||
<ValidationField name={"full_name"} placeholder={"_"} label={"Full Name"} />
|
<ValidationField
|
||||||
<ValidationField name={"phone_number"} placeholder={"_"} label={"Phone Number"} type='text' />
|
name={"full_name"}
|
||||||
<ValidationField name={"mobile_number"} placeholder={"_"} label={"Mobile Number"} />
|
placeholder={"_"}
|
||||||
|
label={"Full Name"}
|
||||||
<ValidationField name={"username"} placeholder={"_"} label={"Username"} />
|
/>
|
||||||
<ValidationField name={"password"} placeholder={"_"} label={"Password"} type='text' />
|
<ValidationField
|
||||||
<ValidationField name={"seller_percentage"} placeholder={"_"} label={"Seller Percentage"} type='text' />
|
name={"phone_number"}
|
||||||
|
placeholder={"_"}
|
||||||
|
label={"Phone Number"}
|
||||||
|
type="text"
|
||||||
|
/>
|
||||||
|
<ValidationField
|
||||||
|
name={"mobile_number"}
|
||||||
|
placeholder={"_"}
|
||||||
|
label={"Mobile Number"}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ValidationField
|
||||||
|
name={"username"}
|
||||||
|
placeholder={"_"}
|
||||||
|
label={"Username"}
|
||||||
|
/>
|
||||||
|
<ValidationField
|
||||||
|
name={"password"}
|
||||||
|
placeholder={"_"}
|
||||||
|
label={"Password"}
|
||||||
|
type="text"
|
||||||
|
/>
|
||||||
|
<ValidationField
|
||||||
|
name={"seller_percentage"}
|
||||||
|
placeholder={"_"}
|
||||||
|
label={"Seller Percentage"}
|
||||||
|
type="text"
|
||||||
|
/>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
export default PersonalDetailsForm
|
export default PersonalDetailsForm;
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,30 @@
|
||||||
import React from 'react'
|
import React from "react";
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from "react-i18next";
|
||||||
import { FaRegAddressBook } from 'react-icons/fa'
|
import { FaRegAddressBook } from "react-icons/fa";
|
||||||
import ValidationField from '../../../../Components/ValidationField/ValidationField';
|
import ValidationField from "../../../../Components/ValidationField/ValidationField";
|
||||||
import { nationalities } from '../../../../types/App';
|
import { nationalities } from "../../../../types/App";
|
||||||
|
|
||||||
const TitleDetailsForm = () => {
|
const TitleDetailsForm = () => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='TitleDetailsForm'>
|
<div className="TitleDetailsForm">
|
||||||
<header className='header_form'>
|
<header className="header_form">
|
||||||
<FaRegAddressBook />
|
<FaRegAddressBook />
|
||||||
<h4>{t("header.address")}</h4>
|
<h4>{t("header.address")}</h4>
|
||||||
</header>
|
</header>
|
||||||
<main className='main_form_body'>
|
<main className="main_form_body">
|
||||||
<ValidationField name={"city_id"} placeholder={"_"} label={"city"} type='Select' option={nationalities} />
|
<ValidationField
|
||||||
<ValidationField name={"address"} placeholder={"_"} label={"address"} />
|
name={"city_id"}
|
||||||
|
placeholder={"_"}
|
||||||
|
label={"city"}
|
||||||
|
type="Select"
|
||||||
|
option={nationalities}
|
||||||
|
/>
|
||||||
|
<ValidationField name={"address"} placeholder={"_"} label={"address"} />
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
export default TitleDetailsForm
|
export default TitleDetailsForm;
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,13 @@
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
|
|
||||||
export const getInitialValues = (
|
export const getInitialValues = (objectToEdit: Partial<any>) => {
|
||||||
objectToEdit: Partial<any>,
|
|
||||||
) => {
|
|
||||||
return {
|
return {
|
||||||
id: objectToEdit?.id ?? null ,
|
id: objectToEdit?.id ?? null,
|
||||||
name: objectToEdit?.name ?? null,
|
name: objectToEdit?.name ?? null,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getValidationSchema = () => {
|
export const getValidationSchema = () => {
|
||||||
// validate input
|
// validate input
|
||||||
return Yup.object().shape({
|
return Yup.object().shape({});
|
||||||
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,6 @@ const TableHeader = () => {
|
||||||
deleteMutation={deleteMutation}
|
deleteMutation={deleteMutation}
|
||||||
ModelEnum={ModalEnum?.RE_SELLER_DELETE}
|
ModelEnum={ModalEnum?.RE_SELLER_DELETE}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ const App: React.FC = () => {
|
||||||
const response = useGetAllReseller({
|
const response = useGetAllReseller({
|
||||||
name: searchQuery,
|
name: searchQuery,
|
||||||
pagination: true,
|
pagination: true,
|
||||||
...filterState
|
...filterState,
|
||||||
});
|
});
|
||||||
|
|
||||||
return <DataTable response={response} useColumns={useColumns} />;
|
return <DataTable response={response} useColumns={useColumns} />;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ export const useColumns = () => {
|
||||||
const { setObjectToEdit } = useObjectToEdit((state) => state);
|
const { setObjectToEdit } = useObjectToEdit((state) => state);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
|
||||||
const handelDelete = (data: ReSeller) => {
|
const handelDelete = (data: ReSeller) => {
|
||||||
setObjectToEdit(data);
|
setObjectToEdit(data);
|
||||||
handel_open_model(ModalEnum?.RE_SELLER_DELETE);
|
handel_open_model(ModalEnum?.RE_SELLER_DELETE);
|
||||||
|
|
@ -63,7 +62,7 @@ export const useColumns = () => {
|
||||||
render: (_text, record) => record?.user?.username,
|
render: (_text, record) => record?.user?.username,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:"",
|
title: "",
|
||||||
|
|
||||||
key: "actions",
|
key: "actions",
|
||||||
align: "center",
|
align: "center",
|
||||||
|
|
@ -72,11 +71,9 @@ export const useColumns = () => {
|
||||||
<ActionButtons
|
<ActionButtons
|
||||||
canDelete={canDeleteReSeller}
|
canDelete={canDeleteReSeller}
|
||||||
canEdit={canEditReSeller}
|
canEdit={canEditReSeller}
|
||||||
|
|
||||||
index={index}
|
index={index}
|
||||||
onDelete={() => handelDelete(record)}
|
onDelete={() => handelDelete(record)}
|
||||||
onEdit={() => handleEdit(record)}
|
onEdit={() => handleEdit(record)}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,16 @@ const FilterForm = () => {
|
||||||
<div>
|
<div>
|
||||||
<Row>
|
<Row>
|
||||||
<Col>
|
<Col>
|
||||||
<ValidationField placeholder="first_name" label="first_name" name="first_name" />
|
<ValidationField
|
||||||
<ValidationField placeholder="last_name" label="last_name" name="last_name" />
|
placeholder="first_name"
|
||||||
|
label="first_name"
|
||||||
|
name="first_name"
|
||||||
|
/>
|
||||||
|
<ValidationField
|
||||||
|
placeholder="last_name"
|
||||||
|
label="last_name"
|
||||||
|
name="last_name"
|
||||||
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@ import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
const { filterState } = useFilterState();
|
const { filterState } = useFilterState();
|
||||||
|
|
||||||
const response = useGetAllStudent({
|
const response = useGetAllStudent({
|
||||||
pagination: true,
|
pagination: true,
|
||||||
...filterState,
|
...filterState,
|
||||||
});
|
});
|
||||||
|
|
||||||
return <DataTable response={response} useColumns={useColumns} />;
|
return <DataTable response={response} useColumns={useColumns} />;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ const DrapableTable: React.FC = () => {
|
||||||
const { subject_id } = useParams<ParamsEnum>();
|
const { subject_id } = useParams<ParamsEnum>();
|
||||||
const { filterState } = useFilterState();
|
const { filterState } = useFilterState();
|
||||||
|
|
||||||
const response = useGetAllUnit({
|
const response = useGetAllUnit({
|
||||||
subject_id: subject_id,
|
subject_id: subject_id,
|
||||||
pagination: false,
|
pagination: false,
|
||||||
...filterState,
|
...filterState,
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ const Form = () => {
|
||||||
placeholder="term"
|
placeholder="term"
|
||||||
label="term"
|
label="term"
|
||||||
option={termsArray}
|
option={termsArray}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,10 @@ const TableHeader = () => {
|
||||||
const SubjectName = Subject?.data?.name ?? "";
|
const SubjectName = Subject?.data?.name ?? "";
|
||||||
useSetPageTitle(
|
useSetPageTitle(
|
||||||
t(`page_header.grade`) +
|
t(`page_header.grade`) +
|
||||||
" / " +
|
|
||||||
` ${t("header.subject_of_class")} (${gradeName})` +
|
|
||||||
" / " +
|
" / " +
|
||||||
SubjectName
|
` ${t("header.subject_of_class")} (${gradeName})` +
|
||||||
|
" / " +
|
||||||
|
SubjectName,
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -56,7 +56,7 @@ const TableHeader = () => {
|
||||||
<FilterLayout
|
<FilterLayout
|
||||||
sub_children={<FilterForm />}
|
sub_children={<FilterForm />}
|
||||||
filterTitle={` ${gradeName} (${SubjectName}) `}
|
filterTitle={` ${gradeName} (${SubjectName}) `}
|
||||||
/>
|
/>
|
||||||
<Table />
|
<Table />
|
||||||
<AddModalForm />
|
<AddModalForm />
|
||||||
<EditModalForm />
|
<EditModalForm />
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,11 @@ import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||||
|
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
const { subject_id } = useParams<ParamsEnum>();
|
const { subject_id } = useParams<ParamsEnum>();
|
||||||
|
|
||||||
const response = useGetAllUnit({
|
const response = useGetAllUnit({
|
||||||
subject_id: subject_id,
|
subject_id: subject_id,
|
||||||
pagination: true,
|
pagination: true,
|
||||||
});
|
});
|
||||||
const { setOldObjectToEdit } = useObjectToEdit();
|
const { setOldObjectToEdit } = useObjectToEdit();
|
||||||
// console.log(response?.data?.data, "response?.data");
|
// console.log(response?.data?.data, "response?.data");
|
||||||
const data = response?.data?.data;
|
const data = response?.data?.data;
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,25 @@ const FilterForm = () => {
|
||||||
<div>
|
<div>
|
||||||
<Row>
|
<Row>
|
||||||
<Col>
|
<Col>
|
||||||
<ValidationField placeholder="username" label="username" name="username" />
|
<ValidationField
|
||||||
<ValidationField placeholder="phone_number" label="phone_number" name="phone_number" />
|
placeholder="username"
|
||||||
|
label="username"
|
||||||
|
name="username"
|
||||||
|
/>
|
||||||
|
<ValidationField
|
||||||
|
placeholder="phone_number"
|
||||||
|
label="phone_number"
|
||||||
|
name="phone_number"
|
||||||
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
<Col>
|
<Col>
|
||||||
<ValidationField type="Select" option={userTypeOptions} placeholder="type" label="type" name="type" />
|
<ValidationField
|
||||||
|
type="Select"
|
||||||
|
option={userTypeOptions}
|
||||||
|
placeholder="type"
|
||||||
|
label="type"
|
||||||
|
name="type"
|
||||||
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -3,25 +3,59 @@ import ValidationField from "../../../../Components/ValidationField/ValidationFi
|
||||||
import useFormatDataToSelect from "../../../../utils/useFormatDataToSelect";
|
import useFormatDataToSelect from "../../../../utils/useFormatDataToSelect";
|
||||||
import { userTypeOptions } from "../../../../config/userTypeOptions";
|
import { userTypeOptions } from "../../../../config/userTypeOptions";
|
||||||
|
|
||||||
const Form = ({isEdit}:{isEdit?:boolean}) => {
|
const Form = ({ isEdit }: { isEdit?: boolean }) => {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row className="w-100">
|
<Row className="w-100">
|
||||||
{isEdit ? "" :
|
{isEdit ? (
|
||||||
|
""
|
||||||
|
) : (
|
||||||
<Col>
|
<Col>
|
||||||
<>
|
<>
|
||||||
<ValidationField placeholder="username" label="username" name="username" />
|
<ValidationField
|
||||||
<ValidationField placeholder="password" label="password" name="password" />
|
placeholder="username"
|
||||||
<ValidationField placeholder="phone_number" label="phone_number" name="phone_number" />
|
label="username"
|
||||||
</>
|
name="username"
|
||||||
</Col>}
|
/>
|
||||||
|
<ValidationField
|
||||||
|
placeholder="password"
|
||||||
|
label="password"
|
||||||
|
name="password"
|
||||||
|
/>
|
||||||
|
<ValidationField
|
||||||
|
placeholder="phone_number"
|
||||||
|
label="phone_number"
|
||||||
|
name="phone_number"
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
</Col>
|
||||||
|
)}
|
||||||
<Col>
|
<Col>
|
||||||
{isEdit ? "":
|
{isEdit ? (
|
||||||
<ValidationField type="Select" option={userTypeOptions} placeholder="type" label="type" name="type" />}
|
""
|
||||||
<ValidationField type="Select" option={userTypeOptions} placeholder="roles" label="roles" name="role_id" />
|
) : (
|
||||||
<ValidationField type="Select" option={userTypeOptions} placeholder="abilities" label="abilities" name="abilities" isMulti={true} />
|
<ValidationField
|
||||||
|
type="Select"
|
||||||
|
option={userTypeOptions}
|
||||||
|
placeholder="type"
|
||||||
|
label="type"
|
||||||
|
name="type"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<ValidationField
|
||||||
|
type="Select"
|
||||||
|
option={userTypeOptions}
|
||||||
|
placeholder="roles"
|
||||||
|
label="roles"
|
||||||
|
name="role_id"
|
||||||
|
/>
|
||||||
|
<ValidationField
|
||||||
|
type="Select"
|
||||||
|
option={userTypeOptions}
|
||||||
|
placeholder="abilities"
|
||||||
|
label="abilities"
|
||||||
|
name="abilities"
|
||||||
|
isMulti={true}
|
||||||
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ export const getInitialValues = (objectToEdit: any): any => {
|
||||||
password: objectToEdit?.password ?? null,
|
password: objectToEdit?.password ?? null,
|
||||||
phone_number: objectToEdit?.phone_number ?? null,
|
phone_number: objectToEdit?.phone_number ?? null,
|
||||||
type: objectToEdit?.type ?? null,
|
type: objectToEdit?.type ?? null,
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -16,7 +15,7 @@ export const getValidationSchema = () => {
|
||||||
// password: Yup.string().required("validation.required"),
|
// password: Yup.string().required("validation.required"),
|
||||||
phone_number: Yup.string()
|
phone_number: Yup.string()
|
||||||
.required("validation.required")
|
.required("validation.required")
|
||||||
.min(10, "Phone number must be at least 10 characters long"),
|
.min(10, "Phone number must be at least 10 characters long"),
|
||||||
type: Yup.string().required("validation.required"),
|
type: Yup.string().required("validation.required"),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,7 @@ const DeleteModalForm = lazy(
|
||||||
|
|
||||||
const TableHeader = () => {
|
const TableHeader = () => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
useSetPageTitle(
|
useSetPageTitle(t(`page_header.user`));
|
||||||
t(`page_header.user`),
|
|
||||||
);
|
|
||||||
const deleteMutation = useDeleteUser();
|
const deleteMutation = useDeleteUser();
|
||||||
return (
|
return (
|
||||||
<div className="TableWithHeader">
|
<div className="TableWithHeader">
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ const App: React.FC = () => {
|
||||||
pagination: true,
|
pagination: true,
|
||||||
...filterState,
|
...filterState,
|
||||||
});
|
});
|
||||||
|
|
||||||
return <DataTable response={response} useColumns={useColumns} />;
|
return <DataTable response={response} useColumns={useColumns} />;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,22 +37,20 @@ const TableHeader = () => {
|
||||||
show: grade_id,
|
show: grade_id,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const gradeName = grade?.data?.name ?? "";
|
const gradeName = grade?.data?.name ?? "";
|
||||||
const SubjectName = Subject?.data?.name ?? "";
|
const SubjectName = Subject?.data?.name ?? "";
|
||||||
const unitName = unit?.data?.name ?? "";
|
const unitName = unit?.data?.name ?? "";
|
||||||
|
|
||||||
useSetPageTitle(
|
useSetPageTitle(
|
||||||
t(`page_header.grade`) +
|
t(`page_header.grade`) +
|
||||||
" / " +
|
" / " +
|
||||||
` ${t("header.subject_of_class")} (${gradeName})` +
|
` ${t("header.subject_of_class")} (${gradeName})` +
|
||||||
" / " +
|
" / " +
|
||||||
SubjectName +
|
SubjectName +
|
||||||
" / " +
|
" / " +
|
||||||
unitName
|
unitName,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="TableWithHeader">
|
<div className="TableWithHeader">
|
||||||
<Suspense fallback={<Spin />}>
|
<Suspense fallback={<Spin />}>
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,10 @@ import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
const { unit_id } = useParams<ParamsEnum>();
|
const { unit_id } = useParams<ParamsEnum>();
|
||||||
|
|
||||||
const response = useGetAllLesson({
|
const response = useGetAllLesson({
|
||||||
unit_id: unit_id,
|
unit_id: unit_id,
|
||||||
pagination: true,
|
pagination: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const { setOldObjectToEdit } = useObjectToEdit();
|
const { setOldObjectToEdit } = useObjectToEdit();
|
||||||
// console.log(response?.data?.data, "response?.data");
|
// console.log(response?.data?.data, "response?.data");
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { Suspense, lazy, useEffect } from "react";
|
import React, { Suspense, lazy, useEffect } from "react";
|
||||||
import { Spin } from "antd";
|
import { Spin } from "antd";
|
||||||
import FormikForm from "../../../Layout/Dashboard/FormikFormModel";
|
import FormikForm from "../../../Layout/Dashboard/FormikFormModel";
|
||||||
import {
|
import {
|
||||||
getInitialValues,
|
getInitialValues,
|
||||||
|
|
@ -22,32 +22,24 @@ import { toast } from "react-toastify";
|
||||||
const AcceptModal = lazy(() => import("./Model/AcceptModal"));
|
const AcceptModal = lazy(() => import("./Model/AcceptModal"));
|
||||||
|
|
||||||
const AddPage: React.FC = () => {
|
const AddPage: React.FC = () => {
|
||||||
|
const { mutateAsync } = useAddQuestionAsync();
|
||||||
const { mutateAsync } = useAddQuestionAsync();
|
const { mutate, isLoading, isSuccess } = useAddQuestion();
|
||||||
const { mutate, isLoading ,isSuccess} = useAddQuestion();
|
const { isBseQuestion, setTagsSearch, objectToEdit, setSuccess } =
|
||||||
const {
|
useObjectToEdit();
|
||||||
isBseQuestion,
|
|
||||||
setTagsSearch,
|
|
||||||
objectToEdit,
|
|
||||||
setSuccess
|
|
||||||
} = useObjectToEdit();
|
|
||||||
|
|
||||||
|
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const { subject_id, lesson_id } =
|
const { subject_id, lesson_id } = useParams<ParamsEnum>();
|
||||||
useParams<ParamsEnum>();
|
|
||||||
|
console.log(objectToEdit, "objectToEdit");
|
||||||
console.log(objectToEdit,"objectToEdit");
|
|
||||||
|
|
||||||
const handleSubmit = (
|
const handleSubmit = (
|
||||||
values: any,
|
values: any,
|
||||||
{ resetForm }: { resetForm: () => void },
|
{ resetForm }: { resetForm: () => void },
|
||||||
) => {
|
) => {
|
||||||
|
|
||||||
const DataToSend = structuredClone(values);
|
const DataToSend = structuredClone(values);
|
||||||
setTagsSearch(null);
|
setTagsSearch(null);
|
||||||
console.log(1);
|
console.log(1);
|
||||||
|
|
||||||
const canAnswersBeShuffled = DataToSend?.canAnswersBeShuffled ? 1 : 0;
|
const canAnswersBeShuffled = DataToSend?.canAnswersBeShuffled ? 1 : 0;
|
||||||
|
|
||||||
if (isBseQuestion || DataToSend?.isBase === 1) {
|
if (isBseQuestion || DataToSend?.isBase === 1) {
|
||||||
|
|
@ -76,14 +68,18 @@ console.log(objectToEdit,"objectToEdit");
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
console.log(answers);
|
console.log(answers);
|
||||||
if(answers?.length > 0){
|
if (answers?.length > 0) {
|
||||||
const isValidAnswers = answers?.some((answer:any) => answer?.isCorrect === 1)
|
const isValidAnswers = answers?.some(
|
||||||
|
(answer: any) => answer?.isCorrect === 1,
|
||||||
if(!isValidAnswers){
|
);
|
||||||
toast.error(t("validation.at_least_one_answer_should_be_correct"));
|
|
||||||
|
if (!isValidAnswers) {
|
||||||
|
toast.error(
|
||||||
|
t("validation.at_least_one_answer_should_be_correct"),
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mutate({
|
mutate({
|
||||||
...item,
|
...item,
|
||||||
parent_id: newBseQuestionId,
|
parent_id: newBseQuestionId,
|
||||||
|
|
@ -97,27 +93,27 @@ console.log(objectToEdit,"objectToEdit");
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log(1);
|
console.log(1);
|
||||||
|
|
||||||
const tags = processTags(DataToSend);
|
const tags = processTags(DataToSend);
|
||||||
const answers = values?.answers?.map((item: any, index: number) => {
|
const answers = values?.answers?.map((item: any, index: number) => {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
order: index,
|
order: index,
|
||||||
...item,
|
...item,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
if(answers?.length > 0){
|
if (answers?.length > 0) {
|
||||||
|
const isValidAnswers = answers?.some(
|
||||||
const isValidAnswers = answers?.some((answer:any) => answer?.isCorrect === 1)
|
(answer: any) => answer?.isCorrect === 1,
|
||||||
|
);
|
||||||
console.log(!isValidAnswers);
|
console.log(!isValidAnswers);
|
||||||
|
|
||||||
if(!isValidAnswers){
|
if (!isValidAnswers) {
|
||||||
toast.error(t("validation.at_least_one_answer_should_be_correct"));
|
toast.error(t("validation.at_least_one_answer_should_be_correct"));
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const NewQuestion = {
|
const NewQuestion = {
|
||||||
...values,
|
...values,
|
||||||
subject_id: subject_id,
|
subject_id: subject_id,
|
||||||
|
|
@ -135,26 +131,16 @@ console.log(objectToEdit,"objectToEdit");
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
navigate(-1);
|
navigate(-1);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
||||||
|
|
||||||
console.log("all api success");
|
console.log("all api success");
|
||||||
if(isSuccess){
|
if (isSuccess) {
|
||||||
|
setSuccess(true);
|
||||||
setSuccess(true )
|
|
||||||
}
|
}
|
||||||
}, [isSuccess])
|
}, [isSuccess]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (isBseQuestion) {
|
if (isBseQuestion) {
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -25,13 +25,8 @@ import BaseForm from "./Model/Malty/Form";
|
||||||
import { Question } from "../../../types/Item";
|
import { Question } from "../../../types/Item";
|
||||||
import { toast } from "react-toastify";
|
import { toast } from "react-toastify";
|
||||||
|
|
||||||
|
|
||||||
const EditPage: React.FC = () => {
|
const EditPage: React.FC = () => {
|
||||||
const {
|
const { subject_id, lesson_id, question_id } = useParams<ParamsEnum>();
|
||||||
subject_id,
|
|
||||||
lesson_id,
|
|
||||||
question_id,
|
|
||||||
} = useParams<ParamsEnum>();
|
|
||||||
const { isBseQuestion, setIsBseQuestion, setTagsSearch, DeletedQuestions } =
|
const { isBseQuestion, setIsBseQuestion, setTagsSearch, DeletedQuestions } =
|
||||||
useObjectToEdit();
|
useObjectToEdit();
|
||||||
|
|
||||||
|
|
@ -58,8 +53,6 @@ const EditPage: React.FC = () => {
|
||||||
|
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const handleSubmit = (values: any) => {
|
const handleSubmit = (values: any) => {
|
||||||
const DataToSend = structuredClone(values);
|
const DataToSend = structuredClone(values);
|
||||||
setTagsSearch(null);
|
setTagsSearch(null);
|
||||||
|
|
@ -100,21 +93,22 @@ const EditPage: React.FC = () => {
|
||||||
const tags = processTags(updatedObject);
|
const tags = processTags(updatedObject);
|
||||||
const oldAnswers = [] as any;
|
const oldAnswers = [] as any;
|
||||||
const newAnswers = [] as any;
|
const newAnswers = [] as any;
|
||||||
|
|
||||||
if(updatedObject?.answers?.length > 0){
|
if (updatedObject?.answers?.length > 0) {
|
||||||
|
const isValidAnswers = updatedObject?.answers?.some(
|
||||||
const isValidAnswers = updatedObject?.answers?.some((answer:any) => answer?.isCorrect === 1)
|
(answer: any) => answer?.isCorrect === 1,
|
||||||
|
);
|
||||||
|
|
||||||
// if(!isValidAnswers){
|
// if(!isValidAnswers){
|
||||||
// toast.error(t("validation.at_least_one_answer_should_be_correct"));
|
// toast.error(t("validation.at_least_one_answer_should_be_correct"));
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
updatedObject?.answers?.forEach((item: any) => {
|
updatedObject?.answers?.forEach((item: any) => {
|
||||||
if (item?.id) {
|
if (item?.id) {
|
||||||
oldAnswers.push({...item,isCorrect:item?.isCorrect ? 1 : 0});
|
oldAnswers.push({ ...item, isCorrect: item?.isCorrect ? 1 : 0 });
|
||||||
} else {
|
} else {
|
||||||
newAnswers.push({...item,isCorrect:item?.isCorrect ? 1 : 0});
|
newAnswers.push({ ...item, isCorrect: item?.isCorrect ? 1 : 0 });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const answers = {
|
const answers = {
|
||||||
|
|
@ -142,7 +136,6 @@ const EditPage: React.FC = () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
const keysToRemove = ["content_image"];
|
const keysToRemove = ["content_image"];
|
||||||
console.log(DataToSend);
|
console.log(DataToSend);
|
||||||
const updatedObject = removeStringKeys(DataToSend, keysToRemove);
|
const updatedObject = removeStringKeys(DataToSend, keysToRemove);
|
||||||
|
|
@ -154,23 +147,21 @@ const EditPage: React.FC = () => {
|
||||||
|
|
||||||
const oldAnswers = [] as any;
|
const oldAnswers = [] as any;
|
||||||
const newAnswers = [] as any;
|
const newAnswers = [] as any;
|
||||||
if(updatedObject?.answers?.length > 0){
|
if (updatedObject?.answers?.length > 0) {
|
||||||
|
|
||||||
// const isValidAnswers = updatedObject?.answers?.some((answer:any) => answer?.isCorrect === 1 || answer?.isCorrect === true)
|
// const isValidAnswers = updatedObject?.answers?.some((answer:any) => answer?.isCorrect === 1 || answer?.isCorrect === true)
|
||||||
// const isValidAnswers2 = updatedObject?.answers?.filter((answer: any) => answer?.isCorrect === 1 || answer?.isCorrect === true ).length > 1;
|
// const isValidAnswers2 = updatedObject?.answers?.filter((answer: any) => answer?.isCorrect === 1 || answer?.isCorrect === true ).length > 1;
|
||||||
// console.log(isValidAnswers2);
|
// console.log(isValidAnswers2);
|
||||||
// console.log(isValidAnswers,"isValidAnswers");
|
// console.log(isValidAnswers,"isValidAnswers");
|
||||||
|
|
||||||
// if(!isValidAnswers || isValidAnswers2){
|
// if(!isValidAnswers || isValidAnswers2){
|
||||||
// toast.error(t("validation.at_least_one_answer_should_be_correct"));
|
// toast.error(t("validation.at_least_one_answer_should_be_correct"));
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
updatedObject?.answers?.forEach((item: any) => {
|
updatedObject?.answers?.forEach((item: any) => {
|
||||||
if (item?.id) {
|
if (item?.id) {
|
||||||
oldAnswers.push({...item,isCorrect:item?.isCorrect ? 1 : 0});
|
oldAnswers.push({ ...item, isCorrect: item?.isCorrect ? 1 : 0 });
|
||||||
} else {
|
} else {
|
||||||
newAnswers.push({...item,isCorrect:item?.isCorrect ? 1 : 0});
|
newAnswers.push({ ...item, isCorrect: item?.isCorrect ? 1 : 0 });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -178,15 +169,12 @@ const EditPage: React.FC = () => {
|
||||||
old: oldAnswers,
|
old: oldAnswers,
|
||||||
new: newAnswers,
|
new: newAnswers,
|
||||||
};
|
};
|
||||||
console.log(tags,"tags");
|
console.log(tags, "tags");
|
||||||
if(tags?.new?.length < 1 && tags?.old?.length < 1){
|
if (tags?.new?.length < 1 && tags?.old?.length < 1) {
|
||||||
mutate({ ...updatedObject, answers, tags:"" });
|
mutate({ ...updatedObject, answers, tags: "" });
|
||||||
|
} else {
|
||||||
}else{
|
mutate({ ...updatedObject, answers, tags });
|
||||||
|
}
|
||||||
mutate({ ...updatedObject, answers, tags });
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,19 @@ import { Col, Row } from "reactstrap";
|
||||||
import useFormatDataToSelect from "../../../utils/useFormatDataToSelect";
|
import useFormatDataToSelect from "../../../utils/useFormatDataToSelect";
|
||||||
|
|
||||||
const FilterForm = () => {
|
const FilterForm = () => {
|
||||||
const yesNoArray = [
|
const yesNoArray = [
|
||||||
{id: "لا", name:"لا"},
|
{ id: "لا", name: "لا" },
|
||||||
{id: "نعم", name:"نعم"},
|
{ id: "نعم", name: "نعم" },
|
||||||
]
|
];
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Row>
|
<Row>
|
||||||
<Col>
|
<Col>
|
||||||
<ValidationField placeholder="content" label="content" name="content" />
|
<ValidationField
|
||||||
|
placeholder="content"
|
||||||
|
label="content"
|
||||||
|
name="content"
|
||||||
|
/>
|
||||||
{/* <ValidationField type="Select" option={yesNoArray} placeholder="isBase" label="isBase" name="isBase" /> */}
|
{/* <ValidationField type="Select" option={yesNoArray} placeholder="isBase" label="isBase" name="isBase" /> */}
|
||||||
</Col>
|
</Col>
|
||||||
{/* <Col>
|
{/* <Col>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Modal } from "antd";
|
import { Modal } from "antd";
|
||||||
import { useModalState } from "../../../../zustand/Modal";
|
import { useModalState } from "../../../../zustand/Modal";
|
||||||
import { ModalEnum } from "../../../../enums/Model";
|
import { ModalEnum } from "../../../../enums/Model";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,10 @@ const CheckboxField = ({
|
||||||
<Checkbox
|
<Checkbox
|
||||||
onChange={onChange || CheckboxhandleChange}
|
onChange={onChange || CheckboxhandleChange}
|
||||||
disabled={isDisabled}
|
disabled={isDisabled}
|
||||||
checked={formik.values?.answers?.[name]?.isCorrect === 1 || formik.values?.answers?.[name]?.isCorrect === true}
|
checked={
|
||||||
|
formik.values?.answers?.[name]?.isCorrect === 1 ||
|
||||||
|
formik.values?.answers?.[name]?.isCorrect === true
|
||||||
|
}
|
||||||
className={className}
|
className={className}
|
||||||
>
|
>
|
||||||
{t(`input.${label ? label : name}`)}
|
{t(`input.${label ? label : name}`)}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ const ChoiceFields = ({ index, data }: { index: number; data: Choice }) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="ChoiceFields">
|
<div className="ChoiceFields">
|
||||||
|
|
||||||
<TextField
|
<TextField
|
||||||
className="textarea_exercise"
|
className="textarea_exercise"
|
||||||
placeholder={"choice"}
|
placeholder={"choice"}
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ const Choices = () => {
|
||||||
{...provided.dragHandleProps}
|
{...provided.dragHandleProps}
|
||||||
>
|
>
|
||||||
<div className="HolderQuestion">
|
<div className="HolderQuestion">
|
||||||
<HolderOutlined/>
|
<HolderOutlined />
|
||||||
</div>
|
</div>
|
||||||
<ChoiceFields index={index} data={item} />
|
<ChoiceFields index={index} data={item} />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,8 @@ const CheckboxField = ({
|
||||||
disabled={isDisabled}
|
disabled={isDisabled}
|
||||||
checked={
|
checked={
|
||||||
formik.values?.Questions?.[parent_index]?.answers?.[name]
|
formik.values?.Questions?.[parent_index]?.answers?.[name]
|
||||||
?.isCorrect === 1 || formik.values?.Questions?.[parent_index]?.answers?.[name]
|
?.isCorrect === 1 ||
|
||||||
|
formik.values?.Questions?.[parent_index]?.answers?.[name]
|
||||||
?.isCorrect === true
|
?.isCorrect === true
|
||||||
}
|
}
|
||||||
className={className}
|
className={className}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@ const ChoiceFields = ({
|
||||||
formik.setFieldValue(`Questions[${parent_index}].answers`, updatedAnswers);
|
formik.setFieldValue(`Questions[${parent_index}].answers`, updatedAnswers);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="ChoiceFields">
|
<div className="ChoiceFields">
|
||||||
|
|
|
||||||
|
|
@ -68,9 +68,9 @@ const Choices = ({ parent_index }: { parent_index: number }) => {
|
||||||
{...provided.draggableProps}
|
{...provided.draggableProps}
|
||||||
{...provided.dragHandleProps}
|
{...provided.dragHandleProps}
|
||||||
>
|
>
|
||||||
<div className="HolderQuestion">
|
<div className="HolderQuestion">
|
||||||
<HolderOutlined/>
|
<HolderOutlined />
|
||||||
</div>
|
</div>
|
||||||
<ChoiceFields
|
<ChoiceFields
|
||||||
key={index}
|
key={index}
|
||||||
parent_index={parent_index}
|
parent_index={parent_index}
|
||||||
|
|
|
||||||
|
|
@ -18,18 +18,21 @@ const Form = () => {
|
||||||
const formik = useFormikContext<any>();
|
const formik = useFormikContext<any>();
|
||||||
const { setSuccess, Success, setSavedQuestionData } = useObjectToEdit();
|
const { setSuccess, Success, setSavedQuestionData } = useObjectToEdit();
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setSavedQuestionData(formik.values);
|
setSavedQuestionData(formik.values);
|
||||||
}, [formik?.values]);
|
}, [formik?.values]);
|
||||||
|
|
||||||
// console.log(formik?.errors);
|
// console.log(formik?.errors);
|
||||||
|
|
||||||
const handleAddChoice = (parent_index: number,fromKeyCombination:boolean = false) => {
|
const handleAddChoice = (
|
||||||
|
parent_index: number,
|
||||||
|
fromKeyCombination: boolean = false,
|
||||||
|
) => {
|
||||||
console.log(parent_index);
|
console.log(parent_index);
|
||||||
|
|
||||||
formik.setFieldValue(`Questions.[${parent_index}].answers`, [
|
formik.setFieldValue(`Questions.[${parent_index}].answers`, [
|
||||||
...((formik?.values as any)?.Questions?.[parent_index]?.answers as Choice[]),
|
...((formik?.values as any)?.Questions?.[parent_index]
|
||||||
|
?.answers as Choice[]),
|
||||||
|
|
||||||
{
|
{
|
||||||
answer: null,
|
answer: null,
|
||||||
|
|
@ -38,12 +41,12 @@ const Form = () => {
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if(fromKeyCombination){
|
if (fromKeyCombination) {
|
||||||
toast.success(t("header.new_choice_have_been_added"))
|
toast.success(t("header.new_choice_have_been_added"));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleAddQuestion = (fromKeyCombination:boolean = false) => {
|
const handleAddQuestion = (fromKeyCombination: boolean = false) => {
|
||||||
formik.setFieldValue("Questions", [
|
formik.setFieldValue("Questions", [
|
||||||
...((formik?.values as any)?.Questions as Choice[]),
|
...((formik?.values as any)?.Questions as Choice[]),
|
||||||
|
|
||||||
|
|
@ -62,27 +65,28 @@ const Form = () => {
|
||||||
const max_mark = formik?.values?.max_mark + 1;
|
const max_mark = formik?.values?.max_mark + 1;
|
||||||
|
|
||||||
formik.setFieldValue("max_mark", max_mark);
|
formik.setFieldValue("max_mark", max_mark);
|
||||||
if(fromKeyCombination){
|
if (fromKeyCombination) {
|
||||||
toast.success(t("header.new_question_have_been_added"))
|
toast.success(t("header.new_question_have_been_added"));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
|
const lastQuestions = formik?.values?.Questions?.length - 1;
|
||||||
|
useKeyCombination(
|
||||||
|
{ ctrlKey: true, shiftKey: true, code: CombinationKeyEnum.CHOICE },
|
||||||
|
() => {
|
||||||
|
handleAddChoice(lastQuestions, true);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
const lastQuestions = formik?.values?.Questions?.length -1 ;
|
useKeyCombination(
|
||||||
useKeyCombination({ ctrlKey: true, shiftKey: true, code: CombinationKeyEnum.CHOICE }, () => {
|
{ ctrlKey: true, shiftKey: true, code: CombinationKeyEnum.QUESTION },
|
||||||
handleAddChoice(lastQuestions,true)
|
() => {
|
||||||
});
|
handleAddQuestion(true);
|
||||||
|
},
|
||||||
useKeyCombination({ ctrlKey: true, shiftKey: true, code: CombinationKeyEnum.QUESTION }, () => {
|
);
|
||||||
|
|
||||||
handleAddQuestion(true)
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
||||||
<Row className="w-100 exercise_form_container">
|
<Row className="w-100 exercise_form_container">
|
||||||
<div className="exercise_form">
|
<div className="exercise_form">
|
||||||
<ValidationField
|
<ValidationField
|
||||||
|
|
@ -139,7 +143,7 @@ const Form = () => {
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<p className="add_new_button">
|
<p className="add_new_button">
|
||||||
<FaCirclePlus onClick={()=>handleAddQuestion()} size={23} />{" "}
|
<FaCirclePlus onClick={() => handleAddQuestion()} size={23} />{" "}
|
||||||
{t("header.add_new_question")}
|
{t("header.add_new_question")}
|
||||||
</p>
|
</p>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
|
||||||
|
|
@ -36,20 +36,22 @@ const MaltySelectTag = ({ parent_index }: { parent_index: number }) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
|
||||||
const options = data?.data ?? [];
|
const options = data?.data ?? [];
|
||||||
const additionalData =
|
const additionalData =
|
||||||
options.length < 1 && searchValue.length > 1 && !isLoading
|
options.length < 1 && searchValue.length > 1 && !isLoading
|
||||||
? [{ id: searchValue, name: searchValue }]
|
? [{ id: searchValue, name: searchValue }]
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
|
console.log(options);
|
||||||
console.log(options);
|
const value =
|
||||||
const value = formik?.values?.Questions[parent_index]?.tags?.map((item: any) => item?.id ?? item) ?? [];
|
formik?.values?.Questions[parent_index]?.tags?.map(
|
||||||
|
(item: any) => item?.id ?? item,
|
||||||
|
) ?? [];
|
||||||
console.log(formik?.values?.Questions[parent_index]);
|
console.log(formik?.values?.Questions[parent_index]);
|
||||||
|
|
||||||
console.log(value);
|
console.log(value);
|
||||||
|
|
||||||
const AllOptions = [...options, ...additionalData]
|
const AllOptions = [...options, ...additionalData];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="SelectTag">
|
<div className="SelectTag">
|
||||||
<label htmlFor="">{t("models.tag")}</label>
|
<label htmlFor="">{t("models.tag")}</label>
|
||||||
|
|
@ -59,7 +61,6 @@ const value = formik?.values?.Questions[parent_index]?.tags?.map((item: any) =>
|
||||||
style={{ width: "100%", height: "40px" }}
|
style={{ width: "100%", height: "40px" }}
|
||||||
placeholder=""
|
placeholder=""
|
||||||
fieldNames={{ label: "name", value: "id" }}
|
fieldNames={{ label: "name", value: "id" }}
|
||||||
|
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
options={AllOptions}
|
options={AllOptions}
|
||||||
filterOption={false}
|
filterOption={false}
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,7 @@ const Form = () => {
|
||||||
const formik = useFormikContext<any>();
|
const formik = useFormikContext<any>();
|
||||||
const { setSuccess, Success } = useObjectToEdit();
|
const { setSuccess, Success } = useObjectToEdit();
|
||||||
|
|
||||||
|
const handleAddChoice = (fromKeyCombination: boolean = false) => {
|
||||||
|
|
||||||
|
|
||||||
const handleAddChoice = (fromKeyCombination:boolean = false ) => {
|
|
||||||
|
|
||||||
formik.setFieldValue("answers", [
|
formik.setFieldValue("answers", [
|
||||||
...((formik?.values as any)?.answers as Choice[]),
|
...((formik?.values as any)?.answers as Choice[]),
|
||||||
{
|
{
|
||||||
|
|
@ -32,28 +28,26 @@ const Form = () => {
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if(fromKeyCombination){
|
if (fromKeyCombination) {
|
||||||
toast.success(t("header.new_choice_have_been_added"))
|
toast.success(t("header.new_choice_have_been_added"));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useKeyCombination(
|
||||||
useKeyCombination({ ctrlKey: true, shiftKey: true, code: CombinationKeyEnum.CHOICE }, () => {
|
{ ctrlKey: true, shiftKey: true, code: CombinationKeyEnum.CHOICE },
|
||||||
|
() => {
|
||||||
handleAddChoice(true)
|
handleAddChoice(true);
|
||||||
|
},
|
||||||
});
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (Success) {
|
||||||
if(Success){
|
formik?.setValues({});
|
||||||
formik?.setValues({})
|
formik.setErrors({});
|
||||||
formik.setErrors({})
|
setSuccess(false);
|
||||||
setSuccess(false)
|
console.log(formik.errors);
|
||||||
console.log(formik.errors);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}, [Success])
|
}, [Success]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row className="w-100 exercise_form_container">
|
<Row className="w-100 exercise_form_container">
|
||||||
|
|
@ -70,7 +64,7 @@ const Form = () => {
|
||||||
<Choices />
|
<Choices />
|
||||||
{formik?.values?.answers?.length < 5 && (
|
{formik?.values?.answers?.length < 5 && (
|
||||||
<p className="add_new_button">
|
<p className="add_new_button">
|
||||||
<FaCirclePlus onClick={()=>handleAddChoice()} size={23} />{" "}
|
<FaCirclePlus onClick={() => handleAddChoice()} size={23} />{" "}
|
||||||
{t("header.add_new_choice")}
|
{t("header.add_new_choice")}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,11 @@ import * as Yup from "yup";
|
||||||
import { Question } from "../../../../types/Item";
|
import { Question } from "../../../../types/Item";
|
||||||
import { toast } from "react-toastify";
|
import { toast } from "react-toastify";
|
||||||
|
|
||||||
|
|
||||||
export const getInitialValues = (objectToEdit: Question): any => {
|
export const getInitialValues = (objectToEdit: Question): any => {
|
||||||
const tags = objectToEdit?.tags?.map((item: any, index: number) => {
|
const tags = objectToEdit?.tags?.map((item: any, index: number) => {
|
||||||
return { ...item };
|
return { ...item };
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: objectToEdit?.id ?? null,
|
id: objectToEdit?.id ?? null,
|
||||||
content: objectToEdit?.content ?? "",
|
content: objectToEdit?.content ?? "",
|
||||||
|
|
@ -27,15 +26,13 @@ export const getValidationSchema = () => {
|
||||||
return Yup.object().shape({
|
return Yup.object().shape({
|
||||||
content_image: Yup.string().nullable(),
|
content_image: Yup.string().nullable(),
|
||||||
content: Yup.string().required("validation.required"),
|
content: Yup.string().required("validation.required"),
|
||||||
answers: Yup.array()
|
answers: Yup.array().of(
|
||||||
.of(
|
Yup.object().shape({
|
||||||
Yup.object().shape({
|
content: Yup.string().required("validation.required"),
|
||||||
content: Yup.string().required("validation.required"),
|
content_image: Yup.string().nullable(),
|
||||||
content_image: Yup.string().nullable(),
|
isCorrect: Yup.boolean(),
|
||||||
isCorrect: Yup.boolean(),
|
}),
|
||||||
}),
|
),
|
||||||
)
|
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -45,13 +42,13 @@ export const getInitialValuesBase = (objectToEdit: Question): any => {
|
||||||
id: tag?.id,
|
id: tag?.id,
|
||||||
name: tag?.name,
|
name: tag?.name,
|
||||||
}));
|
}));
|
||||||
console.log(item,"item");
|
console.log(item, "item");
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
canAnswersBeShuffled: objectToEdit?.canAnswersBeShuffled ? 1 : 0,
|
canAnswersBeShuffled: objectToEdit?.canAnswersBeShuffled ? 1 : 0,
|
||||||
hint: objectToEdit?.hint ?? "",
|
hint: objectToEdit?.hint ?? "",
|
||||||
isBase:0,
|
isBase: 0,
|
||||||
tags,
|
tags,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
@ -89,13 +86,16 @@ export const getValidationSchemaBase = () => {
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.test(
|
.test(
|
||||||
'at-least-one-correct',
|
"at-least-one-correct",
|
||||||
'At least one answer must be correct',
|
"At least one answer must be correct",
|
||||||
(answers:any) => {
|
(answers: any) => {
|
||||||
console.log(answers,"answers");
|
console.log(answers, "answers");
|
||||||
|
|
||||||
return answers.some((answer:any) => answer.isCorrect === true || answer.isCorrect === 1);
|
return answers.some(
|
||||||
}
|
(answer: any) =>
|
||||||
|
answer.isCorrect === true || answer.isCorrect === 1,
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
|
@ -108,7 +108,7 @@ export function processTags(DataToSend: any) {
|
||||||
const oldTags = DataToSend?.tags
|
const oldTags = DataToSend?.tags
|
||||||
?.map((item: any, index: number) => {
|
?.map((item: any, index: number) => {
|
||||||
if (typeof item === "number" || typeof item?.id === "number") {
|
if (typeof item === "number" || typeof item?.id === "number") {
|
||||||
return item?.id ?? item ;
|
return item?.id ?? item;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.filter((item: any) => item !== undefined);
|
.filter((item: any) => item !== undefined);
|
||||||
|
|
@ -117,10 +117,13 @@ export function processTags(DataToSend: any) {
|
||||||
?.map((item: any, index: number) => {
|
?.map((item: any, index: number) => {
|
||||||
console.log(item);
|
console.log(item);
|
||||||
|
|
||||||
if (typeof item === "string" && item !== "" || typeof item?.id === "string" && item?.id !== "" ) {
|
if (
|
||||||
|
(typeof item === "string" && item !== "") ||
|
||||||
|
(typeof item?.id === "string" && item?.id !== "")
|
||||||
|
) {
|
||||||
console.log(item);
|
console.log(item);
|
||||||
|
|
||||||
return { name: item?.id ?? item };
|
return { name: item?.id ?? item };
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.filter((item: any) => item !== undefined);
|
.filter((item: any) => item !== undefined);
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,7 @@ const TableHeader = () => {
|
||||||
|
|
||||||
const deleteMutation = useDeleteQuestion();
|
const deleteMutation = useDeleteQuestion();
|
||||||
|
|
||||||
const { unit_id, grade_id, subject_id, lesson_id } =
|
const { unit_id, grade_id, subject_id, lesson_id } = useParams<ParamsEnum>();
|
||||||
useParams<ParamsEnum>();
|
|
||||||
const { data: unit } = useGetAllUnit({ show: unit_id });
|
const { data: unit } = useGetAllUnit({ show: unit_id });
|
||||||
|
|
||||||
const { data: Subject } = useGetAllSubject({
|
const { data: Subject } = useGetAllSubject({
|
||||||
|
|
@ -46,14 +45,14 @@ const TableHeader = () => {
|
||||||
|
|
||||||
useSetPageTitle(
|
useSetPageTitle(
|
||||||
t(`page_header.grade`) +
|
t(`page_header.grade`) +
|
||||||
" / " +
|
" / " +
|
||||||
` ${t("header.subject_of_class")} (${gradeName})` +
|
` ${t("header.subject_of_class")} (${gradeName})` +
|
||||||
" / " +
|
" / " +
|
||||||
SubjectName +
|
SubjectName +
|
||||||
" / " +
|
" / " +
|
||||||
unitName +
|
unitName +
|
||||||
" / " +
|
" / " +
|
||||||
LessonName
|
LessonName,
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -68,7 +67,8 @@ const TableHeader = () => {
|
||||||
/>
|
/>
|
||||||
<FilterLayout
|
<FilterLayout
|
||||||
sub_children={<FilterForm />}
|
sub_children={<FilterForm />}
|
||||||
filterTitle={` ${unitName} (${LessonName}) `} />
|
filterTitle={` ${unitName} (${LessonName}) `}
|
||||||
|
/>
|
||||||
<Table />
|
<Table />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
<DeleteModels
|
<DeleteModels
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ const TableWithHeader = () => {
|
||||||
useSetPageTitle(
|
useSetPageTitle(
|
||||||
t(`page_header.grade`) +
|
t(`page_header.grade`) +
|
||||||
" / " +
|
" / " +
|
||||||
` ${t("header.subject_of_class")} (${gradeName})`
|
` ${t("header.subject_of_class")} (${gradeName})`,
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,11 @@ const TablePage: React.FC = () => {
|
||||||
const { grade_id } = useParams<ParamsEnum>();
|
const { grade_id } = useParams<ParamsEnum>();
|
||||||
const { filterState } = useFilterState();
|
const { filterState } = useFilterState();
|
||||||
|
|
||||||
const response = useGetAllSubject({
|
const response = useGetAllSubject({
|
||||||
grade_id: grade_id,
|
grade_id: grade_id,
|
||||||
pagination: true,
|
pagination: true,
|
||||||
...filterState,
|
...filterState,
|
||||||
});
|
});
|
||||||
|
|
||||||
return <DataTable response={response} useColumns={useColumns} />;
|
return <DataTable response={response} useColumns={useColumns} />;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,11 @@ import useFilter from "../../Components/FilterField/components/useFilter";
|
||||||
const Dummy = () => {
|
const Dummy = () => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
useSetPageTitle(`${t(ABILITIES_ENUM?.MAIN_PAGE)} / ${t("dashboard")}`);
|
useSetPageTitle(`${t(ABILITIES_ENUM?.MAIN_PAGE)} / ${t("dashboard")}`);
|
||||||
const {FilterButton,FilterBody} = useFilter()
|
const { FilterButton, FilterBody } = useFilter();
|
||||||
return(
|
return (
|
||||||
<div className="DummyHomePage">
|
<div className="DummyHomePage">
|
||||||
<FilterButton/>
|
<FilterButton />
|
||||||
<FilterBody>
|
<FilterBody>karim</FilterBody>
|
||||||
karim
|
|
||||||
</FilterBody>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,11 @@ const FilterForm = () => {
|
||||||
<div>
|
<div>
|
||||||
<Row>
|
<Row>
|
||||||
<Col>
|
<Col>
|
||||||
<ValidationField placeholder="activation_date" label="activation_date" name="activation_date" />
|
<ValidationField
|
||||||
|
placeholder="activation_date"
|
||||||
|
label="activation_date"
|
||||||
|
name="activation_date"
|
||||||
|
/>
|
||||||
{/* <ValidationField placeholder="name" label="name" name="name" /> */}
|
{/* <ValidationField placeholder="name" label="name" name="name" /> */}
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
|
||||||
|
|
@ -2,24 +2,41 @@ import { Col, Row } from "reactstrap";
|
||||||
import ValidationField from "../../../../Components/ValidationField/ValidationField";
|
import ValidationField from "../../../../Components/ValidationField/ValidationField";
|
||||||
import useFormatDataToSelect from "../../../../utils/useFormatDataToSelect";
|
import useFormatDataToSelect from "../../../../utils/useFormatDataToSelect";
|
||||||
|
|
||||||
const Form = ({isEdit}:{isEdit?:boolean}) => {
|
const Form = ({ isEdit }: { isEdit?: boolean }) => {
|
||||||
|
|
||||||
const typeOptions = [
|
const typeOptions = [
|
||||||
{ id: "student", name: "student" },
|
{ id: "student", name: "student" },
|
||||||
{ id: "reseller", name: "reseller" },
|
{ id: "reseller", name: "reseller" },
|
||||||
{ id: "admin", name: "admin" },
|
{ id: "admin", name: "admin" },
|
||||||
]
|
];
|
||||||
const typeArray = useFormatDataToSelect(typeOptions)
|
const typeArray = useFormatDataToSelect(typeOptions);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row className="w-100">
|
<Row className="w-100">
|
||||||
<Col>
|
<Col>
|
||||||
<ValidationField type="Date" placeholder="activation_date" label="activation_date" name="activation_date" />
|
<ValidationField
|
||||||
<ValidationField type="Date" placeholder="expiration_date" label="expiration_date" name="expiration_date" />
|
type="Date"
|
||||||
<ValidationField placeholder="student_id" label="student_id" name="student_id" />
|
placeholder="activation_date"
|
||||||
|
label="activation_date"
|
||||||
|
name="activation_date"
|
||||||
|
/>
|
||||||
|
<ValidationField
|
||||||
|
type="Date"
|
||||||
|
placeholder="expiration_date"
|
||||||
|
label="expiration_date"
|
||||||
|
name="expiration_date"
|
||||||
|
/>
|
||||||
|
<ValidationField
|
||||||
|
placeholder="student_id"
|
||||||
|
label="student_id"
|
||||||
|
name="student_id"
|
||||||
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
<Col>
|
<Col>
|
||||||
<ValidationField placeholder="package_id" label="package_id" name="package_id" />
|
<ValidationField
|
||||||
|
placeholder="package_id"
|
||||||
|
label="package_id"
|
||||||
|
name="package_id"
|
||||||
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ export const getInitialValues = (objectToEdit: any): any => {
|
||||||
: null,
|
: null,
|
||||||
student_id: objectToEdit?.student_id ?? null,
|
student_id: objectToEdit?.student_id ?? null,
|
||||||
package_id: objectToEdit?.package_id ?? null,
|
package_id: objectToEdit?.package_id ?? null,
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export const getValidationSchema = () => {
|
export const getValidationSchema = () => {
|
||||||
|
|
@ -22,4 +21,4 @@ export const getValidationSchema = () => {
|
||||||
student_id: Yup.number().required("validation.required"),
|
student_id: Yup.number().required("validation.required"),
|
||||||
package_id: Yup.number().required("validation.required"),
|
package_id: Yup.number().required("validation.required"),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,7 @@ const DeleteModalForm = lazy(
|
||||||
|
|
||||||
const TableHeader = () => {
|
const TableHeader = () => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
useSetPageTitle(
|
useSetPageTitle(t(`page_header.student_package`));
|
||||||
t(`page_header.student_package`),
|
|
||||||
);
|
|
||||||
// const deleteMutation = useDeleteUser();
|
// const deleteMutation = useDeleteUser();
|
||||||
return (
|
return (
|
||||||
<div className="TableWithHeader">
|
<div className="TableWithHeader">
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ const App: React.FC = () => {
|
||||||
pagination: true,
|
pagination: true,
|
||||||
...filterState,
|
...filterState,
|
||||||
});
|
});
|
||||||
|
|
||||||
return <DataTable response={response} useColumns={useColumns} />;
|
return <DataTable response={response} useColumns={useColumns} />;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,24 +46,24 @@ export const useColumns = () => {
|
||||||
key: "first_name",
|
key: "first_name",
|
||||||
align: "center",
|
align: "center",
|
||||||
render: (row) => {
|
render: (row) => {
|
||||||
return(row?.student?.first_name)
|
return row?.student?.first_name;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("columns.last_name"),
|
title: t("columns.last_name"),
|
||||||
key: "last_name",
|
key: "last_name",
|
||||||
align: "center",
|
align: "center",
|
||||||
render: (row) => {
|
render: (row) => {
|
||||||
return(row?.student?.last_name)
|
return row?.student?.last_name;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("columns.sex"),
|
title: t("columns.sex"),
|
||||||
key: "sex",
|
key: "sex",
|
||||||
align: "center",
|
align: "center",
|
||||||
render: (row) => {
|
render: (row) => {
|
||||||
return(row?.student?.sex)
|
return row?.student?.sex;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// title: t("columns.procedure"),
|
// title: t("columns.procedure"),
|
||||||
|
|
@ -78,7 +78,7 @@ export const useColumns = () => {
|
||||||
// index={index}
|
// index={index}
|
||||||
// onDelete={() => handelDelete(record)}
|
// onDelete={() => handelDelete(record)}
|
||||||
// onEdit={() => handleEdit(record)}
|
// onEdit={() => handleEdit(record)}
|
||||||
|
|
||||||
// />
|
// />
|
||||||
// );
|
// );
|
||||||
// },
|
// },
|
||||||
|
|
|
||||||
|
|
@ -23,14 +23,17 @@ const Report = React.lazy(() => import("./Pages/Admin/Report/Page"));
|
||||||
const Student = React.lazy(() => import("./Pages/Admin/Student/Page"));
|
const Student = React.lazy(() => import("./Pages/Admin/Student/Page"));
|
||||||
const ReSeller = React.lazy(() => import("./Pages/Admin/Reseller/Page"));
|
const ReSeller = React.lazy(() => import("./Pages/Admin/Reseller/Page"));
|
||||||
const AddReSeller = React.lazy(() => import("./Pages/Admin/Reseller/Add/Page"));
|
const AddReSeller = React.lazy(() => import("./Pages/Admin/Reseller/Add/Page"));
|
||||||
const EditReSeller = React.lazy(() => import("./Pages/Admin/Reseller/Edit/Page"));
|
const EditReSeller = React.lazy(
|
||||||
|
() => import("./Pages/Admin/Reseller/Edit/Page"),
|
||||||
|
);
|
||||||
|
|
||||||
const User = React.lazy(() => import("./Pages/Admin/User/Page"));
|
const User = React.lazy(() => import("./Pages/Admin/User/Page"));
|
||||||
const Param = React.lazy(() => import("./Pages/Admin/Param/Page"));
|
const Param = React.lazy(() => import("./Pages/Admin/Param/Page"));
|
||||||
|
|
||||||
/// RESELLER ///
|
/// RESELLER ///
|
||||||
const Student_Package = React.lazy(() => import("./Pages/ReSeller/StudentPackage/Page"));
|
const Student_Package = React.lazy(
|
||||||
|
() => import("./Pages/ReSeller/StudentPackage/Page"),
|
||||||
|
);
|
||||||
|
|
||||||
import { hasAbility } from "./utils/hasAbility";
|
import { hasAbility } from "./utils/hasAbility";
|
||||||
import { ABILITIES_ENUM, ABILITIES_VALUES_ENUM } from "./enums/abilities";
|
import { ABILITIES_ENUM, ABILITIES_VALUES_ENUM } from "./enums/abilities";
|
||||||
|
|
@ -48,7 +51,7 @@ export const menuItems: TMenuItem[] = [
|
||||||
abilities: ABILITIES_ENUM?.PASS,
|
abilities: ABILITIES_ENUM?.PASS,
|
||||||
abilities_value: ABILITIES_VALUES_ENUM.INDEX,
|
abilities_value: ABILITIES_VALUES_ENUM.INDEX,
|
||||||
prevPath: 0,
|
prevPath: 0,
|
||||||
type:UserTypeEnum?.PASS
|
type: UserTypeEnum?.PASS,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
header: "page_header.grade",
|
header: "page_header.grade",
|
||||||
|
|
@ -89,7 +92,6 @@ export const menuItems: TMenuItem[] = [
|
||||||
abilities: ABILITIES_ENUM?.STUDENT,
|
abilities: ABILITIES_ENUM?.STUDENT,
|
||||||
abilities_value: ABILITIES_VALUES_ENUM.INDEX,
|
abilities_value: ABILITIES_VALUES_ENUM.INDEX,
|
||||||
prevPath: 0,
|
prevPath: 0,
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
header: "page_header.reSeller",
|
header: "page_header.reSeller",
|
||||||
|
|
@ -122,7 +124,6 @@ export const menuItems: TMenuItem[] = [
|
||||||
prevPath: 0,
|
prevPath: 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/// RESELLER /////
|
/// RESELLER /////
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -134,12 +135,9 @@ export const menuItems: TMenuItem[] = [
|
||||||
abilities: ABILITIES_ENUM?.Student_Package,
|
abilities: ABILITIES_ENUM?.Student_Package,
|
||||||
abilities_value: ABILITIES_VALUES_ENUM.INDEX,
|
abilities_value: ABILITIES_VALUES_ENUM.INDEX,
|
||||||
prevPath: 0,
|
prevPath: 0,
|
||||||
type:UserTypeEnum.RE_SELLER
|
type: UserTypeEnum.RE_SELLER,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// {
|
// {
|
||||||
// header: "page_header.tags",
|
// header: "page_header.tags",
|
||||||
// element: <Tags />,
|
// element: <Tags />,
|
||||||
|
|
|
||||||
|
|
@ -298,25 +298,21 @@ button:disabled {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bg2 {
|
||||||
|
|
||||||
.bg2{
|
|
||||||
background: var(--bg2);
|
background: var(--bg2);
|
||||||
}
|
}
|
||||||
.header_form{
|
.header_form {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 20px;
|
gap: 20px;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
h4{
|
h4 {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
|
|
||||||
}
|
}
|
||||||
svg{
|
svg {
|
||||||
background: var(--bg);
|
background: var(--bg);
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,10 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
color: var(--white);
|
color: var(--white);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.AuthForm {
|
.AuthForm {
|
||||||
|
|
||||||
height: 440px;
|
height: 440px;
|
||||||
width: 600px;
|
width: 600px;
|
||||||
min-width: 300px;
|
min-width: 300px;
|
||||||
|
|
|
||||||
|
|
@ -61,5 +61,3 @@
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,13 +74,14 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.filter_modal_add_button,
|
||||||
.filter_modal_add_button, .filter_modal_cancel_button{
|
.filter_modal_cancel_button {
|
||||||
padding: 20px 10px !important;
|
padding: 20px 10px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width:800px) {
|
@media screen and (max-width: 800px) {
|
||||||
.filter_modal_add_button, .filter_modal_cancel_button{
|
.filter_modal_add_button,
|
||||||
|
.filter_modal_cancel_button {
|
||||||
font-size: 8px !important;
|
font-size: 8px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@
|
||||||
border: none;
|
border: none;
|
||||||
color: var(--borderColor);
|
color: var(--borderColor);
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
box-shadow: 0px 0px 4px 2px rgba(0, 0, 0, 0.1);
|
box-shadow: 0px 0px 4px 2px rgba(0, 0, 0, 0.1);
|
||||||
|
|
||||||
img{
|
img {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -197,21 +197,17 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.SelectTag {
|
.SelectTag {
|
||||||
padding-inline: 20px;
|
padding-inline: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.exercise_add{
|
.exercise_add {
|
||||||
|
.add_new_button {
|
||||||
.add_new_button{
|
|
||||||
padding-inline: 20px !important;
|
padding-inline: 20px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.HolderQuestion {
|
||||||
.HolderQuestion{
|
|
||||||
transform: translateY(55px);
|
transform: translateY(55px);
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,4 +9,4 @@
|
||||||
@import "./subject.scss";
|
@import "./subject.scss";
|
||||||
@import "./Marks.scss";
|
@import "./Marks.scss";
|
||||||
@import "./exercise.scss";
|
@import "./exercise.scss";
|
||||||
@import './reSeller.scss';
|
@import "./reSeller.scss";
|
||||||
|
|
|
||||||
|
|
@ -1,50 +1,43 @@
|
||||||
.main_form_body{
|
.main_form_body {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
background: var(--bg);
|
background: var(--bg);
|
||||||
padding: 40px 10px;
|
padding: 40px 10px;
|
||||||
>*{
|
> * {
|
||||||
// max-width: 30%;
|
// max-width: 30%;
|
||||||
flex-basis: 33%;
|
flex-basis: 33%;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
.AttachmentForm {
|
||||||
|
.main_form_body {
|
||||||
|
padding: 30px 50px;
|
||||||
|
gap: 40px;
|
||||||
|
> * {
|
||||||
|
// max-width: 30%;
|
||||||
|
flex-basis: 10%;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.resellerButton {
|
||||||
.AttachmentForm{
|
display: flex;
|
||||||
.main_form_body{
|
align-items: center;
|
||||||
padding: 30px 50px;
|
justify-content: flex-end;
|
||||||
gap: 40px;
|
gap: 20px;
|
||||||
>*{
|
padding: 20px;
|
||||||
// max-width: 30%;
|
button {
|
||||||
flex-basis: 10%;
|
all: unset;
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 8px 26px;
|
||||||
}
|
font-size: 15px;
|
||||||
}
|
border-radius: 5px;
|
||||||
|
background: var(--primary);
|
||||||
|
color: var(--white);
|
||||||
|
&:first-child {
|
||||||
|
background: #f2f4f8;
|
||||||
|
color: #515b73;
|
||||||
|
box-shadow: 0px 0px 4px rgb(0, 0, 0, 0.08);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
.resellerButton{
|
}
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 20px;
|
|
||||||
padding: 20px;
|
|
||||||
button{
|
|
||||||
all: unset;
|
|
||||||
cursor: pointer;
|
|
||||||
padding: 8px 26px;
|
|
||||||
font-size: 15px;
|
|
||||||
border-radius: 5px;
|
|
||||||
background: var(--primary);
|
|
||||||
color: var(--white);
|
|
||||||
&:first-child{
|
|
||||||
background: #F2F4F8;
|
|
||||||
color: #515B73;
|
|
||||||
box-shadow: 0px 0px 4px rgb(0, 0, 0,.08);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
export const BaseURL = "https://nerd-back.point-dev.net/api/";
|
export const BaseURL = "https://nerd-back.point-dev.net/api/";
|
||||||
// export const BaseURL = "http://192.168.1.109:8000/api/";
|
// export const BaseURL = "http://192.168.1.109:8000/api/";
|
||||||
|
|
||||||
export const HEADER_KEY = "X-Custom-Query-Key";
|
export const HEADER_KEY = "X-Custom-Query-Key";
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { AxiosResponse } from "../../types/Axios";
|
||||||
|
|
||||||
type DataToSend = {
|
type DataToSend = {
|
||||||
id?: number | string | any;
|
id?: number | string | any;
|
||||||
key?: string | any
|
key?: string | any;
|
||||||
};
|
};
|
||||||
|
|
||||||
function useDeleteMutation(
|
function useDeleteMutation(
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ function useGetQuery(
|
||||||
options: any = {},
|
options: any = {},
|
||||||
) {
|
) {
|
||||||
const axios = useAxios();
|
const axios = useAxios();
|
||||||
const {Filter} = useFilterStateState()
|
const { Filter } = useFilterStateState();
|
||||||
const sort_by = Filter?.sort_by ?? null;
|
const sort_by = Filter?.sort_by ?? null;
|
||||||
const name = Filter?.name ?? null;
|
const name = Filter?.name ?? null;
|
||||||
const { show, pagination, ...remainingParams } = params;
|
const { show, pagination, ...remainingParams } = params;
|
||||||
|
|
@ -23,8 +23,8 @@ function useGetQuery(
|
||||||
const { page, per_page } = PaginationParams(location);
|
const { page, per_page } = PaginationParams(location);
|
||||||
|
|
||||||
const paramToSend = pagination
|
const paramToSend = pagination
|
||||||
? { page: page, per_page: per_page, name,...remainingParams , sort_by }
|
? { page: page, per_page: per_page, name, ...remainingParams, sort_by }
|
||||||
: { name,...remainingParams ,sort_by};
|
: { name, ...remainingParams, sort_by };
|
||||||
|
|
||||||
const filteredParams = filterParams(paramToSend);
|
const filteredParams = filterParams(paramToSend);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ const useUpdateMutation = (
|
||||||
request = dataToSend;
|
request = dataToSend;
|
||||||
id = dataToSend.get("id");
|
id = dataToSend.get("id");
|
||||||
console.log(dataToSend);
|
console.log(dataToSend);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
request = { ...dataToSend, _method: "PUT" };
|
request = { ...dataToSend, _method: "PUT" };
|
||||||
id = dataToSend?.id || dataToSend?.key;
|
id = dataToSend?.id || dataToSend?.key;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
export const statusType = [
|
export const statusType = [
|
||||||
{ id: "upcoming", name: "select.upcoming" },
|
{ id: "upcoming", name: "select.upcoming" },
|
||||||
{ id: "waiting", name: "select.waiting" },
|
{ id: "waiting", name: "select.waiting" },
|
||||||
{ id: "done", name: "select.done" },
|
{ id: "done", name: "select.done" },
|
||||||
]
|
];
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
export const userTypeOptions = [
|
export const userTypeOptions = [
|
||||||
{ id: "student", name: "student" },
|
{ id: "student", name: "student" },
|
||||||
{ id: "reseller", name: "reseller" },
|
{ id: "reseller", name: "reseller" },
|
||||||
{ id: "admin", name: "admin" },
|
{ id: "admin", name: "admin" },
|
||||||
]
|
];
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
export enum CombinationKeyEnum {
|
export enum CombinationKeyEnum {
|
||||||
|
QUESTION = "KeyK",
|
||||||
QUESTION = "KeyK",
|
CHOICE = "KeyJ",
|
||||||
CHOICE = "KeyJ"
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,4 @@ export enum ModalEnum {
|
||||||
Student_Package_EDIT = "Student_Package.edit",
|
Student_Package_EDIT = "Student_Package.edit",
|
||||||
Student_Package_ADD = "Student_Package.add",
|
Student_Package_ADD = "Student_Package.add",
|
||||||
Student_Package_DELETE = "Student_Package.delete",
|
Student_Package_DELETE = "Student_Package.delete",
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
export enum UserTypeEnum {
|
export enum UserTypeEnum {
|
||||||
ADMIN = "admin",
|
ADMIN = "admin",
|
||||||
RE_SELLER = "reseller",
|
RE_SELLER = "reseller",
|
||||||
PASS="pass"
|
PASS = "pass",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ export enum ABILITIES_ENUM {
|
||||||
Report = "report",
|
Report = "report",
|
||||||
User = "user",
|
User = "user",
|
||||||
RE_SELLER = "reseller",
|
RE_SELLER = "reseller",
|
||||||
Student_Package = "student_package"
|
Student_Package = "student_package",
|
||||||
|
|
||||||
////
|
////
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
"grade_to_pass_must_be_less_than_max_grade": "يجب أن تكون درجة النجاح أقل من الحد الأقصى للدرجة",
|
"grade_to_pass_must_be_less_than_max_grade": "يجب أن تكون درجة النجاح أقل من الحد الأقصى للدرجة",
|
||||||
"max_mark_must_be_greater_than_min_mark_to_pass": "يجب ان تكون اكبر من علامة النجاح",
|
"max_mark_must_be_greater_than_min_mark_to_pass": "يجب ان تكون اكبر من علامة النجاح",
|
||||||
"Sorry, the question must have at least one option": "عذرًا، يجب أن يحتوي السؤال على خيار واحد على الأقل",
|
"Sorry, the question must have at least one option": "عذرًا، يجب أن يحتوي السؤال على خيار واحد على الأقل",
|
||||||
"at_least_one_answer_should_be_correct":"يجب أن تكون إجابة واحدة صحيحة"
|
"at_least_one_answer_should_be_correct": "يجب أن تكون إجابة واحدة صحيحة"
|
||||||
},
|
},
|
||||||
"header": {
|
"header": {
|
||||||
"register_students": "تسجيل الطلاب",
|
"register_students": "تسجيل الطلاب",
|
||||||
|
|
@ -116,14 +116,14 @@
|
||||||
"add_question": "اضافة سؤال",
|
"add_question": "اضافة سؤال",
|
||||||
"new_choice_have_been_added": "تم إضافة خيار جديد",
|
"new_choice_have_been_added": "تم إضافة خيار جديد",
|
||||||
"new_question_have_been_added": "تم إضافة سؤال جديد",
|
"new_question_have_been_added": "تم إضافة سؤال جديد",
|
||||||
"sort_by":"ترتيب حسب",
|
"sort_by": "ترتيب حسب",
|
||||||
"filter":"تصفية",
|
"filter": "تصفية",
|
||||||
"per_page":"صف لكل صفحة",
|
"per_page": "صف لكل صفحة",
|
||||||
"entries":"ادخالات",
|
"entries": "ادخالات",
|
||||||
"personal_information":"المعلومات الشخصية",
|
"personal_information": "المعلومات الشخصية",
|
||||||
"address":"العنوان",
|
"address": "العنوان",
|
||||||
"attachment":"المرفق",
|
"attachment": "المرفق",
|
||||||
"subject_of_class":"مواد الصف"
|
"subject_of_class": "مواد الصف"
|
||||||
},
|
},
|
||||||
"columns": {
|
"columns": {
|
||||||
"id": "الرقم التعريفي",
|
"id": "الرقم التعريفي",
|
||||||
|
|
@ -402,15 +402,15 @@
|
||||||
"key": "المفتاح",
|
"key": "المفتاح",
|
||||||
"canAnswersBeShuffled": "يمكن خلط الإجابات",
|
"canAnswersBeShuffled": "يمكن خلط الإجابات",
|
||||||
"ID Number": "رقم الهوية",
|
"ID Number": "رقم الهوية",
|
||||||
"Addition Date": "تاريخ الإضافة",
|
"Addition Date": "تاريخ الإضافة",
|
||||||
"Status": "الحالة",
|
"Status": "الحالة",
|
||||||
"Full Name": "الاسم الثلاثي",
|
"Full Name": "الاسم الثلاثي",
|
||||||
"Phone Number": "رقم الهاتف",
|
"Phone Number": "رقم الهاتف",
|
||||||
"Mobile Number": "رقم الموبايل",
|
"Mobile Number": "رقم الموبايل",
|
||||||
"Seller Percentage": "نسبة البائع",
|
"Seller Percentage": "نسبة البائع",
|
||||||
"city":"المحافظة",
|
"city": "المحافظة",
|
||||||
"personal_image":"صورة شخصية",
|
"personal_image": "صورة شخصية",
|
||||||
"id_image":"صورة الهوية"
|
"id_image": "صورة الهوية"
|
||||||
},
|
},
|
||||||
"select": {
|
"select": {
|
||||||
"enums": {
|
"enums": {
|
||||||
|
|
@ -667,7 +667,7 @@
|
||||||
"admin": "المسؤول",
|
"admin": "المسؤول",
|
||||||
"branchAdmin": "مسؤول الفروع"
|
"branchAdmin": "مسؤول الفروع"
|
||||||
},
|
},
|
||||||
|
|
||||||
"array": {
|
"array": {
|
||||||
"Period": {
|
"Period": {
|
||||||
"Today": "اليوم",
|
"Today": "اليوم",
|
||||||
|
|
@ -704,11 +704,11 @@
|
||||||
"recently_arrived": "وصلت مؤخرا"
|
"recently_arrived": "وصلت مؤخرا"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"upcoming":"فعال",
|
"upcoming": "فعال",
|
||||||
"waiting":"قيد الانتظار",
|
"waiting": "قيد الانتظار",
|
||||||
"done":"انتهى"
|
"done": "انتهى"
|
||||||
},
|
},
|
||||||
|
|
||||||
"sidebar": {
|
"sidebar": {
|
||||||
"dashboard": "لوحة القيادة",
|
"dashboard": "لوحة القيادة",
|
||||||
"course": "الصفوف",
|
"course": "الصفوف",
|
||||||
|
|
@ -767,10 +767,10 @@
|
||||||
"user": "مستخدم",
|
"user": "مستخدم",
|
||||||
"param": "معامل",
|
"param": "معامل",
|
||||||
"student_package": "حزمة الطالب",
|
"student_package": "حزمة الطالب",
|
||||||
"add_reseller":"إضافة بائع",
|
"add_reseller": "إضافة بائع",
|
||||||
"grade":"الصفوف" ,
|
"grade": "الصفوف",
|
||||||
"report":"تقرير",
|
"report": "تقرير",
|
||||||
"tags":"كلمات مفتاحية"
|
"tags": "كلمات مفتاحية"
|
||||||
},
|
},
|
||||||
"page_header": {
|
"page_header": {
|
||||||
"dashboard": "لوحة القيادة / الصفحة الرئيسية",
|
"dashboard": "لوحة القيادة / الصفحة الرئيسية",
|
||||||
|
|
@ -812,8 +812,8 @@
|
||||||
"table": {
|
"table": {
|
||||||
"student": "قائمة الطلاب",
|
"student": "قائمة الطلاب",
|
||||||
"reseller": "البائعين",
|
"reseller": "البائعين",
|
||||||
"grade":"قائمة الصفوف",
|
"grade": "قائمة الصفوف",
|
||||||
"subjects":"مواد الصف"
|
"subjects": "مواد الصف"
|
||||||
},
|
},
|
||||||
"alphabet": {
|
"alphabet": {
|
||||||
"A": "A",
|
"A": "A",
|
||||||
|
|
@ -843,5 +843,5 @@
|
||||||
"Y": "Y",
|
"Y": "Y",
|
||||||
"Z": "Z"
|
"Z": "Z"
|
||||||
},
|
},
|
||||||
"upcoming":""
|
"upcoming": ""
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1 @@
|
||||||
{
|
{}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ type TMenuItemBase = {
|
||||||
withOutLayout?: boolean;
|
withOutLayout?: boolean;
|
||||||
abilities: ABILITIES_ENUM;
|
abilities: ABILITIES_ENUM;
|
||||||
abilities_value: ABILITIES_VALUES_ENUM;
|
abilities_value: ABILITIES_VALUES_ENUM;
|
||||||
type?:UserTypeEnum
|
type?: UserTypeEnum;
|
||||||
prevPath: number;
|
prevPath: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -40,7 +40,7 @@ export type TCrudRoute = {
|
||||||
element: ReactElement | LazyExoticComponent<any>;
|
element: ReactElement | LazyExoticComponent<any>;
|
||||||
abilities: ABILITIES_ENUM;
|
abilities: ABILITIES_ENUM;
|
||||||
abilities_value: ABILITIES_VALUES_ENUM;
|
abilities_value: ABILITIES_VALUES_ENUM;
|
||||||
type?:UserTypeEnum
|
type?: UserTypeEnum;
|
||||||
prevPath: number;
|
prevPath: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user