Compare commits

...

47 Commits

Author SHA1 Message Date
Allan Carr
5d2bdc7ee1 IO-2338 Selection Color
Overrides nth-child color
2023-06-15 15:24:24 -07:00
Patrick Fic
91279c27fe Merged in release/2023-06-09 (pull request #858)
Release/2023 06 09
2023-06-09 22:35:38 +00:00
Patrick Fic
3812a0650e Global search improvements. 2023-06-09 15:11:14 -07:00
Patrick Fic
b1c5bbb01f Change FK relaitonship. 2023-06-09 11:28:22 -07:00
Patrick Fic
f440a2b022 Improve update alert on mobile devices. 2023-06-08 16:18:12 -07:00
Patrick Fic
6262b3ff83 Revert changes for IO-2311 IO-2317. 2023-06-08 16:00:47 -07:00
Patrick Fic
307c77b30c Remove failing CI components. 2023-06-08 15:43:21 -07:00
Patrick Fic
f1d7a98fe8 Merge branch 'feature/IO-2208-chat-affix' into release/2023-06-09 2023-06-08 11:20:10 -07:00
Patrick Fic
be259317f9 Update payables posting label. 2023-06-08 11:13:35 -07:00
swtmply
046d104bfa IO-2208 removed subscriptions to the message 2023-06-09 01:04:59 +08:00
Patrick Fic
9c693a2b74 Merged in feature/IO-2329-update-alert (pull request #851)
IO-2329 Remove testing statement.
2023-06-07 19:06:22 +00:00
Patrick Fic
2be0f3de09 IO-2329 Remove testing statement. 2023-06-07 12:05:55 -07:00
Patrick Fic
de8c2cd5a2 Merged in feature/IO-2329-update-alert (pull request #849)
IO-2329 Change update alert to be permanent.
2023-06-07 19:03:48 +00:00
Patrick Fic
b791f9846f IO-2329 Change update alert to be permanent. 2023-06-07 12:03:17 -07:00
Patrick Fic
daa7631056 Integration IO-2278 schema changes made on wrong branch. 2023-06-07 11:23:00 -07:00
John Allen Delos Reyes
14b8a2daef Merged in feature/IO-2322-insurance-dropdown (pull request #844)
IO-2322 added search function to insurance dropdown

Approved-by: Patrick Fic
2023-06-07 18:14:31 +00:00
John Allen Delos Reyes
90b38d817d Merged in feature/IO-2311-messaging-tile-height (pull request #845)
IO-2311 fixed tile height

Approved-by: Patrick Fic
2023-06-07 18:14:25 +00:00
John Allen Delos Reyes
ace48e2890 Merged in feature/IO-2280-config-query-params (pull request #843)
IO-2280 fixed query params in shop config

Approved-by: Patrick Fic
2023-06-07 18:14:18 +00:00
John Allen Delos Reyes
fb810be5d5 Merged in feature/IO-2317-messaging-screen (pull request #846)
IO-2317 Messaging screen on mobile

Approved-by: Patrick Fic
2023-06-07 18:13:45 +00:00
Patrick Fic
50230e9f50 IO-2278 adjust schema for parts dispatch. 2023-06-06 13:41:38 -07:00
Patrick Fic
86e14967ca IO-2278 Additional permission for dispatch lines. 2023-06-06 13:38:51 -07:00
Patrick Fic
c45c3b4037 IO-2278 Add permissions for parts dispatch. 2023-06-06 13:33:03 -07:00
Patrick Fic
c4c11528b9 IO-2278 Add relationship tracking to parts dispatch. 2023-06-06 13:22:51 -07:00
Patrick Fic
1f9c4e92f1 IO-2278 Add parts dispatch relationship. 2023-06-06 13:21:40 -07:00
Patrick Fic
371e148e09 IO-2278 Track parts dispatch relationships. 2023-06-06 13:18:44 -07:00
swtmply
33af544ded IO-2322 added search function to insurance dropdown 2023-06-06 22:47:20 +08:00
swtmply
6b8d0ec91c IO-2311 fixed tile height 2023-06-06 22:39:39 +08:00
swtmply
5a3ddfad0f IO-2280 fixed query params in shop config 2023-06-06 22:20:22 +08:00
Allan Carr
043c44ed51 Merged in feature/IO-2281-table-colors (pull request #842)
IO-2281 Hover Row Color

Approved-by: Patrick Fic
2023-06-06 00:17:39 +00:00
Allan Carr
6d5dbf3145 IO-2281 Hover Row Color 2023-06-05 17:13:31 -07:00
swtmply
6d8463265c IO-2317 Messaging screen on mobile 2023-06-06 02:07:30 +08:00
Patrick Fic
0669282432 Merged in release/2023-06-02 (pull request #840)
Release/2023 06 02
2023-06-02 20:08:34 +00:00
John Allen Delos Reyes
bf4dc7e158 Merged in feature/IO-2314-problem-job-hyperlink (pull request #835)
IO-2314 Added hyperlink to ro number

Approved-by: Patrick Fic
2023-06-02 15:55:13 +00:00
Allan Carr
5de2036fdb Merged in feature/IO-2316-Predefined-Email-Address-for-CC (pull request #833)
IO-2316 Predefined Email address for CC field

Approved-by: Patrick Fic
2023-06-02 14:37:28 +00:00
Allan Carr
1629663e15 Merged in feature/IO-2315-DMS-Posting-Sheet-Restriction (pull request #832)
IO-2315 DMS Posting Sheet

Approved-by: Patrick Fic
2023-06-02 14:36:32 +00:00
Allan Carr
cbf5d268ea IO-2315 DMS Posting Sheet
Restrict to DMS setups only
2023-06-01 20:32:30 -07:00
Patrick Fic
a92a95a9fa Merge branch 'release/2023-06-02' of bitbucket.org:snaptsoft/bodyshop into release/2023-06-02 2023-06-01 18:31:12 -07:00
Patrick Fic
0be7bf2c8e Merge branch 'feature/IO-2310-active-jobs-ro-sort' into release/2023-06-02 2023-06-01 18:29:53 -07:00
Patrick Fic
56b810dd40 IO-2310 Change RO sort. 2023-06-01 18:29:41 -07:00
Allan Carr
33cfa531b8 IO-2316 Predefined Email address for CC field 2023-06-01 17:34:55 -07:00
John Allen Delos Reyes
000ded6649 Merged in feature/IO-2281-table-colors (pull request #829)
IO-2281 Added striped table colors

Approved-by: Patrick Fic
2023-06-01 22:28:30 +00:00
Patrick Fic
72181e1ff7 Add in missing filter for job search select on job clock on. 2023-05-31 14:33:59 -07:00
swtmply
d73b1d2220 IO-2281 Added striped table colors 2023-06-01 02:34:18 +08:00
Allan Carr
8645b434c8 Merged in feature/IO-2299-RBAC-for-Voiding-File (pull request #827)
IO-2299 RBAC for Voiding File

Approved-by: Patrick Fic
2023-05-31 15:30:15 +00:00
Allan Carr
38a13bd082 IO-2299 RBAC for Voiding File 2023-05-30 20:14:33 -07:00
Allan Carr
3bc5f5d626 Merged in feature/IO-2233-CDK-VEHICLE-LICENSE-PLATE (pull request #826)
IO-2233 Check for null and if stripped string is size 0 send null instead

Approved-by: Patrick Fic
2023-05-31 00:33:20 +00:00
Allan Carr
86a2351316 IO-2233 Check for null and if stripped string is size 0 send null instead 2023-05-30 17:23:22 -07:00
43 changed files with 657 additions and 233 deletions

View File

@@ -145,7 +145,11 @@
//Update row highlighting on production board.
.ant-table-tbody > tr.ant-table-row:hover > td {
background: #eaeaea !important;
background: #e7f3ff !important;
}
.ant-table-tbody > tr.ant-table-row-selected > td {
background: #e6f7ff !important;
}
.job-line-manual {
@@ -156,3 +160,11 @@
td.ant-table-column-sort {
background-color: transparent;
}
.ant-table-tbody > tr.ant-table-row:nth-child(2n) > td {
background-color: #f4f4f4;
}
.rowWithColor > td {
background-color: var(--bgColor) !important;
}

View File

@@ -1,13 +1,18 @@
import { Badge, List, Tag } from "antd";
import React, { useEffect } from "react";
import React from "react";
import { connect } from "react-redux";
import {
AutoSizer,
CellMeasurer,
CellMeasurerCache,
List as VirtualizedList,
} from "react-virtualized";
import { createStructuredSelector } from "reselect";
import { setSelectedConversation } from "../../redux/messaging/messaging.actions";
import { selectSelectedConversation } from "../../redux/messaging/messaging.selectors";
import { TimeAgoFormatter } from "../../utils/DateFormatter";
import PhoneFormatter from "../../utils/PhoneFormatter";
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
import { List as VirtualizedList, AutoSizer } from "react-virtualized";
import "./chat-conversation-list.styles.scss";
@@ -24,57 +29,66 @@ function ChatConversationListComponent({
conversationList,
selectedConversation,
setSelectedConversation,
subscribeToMoreConversations,
loadMoreConversations,
}) {
useEffect(
() => subscribeToMoreConversations(),
// eslint-disable-next-line react-hooks/exhaustive-deps
[]
);
const cache = new CellMeasurerCache({
fixedWidth: true,
defaultHeight: 60,
});
const rowRenderer = ({ index, key, style }) => {
const rowRenderer = ({ index, key, style, parent }) => {
const item = conversationList[index];
return (
<List.Item
<CellMeasurer
key={key}
onClick={() => setSelectedConversation(item.id)}
className={`chat-list-item ${
item.id === selectedConversation
? "chat-list-selected-conversation"
: null
}`}
style={style}
cache={cache}
parent={parent}
columnIndex={0}
rowIndex={index}
>
<div sryle={{ display: "inline-block" }}>
{item.label && <div className="chat-name">{item.label}</div>}
{item.job_conversations.length > 0 ? (
<div className="chat-name">
{item.job_conversations.map((j, idx) => (
<div key={idx}>
<OwnerNameDisplay ownerObject={j.job} />
</div>
))}
</div>
) : (
<PhoneFormatter>{item.phone_num}</PhoneFormatter>
)}
</div>
<div sryle={{ display: "inline-block" }}>
<div>
{item.job_conversations.length > 0
? item.job_conversations.map((j, idx) => (
<Tag key={idx} className="ro-number-tag">
{j.job.ro_number}
</Tag>
))
: null}
<List.Item
onClick={() => setSelectedConversation(item.id)}
className={`chat-list-item ${
item.id === selectedConversation
? "chat-list-selected-conversation"
: null
}`}
style={style}
>
<div
style={{
display: "inline-block",
}}
>
{item.label && <div className="chat-name">{item.label}</div>}
{item.job_conversations.length > 0 ? (
<div className="chat-name">
{item.job_conversations.map((j, idx) => (
<div key={idx}>
<OwnerNameDisplay ownerObject={j.job} />
</div>
))}
</div>
) : (
<PhoneFormatter>{item.phone_num}</PhoneFormatter>
)}
</div>
<TimeAgoFormatter>{item.updated_at}</TimeAgoFormatter>
</div>
<Badge count={item.messages_aggregate.aggregate.count || 0} />
</List.Item>
<div style={{ display: "inline-block" }}>
<div>
{item.job_conversations.length > 0
? item.job_conversations.map((j, idx) => (
<Tag key={idx} className="ro-number-tag">
{j.job.ro_number}
</Tag>
))
: null}
</div>
<TimeAgoFormatter>{item.updated_at}</TimeAgoFormatter>
</div>
<Badge count={item.messages_aggregate.aggregate.count || 0} />
</List.Item>
</CellMeasurer>
);
};
@@ -86,7 +100,7 @@ function ChatConversationListComponent({
height={height}
width={width}
rowCount={conversationList.length}
rowHeight={60}
rowHeight={cache.rowHeight}
rowRenderer={rowRenderer}
onScroll={({ scrollTop, scrollHeight, clientHeight }) => {
if (scrollTop + clientHeight === scrollHeight) {

View File

@@ -4,7 +4,7 @@ import {
ShrinkOutlined,
SyncOutlined,
} from "@ant-design/icons";
import { useLazyQuery, useSubscription } from "@apollo/client";
import { useLazyQuery, useQuery } from "@apollo/client";
import { Badge, Card, Col, Row, Space, Tag, Tooltip, Typography } from "antd";
import React, { useCallback, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
@@ -12,8 +12,7 @@ import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import {
CONVERSATION_LIST_QUERY,
CONVERSATION_LIST_SUBSCRIPTION,
UNREAD_CONVERSATION_COUNT_SUBSCRIPTION,
UNREAD_CONVERSATION_COUNT,
} from "../../graphql/conversations.queries";
import { toggleChatVisible } from "../../redux/messaging/messaging.actions";
import {
@@ -42,19 +41,20 @@ export function ChatPopupComponent({
const { t } = useTranslation();
const [pollInterval, setpollInterval] = useState(0);
const { data: unreadData } = useSubscription(
UNREAD_CONVERSATION_COUNT_SUBSCRIPTION
);
const [
getConversations,
{ loading, data, called, refetch, fetchMore, subscribeToMore },
] = useLazyQuery(CONVERSATION_LIST_QUERY, {
const { data: unreadData } = useQuery(UNREAD_CONVERSATION_COUNT, {
fetchPolicy: "network-only",
nextFetchPolicy: "network-only",
skip: !chatVisible,
...(pollInterval > 0 ? { pollInterval } : {}),
});
const [getConversations, { loading, data, refetch, fetchMore }] =
useLazyQuery(CONVERSATION_LIST_QUERY, {
fetchPolicy: "network-only",
nextFetchPolicy: "network-only",
skip: !chatVisible,
...(pollInterval > 0 ? { pollInterval } : {}),
});
const fcmToken = sessionStorage.getItem("fcmtoken");
useEffect(() => {
@@ -66,13 +66,13 @@ export function ChatPopupComponent({
}, [fcmToken]);
useEffect(() => {
if (called && chatVisible)
if (chatVisible)
getConversations({
variables: {
offset: 0,
},
});
}, [chatVisible, called, getConversations]);
}, [chatVisible, getConversations]);
const loadMoreConversations = useCallback(() => {
if (data)
@@ -119,43 +119,6 @@ export function ChatPopupComponent({
<ChatConversationListComponent
conversationList={data ? data.conversations : []}
loadMoreConversations={loadMoreConversations}
subscribeToMoreConversations={() =>
subscribeToMore({
document: CONVERSATION_LIST_SUBSCRIPTION,
variables: { offset: 0 },
updateQuery: (prev, { subscriptionData }) => {
if (
!subscriptionData.data ||
subscriptionData.data.conversations.length === 0
)
return prev;
let conversations = [...prev.conversations];
const newConversations =
subscriptionData.data.conversations;
for (const conversation of newConversations) {
const index = conversations.findIndex(
(prevConversation) =>
prevConversation.id === conversation.id
);
if (index !== -1) {
conversations.splice(index, 1);
conversations.unshift(conversation);
continue;
}
conversations.unshift(conversation);
}
return Object.assign({}, prev, {
conversations: conversations,
});
},
})
}
/>
)}
</Col>

View File

@@ -66,7 +66,7 @@ export function DmsAllocationsSummaryAp({ socket, bodyshop, billids, title }) {
key: "status",
},
{
title: t("jobs.fields.ro_number"),
title: t("bills.fields.invoice_number"),
dataIndex: ["Posting", "Reference"],
key: "reference",
},

View File

@@ -1,28 +1,28 @@
import { UploadOutlined, UserAddOutlined } from "@ant-design/icons";
import {
Button,
Divider,
Dropdown,
Form,
Input,
Menu,
Select,
Space,
Tabs,
Upload,
Space,
Menu,
Dropdown,
Button,
} from "antd";
import _ from "lodash";
import React from "react";
import { useTranslation } from "react-i18next";
import EmailDocumentsComponent from "../email-documents/email-documents.component";
import _ from "lodash";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectEmailConfig } from "../../redux/email/email.selectors";
import {
selectBodyshop,
selectCurrentUser,
} from "../../redux/user/user.selectors";
import { CreateExplorerLinkForJob } from "../../utils/localmedia";
import { selectEmailConfig } from "../../redux/email/email.selectors";
import EmailDocumentsComponent from "../email-documents/email-documents.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -54,6 +54,15 @@ export function EmailOverlayComponent({
]),
});
};
const handle_CC_Click = ({ item, key, keyPath }) => {
const email = item.props.value;
form.setFieldsValue({
cc: _.uniq([
...(form.getFieldValue("cc") || ""),
...(typeof email === "string" ? [email] : email),
]),
});
};
const menu = (
<div>
@@ -74,6 +83,25 @@ export function EmailOverlayComponent({
</div>
);
const menuCC = (
<div>
<Menu onClick={handle_CC_Click}>
{bodyshop.employees
.filter((e) => e.user_email)
.map((e, idx) => (
<Menu.Item value={e.user_email} key={idx}>
{`${e.first_name} ${e.last_name}`}
</Menu.Item>
))}
{bodyshop.md_to_emails.map((e, idx) => (
<Menu.Item value={e.emails} key={idx + "group"}>
{e.label}
</Menu.Item>
))}
</Menu>
</div>
);
return (
<div>
<Form.Item
@@ -122,7 +150,23 @@ export function EmailOverlayComponent({
>
<Select mode="tags" tokenSeparators={[",", ";"]} />
</Form.Item>
<Form.Item label={t("emails.fields.cc")} name="cc">
<Form.Item
label={
<Space>
{t("emails.fields.cc")}
<Dropdown overlay={menuCC}>
<a
className="ant-dropdown-link"
href=" #"
onClick={(e) => e.preventDefault()}
>
<UserAddOutlined />
</a>
</Dropdown>
</Space>
}
name="cc"
>
<Select mode="tags" tokenSeparators={[",", ";"]} />
</Form.Item>
<Form.Item

View File

@@ -311,7 +311,9 @@ function Header({
icon={<SettingOutlined />}
>
<Menu.Item key="shop" icon={<Icon component={GiSettingsKnobs} />}>
<Link to="/manage/shop">{t("menus.header.shop_config")}</Link>
<Link to="/manage/shop?tab=info">
{t("menus.header.shop_config")}
</Link>
</Menu.Item>
<Menu.Item key="dashboard" icon={<DashboardFilled />}>
<Link to="/manage/dashboard">{t("menus.header.dashboard")}</Link>

View File

@@ -29,6 +29,7 @@ import AddToProduction from "./jobs-detail-header-actions.addtoproduction.util";
import JobsDetaiLheaderCsi from "./jobs-detail-header-actions.csi.component";
import DuplicateJob from "./jobs-detail-header-actions.duplicate.util";
import JobsDetailHeaderActionsExportcustdataComponent from "./jobs-detail-header-actions.exportcustdata.component";
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -461,54 +462,56 @@ export function JobsDetailHeaderActions({
)}
<JobsDetailHeaderActionsAddevent jobid={job.id} />
{!jobRO && job.converted && (
<Menu.Item>
<Popconfirm
title={t("jobs.labels.voidjob")}
okText="Yes"
cancelText="No"
onClick={(e) => e.stopPropagation()}
onConfirm={async () => {
//delete the job.
const result = await voidJob({
variables: {
jobId: job.id,
job: {
status: bodyshop.md_ro_statuses.default_void,
voided: true,
scheduled_in: null,
scheduled_completion: null,
inproduction: false,
},
note: [
{
jobid: job.id,
created_by: currentUser.email,
audit: true,
text: t("jobs.labels.voidnote"),
<RbacWrapper action="jobs:void" noauth>
<Menu.Item>
<Popconfirm
title={t("jobs.labels.voidjob")}
okText="Yes"
cancelText="No"
onClick={(e) => e.stopPropagation()}
onConfirm={async () => {
//delete the job.
const result = await voidJob({
variables: {
jobId: job.id,
job: {
status: bodyshop.md_ro_statuses.default_void,
voided: true,
scheduled_in: null,
scheduled_completion: null,
inproduction: false,
},
],
},
});
note: [
{
jobid: job.id,
created_by: currentUser.email,
audit: true,
text: t("jobs.labels.voidnote"),
},
],
},
});
if (!!!result.errors) {
notification["success"]({
message: t("jobs.successes.voided"),
});
//go back to jobs list.
history.push(`/manage/`);
} else {
notification["error"]({
message: t("jobs.errors.voiding", {
error: JSON.stringify(result.errors),
}),
});
}
}}
getPopupContainer={(trigger) => trigger.parentNode}
>
{t("menus.jobsactions.void")}
</Popconfirm>
</Menu.Item>
if (!!!result.errors) {
notification["success"]({
message: t("jobs.successes.voided"),
});
//go back to jobs list.
history.push(`/manage/`);
} else {
notification["error"]({
message: t("jobs.errors.voiding", {
error: JSON.stringify(result.errors),
}),
});
}
}}
getPopupContainer={(trigger) => trigger.parentNode}
>
{t("menus.jobsactions.void")}
</Popconfirm>
</Menu.Item>
</RbacWrapper>
)}
</Menu>
);

View File

@@ -112,7 +112,9 @@ export function JobsList({ bodyshop }) {
title: t("jobs.fields.ro_number"),
dataIndex: "ro_number",
key: "ro_number",
sorter: (a, b) => alphaSort(a.ro_number, b.ro_number),
sorter: (a, b) =>
parseInt((a.ro_number || "0").replace(/\D/g, "")) -
parseInt((b.ro_number || "0").replace(/\D/g, "")),
sortOrder:
state.sortedInfo.columnKey === "ro_number" && state.sortedInfo.order,

View File

@@ -23,17 +23,34 @@ export function PrintCenterJobsComponent({ printCenterModal, bodyshop }) {
const { id: jobId, job } = printCenterModal.context;
const tempList = TemplateList("job", {});
const { t } = useTranslation();
const JobsReportsList = Object.keys(tempList)
.map((key) => {
return tempList[key];
})
.filter(
(temp) =>
!temp.regions ||
(temp.regions && temp.regions[bodyshop.region_config]) ||
(temp.regions &&
bodyshop.region_config.includes(Object.keys(temp.regions)) === true)
);
const JobsReportsList =
bodyshop.cdk_dealerid === null && bodyshop.pbs_serialnumber === null
? Object.keys(tempList)
.map((key) => {
return tempList[key];
})
.filter(
(temp) =>
(!temp.regions ||
(temp.regions && temp.regions[bodyshop.region_config]) ||
(temp.regions &&
bodyshop.region_config.includes(Object.keys(temp.regions)) ===
true)) &&
(!temp.dms || temp.dms === false)
)
: Object.keys(tempList)
.map((key) => {
return tempList[key];
})
.filter(
(temp) =>
!temp.regions ||
(temp.regions && temp.regions[bodyshop.region_config]) ||
(temp.regions &&
bodyshop.region_config.includes(Object.keys(temp.regions)) ===
true)
);
const filteredJobsReportsList =
search !== ""

View File

@@ -246,11 +246,21 @@ export function ProductionListTable({
(x) => x.status === record.status
);
if (!color) return null;
if (!color) {
if (index % 2 === 0)
return {
style: {
backgroundColor: `rgb(236, 236, 236)`,
},
};
return null;
}
return {
className: "rowWithColor",
style: {
backgroundColor: `rgb(${color.color.r},${color.color.g},${color.color.b},${color.color.a})`,
"--bgColor": `rgb(${color.color.r},${color.color.g},${color.color.b},${color.color.a})`,
},
};
},

View File

@@ -26,6 +26,8 @@ const ret = {
"jobs:partsqueue": 4,
"jobs:checklist-view": 2,
"jobs:list-ready": 1,
"jobs:void": 5,
"bills:enter": 2,
"bills:view": 2,
"bills:list": 2,

View File

@@ -52,7 +52,9 @@ export function ShopInfoComponent({ bodyshop, form, saveLoading }) {
<Tabs
defaultActiveKey={search.subtab}
onChange={(key) =>
history.push({ search: `?tab=${search.tab}&subtab=${key}` })
history.push({
search: `?tab=${search.tab}&subtab=${key}`,
})
}
>
<Tabs.TabPane key="general" tab={t("bodyshop.labels.shopinfo")}>

View File

@@ -1,12 +1,12 @@
import { useTreatments } from "@splitsoftware/splitio-react";
import { Form, InputNumber } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
import { useTreatments } from "@splitsoftware/splitio-react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
@@ -316,6 +316,18 @@ export function ShopInfoRbacComponent({ form, bodyshop }) {
>
<InputNumber />
</Form.Item>
<Form.Item
label={t("bodyshop.fields.rbac.jobs.void")}
rules={[
{
required: true,
//message: t("general.validation.required"),
},
]}
name={["md_rbac", "jobs:void"]}
>
<InputNumber />
</Form.Item>
<Form.Item
label={t("bodyshop.fields.rbac.bills.enter")}
rules={[

View File

@@ -33,6 +33,7 @@ export function TechClockInComponent({ form, bodyshop, technician }) {
<JobSearchSelect
convertedOnly={!bodyshop.tt_allow_post_to_invoiced}
notExported={!bodyshop.tt_allow_post_to_invoiced}
notInvoiced={!bodyshop.tt_allow_post_to_invoiced}
/>
</Form.Item>

View File

@@ -0,0 +1,78 @@
import { Alert, Button, Col, Row, Space } from "antd";
import i18n from "i18next";
import React from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectUpdateAvailable } from "../../redux/application/application.selectors";
import { AlertOutlined } from "@ant-design/icons";
import { useTranslation } from "react-i18next";
import { setUpdateAvailable } from "../../redux/application/application.actions";
import { store } from "../../redux/store";
import * as serviceWorkerRegistration from "../../serviceWorkerRegistration";
let globalRegistration;
const mapStateToProps = createStructuredSelector({
updateAvailable: selectUpdateAvailable,
});
const mapDispatchToProps = (dispatch) => ({
//setUserLanguage: language => dispatch(setUserLanguage(language))
});
export default connect(mapStateToProps, mapDispatchToProps)(UpdateAlert);
export function UpdateAlert({ updateAvailable }) {
const { t } = useTranslation();
if (!updateAvailable) return null;
return (
<Alert
message={t("general.messages.newversiontitle")}
showIcon
icon={<AlertOutlined />}
description={
<Row gutter={[16, 16]}>
<Col sm={24} md={16} lg={18}>
{t("general.messages.newversionmessage")}
</Col>
<Col sm={24} md={8} lg={6}>
<Space wrap>
<Button
onClick={async () => {
window.open("https://imex-online.noticeable.news/", "_blank");
}}
>
{i18n.t("general.actions.viewreleasenotes")}
</Button>
<Button
type="primary"
onClick={async () => {
if (globalRegistration && globalRegistration.waiting) {
await globalRegistration.unregister();
// Makes Workbox call skipWaiting()
globalRegistration.waiting.postMessage({
type: "SKIP_WAITING",
});
// Once the service worker is unregistered, we can reload the page to let
// the browser download a fresh copy of our app (invalidating the cache)
window.location.reload();
}
}}
>
{i18n.t("general.actions.refresh")}
</Button>
</Space>
</Col>
</Row>
}
closable={false}
type="warning"
/>
);
}
const onServiceWorkerUpdate = (registration) => {
console.log("onServiceWorkerUpdate", registration);
globalRegistration = registration;
store.dispatch(setUpdateAvailable(true));
};
serviceWorkerRegistration.register({ onUpdate: onServiceWorkerUpdate });

View File

@@ -1,37 +1,5 @@
import { gql } from "@apollo/client";
export const CONVERSATION_LIST_SUBSCRIPTION = gql`
subscription CONVERSATION_LIST_SUBSCRIPTION($offset: Int!) {
conversations(
order_by: { updated_at: desc }
limit: 1
offset: $offset
where: { archived: { _eq: false } }
) {
phone_num
id
updated_at
unreadcnt
messages_aggregate(
where: { read: { _eq: false }, isoutbound: { _eq: false } }
) {
aggregate {
count
}
}
job_conversations {
job {
id
ro_number
ownr_fn
ownr_ln
ownr_co_nm
}
}
}
}
`;
export const UNREAD_CONVERSATION_COUNT = gql`
query UNREAD_CONVERSATION_COUNT {
messages_aggregate(
@@ -44,18 +12,6 @@ export const UNREAD_CONVERSATION_COUNT = gql`
}
`;
export const UNREAD_CONVERSATION_COUNT_SUBSCRIPTION = gql`
subscription UNREAD_CONVERSATION_COUNT_SUBSCRIPTION {
messages_aggregate(
where: { read: { _eq: false }, isoutbound: { _eq: false } }
) {
aggregate {
count
}
}
}
`;
export const CONVERSATION_LIST_QUERY = gql`
query CONVERSATION_LIST_QUERY($offset: Int!) {
conversations(

View File

@@ -25,6 +25,7 @@ import {
import * as Sentry from "@sentry/react";
import "./manage.page.styles.scss";
import UpdateAlert from "../../components/update-alert/update-alert.component";
const ManageRootPage = lazy(() =>
import("../manage-root/manage-root.page.container")
@@ -394,6 +395,7 @@ export function Manage({ match, conflict, bodyshop }) {
<>
<ChatAffixContainer />
<Layout className="layout-container">
<UpdateAlert />
<HeaderContainer />
<Content className="content-container">

View File

@@ -6,7 +6,7 @@ import AlertComponent from "../../components/alert/alert.component";
import LoadingSpinner from "../../components/loading-spinner/loading-spinner.component";
import { QUERY_BODYSHOP } from "../../graphql/bodyshop.queries";
import { setBodyshop } from "../../redux/user/user.actions";
import "../../utils/RegisterSw";
//import "../../utils/RegisterSw";
import ManagePage from "./manage.page.component";
const mapDispatchToProps = (dispatch) => ({

View File

@@ -40,6 +40,10 @@ export function ShopPage({ bodyshop, setSelectedHeader, setBreadcrumbs }) {
]);
}, [t, setSelectedHeader, setBreadcrumbs, bodyshop.shopname]);
useEffect(() => {
if (!search.tab) history.push({ search: "?tab=info" });
}, [history, search]);
return (
<RbacWrapper action="shop:config">
<Tabs

View File

@@ -12,6 +12,7 @@ import TechSider from "../../components/tech-sider/tech-sider.component";
import { selectTechnician } from "../../redux/tech/tech.selectors";
import FeatureWrapper from "../../components/feature-wrapper/feature-wrapper.component";
import "./tech.page.styles.scss";
import UpdateAlert from "../../components/update-alert/update-alert.component";
const TimeTicketModalContainer = lazy(() =>
import("../../components/time-ticket-modal/time-ticket-modal.container")
);
@@ -56,7 +57,9 @@ export function TechPage({ technician, match }) {
<TechSider />
<Layout>
{technician ? null : <Redirect to={`${match.path}/login`} />}
<UpdateAlert />
<TechHeader />
<Content className="tech-content-container">
<ErrorBoundary>
<Suspense

View File

@@ -9,7 +9,7 @@ import LoadingSpinner from "../../components/loading-spinner/loading-spinner.com
import { useTranslation } from "react-i18next";
import { selectBodyshop } from "../../redux/user/user.selectors";
import { createStructuredSelector } from "reselect";
import "../../utils/RegisterSw";
//import "../../utils/RegisterSw";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,

View File

@@ -62,3 +62,8 @@ export const setProblemJobs = (problemJobs) => ({
type: ApplicationActionTypes.SET_PROBLEM_JOBS,
payload: problemJobs,
});
export const setUpdateAvailable = (isUpdateAvailable) => ({
type: ApplicationActionTypes.SET_UPDATE_AVAILABLE,
payload: isUpdateAvailable,
});

View File

@@ -3,6 +3,7 @@ import ApplicationActionTypes from "./application.types";
const INITIAL_STATE = {
loading: false,
online: true,
updateAvailable: false,
breadcrumbs: [],
recentItems: [],
selectedHeader: "home",
@@ -18,6 +19,11 @@ const INITIAL_STATE = {
const applicationReducer = (state = INITIAL_STATE, action) => {
switch (action.type) {
case ApplicationActionTypes.SET_UPDATE_AVAILABLE:
return {
...state,
updateAvailable: action.payload,
};
case ApplicationActionTypes.SET_SELECTED_HEADER:
return {
...state,

View File

@@ -48,3 +48,7 @@ export const selectProblemJobs = createSelector(
[selectApplication],
(application) => application.problemJobs
);
export const selectUpdateAvailable = createSelector(
[selectApplication],
(application) => application.updateAvailable
);

View File

@@ -12,5 +12,6 @@ const ApplicationActionTypes = {
SET_ONLINE_STATUS: "SET_ONLINE_STATUS",
INSERT_AUDIT_TRAIL: "INSERT_AUDIT_TRAIL",
SET_PROBLEM_JOBS: "SET_PROBLEM_JOBS",
SET_UPDATE_AVAILABLE: "SET_UPDATE_AVAILABLE"
};
export default ApplicationActionTypes;

View File

@@ -405,7 +405,8 @@
"list-active": "Jobs -> List Active",
"list-all": "Jobs -> List All",
"list-ready": "Jobs -> List Ready",
"partsqueue": "Jobs -> Parts Queue"
"partsqueue": "Jobs -> Parts Queue",
"void": "Jobs -> Void"
},
"owners": {
"detail": "Owners -> Detail",
@@ -1117,7 +1118,7 @@
},
"messages": {
"exception": "$t(titles.app) has encountered an error. Please try again. If the problem persists, please submit a support ticket or contact us.",
"newversionmessage": "Click refresh below to update to the latest available version of ImEX Online. Please make sure all other tabs and windows are closed.",
"newversionmessage": "Click refresh to update to the latest available version of ImEX Online. Please make sure all other tabs and windows are closed.",
"newversiontitle": "New version of ImEX Online Available",
"noacctfilepath": "There is no accounting file path set. You will not be able to export any items.",
"nofeatureaccess": "You do not have access to this feature of ImEX Online. Please contact support to request a license for this feature.",

View File

@@ -405,7 +405,8 @@
"list-active": "",
"list-all": "",
"list-ready": "",
"partsqueue": ""
"partsqueue": "",
"void": ""
},
"owners": {
"detail": "",

View File

@@ -405,7 +405,8 @@
"list-active": "",
"list-all": "",
"list-ready": "",
"partsqueue": ""
"partsqueue": "",
"void": ""
},
"owners": {
"detail": "",

View File

@@ -3,6 +3,7 @@ import { Button, notification, Space } from "antd";
import i18n from "i18next";
import React from "react";
import * as serviceWorkerRegistration from "../serviceWorkerRegistration";
import { store } from "../redux/store";
const onServiceWorkerUpdate = (registration) => {
console.log("onServiceWorkerUpdate", registration);
@@ -33,6 +34,9 @@ const onServiceWorkerUpdate = (registration) => {
</Button>
</Space>
);
store.dispatch()
notification.open({
icon: <AlertOutlined />,
message: i18n.t("general.messages.newversiontitle"),

View File

@@ -512,6 +512,7 @@ export const TemplateList = (type, context) => {
key: "dms_posting_sheet",
disabled: false,
group: "financial",
dms: true,
},
}
: {}),

View File

@@ -2690,6 +2690,13 @@
table:
name: inventory
schema: public
- name: parts_dispatch_lines
using:
foreign_key_constraint_on:
column: joblineid
table:
name: parts_dispatch_lines
schema: public
- name: parts_order_lines
using:
foreign_key_constraint_on:
@@ -3131,6 +3138,13 @@
table:
name: notes
schema: public
- name: parts_dispatches
using:
foreign_key_constraint_on:
column: jobid
table:
name: parts_dispatch
schema: public
- name: parts_orders
using:
foreign_key_constraint_on:
@@ -4556,6 +4570,165 @@
template_engine: Kriti
url: '{{$base_url}}/opensearch'
version: 2
- table:
name: parts_dispatch
schema: public
object_relationships:
- name: job
using:
foreign_key_constraint_on: jobid
array_relationships:
- name: parts_dispatch_lines
using:
foreign_key_constraint_on:
column: partsdispatchid
table:
name: parts_dispatch_lines
schema: public
insert_permissions:
- role: user
permission:
check:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- id
- created_at
- updated_at
- jobid
- number
- employeeid
- dispatched_at
- dispatched_by
select_permissions:
- role: user
permission:
columns:
- number
- dispatched_by
- created_at
- dispatched_at
- updated_at
- employeeid
- id
- jobid
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
update_permissions:
- role: user
permission:
columns:
- number
- dispatched_by
- created_at
- dispatched_at
- updated_at
- employeeid
- id
- jobid
filter:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
check: null
- table:
name: parts_dispatch_lines
schema: public
object_relationships:
- name: jobline
using:
foreign_key_constraint_on: joblineid
- name: parts_dispatch
using:
foreign_key_constraint_on: partsdispatchid
insert_permissions:
- role: user
permission:
check:
parts_dispatch:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
columns:
- id
- created_at
- updated_at
- partsdispatchid
- joblineid
- quantity
- accepted_at
select_permissions:
- role: user
permission:
columns:
- quantity
- accepted_at
- created_at
- updated_at
- id
- joblineid
- partsdispatchid
filter:
parts_dispatch:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
update_permissions:
- role: user
permission:
columns:
- id
- created_at
- updated_at
- partsdispatchid
- joblineid
- quantity
- accepted_at
filter:
parts_dispatch:
job:
bodyshop:
associations:
_and:
- user:
authid:
_eq: X-Hasura-User-Id
- active:
_eq: true
check: null
- table:
name: parts_order_lines
schema: public

View File

@@ -0,0 +1 @@
DROP TABLE "public"."parts_dispatch";

View File

@@ -0,0 +1,18 @@
CREATE TABLE "public"."parts_dispatch" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), "jobid" uuid NOT NULL, "number" serial NOT NULL, "employeeid" uuid NOT NULL, "dispatched_at" timestamptz NOT NULL, "dispatched_by" text NOT NULL, PRIMARY KEY ("id") , FOREIGN KEY ("jobid") REFERENCES "public"."jobs"("id") ON UPDATE cascade ON DELETE cascade);
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
RETURNS TRIGGER AS $$
DECLARE
_new record;
BEGIN
_new := NEW;
_new."updated_at" = NOW();
RETURN _new;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER "set_public_parts_dispatch_updated_at"
BEFORE UPDATE ON "public"."parts_dispatch"
FOR EACH ROW
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
COMMENT ON TRIGGER "set_public_parts_dispatch_updated_at" ON "public"."parts_dispatch"
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
CREATE EXTENSION IF NOT EXISTS pgcrypto;

View File

@@ -0,0 +1 @@
DROP TABLE "public"."parts_dispatch_lines";

View File

@@ -0,0 +1,18 @@
CREATE TABLE "public"."parts_dispatch_lines" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), "partsdispatchid" UUID NOT NULL, "joblineid" uuid NOT NULL, "quantity" numeric NOT NULL DEFAULT 1, "accepted_at" timestamptz NOT NULL, PRIMARY KEY ("id") , FOREIGN KEY ("joblineid") REFERENCES "public"."joblines"("id") ON UPDATE cascade ON DELETE cascade);
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
RETURNS TRIGGER AS $$
DECLARE
_new record;
BEGIN
_new := NEW;
_new."updated_at" = NOW();
RETURN _new;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER "set_public_parts_dispatch_lines_updated_at"
BEFORE UPDATE ON "public"."parts_dispatch_lines"
FOR EACH ROW
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
COMMENT ON TRIGGER "set_public_parts_dispatch_lines_updated_at" ON "public"."parts_dispatch_lines"
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
CREATE EXTENSION IF NOT EXISTS pgcrypto;

View File

@@ -0,0 +1 @@
alter table "public"."parts_dispatch_lines" drop constraint "parts_dispatch_lines_partsdispatchid_fkey";

View File

@@ -0,0 +1,5 @@
alter table "public"."parts_dispatch_lines"
add constraint "parts_dispatch_lines_partsdispatchid_fkey"
foreign key ("partsdispatchid")
references "public"."parts_dispatch"
("id") on update cascade on delete cascade;

View File

@@ -0,0 +1 @@
alter table "public"."parts_dispatch_lines" alter column "accepted_at" set not null;

View File

@@ -0,0 +1 @@
alter table "public"."parts_dispatch_lines" alter column "accepted_at" drop not null;

View File

@@ -0,0 +1,5 @@
alter table "public"."job_conversations" drop constraint "job_conversations_conversationid_fkey",
add constraint "job_conversations_conversationid_fkey"
foreign key ("conversationid")
references "public"."conversations"
("id") on update restrict on delete restrict;

View File

@@ -0,0 +1,5 @@
alter table "public"."job_conversations" drop constraint "job_conversations_conversationid_fkey",
add constraint "job_conversations_conversationid_fkey"
foreign key ("conversationid")
references "public"."conversations"
("id") on update cascade on delete cascade;

View File

@@ -729,9 +729,15 @@ async function InsertDmsVehicle(socket) {
deliveryDate: moment()
// .tz(socket.JobData.bodyshop.timezone)
.format("YYYYMMDD"),
licensePlateNo: String(socket.JobData.plate_no)
.replace(/([^\w]|_)/g, "")
.toUpperCase(),
licensePlateNo:
socket.JobData.plate_no === null
? null
: String(socket.JobData.plate_no).replace(/([^\w]|_)/g, "")
.length === 0
? null
: String(socket.JobData.plate_no)
.replace(/([^\w]|_)/g, "")
.toUpperCase(),
make: socket.txEnvelope.dms_make,
modelAbrev: socket.txEnvelope.dms_model,
modelYear: socket.JobData.v_model_yr,

View File

@@ -86,6 +86,7 @@ async function OpenSearchUpdateHandler(req, res) {
"v_model_yr",
"v_make_desc",
"v_model_desc",
"v_vin",
]);
document.bodyshopid = req.body.event.data.new.shopid;
break;
@@ -139,7 +140,7 @@ async function OpenSearchUpdateHandler(req, res) {
"exported_at",
"invoice_number",
"is_credit_memo",
"total"
"total",
]),
...bill.bills_by_pk,
bodyshopid: bill.bills_by_pk.job.shopid,
@@ -244,17 +245,54 @@ async function OpensearchSearchHandler(req, res) {
bool: {
must: [
{
multi_match: {
query: search,
type: "phrase_prefix",
//fields: ["*"],
// fuzziness: "5",
//prefix_length: 2,
match: {
bodyshopid: assocs.associations[0].shopid,
},
},
{
match: {
bodyshopid: assocs.associations[0].shopid,
bool: {
should: [
{
multi_match: {
query: search,
type: "cross_fields",
fields: ["*ownr_fn", "*ownr_ln"],
},
},
{
multi_match: {
query: search,
type: "most_fields",
fields: [
"*v_model_yr",
"*v_make_desc^2",
"*v_model_desc^3",
],
},
},
{
query_string: {
query: `*${search}*`,
fields: [
"*ro_number^20",
"*clm_no^14",
"*v_vin^12",
"*plate_no^12",
"*ownr_ln^10",
"transactionid^10",
"paymentnum^10",
"invoice_number^10",
"*ownr_fn^8",
"*ownr_co_nm^8",
"*ownr_ph1^8",
"*ownr_ph2^8",
"*",
],
},
},
],
minimum_should_match: 1,
},
},
],