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 {
|
||||
CheckCircleFilled,
|
||||
CheckCircleOutlined,
|
||||
@@ -15,9 +8,16 @@ import {
|
||||
PlusCircleFilled,
|
||||
SyncOutlined
|
||||
} 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 { Link, useLocation, useNavigate } from "react-router-dom";
|
||||
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
|
||||
@@ -140,6 +140,17 @@ function TaskListComponent({
|
||||
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) {
|
||||
columns.push({
|
||||
title: t("tasks.fields.assigned_to"),
|
||||
|
||||
@@ -3187,6 +3187,7 @@
|
||||
"billid": "Bill",
|
||||
"completed": "Completed",
|
||||
"created_at": "Created At",
|
||||
"created_by": "Created By",
|
||||
"description": "Description",
|
||||
"due_date": "Due Date",
|
||||
"job": {
|
||||
|
||||
@@ -3187,6 +3187,7 @@
|
||||
"billid": "",
|
||||
"completed": "",
|
||||
"created_at": "",
|
||||
"created_by": "",
|
||||
"description": "",
|
||||
"due_date": "",
|
||||
"job": {
|
||||
|
||||
@@ -3187,6 +3187,7 @@
|
||||
"billid": "",
|
||||
"completed": "",
|
||||
"created_at": "",
|
||||
"created_by": "",
|
||||
"description": "",
|
||||
"due_date": "",
|
||||
"job": {
|
||||
|
||||
@@ -77,6 +77,7 @@ const formatPriority = (priority) => {
|
||||
* @param priority
|
||||
* @param description
|
||||
* @param dueDate
|
||||
* @param createdBy
|
||||
* @param bodyshop
|
||||
* @param job
|
||||
* @param taskId
|
||||
@@ -96,11 +97,11 @@ const getEndpoints = (bodyshop) =>
|
||||
: "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);
|
||||
return {
|
||||
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>`,
|
||||
dateLine
|
||||
};
|
||||
@@ -181,7 +182,8 @@ const taskAssignedEmail = async (req, res) => {
|
||||
tasks_by_pk.bodyshop,
|
||||
tasks_by_pk.job,
|
||||
newTask.id,
|
||||
dateLine
|
||||
dateLine,
|
||||
newTask.created_by
|
||||
)
|
||||
),
|
||||
null,
|
||||
@@ -268,7 +270,8 @@ const tasksRemindEmail = async (req, res) => {
|
||||
onlyTask.bodyshop,
|
||||
onlyTask.job,
|
||||
onlyTask.id,
|
||||
dateLine
|
||||
dateLine,
|
||||
onlyTask.created_by
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2506,6 +2506,7 @@ exports.QUERY_TASK_BY_ID = `
|
||||
query QUERY_TASK_BY_ID($id: uuid!) {
|
||||
tasks_by_pk(id: $id) {
|
||||
id
|
||||
created_by
|
||||
assigned_to_employee{
|
||||
id
|
||||
user_email
|
||||
|
||||
Reference in New Issue
Block a user