Merge branch 'master' into feature/major-package-upgrades
This commit is contained in:
@@ -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>
|
||||
}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user