INFRA-2867 | add optional chaining
This commit is contained in:
@@ -73,7 +73,6 @@ const CreateIncidentForm: React.FC<CreateIncidentFormProps> = ({
|
||||
};
|
||||
const handleTeamChange = (val: SelectPickerOptionProps[]): void => {
|
||||
dispatch({ type: actionTypes.SET_SELECTED_TEAM, payload: val });
|
||||
if (val?.length === 0) return;
|
||||
};
|
||||
const handleAssignerChange = (val: SelectPickerValue): void => {
|
||||
dispatch({ type: actionTypes.SET_SELECTED_ASSIGNER, payload: val });
|
||||
|
||||
@@ -421,6 +421,7 @@ const AllDailogBox: FC = () => {
|
||||
UpdateData.type === 'severity' &&
|
||||
showJustificationBox &&
|
||||
state.reason.length <= 5;
|
||||
const isProductAndDisabled = UpdateData.type === 'product' && !state.team;
|
||||
return (
|
||||
<div className={styles['modal-footer']}>
|
||||
{isSeverityAndDisabled ? (
|
||||
@@ -430,7 +431,7 @@ const AllDailogBox: FC = () => {
|
||||
) : (
|
||||
<Button
|
||||
onClick={handleUpdateIncidentClick}
|
||||
disabled={UpdateData.type === 'product' && !state.team}
|
||||
disabled={isProductAndDisabled}
|
||||
>
|
||||
Update incident
|
||||
</Button>
|
||||
|
||||
@@ -108,12 +108,13 @@ export const getUpdateValueText = ({
|
||||
} `;
|
||||
case ProductType:
|
||||
return ` ${
|
||||
initialValues.initialProducts?.length
|
||||
? initialValues.initialProducts
|
||||
.map(
|
||||
(product: { value: number }) => maps.productMap[product.value],
|
||||
initialValues?.initialProducts?.length
|
||||
? initialValues?.initialProducts
|
||||
?.map(
|
||||
(product: { value: number }) =>
|
||||
maps?.productMap?.[product?.value],
|
||||
)
|
||||
.join(', ')
|
||||
?.join(', ')
|
||||
: '-'
|
||||
} `;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user