Added row background color and also changed message on report submit
This commit is contained in:
parent
25127659c8
commit
a60cd6b1a9
@ -175,3 +175,7 @@
|
|||||||
.text-darkgreen {
|
.text-darkgreen {
|
||||||
color: #16a085;
|
color: #16a085;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.table-row-header {
|
||||||
|
background-color: #efefef;
|
||||||
|
}
|
||||||
|
@ -43,7 +43,7 @@ export const ReportTask = ({ report, closeModal, refetch }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let response = await TasksRepository.reportTask(reportData);
|
let response = await TasksRepository.reportTask(reportData);
|
||||||
showToast("succesfully", "success");
|
showToast("Task reported successfully.", "success");
|
||||||
refetch();
|
refetch();
|
||||||
closeModal();
|
closeModal();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -32,13 +32,12 @@ const DailyTask = () => {
|
|||||||
// Sync projectId (either from URL or pick first accessible one)
|
// Sync projectId (either from URL or pick first accessible one)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!project_lodaing && projects.length > 0 && !initialized) {
|
if (!project_lodaing && projects.length > 0 && !initialized) {
|
||||||
if (selectedProject === 1 || selectedProject === undefined) {
|
if (selectedProject === 1 || selectedProject === undefined) {
|
||||||
dispatch(setProjectId(projects[0].id));
|
dispatch(setProjectId(projects[0].id));
|
||||||
}
|
}
|
||||||
|
|
||||||
setInitialized(true);
|
setInitialized(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}, [project_lodaing, projects, projectId, selectedProject, initialized]);
|
}, [project_lodaing, projects, projectId, selectedProject, initialized]);
|
||||||
|
|
||||||
const dispatch = useDispatch(selectedProject);
|
const dispatch = useDispatch(selectedProject);
|
||||||
@ -68,8 +67,6 @@ const DailyTask = () => {
|
|||||||
...new Set(TaskLists.map((task) => task.assignmentDate.split("T")[0])),
|
...new Set(TaskLists.map((task) => task.assignmentDate.split("T")[0])),
|
||||||
].sort((a, b) => new Date(b) - new Date(a));
|
].sort((a, b) => new Date(b) - new Date(a));
|
||||||
setDates(AssignmentDates);
|
setDates(AssignmentDates);
|
||||||
|
|
||||||
|
|
||||||
}, [TaskLists]);
|
}, [TaskLists]);
|
||||||
|
|
||||||
const [selectedTask, selectTask] = useState(null);
|
const [selectedTask, selectTask] = useState(null);
|
||||||
@ -90,7 +87,7 @@ const DailyTask = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
popoverRefs.current.forEach((el) => {
|
popoverRefs.current.forEach((el) => {
|
||||||
console.log(el)
|
console.log(el);
|
||||||
if (el) {
|
if (el) {
|
||||||
new bootstrap.Popover(el, {
|
new bootstrap.Popover(el, {
|
||||||
trigger: "focus",
|
trigger: "focus",
|
||||||
@ -144,7 +141,7 @@ const DailyTask = () => {
|
|||||||
<div className="col-6 text-start">
|
<div className="col-6 text-start">
|
||||||
<DateRangePicker
|
<DateRangePicker
|
||||||
onRangeChange={setDateRange}
|
onRangeChange={setDateRange}
|
||||||
DateDifference="1"
|
DateDifference="6"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-sm-3 col-6 text-end mb-1">
|
<div className="col-sm-3 col-6 text-end mb-1">
|
||||||
@ -184,8 +181,7 @@ const DailyTask = () => {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody className="table-border-bottom-0">
|
<tbody className="table-border-bottom-0">
|
||||||
|
{task_loading && (
|
||||||
{task_loading && (
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colSpan={7} className="text-center">
|
<td colSpan={7} className="text-center">
|
||||||
<p>Loading..</p>
|
<p>Loading..</p>
|
||||||
@ -195,7 +191,7 @@ const DailyTask = () => {
|
|||||||
{dates.map((date, i) => {
|
{dates.map((date, i) => {
|
||||||
return (
|
return (
|
||||||
<React.Fragment key={i}>
|
<React.Fragment key={i}>
|
||||||
<tr>
|
<tr className="table-row-header">
|
||||||
<td colSpan={7} className="text-start">
|
<td colSpan={7} className="text-start">
|
||||||
<strong>{date}</strong>
|
<strong>{date}</strong>
|
||||||
</td>
|
</td>
|
||||||
@ -204,7 +200,7 @@ const DailyTask = () => {
|
|||||||
task.assignmentDate.includes(date)
|
task.assignmentDate.includes(date)
|
||||||
).map((task, index) => {
|
).map((task, index) => {
|
||||||
const refIndex = index * 10 + i;
|
const refIndex = index * 10 + i;
|
||||||
console.log(refIndex)
|
console.log(refIndex);
|
||||||
return (
|
return (
|
||||||
<React.Fragment key={index}>
|
<React.Fragment key={index}>
|
||||||
<tr>
|
<tr>
|
||||||
@ -266,14 +262,22 @@ const DailyTask = () => {
|
|||||||
<div class="d-flex align-items-center gap-2 mb-2">
|
<div class="d-flex align-items-center gap-2 mb-2">
|
||||||
<div class="avatar avatar-xs">
|
<div class="avatar avatar-xs">
|
||||||
<span class="avatar-initial rounded-circle bg-label-primary">
|
<span class="avatar-initial rounded-circle bg-label-primary">
|
||||||
${member?.firstName?.charAt(0) || ""}${member?.lastName?.charAt(0) || ""}
|
${
|
||||||
|
member?.firstName?.charAt(
|
||||||
|
0
|
||||||
|
) || ""
|
||||||
|
}${
|
||||||
|
member?.lastName?.charAt(0) || ""
|
||||||
|
}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<span>${member.firstName} ${member.lastName}</span>
|
<span>${member.firstName} ${
|
||||||
|
member.lastName
|
||||||
|
}</span>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
.join('')}
|
.join("")}
|
||||||
</div>
|
</div>
|
||||||
`}
|
`}
|
||||||
>
|
>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user