change_route

This commit is contained in:
karimalden 2024-07-27 14:17:51 +03:00
parent 9530ea30e7
commit d721b8417c
3 changed files with 4 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,24 +1,17 @@
import { Space, TableColumnsType, Tooltip } from "antd"; import { Space, TableColumnsType, Tooltip } from "antd";
import { Question } from "../../types/Item"; import { Question } from "../../types/Item";
import { FaPlus } from "react-icons/fa"; import { FaPlus } from "react-icons/fa";
import useModalHandler from "../../utils/useModalHandler";
import { ModalEnum } from "../../enums/Model"; import { ModalEnum } from "../../enums/Model";
import { useObjectToEdit } from "../../zustand/ObjectToEditState"; import { useObjectToEdit } from "../../zustand/ObjectToEditState";
import { RiDeleteBin6Fill } from "react-icons/ri"; import { RiDeleteBin6Fill } from "react-icons/ri";
import { MdOutlineEdit } from "react-icons/md"; import { MdOutlineEdit } from "react-icons/md";
import { findLabelByValue } from "../../utils/findLabelByValue";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
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";
import { formatNumber } from "../../utils/formatNumber";
import { BsEyeFill } from "react-icons/bs";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { useModalState } from "../../zustand/Modal"; import { useModalState } from "../../zustand/Modal";
export const useColumns = () => { export const useColumns = () => {
const { handel_open_model } = useModalHandler();
const { set_object_to_edit } = useObjectToEdit((state) => state); const { set_object_to_edit } = useObjectToEdit((state) => state);
const navigate = useNavigate() const navigate = useNavigate()
const { setIsOpen } = useModalState((state) => state); const { setIsOpen } = useModalState((state) => state);
@ -71,6 +64,7 @@ export const useColumns = () => {
key: "name", key: "name",
align: "center", align: "center",
render: (text, record) => record?.content, render: (text, record) => record?.content,
ellipsis:true
}, },
{ {
title: t("columns.isBase"), title: t("columns.isBase"),

View File

@ -100,7 +100,7 @@ export const CrudRoute: TCrudRoute[] = [
path: `/${ABILITIES_ENUM?.SUBJECT}/:${ParamsEnum?.SUBJECT_ID}/${ABILITIES_ENUM?.UNIT}/:${ParamsEnum?.UNIT_ID}/${ABILITIES_ENUM?.LESSON}/:${ParamsEnum?.LESSON_ID}/${ABILITIES_ENUM?.QUESTION}/add`, path: `/${ABILITIES_ENUM?.SUBJECT}/:${ParamsEnum?.SUBJECT_ID}/${ABILITIES_ENUM?.UNIT}/:${ParamsEnum?.UNIT_ID}/${ABILITIES_ENUM?.LESSON}/:${ParamsEnum?.LESSON_ID}/${ABILITIES_ENUM?.QUESTION}/add`,
abilities: ABILITIES_ENUM?.QUESTION, abilities: ABILITIES_ENUM?.QUESTION,
abilities_value: ABILITIES_VALUES_ENUM.INDEX, abilities_value: ABILITIES_VALUES_ENUM.INDEX,
prevPath: 0, prevPath: 2,
}, },
{ {
header: "page_header.edit_Question", header: "page_header.edit_Question",
@ -108,7 +108,7 @@ export const CrudRoute: TCrudRoute[] = [
path: `/${ABILITIES_ENUM?.SUBJECT}/:${ParamsEnum?.SUBJECT_ID}/${ABILITIES_ENUM?.UNIT}/:${ParamsEnum?.UNIT_ID}/${ABILITIES_ENUM?.LESSON}/:${ParamsEnum?.LESSON_ID}/${ABILITIES_ENUM?.QUESTION}/:${ParamsEnum?.QUESTION_ID}`, path: `/${ABILITIES_ENUM?.SUBJECT}/:${ParamsEnum?.SUBJECT_ID}/${ABILITIES_ENUM?.UNIT}/:${ParamsEnum?.UNIT_ID}/${ABILITIES_ENUM?.LESSON}/:${ParamsEnum?.LESSON_ID}/${ABILITIES_ENUM?.QUESTION}/:${ParamsEnum?.QUESTION_ID}`,
abilities: ABILITIES_ENUM?.QUESTION, abilities: ABILITIES_ENUM?.QUESTION,
abilities_value: ABILITIES_VALUES_ENUM.INDEX, abilities_value: ABILITIES_VALUES_ENUM.INDEX,
prevPath: 0, prevPath: 2,
}, },
]; ];