diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Abstractions/IJiboExperienceContentRepository.cs b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Abstractions/IJiboExperienceContentRepository.cs index 1626a18..8ed7e6c 100644 --- a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Abstractions/IJiboExperienceContentRepository.cs +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Abstractions/IJiboExperienceContentRepository.cs @@ -35,6 +35,7 @@ public sealed class JiboExperienceCatalog public IReadOnlyList WeatherServiceDownReplies { get; init; } = []; public IReadOnlyList CalendarNothingTodayReplies { get; init; } = []; public IReadOnlyList CalendarNothingReplies { get; init; } = []; + public IReadOnlyList CalendarServiceDownReplies { get; init; } = []; public IReadOnlyList CalendarOutroReplies { get; init; } = []; public IReadOnlyList CommuteNowReplies { get; init; } = []; public IReadOnlyList CommuteServiceDownReplies { get; init; } = []; diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/PersonalReportOrchestrator.cs b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/PersonalReportOrchestrator.cs index 4dd06d4..6e5b31f 100644 --- a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/PersonalReportOrchestrator.cs +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Application/Services/PersonalReportOrchestrator.cs @@ -272,12 +272,23 @@ internal static class PersonalReportOrchestrator 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( RenderReportSkillTemplate( ChooseReportSkillTemplate( - catalog.CalendarNothingTodayReplies, - catalog.CalendarNothingReplies, - "Looking at your calendar, I don't see anything scheduled today."), + catalog.CalendarOutroReplies, + [], + "And that's your calendar."), userName)); } diff --git a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMimCatalogImporter.cs b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMimCatalogImporter.cs index 59ffe2a..769c8c4 100644 --- a/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMimCatalogImporter.cs +++ b/OpenJibo/src/Jibo.Cloud/dotnet/src/Jibo.Cloud.Infrastructure/Content/LegacyMimCatalogImporter.cs @@ -134,6 +134,9 @@ public static class LegacyMimCatalogImporter if (fileName.StartsWith("CalendarNothing", StringComparison.OrdinalIgnoreCase)) return LegacyMimBucket.CalendarNothing; + if (fileName.StartsWith("CalendarServiceDown", StringComparison.OrdinalIgnoreCase)) + return LegacyMimBucket.CalendarServiceDown; + if (fileName.StartsWith("CalendarOutro", StringComparison.OrdinalIgnoreCase)) return LegacyMimBucket.CalendarOutro; @@ -251,6 +254,8 @@ public static class LegacyMimCatalogImporter CalendarNothingTodayReplies = Merge(baseCatalog.CalendarNothingTodayReplies, importedCatalog.CalendarNothingTodayReplies), CalendarNothingReplies = Merge(baseCatalog.CalendarNothingReplies, importedCatalog.CalendarNothingReplies), + CalendarServiceDownReplies = Merge(baseCatalog.CalendarServiceDownReplies, + importedCatalog.CalendarServiceDownReplies), CalendarOutroReplies = Merge(baseCatalog.CalendarOutroReplies, importedCatalog.CalendarOutroReplies), CommuteNowReplies = Merge(baseCatalog.CommuteNowReplies, importedCatalog.CommuteNowReplies), CommuteServiceDownReplies = Merge(baseCatalog.CommuteServiceDownReplies, @@ -352,6 +357,7 @@ public static class LegacyMimCatalogImporter WeatherServiceDown, CalendarNothingToday, CalendarNothing, + CalendarServiceDown, CalendarOutro, CommuteNow, CommuteServiceDown, @@ -365,6 +371,7 @@ public static class LegacyMimCatalogImporter { private readonly List _calendarNothingReplies = []; private readonly List _calendarNothingTodayReplies = []; + private readonly List _calendarServiceDownReplies = []; private readonly List _calendarOutroReplies = []; private readonly List _commuteNowReplies = []; private readonly List _commuteServiceDownReplies = []; @@ -485,6 +492,9 @@ public static class LegacyMimCatalogImporter case LegacyMimBucket.CalendarNothing: AddDistinct(_calendarNothingReplies, text); return; + case LegacyMimBucket.CalendarServiceDown: + AddDistinct(_calendarServiceDownReplies, text); + return; case LegacyMimBucket.CalendarOutro: AddDistinct(_calendarOutroReplies, text); return; @@ -534,6 +544,7 @@ public static class LegacyMimCatalogImporter WeatherServiceDownReplies = [.. _weatherServiceDownReplies], CalendarNothingTodayReplies = [.. _calendarNothingTodayReplies], CalendarNothingReplies = [.. _calendarNothingReplies], + CalendarServiceDownReplies = [.. _calendarServiceDownReplies], CalendarOutroReplies = [.. _calendarOutroReplies], CommuteNowReplies = [.. _commuteNowReplies], CommuteServiceDownReplies = [.. _commuteServiceDownReplies], diff --git a/OpenJibo/tests/Jibo.Cloud.Tests/Content/LegacyMimCatalogImporterTests.cs b/OpenJibo/tests/Jibo.Cloud.Tests/Content/LegacyMimCatalogImporterTests.cs index b77a8ad..96edf35 100644 --- a/OpenJibo/tests/Jibo.Cloud.Tests/Content/LegacyMimCatalogImporterTests.cs +++ b/OpenJibo/tests/Jibo.Cloud.Tests/Content/LegacyMimCatalogImporterTests.cs @@ -265,6 +265,8 @@ public sealed class LegacyMimCatalogImporterTests catalog.PersonalReportOutroReplies); Assert.Contains("Looking at your calendar, I don't see anything scheduled today.", 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("Here's today's news, from the associated press.", catalog.NewsIntroReplies); 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("Looking at your calendar, I don't see anything scheduled today.", catalog.CalendarNothingTodayReplies); + Assert.Contains("Looks like I can't access calendars right now. Sorry.", catalog.CalendarServiceDownReplies); } private static string CreateSeedDirectory()