Skip to content

Commit

Permalink
EPMRPP-76232 || fix save comment for bulk operation, make decision mo…
Browse files Browse the repository at this point in the history
…dal (#3045)

* EPMRPP-76232 || fix save comment for bulk operation

* EPMRPP-76232 || code review fixes - 1
  • Loading branch information
chivekrodis authored and AmsterGet committed Mar 29, 2022
1 parent 9b8b9b6 commit 44ff0e7
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ import { debugModeSelector } from 'controllers/launch';
import { SCREEN_SM_MAX, SCREEN_XS_MAX } from 'common/constants/screenSizeVariables';
import { TO_INVESTIGATE_LOCATOR_PREFIX } from 'common/constants/defectTypes';
import { InputCheckbox } from 'components/inputs/inputCheckbox';
import { SELECT_DEFECT_MANUALLY } from '../../constants';
import {
ADD_FOR_ALL,
NOT_CHANGED_FOR_ALL,
REPLACE_FOR_ALL,
SELECT_DEFECT_MANUALLY,
} from '../../constants';
import { messages } from '../../messages';
import { ActionButtonsBar } from './actionButtonsBar';
import styles from './selectDefectManually.scss';
Expand Down Expand Up @@ -88,6 +93,17 @@ export const SelectDefectManually = ({
};
const handleDefectCommentChange = (value) => {
handleManualChange({ comment: value.trim() });
if (isBulkOperation) {
const isValueEmpty = value.trim() === '';
if (!source.issue.comment && !isValueEmpty) {
setModalState({ commentOption: ADD_FOR_ALL });
} else if (
isValueEmpty &&
[ADD_FOR_ALL, REPLACE_FOR_ALL].includes(modalState.commentOption)
) {
setModalState({ commentOption: NOT_CHANGED_FOR_ALL });
}
}
};

const getActionItems = () => {
Expand Down

0 comments on commit 44ff0e7

Please sign in to comment.