Skip to content

Commit 883d6e7

Browse files
authored
Merge pull request #33 from GGrouppFoundation/feature/fix-project-choice-message
Fix choice project result message
2 parents d2f77cd + 9bea0b7 commit 883d6e7

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

src/Application/Application.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<InvariantGlobalization>false</InvariantGlobalization>
99
<RootNamespace>GGroupp.Internal.Timesheet</RootNamespace>
1010
<AssemblyName>GGroupp.Internal.Timesheet.Bot.Application</AssemblyName>
11-
<Version>1.5.7</Version>
11+
<Version>1.5.8</Version>
1212
</PropertyGroup>
1313

1414
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Application' " />

src/Timesheet.Create/Step.FindProject/ProjectFindFlowStep.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ internal static ChatFlow<TimesheetCreateFlowState> FindProject(
2424

2525
private static string CreateResultMessage(IChatFlowContext<TimesheetCreateFlowState> context, LookupValue projectValue)
2626
=>
27-
$"{projectValue.GetProjectType().ToStringRussianCulture()}: {context.EncodeTextWithStyle(projectValue.Name, BotTextStyle.Bold)}";
27+
$"{projectValue.GetProjectType().ToStringRussianCulture()}: {context.CreateBoldText(projectValue.Name)}";
2828

2929
private static TimesheetProjectType GetProjectType(this LookupValue projectValue)
3030
=>

src/Timesheet.Create/Timesheet.Create.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="GGroupp.Infra.Bot.Builder.ChatFlow.Step.Card" Version="1.2.4" />
15-
<PackageReference Include="GGroupp.Infra.Bot.Builder.ChatFlow.Step.Lookup" Version="2.3.3" />
15+
<PackageReference Include="GGroupp.Infra.Bot.Builder.ChatFlow.Step.Lookup" Version="2.3.4" />
1616
<PackageReference Include="GGroupp.Infra.Bot.Builder.ChatFlow.Step.Value" Version="2.3.3" />
1717
<PackageReference Include="GGroupp.Internal.Timesheet.FavoriteProjectSet.Get.InOut" Version="1.8.1" />
1818
<PackageReference Include="GGroupp.Internal.Timesheet.ProjectSet.Search.InOut" Version="1.3.1" />

src/Timesheet.Create/UITextHelper/UITextHelper.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
using System.Globalization;
2+
using System.Text;
3+
using GGroupp.Infra.Bot.Builder;
4+
using Microsoft.Bot.Builder;
25

36
namespace GGroupp.Internal.Timesheet;
47

@@ -23,4 +26,12 @@ internal static string ToStringRussianCulture(this TimesheetProjectType projectT
2326
TimesheetProjectType.Incident => "Инцидент",
2427
_ => "Проект"
2528
};
29+
30+
internal static string CreateBoldText(this ITurnContext turnContext, string message)
31+
=>
32+
turnContext.IsNotTelegramChannel() switch
33+
{
34+
true => new StringBuilder().Append("**").Append(message).Append("**").ToString(),
35+
_ => new StringBuilder().Append("<b>").Append(message).Append("</b>").ToString()
36+
};
2637
}

0 commit comments

Comments
 (0)