Skip to content

Instantly share code, notes, and snippets.

@mabsboza
Created July 30, 2020 21:28
Show Gist options
  • Save mabsboza/1fbabbd92ffe63f822ee81f1388dedae to your computer and use it in GitHub Desktop.
Save mabsboza/1fbabbd92ffe63f822ee81f1388dedae to your computer and use it in GitHub Desktop.
<Form.Item
name="workOrderType"
label={
<Tooltip
title={
<FormattedMessage
id="activities.workOrderType.hint"
defaultMessage="hint"
/>
}
>
<span>
<FormattedMessage
id="activities.workOrderType"
defaultMessage="workOrderType"
/>
<InfoCircleOutlined style={{ marginLeft: "8px" }} />
</span>
</Tooltip>
}
rules={[Rules.required]}
extra={
<Form.Item
noStyle
shouldUpdate={(prev, next) =>
prev.workOrderType !== next.workOrderType
}
>
{({ getFieldValue }) => {
const workOrderType = getFieldValue("workOrderType");
return (
workOrderType && (
<FormattedMessage
{...{
id: `activities.workOrderTypes.${workOrderType}`
}}
/>
)
);
}}
</Form.Item>
}
>
<SelectField
showGroups
options={workOrderTypeOptions}
onChange={e => {
if (e === WorkOrderType.Repair) {
disabledRadioGroup = true;
}
}}
/>
</Form.Item>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment