Update assigned_to handling on front end & debug task assignment.

This commit is contained in:
Patrick Fic
2024-04-19 09:22:20 -07:00
parent fb322f760f
commit 2a8846297f
24 changed files with 88 additions and 34 deletions

View File

@@ -3,24 +3,25 @@ import TaskListContainer from "../../components/task-list/task-list.container.js
import { QUERY_ALL_TASKS_PAGINATED, QUERY_MY_TASKS_PAGINATED } from "../../graphql/tasks.queries.js";
import taskPageTypes from "./taskPageTypes.jsx";
import { createStructuredSelector } from "reselect";
import { selectCurrentUser } from "../../redux/user/user.selectors.js";
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors.js";
import { connect } from "react-redux";
const mapStateToProps = createStructuredSelector({
currentUser: selectCurrentUser
currentUser: selectCurrentUser,
bodyshop: selectBodyshop
});
const mapDispatchToProps = (dispatch) => ({});
export default connect(mapStateToProps, mapDispatchToProps)(TasksPageComponent);
export function TasksPageComponent({ currentUser, type }) {
export function TasksPageComponent({ bodyshop, currentUser, type }) {
switch (type) {
case taskPageTypes.MY_TASKS:
return (
<TaskListContainer
onlyMine={true}
relationshipId={currentUser.email}
relationshipType={"user"}
relationshipId={bodyshop?.employees?.find((e) => e.user_email === currentUser.email)?.id}
relationshipType={"assigned_to"}
query={{ QUERY_MY_TASKS_PAGINATED }}
titleTranslation={"tasks.titles.my_tasks"}
disableJobRefetch={true}