fixed-pages #2

Merged
MaxOvs19 merged 8 commits from fixed-pages into main 2023-12-11 15:06:36 +03:00
4 changed files with 10 additions and 10 deletions
Showing only changes of commit f98e788201 - Show all commits

View File

@ -30,7 +30,7 @@ const AllTaskTableItem = ({ task, projects }) => {
<div className="taskList__table__name-project hide-desc">
<h4>Проект:</h4>
<p>
{projects.map((project) => {
{projects?.map((project) => {
if (project.id == task.project_id) {
return project.name;
}

View File

@ -17,8 +17,8 @@ const AllTaskTableTracker = ({ filteredAllTasks, projects, loader }) => {
useEffect(() => {
setItems(filteredAllTasks);
const endOffset = itemOffset + itemsPerPage;
setCurrentItems(filteredAllTasks.slice(itemOffset, endOffset));
setPageCount(Math.ceil(filteredAllTasks.length / itemsPerPage));
setCurrentItems(filteredAllTasks?.slice(itemOffset, endOffset));
setPageCount(Math.ceil(filteredAllTasks?.length / itemsPerPage));
}, [filteredAllTasks]);
useEffect(() => {

View File

@ -18,7 +18,7 @@ const ArchiveTableTracker = ({ filterCompleteTasks, loader }) => {
{!loader && (
<>
{Boolean(filterCompleteTasks.length) ? (
filterCompleteTasks.map((task, index) => {
filterCompleteTasks?.map((task, index) => {
return (
<ArchiveTasksItem task={task} index={index} key={index} />
);

View File

@ -187,7 +187,7 @@ export const Tracker = () => {
{projects &&
Boolean(projects.length) &&
!loader &&
projects.map((project, index) => {
projects?.map((project, index) => {
return project.status !== 10 ? (
<ProjectTiket key={index} project={project} />
) : (
@ -197,7 +197,7 @@ export const Tracker = () => {
{typeof projects === "object" &&
(!Boolean(projects.length) ||
!Boolean(
projects.filter((project) => project.status !== 10).length
projects?.filter((project) => project.status !== 10).length
)) &&
!loader && (
<div className="no-projects">
@ -380,10 +380,10 @@ export const Tracker = () => {
<h3>Архив проектов:</h3>
<p>
{`${
projects.filter((project) => project.status === 10).length
projects?.filter((project) => project.status === 10).length
}
${caseOfNum(
projects.filter((project) => project.status === 10)
projects?.filter((project) => project.status === 10)
.length,
"projects"
)}`}
@ -391,9 +391,9 @@ export const Tracker = () => {
</div>
<div className="archive__tasksWrapper">
{Boolean(
projects.filter((project) => project.status === 10).length
projects?.filter((project) => project.status === 10).length
) ? (
projects.map((project, index) => {
projects?.map((project, index) => {
return project.status === 10 ? (
<div
className="archive__completeTask-project"