Skip to content

Commit

Permalink
fix: new responsible validation (#1001)
Browse files Browse the repository at this point in the history
  • Loading branch information
nunocaseiro authored Feb 2, 2023
1 parent aa63ded commit 609ec51
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions backend/src/modules/boards/services/update.board.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ export class SlackCommunicationApplication implements CommunicationApplicationIn
const generalText = {
member: (
boardId: string
) => `<!channel> In order to proceed with the retro of this month, here is the board link: \n\n
) => `<!here> 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
) => `<!channel> In order to proceed with the retro of this month, here is the main board link: \n\n
) => `<!here> In order to proceed with the retro of this month, here is the main board link: \n\n
${this.config.frontendUrl}/boards/${boardId}
`
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class SlackMergeBoardApplication implements MergeBoardApplicationInterfac

async execute(data: MergeBoardType): Promise<MergeBoardType | null> {
const { responsiblesChannelId, teamNumber, isLastSubBoard } = data;
const message = `<!channel>, The board of team ${teamNumber} is ready`;
const message = `<!here>, The board of team ${teamNumber} is ready`;
this.chatHandler.postMessage(responsiblesChannelId, message);

if (isLastSubBoard) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class SlackResponsibleApplication implements ResponsibleApplicationInterf

const newResponsibleId = await this.usersHandler.getSlackUserIdByEmail(newResponsibleEmail);

const message = `<!channel>, <@${newResponsibleId}> is the new responsible for the team ${teamNumber}`;
const message = `<!here>, <@${newResponsibleId}> is the new responsible for the team ${teamNumber}`;

if (mainChannelId) {
await this.chatHandler.postMessage(mainChannelId, message);
Expand Down

0 comments on commit 609ec51

Please sign in to comment.