From 609ec5170a5b971938e16cd7b81df88ee1ea2d49 Mon Sep 17 00:00:00 2001 From: Nuno Caseiro <90208434+nunocaseiro@users.noreply.github.com> Date: Thu, 2 Feb 2023 16:24:29 +0000 Subject: [PATCH] fix: new responsible validation (#1001) --- backend/src/modules/boards/services/update.board.service.ts | 4 ++-- .../applications/slack-communication.application.ts | 4 ++-- .../applications/slack-merge-board.application.ts | 2 +- .../applications/slack-responsible.application.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/src/modules/boards/services/update.board.service.ts b/backend/src/modules/boards/services/update.board.service.ts index 5919b60e4..f052131f8 100644 --- a/backend/src/modules/boards/services/update.board.service.ts +++ b/backend/src/modules/boards/services/update.board.service.ts @@ -98,11 +98,11 @@ export default class UpdateBoardServiceImpl implements UpdateBoardServiceInterfa * - is a sub-board * - and the logged user isn't the current responsible */ - if (boardData.users && currentResponsible.id !== newResponsible.id) { + if (boardData.users && String(currentResponsible.id) !== String(newResponsible.id)) { if (isSubBoard) { const promises = boardData.users .filter((boardUser) => - [getIdFromObjectId(String(currentResponsible?.id)), newResponsible.id].includes( + [getIdFromObjectId(String(currentResponsible?.id)), String(newResponsible.id)].includes( (boardUser.user as unknown as User)._id ) ) diff --git a/backend/src/modules/communication/applications/slack-communication.application.ts b/backend/src/modules/communication/applications/slack-communication.application.ts index 3e1f83141..8734ada80 100644 --- a/backend/src/modules/communication/applications/slack-communication.application.ts +++ b/backend/src/modules/communication/applications/slack-communication.application.ts @@ -71,12 +71,12 @@ export class SlackCommunicationApplication implements CommunicationApplicationIn const generalText = { member: ( boardId: string - ) => ` In order to proceed with the retro of this month, here is the board link: \n\n + ) => ` In order to proceed with the retro of this month, here is the board link: \n\n ${this.config.frontendUrl}/boards/${boardId} `, responsible: ( boardId: string - ) => ` In order to proceed with the retro of this month, here is the main board link: \n\n + ) => ` In order to proceed with the retro of this month, here is the main board link: \n\n ${this.config.frontendUrl}/boards/${boardId} ` }; diff --git a/backend/src/modules/communication/applications/slack-merge-board.application.ts b/backend/src/modules/communication/applications/slack-merge-board.application.ts index 29ab998f1..8e33dfee8 100644 --- a/backend/src/modules/communication/applications/slack-merge-board.application.ts +++ b/backend/src/modules/communication/applications/slack-merge-board.application.ts @@ -10,7 +10,7 @@ export class SlackMergeBoardApplication implements MergeBoardApplicationInterfac async execute(data: MergeBoardType): Promise { const { responsiblesChannelId, teamNumber, isLastSubBoard } = data; - const message = `, The board of team ${teamNumber} is ready`; + const message = `, The board of team ${teamNumber} is ready`; this.chatHandler.postMessage(responsiblesChannelId, message); if (isLastSubBoard) { diff --git a/backend/src/modules/communication/applications/slack-responsible.application.ts b/backend/src/modules/communication/applications/slack-responsible.application.ts index 57e7d62c9..3a6059992 100644 --- a/backend/src/modules/communication/applications/slack-responsible.application.ts +++ b/backend/src/modules/communication/applications/slack-responsible.application.ts @@ -22,7 +22,7 @@ export class SlackResponsibleApplication implements ResponsibleApplicationInterf const newResponsibleId = await this.usersHandler.getSlackUserIdByEmail(newResponsibleEmail); - const message = `, <@${newResponsibleId}> is the new responsible for the team ${teamNumber}`; + const message = `, <@${newResponsibleId}> is the new responsible for the team ${teamNumber}`; if (mainChannelId) { await this.chatHandler.postMessage(mainChannelId, message);