INFRA-2867 | houston incident creation clean after creation (#135)
This commit is contained in:
@@ -67,7 +67,7 @@ const CreateIncidentForm: React.FC<CreateIncidentFormProps> = ({
|
||||
validateTitle(inputValue);
|
||||
};
|
||||
const handleTeamChange = (val: SelectPickerOptionProps[]): void => {
|
||||
if (val.length < state?.selectedTeam?.length) {
|
||||
if (val?.length < state?.selectedTeam?.length || val?.length == 0) {
|
||||
dispatch({ type: actionTypes.SET_SELECTED_REPORTER, payload: 0 });
|
||||
dispatch({ type: actionTypes.SET_SELECTED_RESPONDER, payload: 0 });
|
||||
}
|
||||
@@ -98,7 +98,7 @@ const CreateIncidentForm: React.FC<CreateIncidentFormProps> = ({
|
||||
!state.isTitleValid ||
|
||||
!state.isDescriptionValid ||
|
||||
!state.title ||
|
||||
!state.selectedSeverity.value ||
|
||||
!state.selectedSeverity?.value ||
|
||||
!state.selectedTeam?.length ||
|
||||
!state.description ||
|
||||
!state.selectedReporter ||
|
||||
@@ -121,7 +121,7 @@ const CreateIncidentForm: React.FC<CreateIncidentFormProps> = ({
|
||||
description: state.description,
|
||||
reportingTeamId: state.selectedReporter,
|
||||
responderTeamId: state.selectedResponder,
|
||||
productIds: state.selectedTeam.map((team: Team) => team.value),
|
||||
productIds: state?.selectedTeam?.map((team: Team) => team?.value),
|
||||
createdBy: userEmail,
|
||||
})
|
||||
.then(response => {
|
||||
|
||||
@@ -27,18 +27,18 @@ const UpdateSevList: FC<UpdateSevListProps> = (props: UpdateSevListProps) => {
|
||||
};
|
||||
|
||||
const onSubmit = (): void => {
|
||||
const selectedMemberString = selectedMember.join(',');
|
||||
const selectedMemberString = selectedMember?.join(',');
|
||||
updateMember(selectedMemberString, sevType);
|
||||
handleClose();
|
||||
};
|
||||
|
||||
const handleChipRemoval = (options: SelectPickerOptionProps[]): void => {
|
||||
setSelectedMember(options.map(option => option.value));
|
||||
setIsSubmitDisabled(options.length === 0);
|
||||
setSelectedMember(options?.map(option => option?.value));
|
||||
setIsSubmitDisabled(options?.length === 0);
|
||||
};
|
||||
const handleSelectionChange = (options: SelectPickerOptionProps[]): void => {
|
||||
setSelectedMember(options.map(option => option.value));
|
||||
setIsSubmitDisabled(options.length === 0);
|
||||
setSelectedMember(options?.map(option => option?.value));
|
||||
setIsSubmitDisabled(options?.length === 0);
|
||||
};
|
||||
const handleClearAll = (): void => {
|
||||
setSelectedMember([]);
|
||||
|
||||
Reference in New Issue
Block a user