Compare commits
No commits in common. "cd6e47903bdc6888365aa0070eae525e977f4557" and "1d31d5eb34022c2f7c28e8e10a3bb8e80c124c48" have entirely different histories.
cd6e47903b
...
1d31d5eb34
|
|
@ -18,6 +18,7 @@ const SearchField: React.FC<Props> = ({ placeholder, searchBy }) => {
|
||||||
const handleInputChange = (value: string) => {
|
const handleInputChange = (value: string) => {
|
||||||
setSearchQuery(value);
|
setSearchQuery(value);
|
||||||
};
|
};
|
||||||
|
console.log(searchBy,"searchBy");
|
||||||
|
|
||||||
const handleInputChangeWithDebounce = useDebounce((value: string) => {
|
const handleInputChangeWithDebounce = useDebounce((value: string) => {
|
||||||
setFilter({
|
setFilter({
|
||||||
|
|
|
||||||
|
|
@ -29,14 +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",
|
value: "recently_viewed",
|
||||||
// label: t("select.array.order.recently_viewed"),
|
label: t("select.array.order.recently_viewed"),
|
||||||
// },
|
},
|
||||||
// {
|
{
|
||||||
// value: "recently_arrived",
|
value: "recently_arrived",
|
||||||
// label: t("select.array.order.recently_arrived"),
|
label: t("select.array.order.recently_arrived"),
|
||||||
// },
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ import { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { MdExpandLess, MdExpandMore } from "react-icons/md";
|
import { MdExpandLess, MdExpandMore } from "react-icons/md";
|
||||||
import { Link, useNavigate } from "react-router-dom";
|
import { Link, useNavigate } from "react-router-dom";
|
||||||
import { useFilterStateState } from "../../../zustand/Filter";
|
|
||||||
|
|
||||||
export const MenuItem = ({ item, location, index, isOpen }: any) => {
|
export const MenuItem = ({ item, location, index, isOpen }: any) => {
|
||||||
const isActive = location.pathname.split("/")[1] === item.path?.slice(1);
|
const isActive = location.pathname.split("/")[1] === item.path?.slice(1);
|
||||||
|
|
@ -13,17 +12,12 @@ export const MenuItem = ({ item, location, index, isOpen }: any) => {
|
||||||
const isDropdownOpen = openDropdown === index;
|
const isDropdownOpen = openDropdown === index;
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { setFilter} = useFilterStateState();
|
|
||||||
const handleNavigate = ()=>{
|
|
||||||
setFilter({})
|
|
||||||
navigate(item.path || "/")
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
className={`link ${isActive ? "active" : ""} ${item?.children && "DropDownLink"}`}
|
className={`link ${isActive ? "active" : ""} ${item?.children && "DropDownLink"}`}
|
||||||
onClick={() => handleNavigate()}
|
onClick={() => navigate(item.path || "/")}
|
||||||
>
|
>
|
||||||
<i>{item.icon}</i>
|
<i>{item.icon}</i>
|
||||||
{/* Conditionally render the text based on sidebar width */}
|
{/* Conditionally render the text based on sidebar width */}
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,6 @@ const TextField = ({
|
||||||
showCount
|
showCount
|
||||||
maxLength={1000}
|
maxLength={1000}
|
||||||
autoSize={{ minRows: 4, maxRows: 10 }}
|
autoSize={{ minRows: 4, maxRows: 10 }}
|
||||||
|
|
||||||
onChange={onChange || TextFilehandleChange}
|
onChange={onChange || TextFilehandleChange}
|
||||||
id={name}
|
id={name}
|
||||||
{...props}
|
{...props}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import useModalHandler from "../../utils/useModalHandler";
|
||||||
import { deletePathSegments } from "../../utils/deletePathSegments";
|
import { deletePathSegments } from "../../utils/deletePathSegments";
|
||||||
import { getPrevPathRoute } from "../../utils/getPrevPathRoute";
|
import { getPrevPathRoute } from "../../utils/getPrevPathRoute";
|
||||||
import PageTitleComponent from "./PageTitle";
|
import PageTitleComponent from "./PageTitle";
|
||||||
import { useFilterStateState } from "../../zustand/Filter";
|
|
||||||
|
|
||||||
const PageHeader = ({
|
const PageHeader = ({
|
||||||
canAdd,
|
canAdd,
|
||||||
|
|
@ -28,12 +27,8 @@ const PageHeader = ({
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const PrevPath = getPrevPathRoute(location.pathname);
|
const PrevPath = getPrevPathRoute(location.pathname);
|
||||||
const { setFilter } = useFilterStateState();
|
|
||||||
|
|
||||||
const handleNavigateToPage = (location: string) => {
|
const handleNavigateToPage = (location: string) => {
|
||||||
setFilter({})
|
|
||||||
navigate(location);
|
navigate(location);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log();
|
console.log();
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,16 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { useLocation, useNavigate } from 'react-router-dom'
|
import { useLocation, useNavigate } from 'react-router-dom'
|
||||||
import { usePageTitleState } from '../../zustand/PageTitleState'
|
import { usePageTitleState } from '../../zustand/PageTitleState'
|
||||||
import { useFilterStateState } from '../../zustand/Filter'
|
|
||||||
|
|
||||||
const PageTitleComponent = () => {
|
const PageTitleComponent = () => {
|
||||||
|
|
||||||
const {PageTitle} = usePageTitleState()
|
const {PageTitle,setPageTitle} = usePageTitleState()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
const { setFilter } = useFilterStateState();
|
|
||||||
|
|
||||||
|
|
||||||
const handleNavigate = (path:string)=>{
|
const handleNavigate = (path:string)=>{
|
||||||
const currentPath = location.pathname ;
|
const currentPath = location.pathname ;
|
||||||
const newPath = currentPath?.split(path)?.[0] + path ;
|
const newPath = currentPath?.split(path)?.[0] + path ;
|
||||||
if(newPath !== currentPath){
|
if(newPath !== currentPath){
|
||||||
setFilter({})
|
|
||||||
navigate(newPath)
|
navigate(newPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import { CiMenuBurger, CiSettings } from "react-icons/ci";
|
||||||
import { IoIosMenu } from "react-icons/io";
|
import { IoIosMenu } from "react-icons/io";
|
||||||
import { HiMenuAlt2, HiMenuAlt3 } from "react-icons/hi";
|
import { HiMenuAlt2, HiMenuAlt3 } from "react-icons/hi";
|
||||||
import { RoleByType } from "../../utils/RoleByType";
|
import { RoleByType } from "../../utils/RoleByType";
|
||||||
import { useFilterStateState } from "../../zustand/Filter";
|
|
||||||
|
|
||||||
const SideBar = ({
|
const SideBar = ({
|
||||||
isOpen,
|
isOpen,
|
||||||
|
|
@ -26,6 +25,7 @@ const SideBar = ({
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { logout } = useAuthState();
|
const { logout } = useAuthState();
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
const branch_name = getLocalStorage(BRANCH_OBJECT_KEY)?.name;
|
||||||
|
|
||||||
const toggleSidebar = () => {
|
const toggleSidebar = () => {
|
||||||
setIsOpen((prev: boolean) => (prev === true ? false : true));
|
setIsOpen((prev: boolean) => (prev === true ? false : true));
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,13 @@ import React from "react";
|
||||||
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
|
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
|
||||||
import { useGetAllGrade } from "../../../api/grade";
|
import { useGetAllGrade } from "../../../api/grade";
|
||||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||||
import { useFilterStateState } from "../../../zustand/Filter";
|
|
||||||
|
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
const { filterState } = useFilterState();
|
const { filterState } = useFilterState();
|
||||||
const { Filter } = useFilterStateState();
|
|
||||||
const name = Filter?.name ;
|
|
||||||
const sort_by = Filter?.sort_by ;
|
|
||||||
const response = useGetAllGrade({
|
const response = useGetAllGrade({
|
||||||
pagination: true,
|
pagination: true,
|
||||||
...filterState,
|
...filterState,
|
||||||
name,
|
|
||||||
sort_by
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return <DataTable response={response} useColumns={useColumns} />;
|
return <DataTable response={response} useColumns={useColumns} />;
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,17 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
|
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
|
||||||
import { useColumns } from "./useTableColumns";
|
import { useColumns } from "./useTableColumns";
|
||||||
|
import useSearchQuery from "../../../api/utils/useSearchQuery";
|
||||||
import { useGetAllParam } from "../../../api/param";
|
import { useGetAllParam } from "../../../api/param";
|
||||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useFilterStateState } from "../../../zustand/Filter";
|
|
||||||
|
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
|
const [searchQuery] = useSearchQuery("name");
|
||||||
const { filterState } = useFilterState();
|
const { filterState } = useFilterState();
|
||||||
const { Filter } = useFilterStateState();
|
|
||||||
|
|
||||||
const name = Filter?.name ;
|
|
||||||
const sort_by = Filter?.sort_by ;
|
|
||||||
|
|
||||||
|
|
||||||
const response = useGetAllParam({
|
const response = useGetAllParam({
|
||||||
name,
|
name: searchQuery,
|
||||||
sort_by,
|
|
||||||
pagination: true,
|
pagination: true,
|
||||||
...filterState,
|
...filterState,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -9,15 +9,13 @@ import { useFilterStateState } from "../../../zustand/Filter";
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
const { filterState } = useFilterState();
|
const { filterState } = useFilterState();
|
||||||
const { setFilter,Filter } = useFilterStateState();
|
const { setFilter,Filter } = useFilterStateState();
|
||||||
const sort_by = Filter?.sort_by ;
|
|
||||||
|
|
||||||
console.log(filterState,"filterState");
|
console.log(filterState,"filterState");
|
||||||
|
|
||||||
const response = useGetAllQuestion({
|
const response = useGetAllQuestion({
|
||||||
pagination: true,
|
pagination: true,
|
||||||
...filterState,
|
...filterState,
|
||||||
content:Filter?.content,
|
content:Filter?.content
|
||||||
sort_by,
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,16 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { useGetAllTag } from "../../../api/tags";
|
||||||
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
|
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
|
||||||
import { useColumns } from "./useTableColumns";
|
import { useColumns } from "./useTableColumns";
|
||||||
|
import useSearchQuery from "../../../api/utils/useSearchQuery";
|
||||||
import { useGetAllReport } from "../../../api/report";
|
import { useGetAllReport } from "../../../api/report";
|
||||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||||
import { useFilterStateState } from "../../../zustand/Filter";
|
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
|
const [searchQuery] = useSearchQuery("name");
|
||||||
const { filterState } = useFilterState();
|
const { filterState } = useFilterState();
|
||||||
|
|
||||||
const { Filter } = useFilterStateState();
|
|
||||||
const name = Filter?.name ;
|
|
||||||
const sort_by = Filter?.sort_by ;
|
|
||||||
|
|
||||||
|
|
||||||
const response = useGetAllReport({
|
const response = useGetAllReport({
|
||||||
name,
|
name: searchQuery,
|
||||||
sort_by,
|
|
||||||
pagination: true,
|
pagination: true,
|
||||||
...filterState,
|
...filterState,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -4,17 +4,12 @@ import { useColumns } from "./useTableColumns";
|
||||||
import useSearchQuery from "../../../api/utils/useSearchQuery";
|
import useSearchQuery from "../../../api/utils/useSearchQuery";
|
||||||
import { useGetAllReseller } from "../../../api/reseller";
|
import { useGetAllReseller } from "../../../api/reseller";
|
||||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||||
import { useFilterStateState } from "../../../zustand/Filter";
|
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
|
const [searchQuery] = useSearchQuery("name");
|
||||||
const { filterState } = useFilterState();
|
const { filterState } = useFilterState();
|
||||||
const { Filter } = useFilterStateState();
|
|
||||||
|
|
||||||
const name = Filter?.name ;
|
|
||||||
const sort_by = Filter?.sort_by ;
|
|
||||||
|
|
||||||
const response = useGetAllReseller({
|
const response = useGetAllReseller({
|
||||||
name,
|
name: searchQuery,
|
||||||
sort_by,
|
|
||||||
pagination: true,
|
pagination: true,
|
||||||
...filterState,
|
...filterState,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -3,20 +3,11 @@ import React from "react";
|
||||||
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
|
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
|
||||||
import { useGetAllStudent } from "../../../api/student";
|
import { useGetAllStudent } from "../../../api/student";
|
||||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||||
import { useFilterStateState } from "../../../zustand/Filter";
|
|
||||||
|
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
const { filterState } = useFilterState();
|
const { filterState } = useFilterState();
|
||||||
|
|
||||||
const { Filter } = useFilterStateState();
|
|
||||||
|
|
||||||
const name = Filter?.name ;
|
|
||||||
const sort_by = Filter?.sort_by ;
|
|
||||||
|
|
||||||
|
|
||||||
const response = useGetAllStudent({
|
const response = useGetAllStudent({
|
||||||
name,
|
|
||||||
sort_by,
|
|
||||||
pagination: true,
|
pagination: true,
|
||||||
...filterState,
|
...filterState,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -2,19 +2,15 @@ import React from "react";
|
||||||
import { useGetAllTag } from "../../../api/tags";
|
import { useGetAllTag } from "../../../api/tags";
|
||||||
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
|
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
|
||||||
import { useColumns } from "./useTableColumns";
|
import { useColumns } from "./useTableColumns";
|
||||||
|
import useSearchQuery from "../../../api/utils/useSearchQuery";
|
||||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||||
import { useFilterStateState } from "../../../zustand/Filter";
|
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
|
const [searchQuery] = useSearchQuery("name");
|
||||||
const { filterState } = useFilterState();
|
const { filterState } = useFilterState();
|
||||||
const { Filter } = useFilterStateState();
|
|
||||||
const name = Filter?.name ;
|
|
||||||
const sort_by = Filter?.sort_by ;
|
|
||||||
|
|
||||||
const response = useGetAllTag({
|
const response = useGetAllTag({
|
||||||
|
name: searchQuery,
|
||||||
pagination: true,
|
pagination: true,
|
||||||
name,
|
|
||||||
sort_by,
|
|
||||||
...filterState,
|
...filterState,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ const LoadingLottie = React.lazy(
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useColumns } from "./useTableColumns";
|
import { useColumns } from "./useTableColumns";
|
||||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||||
import { useFilterStateState } from "../../../zustand/Filter";
|
|
||||||
|
|
||||||
interface DataType {
|
interface DataType {
|
||||||
id: string; // Unique identifier for each row
|
id: string; // Unique identifier for each row
|
||||||
|
|
@ -94,14 +93,10 @@ const Row: React.FC<RowProps> = (props) => {
|
||||||
const DrapableTable: React.FC = () => {
|
const DrapableTable: React.FC = () => {
|
||||||
const { subject_id } = useParams<ParamsEnum>();
|
const { subject_id } = useParams<ParamsEnum>();
|
||||||
const { filterState } = useFilterState();
|
const { filterState } = useFilterState();
|
||||||
const { Filter } = useFilterStateState();
|
|
||||||
const name = Filter?.name ;
|
|
||||||
const sort_by = Filter?.sort_by ;
|
|
||||||
const response = useGetAllUnit({
|
const response = useGetAllUnit({
|
||||||
subject_id: subject_id,
|
subject_id: subject_id,
|
||||||
pagination: false,
|
pagination: false,
|
||||||
name,
|
|
||||||
sort_by,
|
|
||||||
...filterState,
|
...filterState,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,24 +6,20 @@ import { useParams } from "react-router-dom";
|
||||||
import { ParamsEnum } from "../../../enums/params";
|
import { ParamsEnum } from "../../../enums/params";
|
||||||
import { useObjectToEdit } from "../../../zustand/ObjectToEditState";
|
import { useObjectToEdit } from "../../../zustand/ObjectToEditState";
|
||||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||||
import { useFilterStateState } from "../../../zustand/Filter";
|
|
||||||
|
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
const { subject_id } = useParams<ParamsEnum>();
|
const { subject_id } = useParams<ParamsEnum>();
|
||||||
const { Filter } = useFilterStateState();
|
|
||||||
const name = Filter?.name ;
|
|
||||||
const sort_by = Filter?.sort_by ;
|
|
||||||
const response = useGetAllUnit({
|
const response = useGetAllUnit({
|
||||||
subject_id: subject_id,
|
subject_id: subject_id,
|
||||||
pagination: true,
|
pagination: true,
|
||||||
name,
|
|
||||||
sort_by
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
const { setOldObjectToEdit } = useObjectToEdit();
|
const { setOldObjectToEdit } = useObjectToEdit();
|
||||||
|
// console.log(response?.data?.data, "response?.data");
|
||||||
const data = response?.data?.data;
|
const data = response?.data?.data;
|
||||||
const lastElement = response?.data?.data && response?.data?.data[data?.length - 1];
|
const lastElement =
|
||||||
|
response?.data?.data && response?.data?.data[data?.length - 1];
|
||||||
|
// console.log(lastElement);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (lastElement) {
|
if (lastElement) {
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,15 @@ import React from "react";
|
||||||
import { useGetAllTag } from "../../../api/tags";
|
import { useGetAllTag } from "../../../api/tags";
|
||||||
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
|
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
|
||||||
import { useColumns } from "./useTableColumns";
|
import { useColumns } from "./useTableColumns";
|
||||||
|
import useSearchQuery from "../../../api/utils/useSearchQuery";
|
||||||
import { useGetAllUser } from "../../../api/user";
|
import { useGetAllUser } from "../../../api/user";
|
||||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||||
import { useFilterStateState } from "../../../zustand/Filter";
|
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
|
const [searchQuery] = useSearchQuery("name");
|
||||||
const { filterState } = useFilterState();
|
const { filterState } = useFilterState();
|
||||||
const { Filter } = useFilterStateState();
|
|
||||||
const name = Filter?.name ;
|
|
||||||
const sort_by = Filter?.sort_by ;
|
|
||||||
|
|
||||||
const response = useGetAllUser({
|
const response = useGetAllUser({
|
||||||
name,
|
name: searchQuery,
|
||||||
sort_by,
|
|
||||||
pagination: true,
|
pagination: true,
|
||||||
...filterState,
|
...filterState,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ const LoadingLottie = React.lazy(
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useColumns } from "./useTableColumns";
|
import { useColumns } from "./useTableColumns";
|
||||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||||
import { useFilterStateState } from "../../../zustand/Filter";
|
|
||||||
|
|
||||||
interface DataType {
|
interface DataType {
|
||||||
id: string; // Unique identifier for each row
|
id: string; // Unique identifier for each row
|
||||||
|
|
@ -95,15 +94,9 @@ const DrapableTable: React.FC = () => {
|
||||||
const { unit_id } = useParams<ParamsEnum>();
|
const { unit_id } = useParams<ParamsEnum>();
|
||||||
const { filterState } = useFilterState();
|
const { filterState } = useFilterState();
|
||||||
|
|
||||||
const { Filter } = useFilterStateState();
|
|
||||||
const name = Filter?.name ;
|
|
||||||
const sort_by = Filter?.sort_by ;
|
|
||||||
|
|
||||||
const response = useGetAllLesson({
|
const response = useGetAllLesson({
|
||||||
unit_id: unit_id,
|
unit_id: unit_id,
|
||||||
pagination: false,
|
pagination: false,
|
||||||
name,
|
|
||||||
sort_by,
|
|
||||||
...filterState,
|
...filterState,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import { useGetAllUnit } from "../../../api/unit";
|
||||||
import { ModalEnum } from "../../../enums/Model";
|
import { ModalEnum } from "../../../enums/Model";
|
||||||
import { useDeleteLesson } from "../../../api/lesson";
|
import { useDeleteLesson } from "../../../api/lesson";
|
||||||
import { useGetAllGrade } from "../../../api/grade";
|
import { useGetAllGrade } from "../../../api/grade";
|
||||||
|
import { useGetAllCurriculum } from "../../../api/curriculum";
|
||||||
import { useGetAllSubject } from "../../../api/subject";
|
import { useGetAllSubject } from "../../../api/subject";
|
||||||
import PageHeader from "../../../Layout/Dashboard/PageHeader";
|
import PageHeader from "../../../Layout/Dashboard/PageHeader";
|
||||||
import FilterLayout from "../../../Layout/Dashboard/FilterLayout";
|
import FilterLayout from "../../../Layout/Dashboard/FilterLayout";
|
||||||
|
|
|
||||||
|
|
@ -6,21 +6,13 @@ import { useParams } from "react-router-dom";
|
||||||
import { ParamsEnum } from "../../../enums/params";
|
import { ParamsEnum } from "../../../enums/params";
|
||||||
import { useObjectToEdit } from "../../../zustand/ObjectToEditState";
|
import { useObjectToEdit } from "../../../zustand/ObjectToEditState";
|
||||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||||
import { useFilterStateState } from "../../../zustand/Filter";
|
|
||||||
|
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
const { unit_id } = useParams<ParamsEnum>();
|
const { unit_id } = useParams<ParamsEnum>();
|
||||||
|
|
||||||
const { Filter } = useFilterStateState();
|
|
||||||
const name = Filter?.name ;
|
|
||||||
const sort_by = Filter?.sort_by ;
|
|
||||||
|
|
||||||
|
|
||||||
const response = useGetAllLesson({
|
const response = useGetAllLesson({
|
||||||
unit_id: unit_id,
|
unit_id: unit_id,
|
||||||
pagination: true,
|
pagination: true,
|
||||||
name,
|
|
||||||
sort_by
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const { setOldObjectToEdit } = useObjectToEdit();
|
const { setOldObjectToEdit } = useObjectToEdit();
|
||||||
|
|
|
||||||
|
|
@ -60,8 +60,7 @@ const TextField = ({
|
||||||
showCount
|
showCount
|
||||||
maxLength={1000}
|
maxLength={1000}
|
||||||
onChange={onChange || TextFilehandleChange}
|
onChange={onChange || TextFilehandleChange}
|
||||||
autoSize={{ minRows: 4, maxRows: 10 }}
|
style={{ height: 120 }}
|
||||||
|
|
||||||
id={id}
|
id={id}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ const TextField = ({
|
||||||
showCount
|
showCount
|
||||||
maxLength={1000}
|
maxLength={1000}
|
||||||
onChange={onChange || TextFilehandleChange}
|
onChange={onChange || TextFilehandleChange}
|
||||||
autoSize={{ minRows: 4, maxRows: 10 }}
|
style={{ height: 120 }}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ const TextField = ({
|
||||||
showCount
|
showCount
|
||||||
maxLength={1000}
|
maxLength={1000}
|
||||||
onChange={onChange || TextFilehandleChange}
|
onChange={onChange || TextFilehandleChange}
|
||||||
autoSize={{ minRows: 4, maxRows: 10 }}
|
style={{ height: 120 }}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -10,16 +10,13 @@ import { useFilterStateState } from "../../../zustand/Filter";
|
||||||
const App: React.FC = () => {
|
const App: React.FC = () => {
|
||||||
const { lesson_id } = useParams<ParamsEnum>();
|
const { lesson_id } = useParams<ParamsEnum>();
|
||||||
const { filterState } = useFilterState();
|
const { filterState } = useFilterState();
|
||||||
const { Filter } = useFilterStateState();
|
const { setFilter,Filter } = useFilterStateState();
|
||||||
const sort_by = Filter?.sort_by ;
|
|
||||||
const content = Filter?.content ;
|
|
||||||
|
|
||||||
const response = useGetAllQuestion({
|
const response = useGetAllQuestion({
|
||||||
lessonsIds: [lesson_id],
|
lessonsIds: [lesson_id],
|
||||||
pagination: true,
|
pagination: true,
|
||||||
...filterState,
|
...filterState,
|
||||||
content,
|
content:Filter?.content
|
||||||
sort_by
|
|
||||||
});
|
});
|
||||||
return <DataTable response={response} useColumns={useColumns} />;
|
return <DataTable response={response} useColumns={useColumns} />;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,11 @@ const DeleteModalForm = lazy(
|
||||||
);
|
);
|
||||||
|
|
||||||
const TableWithHeader = () => {
|
const TableWithHeader = () => {
|
||||||
|
const { handel_open_model } = useModalHandler();
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
const deleteMutation = useDeleteSubject();
|
const deleteMutation = useDeleteSubject();
|
||||||
|
|
||||||
const { grade_id } = useParams<ParamsEnum>();
|
const { grade_id } = useParams<ParamsEnum>();
|
||||||
console.log(grade_id);
|
|
||||||
|
|
||||||
const { data: grade } = useGetAllGrade({
|
const { data: grade } = useGetAllGrade({
|
||||||
show: grade_id,
|
show: grade_id,
|
||||||
|
|
|
||||||
|
|
@ -4,20 +4,15 @@ import DataTable from "../../../../Layout/Dashboard/Table/DataTable";
|
||||||
import { useColumns } from "./useTableColumns";
|
import { useColumns } from "./useTableColumns";
|
||||||
import { ParamsEnum } from "../../../../enums/params";
|
import { ParamsEnum } from "../../../../enums/params";
|
||||||
import { useFilterState } from "../../../../Components/Utils/Filter/FilterState";
|
import { useFilterState } from "../../../../Components/Utils/Filter/FilterState";
|
||||||
import { useFilterStateState } from "../../../../zustand/Filter";
|
|
||||||
|
|
||||||
const TablePage: React.FC = () => {
|
const TablePage: React.FC = () => {
|
||||||
const { grade_id } = useParams<ParamsEnum>();
|
const { grade_id } = useParams<ParamsEnum>();
|
||||||
const { filterState } = useFilterState();
|
const { filterState } = useFilterState();
|
||||||
const { Filter } = useFilterStateState();
|
|
||||||
const name = Filter?.name ;
|
|
||||||
const sort_by = Filter?.sort_by ;
|
|
||||||
const response = useGetAllSubject({
|
const response = useGetAllSubject({
|
||||||
grade_id: grade_id,
|
grade_id: grade_id,
|
||||||
pagination: true,
|
pagination: true,
|
||||||
...filterState,
|
...filterState,
|
||||||
name,
|
|
||||||
sort_by
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return <DataTable response={response} useColumns={useColumns} />;
|
return <DataTable response={response} useColumns={useColumns} />;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
--primary: #3d5ee1;
|
--primary: #3d5ee1;
|
||||||
--secondary: #303972;
|
--secondary: #303972;
|
||||||
--field: #b0d9ff;
|
--field: #b0d9ff;
|
||||||
--text: #202C4B;
|
--text: black;
|
||||||
--subtext: #9d9d9d;
|
--subtext: #9d9d9d;
|
||||||
--label: #0d5190;
|
--label: #0d5190;
|
||||||
--bg: rgb(255, 255, 255);
|
--bg: rgb(255, 255, 255);
|
||||||
|
|
@ -38,3 +38,35 @@
|
||||||
--fieldHeight: 40px;
|
--fieldHeight: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:root:has(.dark) {
|
||||||
|
--primary: #3d5ee1;
|
||||||
|
--secondary: #303972;
|
||||||
|
--field: #b0d9ff;
|
||||||
|
--text: white;
|
||||||
|
--subtext: #9d9d9d;
|
||||||
|
--label: #0d5190;
|
||||||
|
--bg: rgb(51, 51, 51);
|
||||||
|
--bg2: black;
|
||||||
|
--bg3: rgba(255, 255, 255, 0.82);
|
||||||
|
--border-color: #b0d9ff;
|
||||||
|
--shadow: rgba(0, 0, 0, 0.15);
|
||||||
|
--white: white;
|
||||||
|
--bgSideBar: #0f0c1c;
|
||||||
|
--textSideBar: #ffffff;
|
||||||
|
--sideBarWidth: 14vw;
|
||||||
|
--sideBarMinWidth: 14vw;
|
||||||
|
--sideBarSpace: 1%;
|
||||||
|
--links: #25638f;
|
||||||
|
|
||||||
|
--button: #2d3748;
|
||||||
|
--layoutPadding: 3%;
|
||||||
|
--border-radius: 10px;
|
||||||
|
|
||||||
|
--utils_color_one: #fb7d5b;
|
||||||
|
--utils_color_tow: #fcc43e;
|
||||||
|
|
||||||
|
--presence: #31ce83;
|
||||||
|
--absence: #ce3131;
|
||||||
|
--lateArrival: #f0e43b;
|
||||||
|
--earlyDeparture: #3d5ee1;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,19 @@
|
||||||
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;700&display=swap');
|
@font-face {
|
||||||
|
font-family: "Poppins_Bold";
|
||||||
|
src: url("../../font/Poppins-Bold.ttf") format("truetype"); /* Specify the path to the font file */
|
||||||
|
font-display: swap;
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: "Noto Sans Arabic", sans-serif; /* Use Noto Sans Arabic for body text */
|
font-family: "Poppins", sans-serif; /* Use ABeeZee font for body text */
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin Font_Poppins {
|
||||||
|
font-family: "Poppins"; /* Use ABeeZee font for body text */
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin Font_Poppins_Bold {
|
||||||
|
font-family: "Poppins-Bold"; /* Use ABeeZee font for body text */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,6 @@
|
||||||
transition: 1s ease-in-out;
|
transition: 1s ease-in-out;
|
||||||
animation: fadeInRight 1s ease-in-out;
|
animation: fadeInRight 1s ease-in-out;
|
||||||
max-height: 90vh;
|
max-height: 90vh;
|
||||||
min-height: 90vh;
|
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
@include Scrollbar;
|
@include Scrollbar;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
h5 {
|
h5 {
|
||||||
color: var(--secondary);
|
color: var(--secondary);
|
||||||
font-size: 0.8vw;
|
font-size: 0.8vw;
|
||||||
|
@include Font_Poppins;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@
|
||||||
h6 {
|
h6 {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: var(--secondary);
|
color: var(--secondary);
|
||||||
|
@include Font_Poppins_Bold;
|
||||||
font-size: 1.5vw;
|
font-size: 1.5vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,9 @@ import useAxios from "./useAxios";
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
import { PaginationParams } from "../utils/PaginationParams";
|
import { PaginationParams } from "../utils/PaginationParams";
|
||||||
import { filterParams } from "../utils/filterParams";
|
import { filterParams } from "../utils/filterParams";
|
||||||
|
import useAuthState from "../../zustand/AuthState";
|
||||||
|
import { useFilterStateState } from "../../zustand/Filter";
|
||||||
|
|
||||||
function useGetQuery(
|
function useGetQuery(
|
||||||
KEY: string | string[],
|
KEY: string | string[],
|
||||||
url: string,
|
url: string,
|
||||||
|
|
@ -10,18 +13,18 @@ function useGetQuery(
|
||||||
options: any = {},
|
options: any = {},
|
||||||
) {
|
) {
|
||||||
const axios = useAxios();
|
const axios = useAxios();
|
||||||
|
const { Filter } = useFilterStateState();
|
||||||
|
const sort_by = Filter?.sort_by ?? null;
|
||||||
|
const name = Filter?.name ?? null;
|
||||||
const { show, pagination, ...remainingParams } = params;
|
const { show, pagination, ...remainingParams } = params;
|
||||||
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
const { page, per_page } = PaginationParams(location);
|
const { page, per_page } = PaginationParams(location);
|
||||||
|
|
||||||
console.log(remainingParams)
|
|
||||||
const paramToSend = pagination
|
const paramToSend = pagination
|
||||||
|
? { page: page, per_page: per_page, name, ...remainingParams, sort_by }
|
||||||
|
: { name, ...remainingParams, sort_by };
|
||||||
? { page: page, per_page: per_page, ...remainingParams }
|
|
||||||
: { ...remainingParams };
|
|
||||||
|
|
||||||
const filteredParams = filterParams(paramToSend);
|
const filteredParams = filterParams(paramToSend);
|
||||||
|
|
||||||
|
|
|
||||||
BIN
src/font/Poppins-Bold.ttf
Normal file
BIN
src/font/Poppins-Bold.ttf
Normal file
Binary file not shown.
|
|
@ -1,16 +0,0 @@
|
||||||
export function shallowEqual(obj1: any, obj2: any): boolean {
|
|
||||||
const keys1 = Object.keys(obj1);
|
|
||||||
const keys2 = Object.keys(obj2);
|
|
||||||
|
|
||||||
if (keys1.length !== keys2.length) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const key of keys1) {
|
|
||||||
if (obj1[key] !== obj2[key]) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user