Merge branch 'master' into feature/major-package-upgrades
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<babeledit_project version="1.2" be_version="2.7.1">
|
||||
<babeledit_project be_version="2.7.1" version="1.2">
|
||||
<!--
|
||||
|
||||
BabelEdit project file
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
Space,
|
||||
Switch,
|
||||
} from "antd";
|
||||
import axios from "axios";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
@@ -18,7 +19,6 @@ import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||
import axios from "axios";
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
bodyshop: selectBodyshop,
|
||||
@@ -235,7 +235,11 @@ export function JobsConvertButton({
|
||||
loading={loading}
|
||||
onClick={() => {
|
||||
setVisible(true);
|
||||
form.resetFields();
|
||||
form.setFieldsValue({
|
||||
driveable: true,
|
||||
towin: false,
|
||||
employee_csr: job.employee_csr,
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t("jobs.actions.convert")}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import { Space } from "antd";
|
||||
import React from "react";
|
||||
import React, { useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { useLocation } from "react-router-dom";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectScheduleLoad } from "../../redux/application/application.selectors";
|
||||
import queryString from "query-string";
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser
|
||||
scheduleLoad: selectScheduleLoad,
|
||||
@@ -14,20 +12,33 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
});
|
||||
|
||||
export function ScheduleAtsSummary({ scheduleLoad }) {
|
||||
export function ScheduleAtsSummary({ scheduleLoad, appointments }) {
|
||||
const { t } = useTranslation();
|
||||
const search = queryString.parse(useLocation().search);
|
||||
|
||||
if (
|
||||
(search.view === undefined || search.view === "week") &&
|
||||
scheduleLoad.atsSummary &&
|
||||
Object.keys(scheduleLoad.atsSummary).length > 0
|
||||
)
|
||||
const atsSummary = useMemo(() => {
|
||||
let atsSummary = {};
|
||||
if (!appointments || appointments.length === 0) {
|
||||
return {};
|
||||
}
|
||||
appointments
|
||||
.filter((a) => a.isintake)
|
||||
.forEach((a) => {
|
||||
if (!a.job.alt_transport) return;
|
||||
if (!atsSummary[a.job.alt_transport]) {
|
||||
atsSummary[a.job.alt_transport] = 1;
|
||||
} else {
|
||||
atsSummary[a.job.alt_transport] = atsSummary[a.job.alt_transport] + 1;
|
||||
}
|
||||
});
|
||||
return atsSummary;
|
||||
}, [appointments]);
|
||||
|
||||
if (Object.keys(atsSummary).length > 0)
|
||||
return (
|
||||
<Space wrap>
|
||||
{t("schedule.labels.atssummary")}
|
||||
{Object.keys(scheduleLoad.atsSummary).map((key) => (
|
||||
<span key={key}>{`${key}: ${scheduleLoad.atsSummary[key]}`}</span>
|
||||
{Object.keys(atsSummary).map((key) => (
|
||||
<span key={key}>{`${key}: ${atsSummary[key]}`}</span>
|
||||
))}
|
||||
</Space>
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Button, Card, Checkbox, Col, PageHeader, Row, Space } from "antd";
|
||||
import { t } from "i18next";
|
||||
import React, { useMemo } from "react";
|
||||
import useLocalStorage from "../../utils/useLocalStorage";
|
||||
import ScheduleAtsSummary from "../schedule-ats-summary/schedule-ats-summary.component";
|
||||
import ScheduleAtsSummary from "../schedule-ats-summary/schedule-ats-summary.component";
|
||||
import ScheduleCalendarWrapperComponent from "../schedule-calendar-wrapper/scheduler-calendar-wrapper.component";
|
||||
import ScheduleModal from "../schedule-job-modal/schedule-job-modal.container";
|
||||
import ScheduleManualEvent from "../schedule-manual-event/schedule-manual-event.component";
|
||||
@@ -11,7 +11,6 @@ import ScheduleProductionList from "../schedule-production-list/schedule-product
|
||||
import ScheduleVerifyIntegrity from "../schedule-verify-integrity/schedule-verify-integrity.component";
|
||||
|
||||
export default function ScheduleCalendarComponent({ data, refetch }) {
|
||||
|
||||
const [filter, setFilter] = useLocalStorage("filter_events", {
|
||||
intake: true,
|
||||
manual: true,
|
||||
@@ -37,7 +36,7 @@ export default function ScheduleCalendarComponent({ data, refetch }) {
|
||||
<PageHeader
|
||||
extra={
|
||||
<Space wrap>
|
||||
<ScheduleAtsSummary/>
|
||||
<ScheduleAtsSummary appointments={filteredData} />
|
||||
<Checkbox
|
||||
checked={filter?.intake}
|
||||
onChange={(e) => {
|
||||
@@ -73,8 +72,6 @@ export default function ScheduleCalendarComponent({ data, refetch }) {
|
||||
<ScheduleProductionList />
|
||||
|
||||
<ScheduleManualEvent />
|
||||
|
||||
|
||||
</Space>
|
||||
}
|
||||
/>
|
||||
|
||||
@@ -1101,6 +1101,9 @@ export const UPDATE_JOB_ASSIGNMENTS = gql`
|
||||
first_name
|
||||
last_name
|
||||
}
|
||||
employee_csr
|
||||
employee_body
|
||||
employee_prep
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import { persistor, store } from "./redux/store";
|
||||
import reportWebVitals from "./reportWebVitals";
|
||||
import "./translations/i18n";
|
||||
import "./utils/CleanAxios";
|
||||
import { BrowserTracing } from "@sentry/tracing";
|
||||
//import { BrowserTracing } from "@sentry/tracing";
|
||||
|
||||
// Dinero.defaultCurrency = "CAD";
|
||||
// Dinero.globalLocale = "en-CA";
|
||||
@@ -29,18 +29,18 @@ if (process.env.NODE_ENV !== "development") {
|
||||
"Module specifier, 'zlib' does not start with",
|
||||
],
|
||||
integrations: [
|
||||
new BrowserTracing(),
|
||||
// new BrowserTracing(),
|
||||
// new Sentry.Integrations.Breadcrumbs({ console: true }),
|
||||
new Sentry.Replay(),
|
||||
// new Sentry.Replay(),
|
||||
],
|
||||
// This sets the sample rate to be 10%. You may want this to be 100% while
|
||||
// in development and sample at a lower rate in production
|
||||
replaysSessionSampleRate: 0.1,
|
||||
// If the entire session is not sampled, use the below sample rate to sample
|
||||
// sessions when an error occurs.
|
||||
replaysOnErrorSampleRate: 1.0,
|
||||
// replaysSessionSampleRate: 0.1,
|
||||
// // If the entire session is not sampled, use the below sample rate to sample
|
||||
// // sessions when an error occurs.
|
||||
// replaysOnErrorSampleRate: 1.0,
|
||||
environment: process.env.NODE_ENV,
|
||||
tracesSampleRate: 0.2,
|
||||
// tracesSampleRate: 0.2,
|
||||
// We recommend adjusting this value in production, or using tracesSampler
|
||||
// for finer control
|
||||
// tracesSampleRate: 0.5,
|
||||
@@ -52,7 +52,7 @@ const root = createRoot(container); // createRoot(container!) if you use TypeScr
|
||||
|
||||
root.render(
|
||||
<Provider store={store}>
|
||||
<BrowserRouter >
|
||||
<BrowserRouter>
|
||||
<PersistGate
|
||||
loading={<LoadingSpinner message="Restoring your settings..." />}
|
||||
persistor={persistor}
|
||||
|
||||
@@ -172,21 +172,6 @@ export function* calculateScheduleLoad({ payload: end }) {
|
||||
}
|
||||
}
|
||||
|
||||
//Calculate weekly ATS summary.
|
||||
const startOfWeek = moment(end).startOf("week");
|
||||
const endOfWeek = moment(end).endOf("week");
|
||||
load.atsSummary = {};
|
||||
arrJobs
|
||||
.filter((j) => moment(j.scheduled_in).isBetween(startOfWeek, endOfWeek))
|
||||
.forEach((j) => {
|
||||
if (!load.atsSummary[j.alt_transport]) {
|
||||
load.atsSummary[j.alt_transport] = 1;
|
||||
} else {
|
||||
load.atsSummary[j.alt_transport] =
|
||||
load.atsSummary[j.alt_transport] + 1;
|
||||
}
|
||||
});
|
||||
|
||||
yield put(setProblemJobs(problemJobs));
|
||||
yield put(scheduleLoadSuccess(load));
|
||||
} catch (error) {
|
||||
|
||||
@@ -2501,7 +2501,7 @@
|
||||
},
|
||||
"schedule": {
|
||||
"labels": {
|
||||
"atssummary": "Weekly ATS Summary",
|
||||
"atssummary": "ATS Summary",
|
||||
"employeevacation": "Employee Vacations",
|
||||
"intake": "Intake Events",
|
||||
"manual": "Manual Events",
|
||||
|
||||
@@ -654,9 +654,9 @@ exports.default = function ({
|
||||
if (qbo) {
|
||||
InvoiceLineAdd.push({
|
||||
DetailType: "SalesItemLineDetail",
|
||||
Amount: Dinero({ amount: (payer.amount || 0) * 100 * -1 }).toFormat(
|
||||
DineroQbFormat
|
||||
),
|
||||
Amount: Dinero({
|
||||
amount: Math.round((payer.amount || 0) * 100) * -1,
|
||||
}).toFormat(DineroQbFormat),
|
||||
SalesItemLineDetail: {
|
||||
...(jobs_by_pk.class
|
||||
? { ClassRef: { value: classes[jobs_by_pk.class] } }
|
||||
@@ -687,9 +687,9 @@ exports.default = function ({
|
||||
FullName: responsibilityCenters.qb_multiple_payers?.accountitem,
|
||||
},
|
||||
Desc: `${payer.name} Liability`,
|
||||
Amount: Dinero({ amount: (payer.amount || 0) * 100 * -1 }).toFormat(
|
||||
DineroQbFormat
|
||||
),
|
||||
Amount: Dinero({
|
||||
amount: Math.round((payer.amount || 0) * 100) * -1,
|
||||
}).toFormat(DineroQbFormat),
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user