Browse Source

Dropdown toggle.

pull/711/head
Sebastian Stehle 5 years ago
parent
commit
f5cd2d0421
  1. 2
      backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj
  2. 53
      backend/src/Squidex.Web/Pipeline/RequestLogPerformanceMiddleware.cs
  3. 7
      backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/FieldDto.cs
  4. 2
      backend/src/Squidex/Squidex.csproj
  5. 8
      backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestContent.cs
  6. 2
      frontend/app/features/content/pages/content/content-history-page.component.html

2
backend/src/Squidex.Infrastructure/Squidex.Infrastructure.csproj

@ -27,7 +27,7 @@
<PackageReference Include="Squidex.Assets" Version="1.4.0" />
<PackageReference Include="Squidex.Caching" Version="1.8.0" />
<PackageReference Include="Squidex.Hosting.Abstractions" Version="1.9.0" />
<PackageReference Include="Squidex.Log" Version="1.2.0" />
<PackageReference Include="Squidex.Log" Version="1.4.0" />
<PackageReference Include="Squidex.Text" Version="1.6.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />

53
backend/src/Squidex.Web/Pipeline/RequestLogPerformanceMiddleware.cs

@ -28,33 +28,50 @@ namespace Squidex.Web.Pipeline
public async Task InvokeAsync(HttpContext context, ISemanticLog log)
{
var watch = ValueStopwatch.StartNew();
var shouldStartSession = requestLogOptions.LogRequests || Profiler.HasListener;
using (Profiler.StartSession())
if (requestLogOptions.LogRequests || shouldStartSession)
{
try
{
await next(context);
}
finally
{
var elapsedMs = watch.Stop();
var session =
shouldStartSession ?
Profiler.StartSession() :
default;
if (requestLogOptions.LogRequests)
var watch =
requestLogOptions.LogRequests ?
ValueStopwatch.StartNew() :
default;
using (session)
{
try
{
log.LogInformation((elapsedMs, context), (ctx, w) =>
await next(context);
}
finally
{
if (requestLogOptions.LogRequests)
{
if (requestLogOptions.LogProfiler)
{
Profiler.Session?.Write(w);
}
var elapsedMs = watch.Stop();
w.WriteObject("filters", ctx.context, LogFilters);
w.WriteProperty("elapsedRequestMs", ctx.elapsedMs);
});
log.LogInformation((elapsedMs, context), (ctx, w) =>
{
if (requestLogOptions.LogProfiler)
{
Profiler.Session?.Write(w);
}
w.WriteObject("filters", ctx.context, LogFilters);
w.WriteProperty("elapsedRequestMs", ctx.elapsedMs);
});
}
}
}
}
else
{
await next(context);
}
}
private static void LogFilters(HttpContext httpContext, IObjectWriter c)

7
backend/src/Squidex/Areas/Api/Controllers/Schemas/Models/FieldDto.cs

@ -130,13 +130,16 @@ namespace Squidex.Areas.Api.Controllers.Schemas.Models
AddPutLink("disable", resources.Url<SchemaFieldsController>(x => nameof(x.DisableField), values));
}
if (Properties is ArrayFieldPropertiesDto)
if (Nested != null)
{
var parentValues = new { values.app, values.schema, parentId = FieldId };
AddPostLink("fields/add", resources.Url<SchemaFieldsController>(x => nameof(x.PostNestedField), parentValues));
AddPutLink("fields/order", resources.Url<SchemaFieldsController>(x => nameof(x.PutNestedFieldOrdering), parentValues));
if (Nested.Count > 0)
{
AddPutLink("fields/order", resources.Url<SchemaFieldsController>(x => nameof(x.PutNestedFieldOrdering), parentValues));
}
}
if (!IsLocked)

2
backend/src/Squidex/Squidex.csproj

@ -66,7 +66,7 @@
<PackageReference Include="Squidex.Assets.Mongo" Version="1.4.0" />
<PackageReference Include="Squidex.Assets.S3" Version="1.4.0" />
<PackageReference Include="Squidex.Caching.Orleans" Version="1.8.0" />
<PackageReference Include="Squidex.ClientLibrary" Version="6.19.0" />
<PackageReference Include="Squidex.ClientLibrary" Version="7.3.0" />
<PackageReference Include="Squidex.Hosting" Version="1.9.0" />
<PackageReference Include="Squidex.OpenIddict.MongoDb" Version="4.0.1-dev" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" />

8
backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/TestContent.cs

@ -326,14 +326,6 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL
}
}
},
["myGeolocation"] = new
{
iv = new
{
latitude = 10,
longitude = 20
}
},
["myTags"] = new
{
iv = new[]

2
frontend/app/features/content/pages/content/content-history-page.component.html

@ -29,7 +29,7 @@
<ng-template #newVersion>
<label>{{ 'contents.draftStatus' | sqxTranslate }}</label>
<button type="button" class="btn btn-outline-secondary btn-block btn-status dropdown-toggle" (click)="dropdownNew.toggle()" #buttonOptions>
<button type="button" class="btn btn-outline-secondary btn-block btn-status" (click)="dropdownNew.toggle()" #buttonOptions>
<sqx-content-status
layout="multiline"
[status]="content.newStatus!"

Loading…
Cancel
Save