Skip to content

Commit

Permalink
Merge branch 'dev' into skrypt/#8034
Browse files Browse the repository at this point in the history
  • Loading branch information
Skrypt committed Dec 21, 2020
2 parents 624d526 + 8c2f9e4 commit 7a6956b
Show file tree
Hide file tree
Showing 27 changed files with 221 additions and 161 deletions.
7 changes: 7 additions & 0 deletions OrchardCore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Tests.Functiona
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Placements", "src\OrchardCore.Modules\OrchardCore.Placements\OrchardCore.Placements.csproj", "{5F94223B-CD69-47E1-B4AE-DEA03CBC4D3D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Configuration.KeyVault", "src\OrchardCore\OrchardCore.Configuration.KeyVault\OrchardCore.Configuration.KeyVault.csproj", "{17187E9E-90EE-4484-AC5E-8920D9126025}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1037,6 +1039,10 @@ Global
{5F94223B-CD69-47E1-B4AE-DEA03CBC4D3D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F94223B-CD69-47E1-B4AE-DEA03CBC4D3D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F94223B-CD69-47E1-B4AE-DEA03CBC4D3D}.Release|Any CPU.Build.0 = Release|Any CPU
{17187E9E-90EE-4484-AC5E-8920D9126025}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{17187E9E-90EE-4484-AC5E-8920D9126025}.Debug|Any CPU.Build.0 = Debug|Any CPU
{17187E9E-90EE-4484-AC5E-8920D9126025}.Release|Any CPU.ActiveCfg = Release|Any CPU
{17187E9E-90EE-4484-AC5E-8920D9126025}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1218,6 +1224,7 @@ Global
{57EA05E8-0275-4163-8FD1-2B244E396F91} = {F23AC6C2-DE44-4699-999D-3C478EF3D691}
{2CA507BD-5517-4CD2-8F30-093AC5D11EBA} = {B8D16C60-99B4-43D5-A3AD-4CD89AF39B25}
{5F94223B-CD69-47E1-B4AE-DEA03CBC4D3D} = {90030E85-0C4F-456F-B879-443E8A3F220D}
{17187E9E-90EE-4484-AC5E-8920D9126025} = {F23AC6C2-DE44-4699-999D-3C478EF3D691}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {46A1D25A-78D1-4476-9CBF-25B75E296341}
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ nav:
- GraphQL queries: docs/reference/core/Apis.GraphQL.Abstractions/README.md
- Health Check: docs/reference/modules/HealthChecks/README.md
- HTTPS: docs/reference/modules/Https/README.md
- Key Vault (Azure): docs/reference/core/KeyVault.Azure/README.md
- Localization: docs/reference/modules/Localize/README.md
- Logging Serilog: docs/reference/core/Logging.Serilog/readme.md
- Mini Profiler: docs/reference/modules/MiniProfiler/README.md
Expand Down
7 changes: 4 additions & 3 deletions src/OrchardCore.Build/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

<ItemGroup>
<PackageManagement Include="AngleSharp" Version="0.14.0" />
<PackageManagement Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.0.2" />
<PackageManagement Include="Azure.Extensions.AspNetCore.DataProtection.Blobs" Version="1.0.1" />
<PackageManagement Include="Azure.Identity" Version="1.3.0" />
<PackageManagement Include="Azure.Storage.Blobs" Version="12.7.0" />
<PackageManagement Include="Castle.Core" Version="4.4.1" />
<PackageManagement Include="Irony.Core" Version="1.0.7" />
Expand Down Expand Up @@ -38,9 +40,8 @@
<PackageManagement Include="Shortcodes" Version="1.0.0" />
<PackageManagement Include="SixLabors.ImageSharp.Web" Version="1.0.1" />
<PackageManagement Include="xunit.analyzers" Version="0.10.0" />
<!-- xunit downgraded due to Theory Skip bug c.f. https://github.com/xunit/xunit/issues/1782 -->
<PackageManagement Include="xunit" Version="2.3.1" />
<PackageManagement Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageManagement Include="xunit" Version="2.4.1" />
<PackageManagement Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageManagement Include="YesSql.Abstractions" Version="2.0.0-beta-1637" />
<PackageManagement Include="YesSql.Core" Version="2.0.0-beta-1637" />
<PackageManagement Include="YesSql.Provider.MySql" Version="1.0.0-beta-1637" />
Expand Down
5 changes: 5 additions & 0 deletions src/OrchardCore.Cms.Web/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@
// "TablePrefix": "", // Optionally, configure a table prefix.
// "MigrateFromFiles": true // Optionally, enable to migrate existing App_Data files to Database automatically.
//},
// Add 'AddOrchardCoreAzureKeyVault()' to the Generic Host in 'CreateHostBuilder() section'.
// "OrchardCore_KeyVault_Azure": {
// "KeyVaultName": "", // Set the name of your Azure Key Vault.
// "ReloadInterval": // Optional, timespan to wait between attempts at polling the Azure KeyVault for changes. Leave blank to disable reloading.
// },
// See https://docs.orchardcore.net/en/latest/docs/reference/modules/Users/Configuration/#custom-paths
//"OrchardCore_Users": {
// "LoginPath": "Login",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public override Task GetContentItemAspectAsync(ContentItemAspectContext context,
if (part.Culture != null)
{
cultureAspect.Culture = CultureInfo.GetCultureInfo(part.Culture);
cultureAspect.HasCulture = true;
}

return Task.CompletedTask;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<button class="btn btn-secondary btn-sm dropdown-toggle" type="button" id="new-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@T["New"]
</button>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="bulk-action-menu-button">
<div class="dropdown-menu dropdown-menu-right scrollable" aria-labelledby="bulk-action-menu-button">
@foreach (var item in Model.CreatableTypes)
{
<a class="dropdown-item" href="@Url.RouteUrl(new { area = "OrchardCore.Contents", controller = "Admin", action = "Create", id = @item.Value, returnUrl = FullRequestPath })">@T[item.Text]</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<div class="btn-group mt-1">
@if (Model.ContentTypeOptions.Any())
{
<select asp-for="SelectedContentType" asp-items="Model.ContentTypeOptions" class="selectpicker contenttypes-selectpicker show-tick mr-2" data-header="@T["Filter by content type"]" data-live-search="true" data-selected-text-format="static" data-width="fit" title="@T["Content Type"]" data-style="btn-sm">
<select asp-for="SelectedContentType" asp-items="Model.ContentTypeOptions" class="selectpicker contenttypes-selectpicker show-tick mr-2" data-header="@T["Filter by content type"]" data-live-search="true" data-selected-text-format="static" data-width="fit" title="@T["Content Type"]" data-style="btn-sm" data-dropdown-align-right="auto">
</select>
}
<select asp-for="ContentsStatus" asp-items="@Model.ContentStatuses" class="selectpicker contentstatuses-selectpicker show-tick mr-2" data-header="@T["Filter by status"]" data-selected-text-format="static" data-width="fit" data-dropdown-align-right="true" title="@T["Show"]" data-style="btn-sm"></select>
<select asp-for="ContentsStatus" asp-items="@Model.ContentStatuses" class="selectpicker contentstatuses-selectpicker show-tick mr-2" data-header="@T["Filter by status"]" data-selected-text-format="static" data-width="fit" data-dropdown-align-right="auto" title="@T["Show"]" data-style="btn-sm"></select>
<select asp-for="OrderBy" asp-items="@Model.ContentSorts" class="selectpicker contentsorts-selectpicker show-tick" data-header="@T["Sort by"]" data-width="fit" data-selected-text-format="static" data-dropdown-align-right="true" title="@T["Sort"]" data-style="btn-sm"></select>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
@using OrchardCore.ContentManagement

@using System.Globalization
@{
ContentItem contentItem = Model.ContentItem;
var modifiedUtc = contentItem.ModifiedUtc?.ToString("yyyy-MM-ddTHH:mm:sszzz", CultureInfo.InvariantCulture);
}

@if (contentItem.ModifiedUtc.HasValue)
{
<small class="badge ta-badge font-weight-normal" data-toggle="tooltip" title="@await DisplayAsync(await New.DateTime(Utc: contentItem.ModifiedUtc, Format: "g"))">
<i class="fa fa-calendar text-secondary"></i> <time>@await DisplayAsync(await New.Timespan(Utc: contentItem.ModifiedUtc))</time>
<i class="fa fa-calendar text-secondary"></i> <time datetime="@modifiedUtc">@await DisplayAsync(await New.Timespan(Utc: contentItem.ModifiedUtc))</time>
</small>
<small class="badge ta-badge font-weight-normal" data-toggle="tooltip" title="@contentItem.Owner">
<i class="fa fa-user text-secondary"></i> @contentItem.Author
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using OrchardCore.ContentLocalization;
using OrchardCore.ContentManagement;
using OrchardCore.ContentManagement.Handlers;
using OrchardCore.ContentPreview;
Expand Down Expand Up @@ -60,14 +61,11 @@ private Task AddContextAsync(ContentContextBase context)
private static async Task IndexingAsync(ShellScope scope, IEnumerable<ContentContextBase> contexts)
{
var services = scope.ServiceProvider;

var contentManager = services.GetRequiredService<IContentManager>();
var contentItemIndexHandlers = services.GetServices<IContentItemIndexHandler>();

var luceneIndexManager = services.GetRequiredService<LuceneIndexManager>();
var luceneIndexSettingsService = services.GetRequiredService<LuceneIndexSettingsService>();
var logger = services.GetRequiredService<ILogger<LuceneIndexingContentHandler>>();

// Multiple items may have been updated in the same scope, e.g through a recipe.
var contextsGroupById = contexts.GroupBy(c => c.ContentItem.ContentItemId, c => c);

Expand All @@ -82,7 +80,9 @@ private static async Task IndexingAsync(ShellScope scope, IEnumerable<ContentCon

foreach (var indexSettings in await luceneIndexSettingsService.GetSettingsAsync())
{
var ignoreIndexedCulture = indexSettings.Culture == "any" ? false : context.ContentItem.Content?.LocalizationPart?.Culture != indexSettings.Culture;
var cultureAspect = await contentManager.PopulateAspectAsync<CultureAspect>(context.ContentItem);
var culture = cultureAspect.HasCulture ? cultureAspect.Culture.Name : null;
var ignoreIndexedCulture = indexSettings.Culture == "any" ? false : culture != indexSettings.Culture;

if (indexSettings.IndexedContentTypes.Contains(context.ContentItem.ContentType) && !ignoreIndexedCulture)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

<ItemGroup>
<ProjectReference Include="..\..\OrchardCore\OrchardCore.Admin.Abstractions\OrchardCore.Admin.Abstractions.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.ContentLocalization.Abstractions\OrchardCore.ContentLocalization.Abstractions.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.ContentManagement.Display\OrchardCore.ContentManagement.Display.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.ContentManagement.GraphQL\OrchardCore.ContentManagement.GraphQL.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.ContentManagement\OrchardCore.ContentManagement.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using OrchardCore.ContentLocalization;
using OrchardCore.ContentManagement;
using OrchardCore.Entities;
using OrchardCore.Environment.Shell;
Expand Down Expand Up @@ -186,7 +187,9 @@ await shellScope.UsingAsync(async scope =>
continue;
}

var ignoreIndexedCulture = settings.Culture == "any" ? false : context.ContentItem.Content?.LocalizationPart?.Culture != settings.Culture;
var cultureAspect = await contentManager.PopulateAspectAsync<CultureAspect>(context.ContentItem);
var culture = cultureAspect.HasCulture ? cultureAspect.Culture.Name : null;
var ignoreIndexedCulture = settings.Culture == "any" ? false : culture != settings.Culture;

// Ignore if the content item content type or culture is not indexed in this index
if (!settings.IndexedContentTypes.Contains(context.ContentItem.ContentType) || ignoreIndexedCulture)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,33 @@
</div>

<ul class="list-group with-checkbox">
<li class="list-group-item bg-primary">
<div class="row">
<div class="form-group col mb-n1">
<div class="custom-control custom-checkbox mt-2 mr-n2">
<input type="checkbox" class="custom-control-input" id="select-all">
<label class="custom-control-label" for="select-all" id="select-all-label" title="@T["Select All"]"></label>
<label id="items" for="select-all">@T.Plural(Model.ShapePlacements.Count, "1 item", "{0} items")<span class="text-muted" title="@T["Items {0} to {1}", startIndex, endIndex]">@T.Plural((int)Model.Pager.TotalItemCount, " / {0} item in total", " / {0} items in total")</span></label>
<label id="selected-items" class="text-muted" for="select-all"></label>
@if (Model.ShapePlacements.Any())
{
<li class="list-group-item bg-primary">
<div class="row">
<div class="form-group col mb-n1">
<div class="custom-control custom-checkbox mt-2 mr-n2">
<input type="checkbox" class="custom-control-input" id="select-all">
<label class="custom-control-label" for="select-all" id="select-all-label" title="@T["Select All"]"></label>
<label id="items" for="select-all">@T.Plural(Model.ShapePlacements.Count, "1 item", "{0} items")<span class="text-muted" title="@T["Items {0} to {1}", startIndex, endIndex]">@T.Plural((int)Model.Pager.TotalItemCount, " / {0} item in total", " / {0} items in total")</span></label>
<label id="selected-items" class="text-muted" for="select-all"></label>
</div>
</div>
</div>
<div class="form-group col-2 mb-n1" style="display:none" id="actions">
<span class="dropdown float-right mt-1">
<button class="btn btn-sm btn-light dropdown-toggle" type="button" id="bulk-action-menu-button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@T["Actions"]
</button>
<span class="dropdown-menu dropdown-menu-right" aria-labelledby="bulk-action-menu-button">
@foreach (var item in Model.Options.ContentsBulkAction)
{
<a class="dropdown-item" href="javascript:void(0)" data-action="@item.Value" data-title="@T["Bulk Action"]" data-message="@T["Are you sure you want to {0} these items?", @item.Text.ToLower()]">@item.Text</a>
}
<div class="form-group col-2 mb-n1" style="display:none" id="actions">
<span class="dropdown float-right mt-1">
<button class="btn btn-sm btn-light dropdown-toggle" type="button" id="bulk-action-menu-button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@T["Actions"]
</button>
<span class="dropdown-menu dropdown-menu-right" aria-labelledby="bulk-action-menu-button">
@foreach (var item in Model.Options.ContentsBulkAction)
{
<a class="dropdown-item" href="javascript:void(0)" data-action="@item.Value" data-title="@T["Bulk Action"]" data-message="@T["Are you sure you want to {0} these items?", @item.Text.ToLower()]">@item.Text</a>
}
</span>
</span>
</span>
</div>
</div>
</div>
</li>
@if (Model.ShapePlacements.Any())
{
</li>
@foreach (var entry in Model.ShapePlacements)
{
<li class="list-group-item">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@{
int startIndex = (Model.Pager.Page - 1) * (Model.Pager.PageSize) + 1;
int endIndex = startIndex + Model.Templates.Count - 1;
var formAction = Model.Options.AdminTemplates ? "admin" : "index";
}

@if (Model.Options.AdminTemplates)
Expand All @@ -14,7 +15,7 @@ else
}

@* the form is necessary to generate and antiforgery token for the delete action *@
<form asp-action="Index">
<form asp-action="@formAction">
<input type="submit" name="submit.Filter" id="submitFilter" class="d-none" />
<input asp-for="Options.AdminTemplates" type="hidden" />
<input asp-for="Options.BulkAction" type="hidden" />
Expand Down
Loading

0 comments on commit 7a6956b

Please sign in to comment.