20 changed files
UnitTest | ||
AvailabilityExtensionsTest.cs | ||
ColorExtensionsTest.cs | ||
DateTimeExtensionsTest.cs | ||
ListExtensionsTest.cs | ||
StringExtensionsTest.cs | ||
TemperatureExtensionsTest.cs | ||
UnitTest.csproj | ||
WPE.App.Extensions | ||
DateTimeExtensions.cs rename, edit | ||
NavigationManagerExtensions.cs rename | ||
StringExtensions.cs + | ||
WPE.App.Extensions.csproj rename, edit | ||
WPE.App.Utils | ||
Models | ||
Availability.cs | ||
StateColor.cs | ||
TemperatureUnit.cs | ||
AvailabilityExtensions.cs | ||
ColorExtensions.cs | ||
ListExtensions.cs | ||
StringExtensions.cs | ||
TemperatureExtensions.cs | ||
WPE.App.Extensions.sln | ||
AvailabilityExtensionsTest.cs
/UnitTest/AvailabilityExtensionsTest.cs-68/UnitTest/AvailabilityExtensionsTest.cs
Add comment 1 Minus using Microsoft.AspNetCore.Components;
Add comment 2 Minus using Microsoft.Extensions.Logging;
Add comment 3 Minus
Add comment 4 Minus namespace Infsoft.WPE.App.Services.Analytics.Logging
Add comment 5 Minus {
Add comment 6 Minus /// <summary>
Add comment 7 Minus /// Implements <see cref="IAnalyticsService"/> as logging only
Add comment 8 Minus /// </summary>
Add comment 9 Minus internal class LoggingAnalyticsService(ILogger<LoggingAnalyticsService> Logger, IPageTitleCache PageTitleCache, NavigationManager NavigationManager) : IAnalyticsService
Add comment 10 Minus {
Add comment 11 Minus /// <inheritdoc/>
Add comment 12 Minus public Task OnClick(string name, string text, InteractionType interactionType, string location) => Log($"Clicked {interactionType} with name '{name}' and text '{text}' at location {location}");
Add comment 13 Minus
Add comment 14 Minus /// <inheritdoc/>
Add comment 15 Minus public Task OnSearch(int numberOfResults, string searchLocation, string? term = null, Dictionary<string, List<string>>? filters = null, DateTime? startDate = null, DateTime? endDate = null)
Add comment 16 Minus {
Add comment 17 Minus var msg = "Performed search";
Add comment 18 Minus var restrictions = new List<string>();
Add comment 19 Minus if (term is not null)
Add comment 20 Minus restrictions.Add($"term {term}");
Add comment 21 Minus if (filters is not null)
Add comment 22 Minus restrictions.Add($"filters: {string.Join(';', filters.Select(kv => $"{kv.Key}={string.Join(',', kv.Value)}"))}");
Add comment 23 Minus if (startDate is not null)
Add comment 24 Minus restrictions.Add($"startDate: {startDate.Value:o}");
Add comment 25 Minus if (endDate is not null)
Add comment 26 Minus restrictions.Add($"endDate: {endDate.Value:o}");
Add comment 27 Minus if (restrictions.Count != 0)
Add comment 28 Minus msg += $" with {string.Join(" and ", restrictions)}";
Add comment 29 Minus msg += $" at location {searchLocation} returning {numberOfResults} results";
Add comment 30 Minus
Add comment 31 Minus if (startDate is null && endDate is not null)
Add comment 32 Minus Logger.LogWarning("End date was logged without start date, this is not supported");
Add comment 33 Minus return Log(msg);
Add comment 34 Minus }
Add comment 35 Minus
Add comment 36 Minus /// <inheritdoc/>
Add comment 37 Minus public async Task Init() {
Add comment 38 Minus await Log("Initialized service");
Add comment 39 Minus
Add comment 40 Minus await OnPageView(NavigationManager.ToBaseRelativePath(NavigationManager.Uri).Split('?')[0]);
Add comment 41 Minus }
Add comment 42 Minus
Add comment 43 Minus /// <inheritdoc/>
Add comment 44 Minus public Task OnConsentUpdate(Dictionary<string, bool> givenConsents) => Log($"Updated consent: {string.Join(',', givenConsents.Select(consent => $"{consent.Key}: {consent.Value}"))}");
Add comment 45 Minus
Add comment 46 Minus /// <inheritdoc/>
Add comment 47 Minus public Task OnLogin() => Log("Perfomed login");
Add comment 48 Minus
Add comment 49 Minus /// <inheritdoc/>
Add comment 50 Minus public Task OnPageView(string relativeUrl) {
Add comment 51 Minus relativeUrl = $"/{relativeUrl}";
Add comment 52 Minus return Log($"Opened page with name '{relativeUrl}' and title '{(PageTitleCache.TryGetPageTitle(relativeUrl, out var title) ? title : "Unknown")}'");
Add comment 53 Minus }
Add comment 54 Minus
Add comment 55 Minus /// <inheritdoc/>
Add comment 56 Minus public Task OnSilentLogin() => Log("Perfomed silent login");
Add comment 57 Minus
Add comment 58 Minus
Add comment 59 Minus private Task Log(string message)
Add comment 60 Minus {
Add comment 61 Minus using var scope = Logger.BeginScope("Analytics");
Add comment 62 Minus Logger.LogInformation("{Message}", message);
Add comment 63 Minus return Task.CompletedTask;
Add comment 64 Minus }
Add comment 65 Minus }
Add comment 66 Minus
Add comment 67 Minus }
Add comment 68 Minus
Add comment 1 Minus using Microsoft.AspNetCore.Components;
Add comment 2 Minus using Microsoft.Extensions.Logging;
Add comment 3 Minus
Add comment 4 Minus namespace Infsoft.WPE.App.Services.Analytics.Logging
Add comment 5 Minus {
Add comment 6 Minus /// <summary>
Add comment 7 Minus /// Implements <see cref="IAnalyticsService"/> as logging only
Add comment 8 Minus /// </summary>
Add comment 9 Minus internal class LoggingAnalyticsService(ILogger<LoggingAnalyticsService> Logger, IPageTitleCache PageTitleCache, NavigationManager NavigationManager) : IAnalyticsService
Add comment 10 Minus {
Add comment 11 Minus /// <inheritdoc/>
Add comment 12 Minus public Task OnClick(string name, string text, InteractionType interactionType, string location) => Log($"Clicked {interactionType} with name '{name}' and text '{text}' at location {location}");
Add comment 13 Minus
Add comment 14 Minus /// <inheritdoc/>
Add comment 15 Minus public Task OnSearch(int numberOfResults, string searchLocation, string? term = null, Dictionary<string, List<string>>? filters = null, DateTime? startDate = null, DateTime? endDate = null)
Add comment 16 Minus {
Add comment 17 Minus var msg = "Performed search";
Add comment 18 Minus var restrictions = new List<string>();
Add comment 19 Minus if (term is not null)
Add comment 20 Minus restrictions.Add($"term {term}");
Add comment 21 Minus if (filters is not null)
Add comment 22 Minus restrictions.Add($"filters: {string.Join(';', filters.Select(kv => $"{kv.Key}={string.Join(',', kv.Value)}"))}");
Add comment 23 Minus if (startDate is not null)
Add comment 24 Minus restrictions.Add($"startDate: {startDate.Value:o}");
Add comment 25 Minus if (endDate is not null)
Add comment 26 Minus restrictions.Add($"endDate: {endDate.Value:o}");
Add comment 27 Minus if (restrictions.Count != 0)
Add comment 28 Minus msg += $" with {string.Join(" and ", restrictions)}";
Add comment 29 Minus msg += $" at location {searchLocation} returning {numberOfResults} results";
Add comment 30 Minus
Add comment 31 Minus if (startDate is null && endDate is not null)
Add comment 32 Minus Logger.LogWarning("End date was logged without start date, this is not supported");
Add comment 33 Minus return Log(msg);
Add comment 34 Minus }
Add comment 35 Minus
Add comment 36 Minus /// <inheritdoc/>
Add comment 37 Minus public async Task Init() {
Add comment 38 Minus await Log("Initialized service");
Add comment 39 Minus
Add comment 40 Minus await OnPageView(NavigationManager.ToBaseRelativePath(NavigationManager.Uri).Split('?')[0]);
Add comment 41 Minus }
Add comment 42 Minus
Add comment 43 Minus /// <inheritdoc/>
Add comment 44 Minus public Task OnConsentUpdate(Dictionary<string, bool> givenConsents) => Log($"Updated consent: {string.Join(',', givenConsents.Select(consent => $"{consent.Key}: {consent.Value}"))}");
Add comment 45 Minus
Add comment 46 Minus /// <inheritdoc/>
Add comment 47 Minus public Task OnLogin() => Log("Perfomed login");
Add comment 48 Minus
Add comment 49 Minus /// <inheritdoc/>
Add comment 50 Minus public Task OnPageView(string relativeUrl) {
Add comment 51 Minus relativeUrl = $"/{relativeUrl}";
Add comment 52 Minus return Log($"Opened page with name '{relativeUrl}' and title '{(PageTitleCache.TryGetPageTitle(relativeUrl, out var title) ? title : "Unknown")}'");
Add comment 53 Minus }
Add comment 54 Minus
Add comment 55 Minus /// <inheritdoc/>
Add comment 56 Minus public Task OnSilentLogin() => Log("Perfomed silent login");
Add comment 57 Minus
Add comment 58 Minus
Add comment 59 Minus private Task Log(string message)
Add comment 60 Minus {
Add comment 61 Minus using var scope = Logger.BeginScope("Analytics");
Add comment 62 Minus Logger.LogInformation("{Message}", message);
Add comment 63 Minus return Task.CompletedTask;
Add comment 64 Minus }
Add comment 65 Minus }
Add comment 66 Minus
Add comment 67 Minus }
Add comment 68 Minus
DateTimeExtensionsTest.cs
/UnitTest/DateTimeExtensionsTest.cs-68/UnitTest/DateTimeExtensionsTest.cs
Add comment 1 Minus using Microsoft.AspNetCore.Components;
Add comment 2 Minus using Microsoft.Extensions.Logging;
Add comment 3 Minus
Add comment 4 Minus namespace Infsoft.WPE.App.Services.Analytics.Logging
Add comment 5 Minus {
Add comment 6 Minus /// <summary>
Add comment 7 Minus /// Implements <see cref="IAnalyticsService"/> as logging only
Add comment 8 Minus /// </summary>
Add comment 9 Minus internal class LoggingAnalyticsService(ILogger<LoggingAnalyticsService> Logger, IPageTitleCache PageTitleCache, NavigationManager NavigationManager) : IAnalyticsService
Add comment 10 Minus {
Add comment 11 Minus /// <inheritdoc/>
Add comment 12 Minus public Task OnClick(string name, string text, InteractionType interactionType, string location) => Log($"Clicked {interactionType} with name '{name}' and text '{text}' at location {location}");
Add comment 13 Minus
Add comment 14 Minus /// <inheritdoc/>
Add comment 15 Minus public Task OnSearch(int numberOfResults, string searchLocation, string? term = null, Dictionary<string, List<string>>? filters = null, DateTime? startDate = null, DateTime? endDate = null)
Add comment 16 Minus {
Add comment 17 Minus var msg = "Performed search";
Add comment 18 Minus var restrictions = new List<string>();
Add comment 19 Minus if (term is not null)
Add comment 20 Minus restrictions.Add($"term {term}");
Add comment 21 Minus if (filters is not null)
Add comment 22 Minus restrictions.Add($"filters: {string.Join(';', filters.Select(kv => $"{kv.Key}={string.Join(',', kv.Value)}"))}");
Add comment 23 Minus if (startDate is not null)
Add comment 24 Minus restrictions.Add($"startDate: {startDate.Value:o}");
Add comment 25 Minus if (endDate is not null)
Add comment 26 Minus restrictions.Add($"endDate: {endDate.Value:o}");
Add comment 27 Minus if (restrictions.Count != 0)
Add comment 28 Minus msg += $" with {string.Join(" and ", restrictions)}";
Add comment 29 Minus msg += $" at location {searchLocation} returning {numberOfResults} results";
Add comment 30 Minus
Add comment 31 Minus if (startDate is null && endDate is not null)
Add comment 32 Minus Logger.LogWarning("End date was logged without start date, this is not supported");
Add comment 33 Minus return Log(msg);
Add comment 34 Minus }
Add comment 35 Minus
Add comment 36 Minus /// <inheritdoc/>
Add comment 37 Minus public async Task Init() {
Add comment 38 Minus await Log("Initialized service");
Add comment 39 Minus
Add comment 40 Minus await OnPageView(NavigationManager.ToBaseRelativePath(NavigationManager.Uri).Split('?')[0]);
Add comment 41 Minus }
Add comment 42 Minus
Add comment 43 Minus /// <inheritdoc/>
Add comment 44 Minus public Task OnConsentUpdate(Dictionary<string, bool> givenConsents) => Log($"Updated consent: {string.Join(',', givenConsents.Select(consent => $"{consent.Key}: {consent.Value}"))}");
Add comment 45 Minus
Add comment 46 Minus /// <inheritdoc/>
Add comment 47 Minus public Task OnLogin() => Log("Perfomed login");
Add comment 48 Minus
Add comment 49 Minus /// <inheritdoc/>
Add comment 50 Minus public Task OnPageView(string relativeUrl) {
Add comment 51 Minus relativeUrl = $"/{relativeUrl}";
Add comment 52 Minus return Log($"Opened page with name '{relativeUrl}' and title '{(PageTitleCache.TryGetPageTitle(relativeUrl, out var title) ? title : "Unknown")}'");
Add comment 53 Minus }
Add comment 54 Minus
Add comment 55 Minus /// <inheritdoc/>
Add comment 56 Minus public Task OnSilentLogin() => Log("Perfomed silent login");
Add comment 57 Minus
Add comment 58 Minus
Add comment 59 Minus private Task Log(string message)
Add comment 60 Minus {
Add comment 61 Minus using var scope = Logger.BeginScope("Analytics");
Add comment 62 Minus Logger.LogInformation("{Message}", message);
Add comment 63 Minus return Task.CompletedTask;
Add comment 64 Minus }
Add comment 65 Minus }
Add comment 66 Minus
Add comment 67 Minus }
Add comment 68 Minus
Add comment 1 Minus using Microsoft.AspNetCore.Components;
Add comment 2 Minus using Microsoft.Extensions.Logging;
Add comment 3 Minus
Add comment 4 Minus namespace Infsoft.WPE.App.Services.Analytics.Logging
Add comment 5 Minus {
Add comment 6 Minus /// <summary>
Add comment 7 Minus /// Implements <see cref="IAnalyticsService"/> as logging only
Add comment 8 Minus /// </summary>
Add comment 9 Minus internal class LoggingAnalyticsService(ILogger<LoggingAnalyticsService> Logger, IPageTitleCache PageTitleCache, NavigationManager NavigationManager) : IAnalyticsService
Add comment 10 Minus {
Add comment 11 Minus /// <inheritdoc/>
Add comment 12 Minus public Task OnClick(string name, string text, InteractionType interactionType, string location) => Log($"Clicked {interactionType} with name '{name}' and text '{text}' at location {location}");
Add comment 13 Minus
Add comment 14 Minus /// <inheritdoc/>
Add comment 15 Minus public Task OnSearch(int numberOfResults, string searchLocation, string? term = null, Dictionary<string, List<string>>? filters = null, DateTime? startDate = null, DateTime? endDate = null)
Add comment 16 Minus {
Add comment 17 Minus var msg = "Performed search";
Add comment 18 Minus var restrictions = new List<string>();
Add comment 19 Minus if (term is not null)
Add comment 20 Minus restrictions.Add($"term {term}");
Add comment 21 Minus if (filters is not null)
Add comment 22 Minus restrictions.Add($"filters: {string.Join(';', filters.Select(kv => $"{kv.Key}={string.Join(',', kv.Value)}"))}");
Add comment 23 Minus if (startDate is not null)
Add comment 24 Minus restrictions.Add($"startDate: {startDate.Value:o}");
Add comment 25 Minus if (endDate is not null)
Add comment 26 Minus restrictions.Add($"endDate: {endDate.Value:o}");
Add comment 27 Minus if (restrictions.Count != 0)
Add comment 28 Minus msg += $" with {string.Join(" and ", restrictions)}";
Add comment 29 Minus msg += $" at location {searchLocation} returning {numberOfResults} results";
Add comment 30 Minus
Add comment 31 Minus if (startDate is null && endDate is not null)
Add comment 32 Minus Logger.LogWarning("End date was logged without start date, this is not supported");
Add comment 33 Minus return Log(msg);
Add comment 34 Minus }
Add comment 35 Minus
Add comment 36 Minus /// <inheritdoc/>
Add comment 37 Minus public async Task Init() {
Add comment 38 Minus await Log("Initialized service");
Add comment 39 Minus
Add comment 40 Minus await OnPageView(NavigationManager.ToBaseRelativePath(NavigationManager.Uri).Split('?')[0]);
Add comment 41 Minus }
Add comment 42 Minus
Add comment 43 Minus /// <inheritdoc/>
Add comment 44 Minus public Task OnConsentUpdate(Dictionary<string, bool> givenConsents) => Log($"Updated consent: {string.Join(',', givenConsents.Select(consent => $"{consent.Key}: {consent.Value}"))}");
Add comment 45 Minus
Add comment 46 Minus /// <inheritdoc/>
Add comment 47 Minus public Task OnLogin() => Log("Perfomed login");
Add comment 48 Minus
Add comment 49 Minus /// <inheritdoc/>
Add comment 50 Minus public Task OnPageView(string relativeUrl) {
Add comment 51 Minus relativeUrl = $"/{relativeUrl}";
Add comment 52 Minus return Log($"Opened page with name '{relativeUrl}' and title '{(PageTitleCache.TryGetPageTitle(relativeUrl, out var title) ? title : "Unknown")}'");
Add comment 53 Minus }
Add comment 54 Minus
Add comment 55 Minus /// <inheritdoc/>
Add comment 56 Minus public Task OnSilentLogin() => Log("Perfomed silent login");
Add comment 57 Minus
Add comment 58 Minus
Add comment 59 Minus private Task Log(string message)
Add comment 60 Minus {
Add comment 61 Minus using var scope = Logger.BeginScope("Analytics");
Add comment 62 Minus Logger.LogInformation("{Message}", message);
Add comment 63 Minus return Task.CompletedTask;
Add comment 64 Minus }
Add comment 65 Minus }
Add comment 66 Minus
Add comment 67 Minus }
Add comment 68 Minus
Add comment 1 Minus using Microsoft.AspNetCore.Components;
Add comment 2 Minus using Microsoft.Extensions.Logging;
Add comment 3 Minus
Add comment 4 Minus namespace Infsoft.WPE.App.Services.Analytics.Logging
Add comment 5 Minus {
Add comment 6 Minus /// <summary>
Add comment 7 Minus /// Implements <see cref="IAnalyticsService"/> as logging only
Add comment 8 Minus /// </summary>
Add comment 9 Minus internal class LoggingAnalyticsService(ILogger<LoggingAnalyticsService> Logger, IPageTitleCache PageTitleCache, NavigationManager NavigationManager) : IAnalyticsService
Add comment 10 Minus {
Add comment 11 Minus /// <inheritdoc/>
Add comment 12 Minus public Task OnClick(string name, string text, InteractionType interactionType, string location) => Log($"Clicked {interactionType} with name '{name}' and text '{text}' at location {location}");
Add comment 13 Minus
Add comment 14 Minus /// <inheritdoc/>
Add comment 15 Minus public Task OnSearch(int numberOfResults, string searchLocation, string? term = null, Dictionary<string, List<string>>? filters = null, DateTime? startDate = null, DateTime? endDate = null)
Add comment 16 Minus {
Add comment 17 Minus var msg = "Performed search";
Add comment 18 Minus var restrictions = new List<string>();
Add comment 19 Minus if (term is not null)
Add comment 20 Minus restrictions.Add($"term {term}");
Add comment 21 Minus if (filters is not null)
Add comment 22 Minus restrictions.Add($"filters: {string.Join(';', filters.Select(kv => $"{kv.Key}={string.Join(',', kv.Value)}"))}");
Add comment 23 Minus if (startDate is not null)
Add comment 24 Minus restrictions.Add($"startDate: {startDate.Value:o}");
Add comment 25 Minus if (endDate is not null)
Add comment 26 Minus restrictions.Add($"endDate: {endDate.Value:o}");
Add comment 27 Minus if (restrictions.Count != 0)
Add comment 28 Minus msg += $" with {string.Join(" and ", restrictions)}";
Add comment 29 Minus msg += $" at location {searchLocation} returning {numberOfResults} results";
Add comment 30 Minus
Add comment 31 Minus if (startDate is null && endDate is not null)
Add comment 32 Minus Logger.LogWarning("End date was logged without start date, this is not supported");
Add comment 33 Minus return Log(msg);
Add comment 34 Minus }
Add comment 35 Minus
Add comment 36 Minus /// <inheritdoc/>
Add comment 37 Minus public async Task Init() {
Add comment 38 Minus await Log("Initialized service");
Add comment 39 Minus
Add comment 40 Minus await OnPageView(NavigationManager.ToBaseRelativePath(NavigationManager.Uri).Split('?')[0]);
Add comment 41 Minus }
Add comment 42 Minus
Add comment 43 Minus /// <inheritdoc/>
Add comment 44 Minus public Task OnConsentUpdate(Dictionary<string, bool> givenConsents) => Log($"Updated consent: {string.Join(',', givenConsents.Select(consent => $"{consent.Key}: {consent.Value}"))}");
Add comment 45 Minus
Add comment 46 Minus /// <inheritdoc/>
Add comment 47 Minus public Task OnLogin() => Log("Perfomed login");
Add comment 48 Minus
Add comment 49 Minus /// <inheritdoc/>
Add comment 50 Minus public Task OnPageView(string relativeUrl) {
Add comment 51 Minus relativeUrl = $"/{relativeUrl}";
Add comment 52 Minus return Log($"Opened page with name '{relativeUrl}' and title '{(PageTitleCache.TryGetPageTitle(relativeUrl, out var title) ? title : "Unknown")}'");
Add comment 53 Minus }
Add comment 54 Minus
Add comment 55 Minus /// <inheritdoc/>
Add comment 56 Minus public Task OnSilentLogin() => Log("Perfomed silent login");
Add comment 57 Minus
Add comment 58 Minus
Add comment 59 Minus private Task Log(string message)
Add comment 60 Minus {
Add comment 61 Minus using var scope = Logger.BeginScope("Analytics");
Add comment 62 Minus Logger.LogInformation("{Message}", message);
Add comment 63 Minus return Task.CompletedTask;
Add comment 64 Minus }
Add comment 65 Minus }
Add comment 66 Minus
Add comment 67 Minus }
Add comment 68 Minus
TemperatureExtensionsTest.cs
/UnitTest/TemperatureExtensionsTest.cs-68/UnitTest/TemperatureExtensionsTest.cs
Add comment 1 Minus using Microsoft.AspNetCore.Components;
Add comment 2 Minus using Microsoft.Extensions.Logging;
Add comment 3 Minus
Add comment 4 Minus namespace Infsoft.WPE.App.Services.Analytics.Logging
Add comment 5 Minus {
Add comment 6 Minus /// <summary>
Add comment 7 Minus /// Implements <see cref="IAnalyticsService"/> as logging only
Add comment 8 Minus /// </summary>
Add comment 9 Minus internal class LoggingAnalyticsService(ILogger<LoggingAnalyticsService> Logger, IPageTitleCache PageTitleCache, NavigationManager NavigationManager) : IAnalyticsService
Add comment 10 Minus {
Add comment 11 Minus /// <inheritdoc/>
Add comment 12 Minus public Task OnClick(string name, string text, InteractionType interactionType, string location) => Log($"Clicked {interactionType} with name '{name}' and text '{text}' at location {location}");
Add comment 13 Minus
Add comment 14 Minus /// <inheritdoc/>
Add comment 15 Minus public Task OnSearch(int numberOfResults, string searchLocation, string? term = null, Dictionary<string, List<string>>? filters = null, DateTime? startDate = null, DateTime? endDate = null)
Add comment 16 Minus {
Add comment 17 Minus var msg = "Performed search";
Add comment 18 Minus var restrictions = new List<string>();
Add comment 19 Minus if (term is not null)
Add comment 20 Minus restrictions.Add($"term {term}");
Add comment 21 Minus if (filters is not null)
Add comment 22 Minus restrictions.Add($"filters: {string.Join(';', filters.Select(kv => $"{kv.Key}={string.Join(',', kv.Value)}"))}");
Add comment 23 Minus if (startDate is not null)
Add comment 24 Minus restrictions.Add($"startDate: {startDate.Value:o}");
Add comment 25 Minus if (endDate is not null)
Add comment 26 Minus restrictions.Add($"endDate: {endDate.Value:o}");
Add comment 27 Minus if (restrictions.Count != 0)
Add comment 28 Minus msg += $" with {string.Join(" and ", restrictions)}";
Add comment 29 Minus msg += $" at location {searchLocation} returning {numberOfResults} results";
Add comment 30 Minus
Add comment 31 Minus if (startDate is null && endDate is not null)
Add comment 32 Minus Logger.LogWarning("End date was logged without start date, this is not supported");
Add comment 33 Minus return Log(msg);
Add comment 34 Minus }
Add comment 35 Minus
Add comment 36 Minus /// <inheritdoc/>
Add comment 37 Minus public async Task Init() {
Add comment 38 Minus await Log("Initialized service");
Add comment 39 Minus
Add comment 40 Minus await OnPageView(NavigationManager.ToBaseRelativePath(NavigationManager.Uri).Split('?')[0]);
Add comment 41 Minus }
Add comment 42 Minus
Add comment 43 Minus /// <inheritdoc/>
Add comment 44 Minus public Task OnConsentUpdate(Dictionary<string, bool> givenConsents) => Log($"Updated consent: {string.Join(',', givenConsents.Select(consent => $"{consent.Key}: {consent.Value}"))}");
Add comment 45 Minus
Add comment 46 Minus /// <inheritdoc/>
Add comment 47 Minus public Task OnLogin() => Log("Perfomed login");
Add comment 48 Minus
Add comment 49 Minus /// <inheritdoc/>
Add comment 50 Minus public Task OnPageView(string relativeUrl) {
Add comment 51 Minus relativeUrl = $"/{relativeUrl}";
Add comment 52 Minus return Log($"Opened page with name '{relativeUrl}' and title '{(PageTitleCache.TryGetPageTitle(relativeUrl, out var title) ? title : "Unknown")}'");
Add comment 53 Minus }
Add comment 54 Minus
Add comment 55 Minus /// <inheritdoc/>
Add comment 56 Minus public Task OnSilentLogin() => Log("Perfomed silent login");
Add comment 57 Minus
Add comment 58 Minus
Add comment 59 Minus private Task Log(string message)
Add comment 60 Minus {
Add comment 61 Minus using var scope = Logger.BeginScope("Analytics");
Add comment 62 Minus Logger.LogInformation("{Message}", message);
Add comment 63 Minus return Task.CompletedTask;
Add comment 64 Minus }
Add comment 65 Minus }
Add comment 66 Minus
Add comment 67 Minus }
Add comment 68 Minus
Add comment 1 Minus using Microsoft.AspNetCore.Components;
Add comment 2 Minus using Microsoft.Extensions.Logging;
Add comment 3 Minus
Add comment 4 Minus namespace Infsoft.WPE.App.Services.Analytics.Logging
Add comment 5 Minus {
Add comment 6 Minus /// <summary>
Add comment 7 Minus /// Implements <see cref="IAnalyticsService"/> as logging only
Add comment 8 Minus /// </summary>
Add comment 9 Minus internal class LoggingAnalyticsService(ILogger<LoggingAnalyticsService> Logger, IPageTitleCache PageTitleCache, NavigationManager NavigationManager) : IAnalyticsService
Add comment 10 Minus {
Add comment 11 Minus /// <inheritdoc/>
Add comment 12 Minus public Task OnClick(string name, string text, InteractionType interactionType, string location) => Log($"Clicked {interactionType} with name '{name}' and text '{text}' at location {location}");
Add comment 13 Minus
Add comment 14 Minus /// <inheritdoc/>
Add comment 15 Minus public Task OnSearch(int numberOfResults, string searchLocation, string? term = null, Dictionary<string, List<string>>? filters = null, DateTime? startDate = null, DateTime? endDate = null)
Add comment 16 Minus {
Add comment 17 Minus var msg = "Performed search";
Add comment 18 Minus var restrictions = new List<string>();
Add comment 19 Minus if (term is not null)
Add comment 20 Minus restrictions.Add($"term {term}");
Add comment 21 Minus if (filters is not null)
Add comment 22 Minus restrictions.Add($"filters: {string.Join(';', filters.Select(kv => $"{kv.Key}={string.Join(',', kv.Value)}"))}");
Add comment 23 Minus if (startDate is not null)
Add comment 24 Minus restrictions.Add($"startDate: {startDate.Value:o}");
Add comment 25 Minus if (endDate is not null)
Add comment 26 Minus restrictions.Add($"endDate: {endDate.Value:o}");
Add comment 27 Minus if (restrictions.Count != 0)
Add comment 28 Minus msg += $" with {string.Join(" and ", restrictions)}";
Add comment 29 Minus msg += $" at location {searchLocation} returning {numberOfResults} results";
Add comment 30 Minus
Add comment 31 Minus if (startDate is null && endDate is not null)
Add comment 32 Minus Logger.LogWarning("End date was logged without start date, this is not supported");
Add comment 33 Minus return Log(msg);
Add comment 34 Minus }
Add comment 35 Minus
Add comment 36 Minus /// <inheritdoc/>
Add comment 37 Minus public async Task Init() {
Add comment 38 Minus await Log("Initialized service");
Add comment 39 Minus
Add comment 40 Minus await OnPageView(NavigationManager.ToBaseRelativePath(NavigationManager.Uri).Split('?')[0]);
Add comment 41 Minus }
Add comment 42 Minus
Add comment 43 Minus /// <inheritdoc/>
Add comment 44 Minus public Task OnConsentUpdate(Dictionary<string, bool> givenConsents) => Log($"Updated consent: {string.Join(',', givenConsents.Select(consent => $"{consent.Key}: {consent.Value}"))}");
Add comment 45 Minus
Add comment 46 Minus /// <inheritdoc/>
Add comment 47 Minus public Task OnLogin() => Log("Perfomed login");
Add comment 48 Minus
Add comment 49 Minus /// <inheritdoc/>
Add comment 50 Minus public Task OnPageView(string relativeUrl) {
Add comment 51 Minus relativeUrl = $"/{relativeUrl}";
Add comment 52 Minus return Log($"Opened page with name '{relativeUrl}' and title '{(PageTitleCache.TryGetPageTitle(relativeUrl, out var title) ? title : "Unknown")}'");
Add comment 53 Minus }
Add comment 54 Minus
Add comment 55 Minus /// <inheritdoc/>
Add comment 56 Minus public Task OnSilentLogin() => Log("Perfomed silent login");
Add comment 57 Minus
Add comment 58 Minus
Add comment 59 Minus private Task Log(string message)
Add comment 60 Minus {
Add comment 61 Minus using var scope = Logger.BeginScope("Analytics");
Add comment 62 Minus Logger.LogInformation("{Message}", message);
Add comment 63 Minus return Task.CompletedTask;
Add comment 64 Minus }
Add comment 65 Minus }
Add comment 66 Minus
Add comment 67 Minus }
Add comment 68 Minus
DateTimeExtensions.cs
/WPE.App.Extensions/DateTimeExtensions.cs-68/WPE.App.Extensions/DateTimeExtensions.cs
Renamed from
/WPE.App.Utils/DateTimeExtensions.cs
Add comment 1 Minus using Microsoft.AspNetCore.Components;
Add comment 2 Minus using Microsoft.Extensions.Logging;
Add comment 3 Minus
Add comment 4 Minus namespace Infsoft.WPE.App.Services.Analytics.Logging
Add comment 5 Minus {
Add comment 6 Minus /// <summary>
Add comment 7 Minus /// Implements <see cref="IAnalyticsService"/> as logging only
Add comment 8 Minus /// </summary>
Add comment 9 Minus internal class LoggingAnalyticsService(ILogger<LoggingAnalyticsService> Logger, IPageTitleCache PageTitleCache, NavigationManager NavigationManager) : IAnalyticsService
Add comment 10 Minus {
Add comment 11 Minus /// <inheritdoc/>
Add comment 12 Minus public Task OnClick(string name, string text, InteractionType interactionType, string location) => Log($"Clicked {interactionType} with name '{name}' and text '{text}' at location {location}");
Add comment 13 Minus
Add comment 14 Minus /// <inheritdoc/>
Add comment 15 Minus public Task OnSearch(int numberOfResults, string searchLocation, string? term = null, Dictionary<string, List<string>>? filters = null, DateTime? startDate = null, DateTime? endDate = null)
Add comment 16 Minus {
Add comment 17 Minus var msg = "Performed search";
Add comment 18 Minus var restrictions = new List<string>();
Add comment 19 Minus if (term is not null)
Add comment 20 Minus restrictions.Add($"term {term}");
Add comment 21 Minus if (filters is not null)
Add comment 22 Minus restrictions.Add($"filters: {string.Join(';', filters.Select(kv => $"{kv.Key}={string.Join(',', kv.Value)}"))}");
Add comment 23 Minus if (startDate is not null)
Add comment 24 Minus restrictions.Add($"startDate: {startDate.Value:o}");
Add comment 25 Minus if (endDate is not null)
Add comment 26 Minus restrictions.Add($"endDate: {endDate.Value:o}");
Add comment 27 Minus if (restrictions.Count != 0)
Add comment 28 Minus msg += $" with {string.Join(" and ", restrictions)}";
Add comment 29 Minus msg += $" at location {searchLocation} returning {numberOfResults} results";
Add comment 30 Minus
Add comment 31 Minus if (startDate is null && endDate is not null)
Add comment 32 Minus Logger.LogWarning("End date was logged without start date, this is not supported");
Add comment 33 Minus return Log(msg);
Add comment 34 Minus }
Add comment 35 Minus
Add comment 36 Minus /// <inheritdoc/>
Add comment 37 Minus public async Task Init() {
Add comment 38 Minus await Log("Initialized service");
Add comment 39 Minus
Add comment 40 Minus await OnPageView(NavigationManager.ToBaseRelativePath(NavigationManager.Uri).Split('?')[0]);
Add comment 41 Minus }
Add comment 42 Minus
Add comment 43 Minus /// <inheritdoc/>
Add comment 44 Minus public Task OnConsentUpdate(Dictionary<string, bool> givenConsents) => Log($"Updated consent: {string.Join(',', givenConsents.Select(consent => $"{consent.Key}: {consent.Value}"))}");
Add comment 45 Minus
Add comment 46 Minus /// <inheritdoc/>
Add comment 47 Minus public Task OnLogin() => Log("Perfomed login");
Add comment 48 Minus
Add comment 49 Minus /// <inheritdoc/>
Add comment 50 Minus public Task OnPageView(string relativeUrl) {
Add comment 51 Minus relativeUrl = $"/{relativeUrl}";
Add comment 52 Minus return Log($"Opened page with name '{relativeUrl}' and title '{(PageTitleCache.TryGetPageTitle(relativeUrl, out var title) ? title : "Unknown")}'");
Add comment 53 Minus }
Add comment 54 Minus
Add comment 55 Minus /// <inheritdoc/>
Add comment 56 Minus public Task OnSilentLogin() => Log("Perfomed silent login");
Add comment 57 Minus
Add comment 58 Minus
Add comment 59 Minus private Task Log(string message)
Add comment 60 Minus {
Add comment 61 Minus using var scope = Logger.BeginScope("Analytics");
Add comment 62 Minus Logger.LogInformation("{Message}", message);
Add comment 63 Minus return Task.CompletedTask;
Add comment 64 Minus }
Add comment 65 Minus }
Add comment 66 Minus
Add comment 67 Minus }
Add comment 68 Minus
NavigationManagerExtensions.cs
/WPE.App.Extensions/NavigationManagerExtensions.cs/WPE.App.Extensions/NavigationManagerExtensions.cs
Renamed from
/WPE.App.Utils/NavigationManagerExtensions.cs
The file content is identical.
StringExtensions.cs
/WPE.App.Extensions/StringExtensions.cs/WPE.App.Extensions/StringExtensions.cs
WPE.App.Extensions.csproj
/WPE.App.Extensions/WPE.App.Extensions.csproj/WPE.App.Extensions/WPE.App.Extensions.csproj
Renamed from
/WPE.App.Utils/WPE.App.Extensions.csproj
TemperatureUnit.cs
/WPE.App.Utils/Models/TemperatureUnit.cs/WPE.App.Utils/Models/TemperatureUnit.cs
AvailabilityExtensions.cs
/WPE.App.Utils/AvailabilityExtensions.cs/WPE.App.Utils/AvailabilityExtensions.cs
TemperatureExtensions.cs
/WPE.App.Utils/TemperatureExtensions.cs/WPE.App.Utils/TemperatureExtensions.cs