Skip to content

Commit

Permalink
Message for detect reassign was added
Browse files Browse the repository at this point in the history
  • Loading branch information
dyatlov-a committed Dec 9, 2024
1 parent 918da2c commit fed1e32
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Inc.TeamAssistant.Gateway/wwwroot/langs/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"Reviewer_Owner": "Author {0}",
"Reviewer_TargetAutomatically": "Automatically assigned to ",
"Reviewer_TargetManually": "Manually assigned to ",
"Reviewer_TargetReassigned": "Reassigned to ",
"Reviewer_ReviewDeclined": "The task has been declined.",
"Reviewer_Accepted": "Task review has been completed.",
"Reviewer_TotalTime": "Total review time {0}",
Expand Down
1 change: 1 addition & 0 deletions src/Inc.TeamAssistant.Gateway/wwwroot/langs/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"Reviewer_Owner": "Автор {0}",
"Reviewer_TargetAutomatically": "Автоматически назначена на ",
"Reviewer_TargetManually": "Вручную назначена на ",
"Reviewer_TargetReassigned": "Переназначена на ",
"Reviewer_ReviewDeclined": "Задача отклонена.",
"Reviewer_Accepted": "Ревью задачи завершено.",
"Reviewer_TotalTime": "Общее время ревью {0}",
Expand Down
1 change: 1 addition & 0 deletions src/Inc.TeamAssistant.Reviewer.Application/Messages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ internal static class Messages
public static readonly MessageId Reviewer_Owner = new(nameof(Reviewer_Owner));
public static readonly MessageId Reviewer_TargetAutomatically = new(nameof(Reviewer_TargetAutomatically));
public static readonly MessageId Reviewer_TargetManually = new(nameof(Reviewer_TargetManually));
public static readonly MessageId Reviewer_TargetReassigned = new(nameof(Reviewer_TargetReassigned));
public static readonly MessageId Reviewer_Accepted = new(nameof(Reviewer_Accepted));
public static readonly MessageId Reviewer_TotalTime = new(nameof(Reviewer_TotalTime));
public static readonly MessageId Reviewer_MoveToInProgress = new(nameof(Reviewer_MoveToInProgress));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,12 @@ private async Task<NotificationMessage> MessageForTeam(

Func<NotificationMessage, NotificationMessage> attachPersons = n => n;
var languageId = await _teamAccessor.GetClientLanguage(task.BotId, owner.Id, token);
var reviewerTargetMessageKey = task.HasConcreteReviewer
? Messages.Reviewer_TargetManually
: Messages.Reviewer_TargetAutomatically;
var reviewerTargetMessageKey = (task.OriginalReviewerId.HasValue, task.HasConcreteReviewer) switch
{
(true, _) => Messages.Reviewer_TargetReassigned,
(_, true) => Messages.Reviewer_TargetManually,
(_, _) => Messages.Reviewer_TargetAutomatically
};

var builder = new StringBuilder();
builder.AppendLine(await _messageBuilder.Build(Messages.Reviewer_NewTaskForReview, languageId));
Expand Down

0 comments on commit fed1e32

Please sign in to comment.