Skip to content

Commit

Permalink
Permit to receive mail for not notified state in UI (#7564)
Browse files Browse the repository at this point in the history
Signed-off-by: vlo-rte <[email protected]>
  • Loading branch information
vlo-rte committed Nov 25, 2024
1 parent f626042 commit ccf0eb7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ export default class CardsRoutingUtilities {
userWithPerimeters,
card.process,
perim.state as string
) &&
CardsRoutingUtilities.checkFilteringNotification(userWithPerimeters, card.process, perim)
)
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ describe('Card routing', function () {
currentUserWithReceiveAndWriteRightWithFilteringNotification,
card
)
).toBeFalsy();
).toBeTruthy();
expect(
CardsRoutingUtilities.shouldUserReceiveTheCard(
currentUserWithReceiveAndWriteRightWithFilteringNotificationNotForProcessState,
Expand All @@ -392,7 +392,7 @@ describe('Card routing', function () {
expect(CardsRoutingUtilities.shouldUserReceiveTheCard(currentUserWithReceiveRight, card)).toBeTruthy();
expect(
CardsRoutingUtilities.shouldUserReceiveTheCard(currentUserWithReceiveRightWithFilteringNotification, card)
).toBeFalsy();
).toBeTruthy();
expect(
CardsRoutingUtilities.shouldUserReceiveTheCard(
currentUserWithReceiveRightWithFilteringNotificationNotForProcessState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,14 @@ export class NotificationConfigurationView {

public clickOnStateNotificationByEmail(processId: string, stateId: string): void {
const process = this.processList.find(({id}) => id === processId);
if (!process) return;
if (!process) {
return;
}

const state = process.states.find(({id}) => id === stateId);
if (!state) return;
if (!state.checked) return;
if (!state) {
return;
}
state.notificationByEmail = !state.notificationByEmail;
this.setEmailEnabled(processId, stateId, state.notificationByEmail);
}
Expand Down

0 comments on commit ccf0eb7

Please sign in to comment.