Skip to content

Commit 09e5729

Browse files
committed
Update package version. Improve MicrosoftTeamsIntegrations message.
1 parent 7d84dd1 commit 09e5729

File tree

2 files changed

+12
-25
lines changed

2 files changed

+12
-25
lines changed

AzureDevopsTracker/AzureDevopsTracker.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
<PackageLicenseFile>LICENSE.md.txt</PackageLicenseFile>
1919
<Description>A NuGet that allows you to use a Azure DevOps Service Hook to track workitems changes in a simply and detailed way.</Description>
2020
<AssemblyVersion>5.0.0.0</AssemblyVersion>
21-
<FileVersion>5.0.1-rc</FileVersion>
22-
<Version>5.0.1-rc</Version>
21+
<FileVersion>5.0.2</FileVersion>
22+
<Version>5.0.2</Version>
2323
<PackageReleaseNotes>Add ChangeLog Feature</PackageReleaseNotes>
2424
</PropertyGroup>
2525

AzureDevopsTracker/Integrations/MicrosoftTeamsIntegration.cs

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -66,28 +66,22 @@ private string GetText(ChangeLog changeLog)
6666
{
6767
if (changeLog == null || !changeLog.ChangeLogItems.Any()) return string.Empty;
6868

69-
StringBuilder text = new StringBuilder();
70-
text.Append(GetWorkItemsDescriptionSection("Features", changeLog.ChangeLogItems.Where(x => x.WorkItemType != WorkItemStatics.WORKITEM_TYPE_BUG)));
71-
text.Append(GetWorkItemsDescriptionSection("Correções", changeLog.ChangeLogItems.Where(x => x.WorkItemType == WorkItemStatics.WORKITEM_TYPE_BUG)));
69+
StringBuilder text = new();
70+
text.AppendLine(GetWorkItemsDescriptionSection("Features", changeLog.ChangeLogItems.Where(x => x.WorkItemType != WorkItemStatics.WORKITEM_TYPE_BUG)));
71+
text.AppendLine(GetWorkItemsDescriptionSection("Correções", changeLog.ChangeLogItems.Where(x => x.WorkItemType == WorkItemStatics.WORKITEM_TYPE_BUG)));
7272

73-
text.Append(GetFooter());
73+
text.AppendLine(GetFooter());
7474
return text.ToString();
7575
}
7676

7777
private string GetWorkItemsDescriptionSection(string sectionName, IEnumerable<ChangeLogItem> changeLogItems)
7878
{
79-
StringBuilder text = new StringBuilder();
79+
StringBuilder text = new();
8080
if (!changeLogItems.Any()) return string.Empty;
8181

82-
text.Append("<br>");
83-
text.AppendLine("\n");
84-
85-
text.Append($"\n # **{ sectionName }**\n");
86-
text.Append("<br>");
82+
text.AppendLine($"\n# **{ sectionName }**\n");
8783
foreach (var workItem in changeLogItems)
88-
{
89-
text.Append(GetWorkItemDescriptionLine(workItem));
90-
}
84+
text.AppendLine(GetWorkItemDescriptionLine(workItem));
9185

9286
text.AppendLine("\n");
9387
return text.ToString();
@@ -96,24 +90,17 @@ private string GetWorkItemsDescriptionSection(string sectionName, IEnumerable<Ch
9690
private string GetWorkItemDescriptionLine(ChangeLogItem workItem)
9791
{
9892
var description = GetDescription(workItem.Description);
99-
var descriptionLine = $"<em>**{ workItem.WorkItemId }**</em> - { description } <br>";
100-
if (description.Length > MicrosoftTeamsStatics.TEXT_SIZE_TO_BREAK_LINE)
101-
return $"<br>{ descriptionLine }<br>";
102-
return descriptionLine;
93+
return $"<em>**{ workItem.WorkItemId }**</em> - { description } <br>";
10394
}
10495

10596
private string GetDescription(string description)
10697
{
107-
if (description.StartsWith("<div>"))
108-
description = description[MicrosoftTeamsStatics.OPENING_DIV_SIZE..];
109-
if (description.EndsWith("</div>"))
110-
description = description[0..^MicrosoftTeamsStatics.CLOSING_DIV_SIZE];
111-
return description;
98+
return description.Replace("<div>", "").Replace("</div>", "").Replace("<br>", "");
11299
}
113100

114101
private string GetFooter()
115102
{
116-
return $"<br><sup> <img src='{ GetLogoTypingHard16x16Url() }' /> { GetNugetVersion() }</sup>";
103+
return $"<br><sup> <img style='width: 16px; height: 16px;' src='{ GetLogoTypingHard16x16Url() }' /> { GetNugetVersion() }</sup>";
117104
}
118105
}
119106
}

0 commit comments

Comments
 (0)