+ setFilteredTasks(tasks);
+ }, [props.tasks_filter, props.priority, props.status, props.classification, props.isActive, props.isAssigned, props.users]);
+
+
+ const tasksList = filteredTasks.map((task, index) => (
+
+ {index + 1} |
+ {truncate(task.taskName, 20)} |
+ {task.priority} |
+ {task.status} |
+
{task.resources.length <= 2 ? (
- task.resources.map(resource => {resource.name} )
+ task.resources.map((resource) => {resource.name} )
) : (
)}
-
-
-
+ |
+
{task.isActive ? (
@@ -94,35 +83,54 @@ export const TasksDetail = props => {
)}
-
-
-
+ |
+
{task.isAssigned ? Assign : Not Assign }
-
- {task.classification}
- {task.estimatedHours.toFixed(2)}
- {task.startedDatetime}
- {task.dueDatetime}
-
+ |
+ {task.classification} |
+ {task.estimatedHours.toFixed(2)} |
+ {formatDate(task.startedDatetime)} |
+ {formatDate(task.dueDatetime)} |
+
+ {props.toggleEditTasks && (
+
+ )}
+ |
+
));
return (
-
Total: {tasksList.length}
-
-
#
-
Task
-
Priority
-
Status
-
Resources
-
Active
-
Assign
-
Class
-
Estimated Hours
-
Start Date
-
End Date
-
-
{tasksList}
+
Total: {tasksList.length}
+
+
+
+ # |
+ Task |
+ Priority |
+ Status |
+ Resources |
+ Active |
+ Assign |
+ Class |
+ Estimated Hours |
+ Start Date |
+ End Date |
+ Actions |
+
+
+ {tasksList}
+
);
};
diff --git a/src/components/Reports/TasksTable/TasksTable.css b/src/components/Reports/TasksTable/TasksTable.css
index 8e432e8ace..c02a87ee2f 100644
--- a/src/components/Reports/TasksTable/TasksTable.css
+++ b/src/components/Reports/TasksTable/TasksTable.css
@@ -82,7 +82,21 @@
outline-color: #e7b1ef;
color: #ca50db;
border-radius: 4px;
- margin-left: 40px;
+ margin-left: 20px;
+ width: 100px;
+ min-width: 100px;
+ height: 30px;
+ cursor: pointer;
+}
+
+.tasks-table-edit-tasks-button{
+ display: block;
+ background-color: white;
+ border: 2px solid #007bff;
+ outline-color: #007bff;
+ color: #5750db;
+ border-radius: 4px;
+ margin-left: 0px;
width: 100px;
min-width: 100px;
height: 30px;
@@ -95,3 +109,10 @@
border-color: #ca50db;
outline-color: #ca50db;
}
+
+.tasks-table-edit-tasks-button:hover,
+.tasks-table-edit-tasks-button:focus,
+.tasks-table-edit-tasks-button:active {
+ border-color: #5750db;
+ outline-color: #5750db;
+}
\ No newline at end of file
diff --git a/src/components/Reports/TasksTable/TasksTable.jsx b/src/components/Reports/TasksTable/TasksTable.jsx
index b3b9273325..26cb7d17bf 100644
--- a/src/components/Reports/TasksTable/TasksTable.jsx
+++ b/src/components/Reports/TasksTable/TasksTable.jsx
@@ -15,11 +15,10 @@ import TextSearchBox from 'components/UserManagement/TextSearchBox';
import { boxStyle, boxStyleDark } from 'styles';
import { TasksDetail } from '../TasksDetail';
-export function TasksTable({ WbsTasksID, darkMode }) {
- const { get_tasks } = useSelector(state => getTasksTableData(state, { WbsTasksID }));
-
+export function TasksTable({ darkMode, tasks }) {
const [isActive, setActive] = useState(true);
const [isAssigned, setAssigned] = useState(true);
+ const [toggleEditTasks, setToggleEditTasks] = useState(false);
const [filters, setFilters] = useState({
status: '',
priority: '',
@@ -51,13 +50,13 @@ export function TasksTable({ WbsTasksID, darkMode }) {
};
const getOptions = (filterName) => {
- const options = [...Array.from(new Set(get_tasks.map(item => item[filterName]))).sort()];
+ const options = [...Array.from(new Set(tasks.map(item => item[filterName]))).sort()];
return options.map(option => ({ value: option, label: option }));
};
const getUserOptions = () => {
let users = [];
- get_tasks.forEach(task => task.resources?.forEach(resource => users.push(resource.name)));
+ tasks.forEach(task => task.resources?.forEach(resource => users.push(resource.name)));
users = Array.from(new Set(users)).sort();
return users.map(user => ({ value: user, label: user }));
};
@@ -72,7 +71,7 @@ export function TasksTable({ WbsTasksID, darkMode }) {
Tasks
);
diff --git a/src/components/Reports/TasksTable/selectors.js b/src/components/Reports/TasksTable/selectors.js
index 54fea0099e..446214777d 100644
--- a/src/components/Reports/TasksTable/selectors.js
+++ b/src/components/Reports/TasksTable/selectors.js
@@ -4,14 +4,14 @@ export const get_task_by_wbsId = (WbsTasksID, tasks) => {
let i = 0;
while (i < WbsTasksID.length && tasks.fetched) {
const result = tasks.taskItems.filter(task => task.wbsId === WbsTasksID[i]);
- get_tasks.push(result);
+ get_tasks.push(...result);
i += 1;
}
}
- return get_tasks[1];
+ return get_tasks;
};
-export const getTasksTableData = (state, { WbsTasksID }) => ({
- get_tasks: get_task_by_wbsId(WbsTasksID, state.tasks) || [],
+export const getTasksTableData = (tasks, { WbsTasksID }) => ({
+ get_tasks: get_task_by_wbsId(WbsTasksID, tasks) || [],
});