Add calendar service-down support to personal report
This commit is contained in:
@@ -35,6 +35,7 @@ public sealed class JiboExperienceCatalog
|
|||||||
public IReadOnlyList<string> WeatherServiceDownReplies { get; init; } = [];
|
public IReadOnlyList<string> WeatherServiceDownReplies { get; init; } = [];
|
||||||
public IReadOnlyList<string> CalendarNothingTodayReplies { get; init; } = [];
|
public IReadOnlyList<string> CalendarNothingTodayReplies { get; init; } = [];
|
||||||
public IReadOnlyList<string> CalendarNothingReplies { get; init; } = [];
|
public IReadOnlyList<string> CalendarNothingReplies { get; init; } = [];
|
||||||
|
public IReadOnlyList<string> CalendarServiceDownReplies { get; init; } = [];
|
||||||
public IReadOnlyList<string> CalendarOutroReplies { get; init; } = [];
|
public IReadOnlyList<string> CalendarOutroReplies { get; init; } = [];
|
||||||
public IReadOnlyList<string> CommuteNowReplies { get; init; } = [];
|
public IReadOnlyList<string> CommuteNowReplies { get; init; } = [];
|
||||||
public IReadOnlyList<string> CommuteServiceDownReplies { get; init; } = [];
|
public IReadOnlyList<string> CommuteServiceDownReplies { get; init; } = [];
|
||||||
|
|||||||
@@ -272,12 +272,23 @@ internal static class PersonalReportOrchestrator
|
|||||||
|
|
||||||
if (toggles.CalendarEnabled)
|
if (toggles.CalendarEnabled)
|
||||||
{
|
{
|
||||||
|
var calendarSummary = ChooseReportSkillTemplate(
|
||||||
|
catalog.CalendarNothingTodayReplies,
|
||||||
|
catalog.CalendarNothingReplies,
|
||||||
|
string.Empty);
|
||||||
|
if (string.IsNullOrWhiteSpace(calendarSummary))
|
||||||
|
calendarSummary = ChooseReportSkillTemplate(
|
||||||
|
catalog.CalendarServiceDownReplies,
|
||||||
|
[],
|
||||||
|
"Looking at your calendar, I don't see anything scheduled today.");
|
||||||
|
|
||||||
|
reportSections.Add(RenderReportSkillTemplate(calendarSummary, userName));
|
||||||
reportSections.Add(
|
reportSections.Add(
|
||||||
RenderReportSkillTemplate(
|
RenderReportSkillTemplate(
|
||||||
ChooseReportSkillTemplate(
|
ChooseReportSkillTemplate(
|
||||||
catalog.CalendarNothingTodayReplies,
|
catalog.CalendarOutroReplies,
|
||||||
catalog.CalendarNothingReplies,
|
[],
|
||||||
"Looking at your calendar, I don't see anything scheduled today."),
|
"And that's your calendar."),
|
||||||
userName));
|
userName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -134,6 +134,9 @@ public static class LegacyMimCatalogImporter
|
|||||||
if (fileName.StartsWith("CalendarNothing", StringComparison.OrdinalIgnoreCase))
|
if (fileName.StartsWith("CalendarNothing", StringComparison.OrdinalIgnoreCase))
|
||||||
return LegacyMimBucket.CalendarNothing;
|
return LegacyMimBucket.CalendarNothing;
|
||||||
|
|
||||||
|
if (fileName.StartsWith("CalendarServiceDown", StringComparison.OrdinalIgnoreCase))
|
||||||
|
return LegacyMimBucket.CalendarServiceDown;
|
||||||
|
|
||||||
if (fileName.StartsWith("CalendarOutro", StringComparison.OrdinalIgnoreCase))
|
if (fileName.StartsWith("CalendarOutro", StringComparison.OrdinalIgnoreCase))
|
||||||
return LegacyMimBucket.CalendarOutro;
|
return LegacyMimBucket.CalendarOutro;
|
||||||
|
|
||||||
@@ -251,6 +254,8 @@ public static class LegacyMimCatalogImporter
|
|||||||
CalendarNothingTodayReplies = Merge(baseCatalog.CalendarNothingTodayReplies,
|
CalendarNothingTodayReplies = Merge(baseCatalog.CalendarNothingTodayReplies,
|
||||||
importedCatalog.CalendarNothingTodayReplies),
|
importedCatalog.CalendarNothingTodayReplies),
|
||||||
CalendarNothingReplies = Merge(baseCatalog.CalendarNothingReplies, importedCatalog.CalendarNothingReplies),
|
CalendarNothingReplies = Merge(baseCatalog.CalendarNothingReplies, importedCatalog.CalendarNothingReplies),
|
||||||
|
CalendarServiceDownReplies = Merge(baseCatalog.CalendarServiceDownReplies,
|
||||||
|
importedCatalog.CalendarServiceDownReplies),
|
||||||
CalendarOutroReplies = Merge(baseCatalog.CalendarOutroReplies, importedCatalog.CalendarOutroReplies),
|
CalendarOutroReplies = Merge(baseCatalog.CalendarOutroReplies, importedCatalog.CalendarOutroReplies),
|
||||||
CommuteNowReplies = Merge(baseCatalog.CommuteNowReplies, importedCatalog.CommuteNowReplies),
|
CommuteNowReplies = Merge(baseCatalog.CommuteNowReplies, importedCatalog.CommuteNowReplies),
|
||||||
CommuteServiceDownReplies = Merge(baseCatalog.CommuteServiceDownReplies,
|
CommuteServiceDownReplies = Merge(baseCatalog.CommuteServiceDownReplies,
|
||||||
@@ -352,6 +357,7 @@ public static class LegacyMimCatalogImporter
|
|||||||
WeatherServiceDown,
|
WeatherServiceDown,
|
||||||
CalendarNothingToday,
|
CalendarNothingToday,
|
||||||
CalendarNothing,
|
CalendarNothing,
|
||||||
|
CalendarServiceDown,
|
||||||
CalendarOutro,
|
CalendarOutro,
|
||||||
CommuteNow,
|
CommuteNow,
|
||||||
CommuteServiceDown,
|
CommuteServiceDown,
|
||||||
@@ -365,6 +371,7 @@ public static class LegacyMimCatalogImporter
|
|||||||
{
|
{
|
||||||
private readonly List<string> _calendarNothingReplies = [];
|
private readonly List<string> _calendarNothingReplies = [];
|
||||||
private readonly List<string> _calendarNothingTodayReplies = [];
|
private readonly List<string> _calendarNothingTodayReplies = [];
|
||||||
|
private readonly List<string> _calendarServiceDownReplies = [];
|
||||||
private readonly List<string> _calendarOutroReplies = [];
|
private readonly List<string> _calendarOutroReplies = [];
|
||||||
private readonly List<string> _commuteNowReplies = [];
|
private readonly List<string> _commuteNowReplies = [];
|
||||||
private readonly List<string> _commuteServiceDownReplies = [];
|
private readonly List<string> _commuteServiceDownReplies = [];
|
||||||
@@ -485,6 +492,9 @@ public static class LegacyMimCatalogImporter
|
|||||||
case LegacyMimBucket.CalendarNothing:
|
case LegacyMimBucket.CalendarNothing:
|
||||||
AddDistinct(_calendarNothingReplies, text);
|
AddDistinct(_calendarNothingReplies, text);
|
||||||
return;
|
return;
|
||||||
|
case LegacyMimBucket.CalendarServiceDown:
|
||||||
|
AddDistinct(_calendarServiceDownReplies, text);
|
||||||
|
return;
|
||||||
case LegacyMimBucket.CalendarOutro:
|
case LegacyMimBucket.CalendarOutro:
|
||||||
AddDistinct(_calendarOutroReplies, text);
|
AddDistinct(_calendarOutroReplies, text);
|
||||||
return;
|
return;
|
||||||
@@ -534,6 +544,7 @@ public static class LegacyMimCatalogImporter
|
|||||||
WeatherServiceDownReplies = [.. _weatherServiceDownReplies],
|
WeatherServiceDownReplies = [.. _weatherServiceDownReplies],
|
||||||
CalendarNothingTodayReplies = [.. _calendarNothingTodayReplies],
|
CalendarNothingTodayReplies = [.. _calendarNothingTodayReplies],
|
||||||
CalendarNothingReplies = [.. _calendarNothingReplies],
|
CalendarNothingReplies = [.. _calendarNothingReplies],
|
||||||
|
CalendarServiceDownReplies = [.. _calendarServiceDownReplies],
|
||||||
CalendarOutroReplies = [.. _calendarOutroReplies],
|
CalendarOutroReplies = [.. _calendarOutroReplies],
|
||||||
CommuteNowReplies = [.. _commuteNowReplies],
|
CommuteNowReplies = [.. _commuteNowReplies],
|
||||||
CommuteServiceDownReplies = [.. _commuteServiceDownReplies],
|
CommuteServiceDownReplies = [.. _commuteServiceDownReplies],
|
||||||
|
|||||||
@@ -265,6 +265,8 @@ public sealed class LegacyMimCatalogImporterTests
|
|||||||
catalog.PersonalReportOutroReplies);
|
catalog.PersonalReportOutroReplies);
|
||||||
Assert.Contains("Looking at your calendar, I don't see anything scheduled today.",
|
Assert.Contains("Looking at your calendar, I don't see anything scheduled today.",
|
||||||
catalog.CalendarNothingTodayReplies);
|
catalog.CalendarNothingTodayReplies);
|
||||||
|
Assert.Contains("Looks like I can't access calendars right now. Sorry.", catalog.CalendarServiceDownReplies);
|
||||||
|
Assert.Contains("And that's your calendar.", catalog.CalendarOutroReplies);
|
||||||
Assert.Contains("Sorry, commute information isn't available right now.", catalog.CommuteServiceDownReplies);
|
Assert.Contains("Sorry, commute information isn't available right now.", catalog.CommuteServiceDownReplies);
|
||||||
Assert.Contains("Here's today's news, from the associated press.", catalog.NewsIntroReplies);
|
Assert.Contains("Here's today's news, from the associated press.", catalog.NewsIntroReplies);
|
||||||
Assert.Contains("And that's what's new in the news.", catalog.NewsOutroReplies);
|
Assert.Contains("And that's what's new in the news.", catalog.NewsOutroReplies);
|
||||||
@@ -316,6 +318,7 @@ public sealed class LegacyMimCatalogImporterTests
|
|||||||
Assert.Contains("Today's high is {high}, and the low is {low}.", catalog.WeatherTodayHighLowReplies);
|
Assert.Contains("Today's high is {high}, and the low is {low}.", catalog.WeatherTodayHighLowReplies);
|
||||||
Assert.Contains("Looking at your calendar, I don't see anything scheduled today.",
|
Assert.Contains("Looking at your calendar, I don't see anything scheduled today.",
|
||||||
catalog.CalendarNothingTodayReplies);
|
catalog.CalendarNothingTodayReplies);
|
||||||
|
Assert.Contains("Looks like I can't access calendars right now. Sorry.", catalog.CalendarServiceDownReplies);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string CreateSeedDirectory()
|
private static string CreateSeedDirectory()
|
||||||
|
|||||||
Reference in New Issue
Block a user