feature/IO-3494-Change-Preferred-Contact - Implement select box, fix capture bug
This commit is contained in:
@@ -5,16 +5,25 @@ import JobCreateContext from "../../pages/jobs-create/jobs-create.context";
|
||||
import FormItemEmail from "../form-items-formatted/email-form-item.component";
|
||||
import FormItemPhone, { PhoneItemFormatterValidation } from "../form-items-formatted/phone-form-item.component";
|
||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||
import { buildOwnerPhoneTypeOptions } from "../../utils/phoneTypeOptions.js";
|
||||
|
||||
export default function JobsCreateOwnerInfoNewComponent() {
|
||||
const PHONE_TYPE_OPTIONS = [
|
||||
{ label: t("owners.labels.home"), value: "Home" },
|
||||
{ label: t("owners.labels.work"), value: "Work" },
|
||||
{ label: t("owners.labels.cell"), value: "Cell" }
|
||||
];
|
||||
const [state] = useContext(JobCreateContext);
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
const PHONE_TYPE_OPTIONS = buildOwnerPhoneTypeOptions(t);
|
||||
|
||||
const PREFERRED_CONTACT_OPTIONS = [
|
||||
{
|
||||
label: t("owners.labels.email", { defaultValue: "Email" }),
|
||||
options: [{ label: t("owners.labels.email", { defaultValue: "Email" }), value: "Email" }]
|
||||
},
|
||||
{
|
||||
label: t("owners.labels.phone", { defaultValue: "Phone" }),
|
||||
options: PHONE_TYPE_OPTIONS
|
||||
}
|
||||
];
|
||||
|
||||
return (
|
||||
<div>
|
||||
<LayoutFormRow header={t("owners.forms.name")} grow>
|
||||
@@ -162,7 +171,7 @@ export default function JobsCreateOwnerInfoNewComponent() {
|
||||
|
||||
<LayoutFormRow grow>
|
||||
<Form.Item label={t("owners.fields.preferred_contact")} name={["owner", "data", "preferred_contact"]}>
|
||||
<Input disabled={!state.owner.new} />
|
||||
<Select disabled={!state.owner.new} allowClear placeholder="Type" options={PREFERRED_CONTACT_OPTIONS} />
|
||||
</Form.Item>
|
||||
</LayoutFormRow>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user