Skip to content

Commit

Permalink
Merge branch 'main' into shape-tag-helper-inner-content
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamco authored Jul 24, 2024
2 parents 165c5a1 + af59baa commit d0c159a
Show file tree
Hide file tree
Showing 62 changed files with 676 additions and 332 deletions.
34 changes: 17 additions & 17 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@

<ItemGroup>
<PackageVersion Include="AngleSharp" Version="1.1.2" />
<PackageVersion Include="AWSSDK.S3" Version="3.7.310.2" />
<PackageVersion Include="AWSSDK.S3" Version="3.7.310.7" />
<PackageVersion Include="AWSSDK.Extensions.NETCore.Setup" Version="3.7.301" />
<PackageVersion Include="Azure.Communication.Email" Version="1.0.1" />
<PackageVersion Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.1" />
<PackageVersion Include="Azure.Extensions.AspNetCore.DataProtection.Blobs" Version="1.3.4" />
<PackageVersion Include="Azure.Identity" Version="1.12.0" />
<PackageVersion Include="Azure.Search.Documents" Version="11.5.1" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.20.0" />
<PackageVersion Include="Azure.Search.Documents" Version="11.6.0" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.21.0" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.12" />
<PackageVersion Include="Castle.Core" Version="5.1.1" />
<PackageVersion Include="DocumentFormat.OpenXml" Version="3.0.2" />
<PackageVersion Include="Fluid.Core" Version="2.10.0" />
<PackageVersion Include="Fluid.Core" Version="2.11.1" />
<PackageVersion Include="GraphQL" Version="7.8.0" />
<PackageVersion Include="GraphQL.DataLoader" Version="7.8.0" />
<PackageVersion Include="GraphQL.MicrosoftDI" Version="7.8.0" />
Expand All @@ -38,18 +38,18 @@
<PackageVersion Include="Lucene.Net.Analysis.Common" Version="4.8.0-beta00016" />
<PackageVersion Include="Lucene.Net.QueryParser" Version="4.8.0-beta00016" />
<PackageVersion Include="Lucene.Net.Spatial" Version="4.8.0-beta00016" />
<PackageVersion Include="MailKit" Version="4.7.0" />
<PackageVersion Include="MailKit" Version="4.7.1.1" />
<PackageVersion Include="Markdig" Version="0.37.0" />
<PackageVersion Include="MessagePack" Version="2.2.60" />
<PackageVersion Include="Microsoft.Extensions.Azure" Version="1.7.4" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="8.7.0" />
<PackageVersion Include="Microsoft.Identity.Web" Version="2.20.0" />
<PackageVersion Include="Microsoft.Identity.Web" Version="3.0.0" />

<!--
Important: the version of the Microsoft.IdentityModel.Protocols.OpenIdConnect package MUST
match the IdentityModel version transitively referenced by OpenIddict to ensure we don't
accidentally end up referencing inconsistent versions (which is not supported by IM).
See https://github.com/OrchardCMS/OrchardCore/pull/16057 for more information.
-->

Expand All @@ -61,7 +61,7 @@
<PackageVersion Include="Moq" Version="4.20.70" />
<PackageVersion Include="ncrontab" Version="3.3.3" />
<PackageVersion Include="NEST" Version="7.17.5" />
<PackageVersion Include="NJsonSchema" Version="11.0.1" />
<PackageVersion Include="NJsonSchema" Version="11.0.2" />
<PackageVersion Include="NLog.Web.AspNetCore" Version="5.3.11" />
<PackageVersion Include="NodaTime" Version="3.1.11" />
<PackageVersion Include="OpenIddict.Core" Version="5.7.0" />
Expand All @@ -73,22 +73,22 @@
<PackageVersion Include="OrchardCore.Translations.All" Version="1.8.0" />
<PackageVersion Include="PdfPig" Version="0.1.8" />
<PackageVersion Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageVersion Include="Shortcodes" Version="1.3.3" />
<PackageVersion Include="Shortcodes" Version="1.3.4" />
<PackageVersion Include="SixLabors.ImageSharp.Web" Version="3.1.2" />
<PackageVersion Include="SixLabors.ImageSharp.Web.Providers.Azure" Version="3.1.2" />
<PackageVersion Include="SixLabors.ImageSharp.Web.Providers.AWS" Version="3.1.2" />
<PackageVersion Include="StackExchange.Redis" Version="2.8.0" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.1.118" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="System.IO.Hashing" Version="8.0.0" />
<PackageVersion Include="xunit" Version="2.8.1" />
<PackageVersion Include="xunit.analyzers" Version="1.14.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.1" />
<PackageVersion Include="YesSql" Version="5.0.0" />
<PackageVersion Include="YesSql.Abstractions" Version="5.0.0" />
<PackageVersion Include="YesSql.Core" Version="5.0.0" />
<PackageVersion Include="YesSql.Filters.Abstractions" Version="5.0.0" />
<PackageVersion Include="YesSql.Filters.Query" Version="5.0.0" />
<PackageVersion Include="xunit" Version="2.9.0" />
<PackageVersion Include="xunit.analyzers" Version="1.15.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="YesSql" Version="5.1.1" />
<PackageVersion Include="YesSql.Abstractions" Version="5.1.1" />
<PackageVersion Include="YesSql.Core" Version="5.1.1" />
<PackageVersion Include="YesSql.Filters.Abstractions" Version="5.1.1" />
<PackageVersion Include="YesSql.Filters.Query" Version="5.1.1" />
<PackageVersion Include="ZString" Version="2.6.0" />
</ItemGroup>

Expand Down
5 changes: 4 additions & 1 deletion src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web">
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk.Web">

<!-- Necessary as we reference the Project and not the Package -->
<Import Project="..\OrchardCore\OrchardCore.Application.Cms.Core.Targets\OrchardCore.Application.Cms.Core.Targets.props" />
Expand All @@ -10,6 +10,9 @@
<RazorRuntimeCompilation>false</RazorRuntimeCompilation>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<!-- With this GUID, user secrets can be added with "dotnet user-secrets set key value" without further changes in
git. See an example use-case at https://docs.orchardcore.net/en/latest/reference/modules/AutoSetup/. -->
<UserSecretsId>2cfccf50-2ae4-4017-bbd7-a0e453cbf713</UserSecretsId>
</PropertyGroup>
<!-- For Unit Tests-->
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static DateTimeParser()
{
var operators = OneOf(Literals.Text(">="), Literals.Text(">"), Literals.Text("<="), Literals.Text("<"));

var arithmetic = Terms.Integer(NumberOptions.AllowSign);
var arithmetic = Terms.Integer(NumberOptions.AllowLeadingSign);
var range = Literals.Text("..");

var todayParser = Terms.Text("@today").And(ZeroOrOne(arithmetic))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class ContentAnchorTag : IAnchorTag
{
public int Order => -10;

public bool Match(List<FilterArgument> argumentsList)
public bool Match(IReadOnlyList<FilterArgument> argumentsList)
{
foreach (var argument in argumentsList)
{
Expand All @@ -37,7 +37,7 @@ public bool Match(List<FilterArgument> argumentsList)
return false;
}

public async ValueTask<Completion> WriteToAsync(List<FilterArgument> argumentsList, IReadOnlyList<Statement> statements, TextWriter writer, TextEncoder encoder, LiquidTemplateContext context)
public async ValueTask<Completion> WriteToAsync(IReadOnlyList<FilterArgument> argumentsList, IReadOnlyList<Statement> statements, TextWriter writer, TextEncoder encoder, LiquidTemplateContext context)
{
var services = context.Services;
var viewContext = context.ViewContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ public class ContentItemTag
{
private static readonly FilterArgument _typeArgument = new("type", new LiteralExpression(StringValue.Create("contentitem")));

public static ValueTask<Completion> WriteToAsync(List<FilterArgument> argumentsList, TextWriter writer, TextEncoder encoder, TemplateContext context)
public static ValueTask<Completion> WriteToAsync(IReadOnlyList<FilterArgument> argumentsList, TextWriter writer, TextEncoder encoder, TemplateContext context)
{
argumentsList.Add(_typeArgument);
return ShapeTag.WriteToAsync(argumentsList, writer, encoder, context);
var list = new List<FilterArgument>(argumentsList)
{
_typeArgument
};

return ShapeTag.WriteToAsync(list, writer, encoder, context);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public async ValueTask<FluidValue> ProcessAsync(FluidValue input, FilterArgument
}

// When returning segments separate them so multiple segments are indexed individually.
return new ArrayValue(aspects.SelectMany(x => x.Segments).Where(x => !string.IsNullOrEmpty(x)).Select(x => new StringValue(x + ' ')));
return new ArrayValue(aspects.SelectMany(x => x.Segments).Where(x => !string.IsNullOrEmpty(x)).Select(x => new StringValue(x + ' ')).ToArray());
}
else
{
Expand All @@ -67,7 +67,7 @@ public async ValueTask<FluidValue> ProcessAsync(FluidValue input, FilterArgument
var fullTextAspect = await _contentManager.PopulateAspectAsync<FullTextAspect>(contentItem);

// Remove empty strings as display text is often unused in contained content items.
return new ArrayValue(fullTextAspect.Segments.Where(x => !string.IsNullOrEmpty(x)).Select(x => new StringValue(x)));
return new ArrayValue(fullTextAspect.Segments.Where(x => !string.IsNullOrEmpty(x)).Select(x => new StringValue(x)).ToArray());
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/OrchardCore.Modules/OrchardCore.Media/Assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
"inputs": [
"./node_modules/blueimp-file-upload/js/jquery.fileupload.js",
"./node_modules/blueimp-file-upload/js/jquery.iframe-transport.js",
"Assets/js/helpers.js",
"Assets/js/app/**/*.js"
],
"watch": [
"Assets/js/helpers.js",
"Assets/js/app/**/*.js"
],
"output": "wwwroot/Scripts/media.js"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class MediaAnchorTag : IAnchorTag
{
public int Order => -20;

public bool Match(List<FilterArgument> argumentsList)
public bool Match(IReadOnlyList<FilterArgument> argumentsList)
{
foreach (var argument in argumentsList)
{
Expand All @@ -30,7 +30,7 @@ public bool Match(List<FilterArgument> argumentsList)
return false;
}

public async ValueTask<Completion> WriteToAsync(List<FilterArgument> argumentsList, IReadOnlyList<Statement> statements, TextWriter writer, TextEncoder encoder, LiquidTemplateContext context)
public async ValueTask<Completion> WriteToAsync(IReadOnlyList<FilterArgument> argumentsList, IReadOnlyList<Statement> statements, TextWriter writer, TextEncoder encoder, LiquidTemplateContext context)
{
var services = context.Services;
var mediaFileStore = services.GetRequiredService<IMediaFileStore>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static ResourceManagementOptionsConfiguration()
_manifest
.DefineScript("media")
.SetUrl("~/OrchardCore.Media/Scripts/media.min.js", "~/OrchardCore.Media/Scripts/media.js")
.SetDependencies("vuejs", "sortable", "vuedraggable", "jQuery-ui")
.SetDependencies("vuejs", "sortable", "vuedraggable", "jQuery-ui", "credential-helpers")
.SetVersion("1.0.0");

_manifest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1558,15 +1558,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
});
});
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function randomUUID() {
if ((typeof crypto === "undefined" ? "undefined" : _typeof(crypto)) === 'object' && typeof crypto.randomUUID === 'function') {
return crypto.randomUUID();
}
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function (c) {
return (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16);
});
}
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
Expand Down Expand Up @@ -71,20 +72,25 @@ public async Task<ActionResult> Index(PagerParameters pagerParameters)
var pager = new Pager(pagerParameters, _pagerOptions.GetPageSize());
var count = await _applicationManager.CountAsync();

var model = new OpenIdApplicationsIndexViewModel
{
Pager = await _shapeFactory.PagerAsync(pager, (int)count),
};
var applications = new List<OpenIdApplicationEntry>();

await foreach (var application in _applicationManager.ListAsync(pager.PageSize, pager.GetStartIndex()))
{
model.Applications.Add(new OpenIdApplicationEntry
applications.Add(new OpenIdApplicationEntry
{
DisplayName = await _applicationManager.GetDisplayNameAsync(application),
Id = await _applicationManager.GetPhysicalIdAsync(application)
});
}

var model = new OpenIdApplicationsIndexViewModel
{
Pager = await _shapeFactory.PagerAsync(pager, (int)count),
Applications = applications.OrderBy(x => x.DisplayName)
.ThenBy(x => x.Id)
.ToArray(),
};

return View(model);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.ModelBinding;

namespace OrchardCore.OpenId.ViewModels
{
public class OpenIdApplicationsIndexViewModel
{
public IList<OpenIdApplicationEntry> Applications { get; } = [];
[BindNever]
public IList<OpenIdApplicationEntry> Applications { get; set; }

[BindNever]
public dynamic Pager { get; set; }
}

Expand Down
Loading

0 comments on commit d0c159a

Please sign in to comment.