diff --git a/.editorconfig b/.editorconfig index 0117830..84580ba 100644 --- a/.editorconfig +++ b/.editorconfig @@ -347,10 +347,6 @@ dotnet_naming_rule.members_are_pascal_case.symbols = memb dotnet_naming_rule.members_are_pascal_case.style = const_field_symbols csharp_style_prefer_method_group_conversion = true:silent csharp_style_prefer_top_level_statements = true:silent -csharp_style_prefer_primary_constructors = true:suggestion -[*.{cs,vb}] -dotnet_style_operator_placement_when_wrapping = beginning_of_line -tab_width = 4 indent_size = 4 end_of_line = crlf dotnet_style_coalesce_expression = true:error diff --git a/src/Kentico.Xperience.Algolia/Admin/Providers/ChannelOptionsProvider.cs b/src/Kentico.Xperience.Algolia/Admin/Providers/ChannelOptionsProvider.cs index 92cc711..0286bf6 100644 --- a/src/Kentico.Xperience.Algolia/Admin/Providers/ChannelOptionsProvider.cs +++ b/src/Kentico.Xperience.Algolia/Admin/Providers/ChannelOptionsProvider.cs @@ -4,7 +4,7 @@ namespace Kentico.Xperience.Algolia.Admin.Providers; -public class ChannelOptionsProvider : IDropDownOptionsProvider +internal class ChannelOptionsProvider : IDropDownOptionsProvider { private readonly IInfoProvider channelInfoProvider; diff --git a/src/Kentico.Xperience.Algolia/Admin/Providers/IndexingStrategyOptionsProvider.cs b/src/Kentico.Xperience.Algolia/Admin/Providers/IndexingStrategyOptionsProvider.cs index dd65dd4..8456fb9 100644 --- a/src/Kentico.Xperience.Algolia/Admin/Providers/IndexingStrategyOptionsProvider.cs +++ b/src/Kentico.Xperience.Algolia/Admin/Providers/IndexingStrategyOptionsProvider.cs @@ -3,7 +3,7 @@ namespace Kentico.Xperience.Algolia.Admin; -public class IndexingStrategyOptionsProvider : IDropDownOptionsProvider +internal class IndexingStrategyOptionsProvider : IDropDownOptionsProvider { public Task> GetOptionItems() => Task.FromResult(StrategyStorage.Strategies.Keys.Select(x => new DropDownOptionItem() diff --git a/src/Kentico.Xperience.Algolia/AlgoliaSearchModule.cs b/src/Kentico.Xperience.Algolia/AlgoliaSearchModule.cs index 70411ab..3c8dbe4 100644 --- a/src/Kentico.Xperience.Algolia/AlgoliaSearchModule.cs +++ b/src/Kentico.Xperience.Algolia/AlgoliaSearchModule.cs @@ -21,7 +21,7 @@ internal class AlgoliaSearchModule : Module private IAlgoliaTaskLogger? algoliaTaskLogger; private IAppSettingsService? appSettingsService; private IConversionService? conversionService; - private const string APP_SETTINGS_KEY_INDEXING_DISABLED = "AlgoliaSearchDisableIndexing"; + private const string APP_SETTINGS_KEY_INDEXING_DISABLED = "CMSAlgoliaSearchDisableIndexing"; private bool IndexingDisabled => conversionService?.GetBoolean(appSettingsService?[APP_SETTINGS_KEY_INDEXING_DISABLED], false) ?? false; diff --git a/src/Kentico.Xperience.Algolia/AlgoliaStartupExtensions.cs b/src/Kentico.Xperience.Algolia/AlgoliaStartupExtensions.cs index bc4ce0f..974c355 100644 --- a/src/Kentico.Xperience.Algolia/AlgoliaStartupExtensions.cs +++ b/src/Kentico.Xperience.Algolia/AlgoliaStartupExtensions.cs @@ -1,4 +1,5 @@ -using Algolia.Search.Clients; +using System.Diagnostics; +using Algolia.Search.Clients; using Kentico.Xperience.Algolia.Admin; using Kentico.Xperience.Algolia.Indexing; using Microsoft.Extensions.Configuration; @@ -30,7 +31,9 @@ public static IServiceCollection AddKenticoAlgolia(this IServiceCollection servi { var options = s.GetRequiredService>(); var configuration = new SearchConfig(options.Value.ApplicationId, options.Value.ApiKey); - configuration.DefaultHeaders["User-Agent"] = "Kentico Xperience for Algolia (2.0.2)"; + var fileVersion = FileVersionInfo.GetVersionInfo(typeof(AlgoliaOptions).Assembly.Location); + string versioNumber = new Version(fileVersion.FileVersion ?? "").ToString(3); + configuration.DefaultHeaders["User-Agent"] = $"Kentico Xperience for Algolia ({versioNumber})"; return new SearchClient(configuration); })