Merged in feature/IO-2973-Created-By-Tasks (pull request #1846)
IO-2973 Created By Tasks Approved-by: Dave Richer
This commit is contained in:
@@ -1,10 +1,3 @@
|
|||||||
import { Button, Card, Space, Switch, Table } from "antd";
|
|
||||||
import queryString from "query-string";
|
|
||||||
import React, { useCallback, useEffect } from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
import { Link, useLocation, useNavigate } from "react-router-dom";
|
|
||||||
import { pageLimit } from "../../utils/config";
|
|
||||||
import dayjs from "../../utils/day";
|
|
||||||
import {
|
import {
|
||||||
CheckCircleFilled,
|
CheckCircleFilled,
|
||||||
CheckCircleOutlined,
|
CheckCircleOutlined,
|
||||||
@@ -15,9 +8,16 @@ import {
|
|||||||
PlusCircleFilled,
|
PlusCircleFilled,
|
||||||
SyncOutlined
|
SyncOutlined
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { DateFormatter, DateTimeFormatter } from "../../utils/DateFormatter.jsx";
|
import { Button, Card, Space, Switch, Table } from "antd";
|
||||||
|
import queryString from "query-string";
|
||||||
|
import React, { useCallback, useEffect } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
|
import { Link, useLocation, useNavigate } from "react-router-dom";
|
||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
|
import { pageLimit } from "../../utils/config";
|
||||||
|
import { DateFormatter, DateTimeFormatter } from "../../utils/DateFormatter.jsx";
|
||||||
|
import dayjs from "../../utils/day";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Task List Component
|
* Task List Component
|
||||||
@@ -140,6 +140,17 @@ function TaskListComponent({
|
|||||||
render: (text, record) => <DateTimeFormatter>{record.created_at}</DateTimeFormatter>
|
render: (text, record) => <DateTimeFormatter>{record.created_at}</DateTimeFormatter>
|
||||||
});
|
});
|
||||||
|
|
||||||
|
columns.push({
|
||||||
|
title: t("tasks.fields.created_by"),
|
||||||
|
dataIndex: "created_by",
|
||||||
|
key: "created_by",
|
||||||
|
width: "10%",
|
||||||
|
defaultSortOrder: "descend",
|
||||||
|
sorter: true,
|
||||||
|
sortOrder: sortcolumn === "created_by" && sortorder,
|
||||||
|
render: (text, record) => record.created_by
|
||||||
|
});
|
||||||
|
|
||||||
if (!onlyMine) {
|
if (!onlyMine) {
|
||||||
columns.push({
|
columns.push({
|
||||||
title: t("tasks.fields.assigned_to"),
|
title: t("tasks.fields.assigned_to"),
|
||||||
|
|||||||
@@ -3187,6 +3187,7 @@
|
|||||||
"billid": "Bill",
|
"billid": "Bill",
|
||||||
"completed": "Completed",
|
"completed": "Completed",
|
||||||
"created_at": "Created At",
|
"created_at": "Created At",
|
||||||
|
"created_by": "Created By",
|
||||||
"description": "Description",
|
"description": "Description",
|
||||||
"due_date": "Due Date",
|
"due_date": "Due Date",
|
||||||
"job": {
|
"job": {
|
||||||
|
|||||||
@@ -3187,6 +3187,7 @@
|
|||||||
"billid": "",
|
"billid": "",
|
||||||
"completed": "",
|
"completed": "",
|
||||||
"created_at": "",
|
"created_at": "",
|
||||||
|
"created_by": "",
|
||||||
"description": "",
|
"description": "",
|
||||||
"due_date": "",
|
"due_date": "",
|
||||||
"job": {
|
"job": {
|
||||||
|
|||||||
@@ -3187,6 +3187,7 @@
|
|||||||
"billid": "",
|
"billid": "",
|
||||||
"completed": "",
|
"completed": "",
|
||||||
"created_at": "",
|
"created_at": "",
|
||||||
|
"created_by": "",
|
||||||
"description": "",
|
"description": "",
|
||||||
"due_date": "",
|
"due_date": "",
|
||||||
"job": {
|
"job": {
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ const formatPriority = (priority) => {
|
|||||||
* @param priority
|
* @param priority
|
||||||
* @param description
|
* @param description
|
||||||
* @param dueDate
|
* @param dueDate
|
||||||
|
* @param createdBy
|
||||||
* @param bodyshop
|
* @param bodyshop
|
||||||
* @param job
|
* @param job
|
||||||
* @param taskId
|
* @param taskId
|
||||||
@@ -96,11 +97,11 @@ const getEndpoints = (bodyshop) =>
|
|||||||
: "https://romeonline.io"
|
: "https://romeonline.io"
|
||||||
});
|
});
|
||||||
|
|
||||||
const generateTemplateArgs = (title, priority, description, dueDate, bodyshop, job, taskId, dateLine) => {
|
const generateTemplateArgs = (title, priority, description, dueDate, bodyshop, job, taskId, dateLine, createdBy) => {
|
||||||
const endPoints = getEndpoints(bodyshop);
|
const endPoints = getEndpoints(bodyshop);
|
||||||
return {
|
return {
|
||||||
header: title,
|
header: title,
|
||||||
subHeader: `Body Shop: ${bodyshop.shopname} | Priority: ${formatPriority(priority)} ${formatDate(dueDate)}`,
|
subHeader: `Body Shop: ${bodyshop.shopname} | Priority: ${formatPriority(priority)} ${formatDate(dueDate)} | Created By: ${createdBy || "N/A"}`,
|
||||||
body: `Reference: ${job.ro_number || "N/A"} | ${job.ownr_co_nm ? job.ownr_co_nm : `${job.ownr_fn || ""} ${job.ownr_ln || ""}`.trim()} | ${`${job.v_model_yr || ""} ${job.v_make_desc || ""} ${job.v_model_desc || ""}`.trim()}<br>${description ? description.concat("<br>") : ""}<a href="${endPoints}/manage/tasks/alltasks?taskid=${taskId}">View this task.</a>`,
|
body: `Reference: ${job.ro_number || "N/A"} | ${job.ownr_co_nm ? job.ownr_co_nm : `${job.ownr_fn || ""} ${job.ownr_ln || ""}`.trim()} | ${`${job.v_model_yr || ""} ${job.v_make_desc || ""} ${job.v_model_desc || ""}`.trim()}<br>${description ? description.concat("<br>") : ""}<a href="${endPoints}/manage/tasks/alltasks?taskid=${taskId}">View this task.</a>`,
|
||||||
dateLine
|
dateLine
|
||||||
};
|
};
|
||||||
@@ -181,7 +182,8 @@ const taskAssignedEmail = async (req, res) => {
|
|||||||
tasks_by_pk.bodyshop,
|
tasks_by_pk.bodyshop,
|
||||||
tasks_by_pk.job,
|
tasks_by_pk.job,
|
||||||
newTask.id,
|
newTask.id,
|
||||||
dateLine
|
dateLine,
|
||||||
|
newTask.created_by
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
null,
|
null,
|
||||||
@@ -268,7 +270,8 @@ const tasksRemindEmail = async (req, res) => {
|
|||||||
onlyTask.bodyshop,
|
onlyTask.bodyshop,
|
||||||
onlyTask.job,
|
onlyTask.job,
|
||||||
onlyTask.id,
|
onlyTask.id,
|
||||||
dateLine
|
dateLine,
|
||||||
|
onlyTask.created_by
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2506,6 +2506,7 @@ exports.QUERY_TASK_BY_ID = `
|
|||||||
query QUERY_TASK_BY_ID($id: uuid!) {
|
query QUERY_TASK_BY_ID($id: uuid!) {
|
||||||
tasks_by_pk(id: $id) {
|
tasks_by_pk(id: $id) {
|
||||||
id
|
id
|
||||||
|
created_by
|
||||||
assigned_to_employee{
|
assigned_to_employee{
|
||||||
id
|
id
|
||||||
user_email
|
user_email
|
||||||
|
|||||||
Reference in New Issue
Block a user