Refactored job closing to be line based instead of totals based. BOD-383
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import React, { forwardRef } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
const LaborTypeFormItem = ({ value, onChange }, ref) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
if (!value) return null;
|
||||
|
||||
return <div>{t(`joblines.fields.lbr_types.${value}`)}</div>;
|
||||
};
|
||||
export default forwardRef(LaborTypeFormItem);
|
||||
@@ -0,0 +1,11 @@
|
||||
import React, { forwardRef } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
const PartTypeFormItem = ({ value, onChange }, ref) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
if (!value) return null;
|
||||
|
||||
return <div>{t(`joblines.fields.part_types.${value}`)}</div>;
|
||||
};
|
||||
export default forwardRef(PartTypeFormItem);
|
||||
@@ -0,0 +1,17 @@
|
||||
import Dinero from "dinero.js";
|
||||
import React, { forwardRef } from "react";
|
||||
|
||||
const ReadOnlyFormItem = ({ value, type = "text", onChange }, ref) => {
|
||||
if (!value) return null;
|
||||
switch (type) {
|
||||
case "text":
|
||||
return <div>{value}</div>;
|
||||
case "currency":
|
||||
return (
|
||||
<div>{Dinero({ amount: Math.round(value * 100) }).toFormat()}</div>
|
||||
);
|
||||
default:
|
||||
return <div>{value}</div>;
|
||||
}
|
||||
};
|
||||
export default forwardRef(ReadOnlyFormItem);
|
||||
@@ -1,23 +0,0 @@
|
||||
import { Button } from "antd";
|
||||
import React, { forwardRef } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
|
||||
function ResetForm({ resetFields }) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<AlertComponent
|
||||
message={
|
||||
<div>
|
||||
{t("general.messages.unsavedchanges")}
|
||||
<Button style={{ marginLeft: "20px" }} onClick={() => resetFields()}>
|
||||
{t("general.actions.reset")}
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
closable
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default forwardRef(ResetForm);
|
||||
Reference in New Issue
Block a user