Created
July 30, 2020 21:28
-
-
Save mabsboza/1fbabbd92ffe63f822ee81f1388dedae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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