Skip to content

Commit

Permalink
Merge pull request #4447 from sbwalker/dev
Browse files Browse the repository at this point in the history
moved Search Provider setting to Search Settings
  • Loading branch information
sbwalker authored Jul 21, 2024
2 parents 81e0fc9 + 66ffad0 commit 4462ae9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
9 changes: 9 additions & 0 deletions Oqtane.Client/Modules/Admin/Search/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
@inject IStringLocalizer<SharedResources> SharedLocalizer

<div class="container">
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="searchprovider" HelpText="Specify the search provider for this site" ResourceKey="SearchProvider">Search Provider: </Label>
<div class="col-sm-9">
<input id="searchprovider" class="form-control" @bind="@_searchProvider" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="enabled" HelpText="Specify if search indexing is enabled" ResourceKey="Enabled">Indexing Enabled? </Label>
<div class="col-sm-9">
Expand Down Expand Up @@ -52,6 +58,7 @@
@code {
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Admin;

private string _searchProvider;
private string _enabled;
private string _lastIndexedOn;
private string _ignorePaths;
Expand All @@ -62,6 +69,7 @@
protected override async Task OnInitializedAsync()
{
var settings = await SettingService.GetSiteSettingsAsync(PageState.Site.SiteId);
_searchProvider = SettingService.GetSetting(settings, "Search_SearchProvider", Constants.DefaultSearchProviderName);
_enabled = SettingService.GetSetting(settings, "Search_Enabled", "True");
_lastIndexedOn = SettingService.GetSetting(settings, "Search_LastIndexedOn", "");
_ignorePaths = SettingService.GetSetting(settings, "Search_IgnorePaths", "");
Expand All @@ -75,6 +83,7 @@
try
{
var settings = await SettingService.GetSiteSettingsAsync(PageState.Site.SiteId);
settings = SettingService.SetSetting(settings, "Search_SearchProvider", _searchProvider);
settings = SettingService.SetSetting(settings, "Search_Enabled", _enabled, true);
settings = SettingService.SetSetting(settings, "Search_LastIndexedOn", _lastIndexedOn, true);
settings = SettingService.SetSetting(settings, "Search_IgnorePaths", _ignorePaths, true);
Expand Down
9 changes: 0 additions & 9 deletions Oqtane.Client/Modules/Admin/Site/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,6 @@
<input id="uploadableFileExt" spellcheck="false" class="form-control" @bind="@_uploadableFiles" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="searchProvider" HelpText="Specify the search provider for this site" ResourceKey="SearchProvider">Search Provider: </Label>
<div class="col-sm-9">
<input id="searchProvider" class="form-control" @bind="@_searchProvider" />
</div>
</div>
</div>
</Section>
<Section Name="PageContent" Heading="Page Content" ResourceKey="PageContent">
Expand Down Expand Up @@ -438,7 +432,6 @@
private string _textEditorProvider = "";
private string _imageFiles = string.Empty;
private string _uploadableFiles = string.Empty;
private string _searchProvider = string.Empty;

private string _headcontent = string.Empty;
private string _bodycontent = string.Empty;
Expand Down Expand Up @@ -528,7 +521,6 @@
_imageFiles = (string.IsNullOrEmpty(_imageFiles)) ? Constants.ImageFiles : _imageFiles;
_uploadableFiles = SettingService.GetSetting(settings, "UploadableFiles", Constants.UploadableFiles);
_uploadableFiles = (string.IsNullOrEmpty(_uploadableFiles)) ? Constants.UploadableFiles : _uploadableFiles;
_searchProvider = SettingService.GetSetting(settings, "SearchProvider", Constants.DefaultSearchProviderName);

// page content
_headcontent = site.HeadContent;
Expand Down Expand Up @@ -735,7 +727,6 @@
settings = SettingService.SetSetting(settings, "TextEditorProvider", _textEditorProvider);
settings = SettingService.SetSetting(settings, "ImageFiles", (_imageFiles != Constants.ImageFiles) ? _imageFiles.Replace(" ", "") : "", false);
settings = SettingService.SetSetting(settings, "UploadableFiles", (_uploadableFiles != Constants.UploadableFiles) ? _uploadableFiles.Replace(" ", "") : "", false);
settings = SettingService.SetSetting(settings, "SearchProvider", _searchProvider);

await SettingService.UpdateSiteSettingsAsync(settings, site.SiteId);

Expand Down
6 changes: 6 additions & 0 deletions Oqtane.Client/Resources/Modules/Admin/Search/Index.resx
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,10 @@
<data name="Error.Save" xml:space="preserve">
<value>Error Saving Search Settings</value>
</data>
<data name="SearchProvider.HelpText" xml:space="preserve">
<value>Specify the search provider for this site</value>
</data>
<data name="SearchProvider.Text" xml:space="preserve">
<value>Search Provider:</value>
</data>
</root>
6 changes: 0 additions & 6 deletions Oqtane.Client/Resources/Modules/Admin/Site/Index.resx
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,4 @@
<data name="Functionality" xml:space="preserve">
<value>Functionality</value>
</data>
<data name="SearchProvider.HelpText" xml:space="preserve">
<value>Specify the search provider for this site</value>
</data>
<data name="SearchProvider.Text" xml:space="preserve">
<value>Search Provider:</value>
</data>
</root>
2 changes: 1 addition & 1 deletion Oqtane.Server/Services/SearchService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Oqtane.Services
{
public class SearchService : ISearchService
{
private const string SearchProviderSettingName = "SearchProvider";
private const string SearchProviderSettingName = "Search_SearchProvider";

private readonly IServiceProvider _serviceProvider;
private readonly ISettingRepository _settingRepository;
Expand Down

0 comments on commit 4462ae9

Please sign in to comment.