Skip to content

Commit fa827d8

Browse files
authored
Merge pull request #1277 from CruGlobal/change-next-action-options
MPDX-8526 - Prevent the next action being defaulted in certain conditions
2 parents 8a2174e + 9aa798e commit fa827d8

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/components/Task/Modal/Form/TaskModalHelper.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,19 @@ export const handleResultChange = ({
118118
result as DisplayResultEnum,
119119
ActivityTypeEnum.None,
120120
);
121-
const defaultNextAction = findNextAction(completedAction, nextActions);
121+
122+
// As per Scott's request, we do not set the next action field if the following are true
123+
// - The phase is PartnerCare.
124+
// - The completed action is InitiationSpecialGiftAppeal.
125+
// There has been discussion to add this logic to the constant API.
126+
// When/If that happens, this logic should be removed.
127+
const doNotSetNextAction =
128+
phaseData?.id === PhaseEnum.PartnerCare ||
129+
completedAction === ActivityTypeEnum.InitiationSpecialGiftAppeal;
130+
131+
const defaultNextAction = doNotSetNextAction
132+
? null
133+
: findNextAction(completedAction, nextActions);
122134
setFieldValue('nextAction', defaultNextAction);
123135
};
124136

0 commit comments

Comments
 (0)