INFRA-2867 | houston incident creation clean after creation (#135)

This commit is contained in:
Dhruv Joshi
2024-03-19 18:40:08 +05:30
committed by GitHub
parent ca5a3f1a84
commit 893a492102
2 changed files with 8 additions and 8 deletions

View File

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

View File

@@ -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([]);