Убраны статичные комментарии

This commit is contained in:
Danil Kislov
2019-06-27 22:00:19 +03:00
parent 1b7b56f63d
commit 087c4f1909
2 changed files with 2 additions and 20 deletions
@@ -1,32 +1,13 @@
using JiraTimeBot.Configuration;
using JiraTimeBot.TaskTime.Objects;
using System;
using System.Collections.Generic;
using System.Linq;
namespace JiraTimeBot.JiraIntegration.Comments
{
public class JiraDescriptionSource : IJiraDescriptionSource
{
private readonly List<string> _dummyComments = new List<string>
{
"Написание кода", "написание кода", "программирование", "реализация задачи", "кодинг", "код + тесты",
"кодинг", "написание кода и тестов"
};
public string GetDescription(TaskTimeItem taskTimeItem, bool addCommentsToWorklog, Settings settings)
{
if (addCommentsToWorklog)
{
return taskTimeItem.Description;
}
if (settings.WorkType == WorkType.Mercurial)
{
return _dummyComments.OrderBy(f => Guid.NewGuid()).FirstOrDefault();
}
return "";
return addCommentsToWorklog ? taskTimeItem.Description : "";
}
}
}
@@ -82,6 +82,7 @@ namespace JiraTimeBot.Mercurial
TimeSpent = TimeSpan.Zero,
Type = GetCommitType(changeset.Branch)
};
if (task.Type == CommitType.Release && task.Description.StartsWith("Merge with", StringComparison.CurrentCultureIgnoreCase))
{
var branch = task.Description.Replace("Merge with", "").Replace(" ", "");