feature/IO-3123-Code-Review-Adjustments: Make Code review adjustments
This commit is contained in:
@@ -134,10 +134,10 @@ export function JobsDetailHeaderActions({
|
|||||||
const notification = useNotification();
|
const notification = useNotification();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
treatments: { ImEXPay, Share_To_Teams }
|
treatments: { ImEXPay }
|
||||||
} = useSplitTreatments({
|
} = useSplitTreatments({
|
||||||
attributes: {},
|
attributes: {},
|
||||||
names: ["ImEXPay", "Share_To_Teams"],
|
names: ["ImEXPay"],
|
||||||
splitKey: bodyshop && bodyshop.imexshopid
|
splitKey: bodyshop && bodyshop.imexshopid
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -202,7 +202,10 @@ export function JobsDetailHeaderActions({
|
|||||||
message: t("appointments.successes.created")
|
message: t("appointments.successes.created")
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
notification.open({ type: "error", message: t("appointments.errors.saving", { error: error.message }) });
|
notification.open({
|
||||||
|
type: "error",
|
||||||
|
message: t("appointments.errors.saving", { error: error.message })
|
||||||
|
});
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
setVisibility(false);
|
setVisibility(false);
|
||||||
@@ -839,7 +842,7 @@ export function JobsDetailHeaderActions({
|
|||||||
id: "job-actions-addtoproduction",
|
id: "job-actions-addtoproduction",
|
||||||
disabled: !job.converted,
|
disabled: !job.converted,
|
||||||
label: t("jobs.actions.addtoproduction"),
|
label: t("jobs.actions.addtoproduction"),
|
||||||
onClick: () => AddToProduction(client, job.id, refetch, notification)
|
onClick: () => AddToProduction(client, job.id, refetch, false, notification)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -972,7 +975,7 @@ export function JobsDetailHeaderActions({
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if (Share_To_Teams?.treatment === "on") {
|
if (bodyshop?.md_functionality_toggles?.teams) {
|
||||||
menuItems.push({
|
menuItems.push({
|
||||||
key: "sharetoteams",
|
key: "sharetoteams",
|
||||||
id: "job-actions-sharetoteams",
|
id: "job-actions-sharetoteams",
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
|||||||
import { DateTimeFormatterFunction } from "../../utils/DateFormatter";
|
import { DateTimeFormatterFunction } from "../../utils/DateFormatter";
|
||||||
import FormDateTimePickerComponent from "../form-date-time-picker/form-date-time-picker.component";
|
import FormDateTimePickerComponent from "../form-date-time-picker/form-date-time-picker.component";
|
||||||
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||||
|
import LoadingSpinner from "../loading-spinner/loading-spinner.component.jsx";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser,
|
//currentUser: selectCurrentUser,
|
||||||
@@ -39,7 +40,7 @@ export function JobsDetailHeaderActionsToggleProduction({
|
|||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const notification = useNotification();
|
const notification = useNotification();
|
||||||
|
|
||||||
const [getJobDetails] = useLazyQuery(GET_JOB_BY_PK_QUICK_INTAKE, {
|
const [getJobDetails, { loading: jobDetailsLoading }] = useLazyQuery(GET_JOB_BY_PK_QUICK_INTAKE, {
|
||||||
variables: { id: job.id },
|
variables: { id: job.id },
|
||||||
onCompleted: (data) => {
|
onCompleted: (data) => {
|
||||||
if (data?.jobs_by_pk) {
|
if (data?.jobs_by_pk) {
|
||||||
@@ -109,65 +110,69 @@ export function JobsDetailHeaderActionsToggleProduction({
|
|||||||
|
|
||||||
const popMenu = (
|
const popMenu = (
|
||||||
<div onClick={(e) => e.stopPropagation()}>
|
<div onClick={(e) => e.stopPropagation()}>
|
||||||
<Form layout="vertical" form={form} onFinish={handleConvert}>
|
{jobDetailsLoading ? (
|
||||||
{scenario === "pre" && (
|
<LoadingSpinner />
|
||||||
<>
|
) : (
|
||||||
<Form.Item
|
<Form layout="vertical" form={form} onFinish={handleConvert}>
|
||||||
name={["actual_in"]}
|
{scenario === "pre" && (
|
||||||
label={t("jobs.fields.actual_in")}
|
<>
|
||||||
rules={[
|
<Form.Item
|
||||||
{
|
name={["actual_in"]}
|
||||||
required: true
|
label={t("jobs.fields.actual_in")}
|
||||||
//message: t("general.validation.required"),
|
rules={[
|
||||||
}
|
{
|
||||||
]}
|
required: true
|
||||||
>
|
//message: t("general.validation.required"),
|
||||||
<FormDateTimePickerComponent disabled={jobRO} />
|
}
|
||||||
</Form.Item>
|
]}
|
||||||
<Form.Item
|
>
|
||||||
name={["scheduled_completion"]}
|
<FormDateTimePickerComponent disabled={jobRO} />
|
||||||
label={t("jobs.fields.scheduled_completion")}
|
</Form.Item>
|
||||||
rules={[
|
<Form.Item
|
||||||
{
|
name={["scheduled_completion"]}
|
||||||
required: true
|
label={t("jobs.fields.scheduled_completion")}
|
||||||
//message: t("general.validation.required"),
|
rules={[
|
||||||
}
|
{
|
||||||
]}
|
required: true
|
||||||
>
|
//message: t("general.validation.required"),
|
||||||
<FormDateTimePickerComponent disabled={jobRO} />
|
}
|
||||||
</Form.Item>
|
]}
|
||||||
<Form.Item name={["scheduled_delivery"]} label={t("jobs.fields.scheduled_delivery")}>
|
>
|
||||||
<FormDateTimePickerComponent disabled={jobRO} />
|
<FormDateTimePickerComponent disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</>
|
<Form.Item name={["scheduled_delivery"]} label={t("jobs.fields.scheduled_delivery")}>
|
||||||
)}
|
<FormDateTimePickerComponent disabled={jobRO} />
|
||||||
{scenario === "prod" && (
|
</Form.Item>
|
||||||
<>
|
</>
|
||||||
<Form.Item
|
)}
|
||||||
name={["actual_completion"]}
|
{scenario === "prod" && (
|
||||||
label={t("jobs.fields.actual_completion")}
|
<>
|
||||||
rules={[
|
<Form.Item
|
||||||
{
|
name={["actual_completion"]}
|
||||||
required: true
|
label={t("jobs.fields.actual_completion")}
|
||||||
//message: t("general.validation.required"),
|
rules={[
|
||||||
}
|
{
|
||||||
]}
|
required: true
|
||||||
>
|
//message: t("general.validation.required"),
|
||||||
<FormDateTimePickerComponent disabled={jobRO} />
|
}
|
||||||
</Form.Item>
|
]}
|
||||||
|
>
|
||||||
|
<FormDateTimePickerComponent disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
<Form.Item name={["actual_delivery"]} label={t("jobs.fields.actual_delivery")}>
|
<Form.Item name={["actual_delivery"]} label={t("jobs.fields.actual_delivery")}>
|
||||||
<FormDateTimePickerComponent disabled={jobRO} />
|
<FormDateTimePickerComponent disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
<Button type="primary" onClick={() => form.submit()} loading={loading}>
|
<Button type="primary" onClick={() => form.submit()} loading={loading}>
|
||||||
{t("general.actions.save")}
|
{t("general.actions.save")}
|
||||||
</Button>
|
</Button>
|
||||||
</Space>
|
</Space>
|
||||||
</Form>
|
</Form>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ export function PartsOrderListTableComponent({
|
|||||||
|
|
||||||
const parts_orders = billsQuery.data ? billsQuery.data.parts_orders : [];
|
const parts_orders = billsQuery.data ? billsQuery.data.parts_orders : [];
|
||||||
const { refetch } = billsQuery;
|
const { refetch } = billsQuery;
|
||||||
// label: <ShareToTeamsButton noIcon={true} urlOverride={`${window.location.origin}${window.location.pathname}`} />
|
|
||||||
const recordActions = (record, showView = false) => (
|
const recordActions = (record, showView = false) => (
|
||||||
<Space direction="horizontal" wrap>
|
<Space direction="horizontal" wrap>
|
||||||
<ShareToTeamsButton
|
<ShareToTeamsButton
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Button, Input, Space, Spin } from "antd";
|
import { Button, Input, Space, Spin } from "antd";
|
||||||
import { useState } from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
@@ -24,19 +23,13 @@ export default connect(mapStateToProps, mapDispatchToProps)(ProductionBoardFilte
|
|||||||
|
|
||||||
export function ProductionBoardFilters({ bodyshop, filter, setFilter, loading }) {
|
export function ProductionBoardFilters({ bodyshop, filter, setFilter, loading }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [alertFilter, setAlertFilter] = useState(false);
|
|
||||||
const [unassignedFilter, setUnassignedFilter] = useState(false);
|
|
||||||
|
|
||||||
const toggleAlertFilter = () => {
|
const toggleAlertFilter = () => {
|
||||||
const newAlertFilter = !alertFilter;
|
setFilter({ ...filter, alert: !filter.alert });
|
||||||
setAlertFilter(newAlertFilter);
|
|
||||||
setFilter({ ...filter, alert: newAlertFilter });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const toggleUnassignedFilter = () => {
|
const toggleUnassignedFilter = () => {
|
||||||
const newUnassignedFilter = !unassignedFilter;
|
setFilter({ ...filter, unassigned: !filter.unassigned });
|
||||||
setUnassignedFilter(newUnassignedFilter);
|
|
||||||
setFilter({ ...filter, unassigned: newUnassignedFilter });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -58,16 +51,16 @@ export function ProductionBoardFilters({ bodyshop, filter, setFilter, loading })
|
|||||||
allowClear
|
allowClear
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
type={alertFilter ? "primary" : "default"}
|
type={filter?.alert ? "primary" : "default"}
|
||||||
onClick={toggleAlertFilter}
|
onClick={toggleAlertFilter}
|
||||||
icon={alertFilter ? <ExclamationCircleFilled /> : <ExclamationCircleOutlined />}
|
icon={filter?.alert ? <ExclamationCircleFilled /> : <ExclamationCircleOutlined />}
|
||||||
>
|
>
|
||||||
{t("production.labels.alerts")}
|
{t("production.labels.alerts")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type={unassignedFilter ? "primary" : "default"}
|
type={filter?.unassigned ? "primary" : "default"}
|
||||||
onClick={toggleUnassignedFilter}
|
onClick={toggleUnassignedFilter}
|
||||||
icon={unassignedFilter ? <UserDeleteOutlined /> : <UsergroupDeleteOutlined />}
|
icon={filter?.unassigned ? <UserDeleteOutlined /> : <UsergroupDeleteOutlined />}
|
||||||
>
|
>
|
||||||
{t("production.labels.unassigned")}
|
{t("production.labels.unassigned")}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { Button } from "antd";
|
|||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
import { SiMicrosoftteams } from "react-icons/si";
|
import { SiMicrosoftteams } from "react-icons/si";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useSplitTreatments } from "@splitsoftware/splitio-react";
|
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors.js";
|
import { selectBodyshop } from "../../redux/user/user.selectors.js";
|
||||||
@@ -43,14 +42,6 @@ const ShareToTeamsComponent = ({
|
|||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const {
|
|
||||||
treatments: { Share_To_Teams }
|
|
||||||
} = useSplitTreatments({
|
|
||||||
attributes: {},
|
|
||||||
names: ["Share_To_Teams"],
|
|
||||||
splitKey: bodyshop && bodyshop.imexshopid
|
|
||||||
});
|
|
||||||
|
|
||||||
const currentUrl =
|
const currentUrl =
|
||||||
urlOverride ||
|
urlOverride ||
|
||||||
encodeURIComponent(`${window.location.origin}${location.pathname}${location.search}${location.hash}`);
|
encodeURIComponent(`${window.location.origin}${location.pathname}${location.search}${location.hash}`);
|
||||||
@@ -78,7 +69,8 @@ const ShareToTeamsComponent = ({
|
|||||||
window.open(teamsShareUrl, "_blank", windowFeatures);
|
window.open(teamsShareUrl, "_blank", windowFeatures);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Share_To_Teams?.treatment !== "on") {
|
// Feature is disabled
|
||||||
|
if (!bodyshop?.md_functionality_toggles?.teams) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import FormItemEmail from "../form-items-formatted/email-form-item.component";
|
|||||||
import PhoneFormItem, { PhoneItemFormatterValidation } from "../form-items-formatted/phone-form-item.component";
|
import PhoneFormItem, { PhoneItemFormatterValidation } from "../form-items-formatted/phone-form-item.component";
|
||||||
import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component";
|
import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component";
|
||||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
// TODO: Client Update, this might break
|
|
||||||
const timeZonesList = Intl.supportedValuesOf("timeZone");
|
const timeZonesList = Intl.supportedValuesOf("timeZone");
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop
|
bodyshop: selectBodyshop
|
||||||
@@ -642,6 +642,15 @@ export function ShopInfoGeneral({ form, bodyshop }) {
|
|||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
|
<LayoutFormRow header={t("bodyshop.labels.shop_enabled_features")} id="sharing">
|
||||||
|
<Form.Item
|
||||||
|
label={t("general.actions.sharetoteams")}
|
||||||
|
valuePropName="checked"
|
||||||
|
name={["md_functionality_toggles", "teams"]}
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
</LayoutFormRow>
|
||||||
<LayoutFormRow grow header={t("bodyshop.labels.messagingpresets")} id="messagingpresets">
|
<LayoutFormRow grow header={t("bodyshop.labels.messagingpresets")} id="messagingpresets">
|
||||||
<Form.List name={["md_messaging_presets"]}>
|
<Form.List name={["md_messaging_presets"]}>
|
||||||
{(fields, { add, remove, move }) => {
|
{(fields, { add, remove, move }) => {
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ function TaskListComponent({
|
|||||||
<Space direction="horizontal">
|
<Space direction="horizontal">
|
||||||
<ShareToTeamsButton
|
<ShareToTeamsButton
|
||||||
linkText=""
|
linkText=""
|
||||||
urlOverride={`https://localhost:3000/manage/tasks/alltasks?taskid=${record.id}`}
|
urlOverride={`${window.location.origin}/manage/tasks/alltasks?taskid=${record.id}`}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
title={t("tasks.buttons.edit")}
|
title={t("tasks.buttons.edit")}
|
||||||
|
|||||||
@@ -235,7 +235,12 @@ export function* signInSuccessSaga({ payload }) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
window.$crisp.push(["set", "user:nickname", [payload.displayName || payload.email]]);
|
window.$crisp.push(["set", "user:nickname", [payload.displayName || payload.email]]);
|
||||||
window.$crisp.push(["set", "session:segments", [["user"]]]);
|
const currentUserSegment = InstanceRenderManager({
|
||||||
|
imex: "imex-online-user",
|
||||||
|
rome: "rome-online-user"
|
||||||
|
});
|
||||||
|
window.$crisp.push(["set", "session:segments", [[currentUserSegment]]]);
|
||||||
|
|
||||||
InstanceRenderManager({
|
InstanceRenderManager({
|
||||||
executeFunction: true,
|
executeFunction: true,
|
||||||
args: [],
|
args: [],
|
||||||
|
|||||||
@@ -712,7 +712,8 @@
|
|||||||
"ssbuckets": "Job Size Definitions",
|
"ssbuckets": "Job Size Definitions",
|
||||||
"systemsettings": "System Settings",
|
"systemsettings": "System Settings",
|
||||||
"task-presets": "Task Presets",
|
"task-presets": "Task Presets",
|
||||||
"workingdays": "Working Days"
|
"workingdays": "Working Days",
|
||||||
|
"shop_enabled_features": "Shop Enabled Features"
|
||||||
},
|
},
|
||||||
"operations": {
|
"operations": {
|
||||||
"contains": "Contains",
|
"contains": "Contains",
|
||||||
|
|||||||
@@ -712,7 +712,8 @@
|
|||||||
"ssbuckets": "",
|
"ssbuckets": "",
|
||||||
"systemsettings": "",
|
"systemsettings": "",
|
||||||
"task-presets": "",
|
"task-presets": "",
|
||||||
"workingdays": ""
|
"workingdays": "",
|
||||||
|
"shop_enabled_features": ""
|
||||||
},
|
},
|
||||||
"operations": {
|
"operations": {
|
||||||
"contains": "",
|
"contains": "",
|
||||||
|
|||||||
@@ -712,7 +712,8 @@
|
|||||||
"ssbuckets": "",
|
"ssbuckets": "",
|
||||||
"systemsettings": "",
|
"systemsettings": "",
|
||||||
"task-presets": "",
|
"task-presets": "",
|
||||||
"workingdays": ""
|
"workingdays": "",
|
||||||
|
"shop_enabled_features": ""
|
||||||
},
|
},
|
||||||
"operations": {
|
"operations": {
|
||||||
"contains": "",
|
"contains": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user