feature/IO-3494-Change-Preferred-Contact - Implement select box, fix capture bug

This commit is contained in:
Dave
2026-01-07 13:21:31 -05:00
parent a6bd3d1383
commit e26df780bf
7 changed files with 63 additions and 21 deletions

View File

@@ -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>

View File

@@ -5,17 +5,22 @@ import FormFieldsChanged from "../form-fields-changed-alert/form-fields-changed-
import FormItemEmail from "../form-items-formatted/email-form-item.component";
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
import { PhoneItemFormatterValidation } from "../form-items-formatted/phone-form-item.component";
import { buildOwnerPhoneTypeOptions } from "../../utils/phoneTypeOptions.js";
export default function OwnerDetailFormComponent({ form, isPhone1OptedOut, isPhone2OptedOut }) {
const { t } = useTranslation();
const { getFieldValue } = form;
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 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>
<FormFieldsChanged form={form} />
@@ -137,8 +142,9 @@ export default function OwnerDetailFormComponent({ form, isPhone1OptedOut, isPho
</Form.Item>
<Form.Item label={t("owners.fields.preferred_contact")} name="preferred_contact">
<Input />
<Select allowClear placeholder="Type" options={PREFERRED_CONTACT_OPTIONS} />
</Form.Item>
<Form.Item label={t("owners.fields.tax_number")} name="tax_number">
<Input />
</Form.Item>