Merge branch 'main' of https://github.com/apuc/outstaffing-react into fix-tracker-and-statistics
This commit is contained in:
@ -71,8 +71,8 @@ export const Tracker = () => {
|
||||
apiRequest(
|
||||
`/task/get-user-tasks?user_id=${localStorage.getItem("id")}`
|
||||
).then((el) => {
|
||||
const allTasks = el.filter((item) => item.status !== 0);
|
||||
const completedTasks = el.filter((item) => item.status === 0);
|
||||
const allTasks = el ? el.filter((item) => item.status !== 0) : [];
|
||||
const completedTasks = el ? el.filter((item) => item.status === 0) : [];
|
||||
setAllTasks(allTasks);
|
||||
setFilteredAllTasks(allTasks);
|
||||
setAllCompletedTasks(completedTasks);
|
||||
@ -179,7 +179,8 @@ export const Tracker = () => {
|
||||
|
||||
{loader && <Loader style="green" />}
|
||||
|
||||
{Boolean(projects.length) &&
|
||||
{projects &&
|
||||
Boolean(projects.length) &&
|
||||
!loader &&
|
||||
projects.map((project, index) => {
|
||||
return project.status !== 10 ? (
|
||||
@ -188,10 +189,11 @@ export const Tracker = () => {
|
||||
""
|
||||
);
|
||||
})}
|
||||
{(!Boolean(projects.length) ||
|
||||
!Boolean(
|
||||
projects.filter((project) => project.status !== 10).length
|
||||
)) &&
|
||||
{typeof projects === "object" &&
|
||||
(!Boolean(projects.length) ||
|
||||
!Boolean(
|
||||
projects.filter((project) => project.status !== 10).length
|
||||
)) &&
|
||||
!loader && (
|
||||
<div className="no-projects">
|
||||
<div className="no-projects__createNew">
|
||||
@ -216,7 +218,7 @@ export const Tracker = () => {
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{Boolean(projects.length) && !loader && (
|
||||
{projects && Boolean(projects.length) && !loader && (
|
||||
<>
|
||||
<BaseButton
|
||||
styles="createProjectBtn"
|
||||
|
@ -321,7 +321,7 @@
|
||||
.projectPersons {
|
||||
display: flex;
|
||||
position: relative;
|
||||
left: -10px;
|
||||
left: 5px;
|
||||
img {
|
||||
position: relative;
|
||||
display: flex;
|
||||
@ -358,7 +358,7 @@
|
||||
color: #252c32;
|
||||
border: 1px solid #dde2e4;
|
||||
background: white;
|
||||
left: -6px;
|
||||
left: -20px;
|
||||
}
|
||||
|
||||
.addPerson {
|
||||
|
Reference in New Issue
Block a user