Browse Source

Some style fixes

pull/590/head
Sebastian 5 years ago
parent
commit
3fe24acc3e
  1. 2
      backend/extensions/Squidex.Extensions/Actions/Comment/CommentActionHandler.cs
  2. 2
      backend/extensions/Squidex.Extensions/Actions/CreateContent/CreateContentActionHandler.cs
  3. 2
      backend/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/ContentSchemaBuilder.cs
  4. 7
      backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentDataObject.cs
  5. 4
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/Adapt.cs
  6. 1
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/QueryContentsByQuery.cs
  7. 8
      backend/src/Squidex.Domain.Apps.Entities.MongoDb/Rules/MongoRuleEventEntity.cs
  8. 2
      backend/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InvitationEventConsumer.cs
  9. 2
      backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/UsageNotifierGrain.cs
  10. 2
      backend/src/Squidex.Domain.Apps.Entities/Assets/AssetDomainObject.cs
  11. 1
      backend/src/Squidex.Domain.Apps.Entities/Assets/AssetFolderDomainObject.cs
  12. 1
      backend/src/Squidex.Domain.Apps.Entities/Assets/Guards/GuardAssetFolder.cs
  13. 2
      backend/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs
  14. 1
      backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AppMutationsGraphType.cs
  15. 1
      backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AssetActions.cs
  16. 4
      backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ContentActions.cs
  17. 2
      backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Utils/EntitySavedGraphType.cs
  18. 8
      backend/src/Squidex.Domain.Apps.Entities/Contents/Text/TextIndexingProcess.cs
  19. 2
      backend/src/Squidex.Domain.Apps.Entities/History/HistoryService.cs
  20. 2
      backend/src/Squidex.Domain.Apps.Entities/Notifications/INotificationSender.cs
  21. 2
      backend/src/Squidex.Domain.Apps.Entities/Notifications/NoopNotificationSender.cs
  22. 2
      backend/src/Squidex.Domain.Apps.Entities/Notifications/NotificationEmailSender.cs
  23. 2
      backend/src/Squidex.Domain.Apps.Entities/Notifications/NotificationEmailTextOptions.cs
  24. 8
      backend/src/Squidex.Infrastructure/Assets/ImageSharp/ImageSharpAssetThumbnailGenerator.cs
  25. 2
      backend/src/Squidex.Infrastructure/EventSourcing/Grains/BatchSubscriber.cs
  26. 2
      backend/src/Squidex.Infrastructure/EventSourcing/IEventConsumer.cs
  27. 4
      backend/src/Squidex.Infrastructure/Migrations/Migrator.cs
  28. 2
      backend/src/Squidex.Infrastructure/Reflection/Internal/ReflectionExtensions.cs
  29. 9
      backend/src/Squidex.Infrastructure/Translations/ResourcesLocalizer.cs
  30. 2
      backend/src/Squidex.Infrastructure/Validation/LocalizedEmailAddressAttribute.cs
  31. 2
      backend/src/Squidex.Infrastructure/Validation/LocalizedRangeAttribute.cs
  32. 2
      backend/src/Squidex.Infrastructure/Validation/LocalizedRegularExpressionAttribute.cs
  33. 2
      backend/src/Squidex.Infrastructure/Validation/LocalizedRequiredAttribute.cs
  34. 3
      backend/src/Squidex/Areas/Frontend/Middlewares/WebpackMiddleware.cs
  35. 2
      backend/src/Squidex/Config/Domain/NotificationsServices.cs
  36. 10
      backend/src/Squidex/wwwroot/scripts/sidebar-search.html
  37. 8
      backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/EventEnricherTests.cs
  38. 1
      backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleEventFormatterCompareTests.cs
  39. 2
      backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/ReferencesValidatorTests.cs
  40. 4
      backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Invitation/InvitationEventConsumerTests.cs
  41. 1
      backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLMutationTests.cs
  42. 1
      backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/ReferenceFluidExtensionTests.cs
  43. 2
      backend/tests/Squidex.Domain.Apps.Entities.Tests/Notifications/NotificationEmailSenderTests.cs
  44. 1
      backend/tests/Squidex.Infrastructure.Tests/Commands/CommandContextTests.cs
  45. 1
      backend/tests/Squidex.Infrastructure.Tests/Reflection/ReflectionExtensionTests.cs
  46. 4
      backend/tests/Squidex.Web.Tests/Pipeline/RequestExceptionMiddlewareTests.cs
  47. 2
      backend/tests/Squidex.Web.Tests/Pipeline/UsageMiddlewareTests.cs

2
backend/extensions/Squidex.Extensions/Actions/Comment/CommentActionHandler.cs

@ -34,7 +34,7 @@ namespace Squidex.Extensions.Actions.Comment
{ {
var ruleJob = new CreateComment var ruleJob = new CreateComment
{ {
AppId = contentEvent.AppId, AppId = contentEvent.AppId
}; };
ruleJob.Text = await FormatAsync(action.Text, @event); ruleJob.Text = await FormatAsync(action.Text, @event);

2
backend/extensions/Squidex.Extensions/Actions/CreateContent/CreateContentActionHandler.cs

@ -43,7 +43,7 @@ namespace Squidex.Extensions.Actions.CreateContent
{ {
var ruleJob = new Command var ruleJob = new Command
{ {
AppId = @event.AppId, AppId = @event.AppId
}; };
var schema = await appProvider.GetSchemaAsync(@event.AppId.Id, action.Schema, true); var schema = await appProvider.GetSchemaAsync(@event.AppId.Id, action.Schema, true);

2
backend/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/ContentSchemaBuilder.cs

@ -32,7 +32,7 @@ namespace Squidex.Domain.Apps.Core.GenerateJsonSchema
["createdBy"] = SchemaBuilder.StringProperty($"The user that has created the {schemaName} content.", true), ["createdBy"] = SchemaBuilder.StringProperty($"The user that has created the {schemaName} content.", true),
["lastModified"] = SchemaBuilder.DateTimeProperty($"The date and time when the {schemaName} content has been modified last.", true), ["lastModified"] = SchemaBuilder.DateTimeProperty($"The date and time when the {schemaName} content has been modified last.", true),
["lastModifiedBy"] = SchemaBuilder.StringProperty($"The user that has updated the {schemaName} content last.", true), ["lastModifiedBy"] = SchemaBuilder.StringProperty($"The user that has updated the {schemaName} content last.", true),
["newStatus"] = SchemaBuilder.StringProperty($"The new status of the content.", true), ["newStatus"] = SchemaBuilder.StringProperty($"The new status of the content.", false),
["status"] = SchemaBuilder.StringProperty($"The status of the content.", true) ["status"] = SchemaBuilder.StringProperty($"The status of the content.", true)
}, },
Type = JsonObjectType.Object Type = JsonObjectType.Object

7
backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentDataObject.cs

@ -73,14 +73,11 @@ namespace Squidex.Domain.Apps.Core.Scripting.ContentWrapper
public override void RemoveOwnProperty(JsValue property) public override void RemoveOwnProperty(JsValue property)
{ {
if (fieldsToDelete == null)
{
fieldsToDelete = new HashSet<string>();
}
var propertyName = property.AsString(); var propertyName = property.AsString();
fieldsToDelete ??= new HashSet<string>();
fieldsToDelete.Add(propertyName); fieldsToDelete.Add(propertyName);
fieldProperties?.Remove(propertyName); fieldProperties?.Remove(propertyName);
MarkChanged(); MarkChanged();

4
backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/Adapt.cs

@ -21,8 +21,8 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents.Operations
private static readonly Dictionary<string, string> PropertyMap = private static readonly Dictionary<string, string> PropertyMap =
typeof(MongoContentEntity).GetProperties() typeof(MongoContentEntity).GetProperties()
.ToDictionary( .ToDictionary(
x => ToElementName(x), ToElementName,
x => ToName(x), ToName,
StringComparer.OrdinalIgnoreCase); StringComparer.OrdinalIgnoreCase);
private static string ToName(PropertyInfo x) private static string ToName(PropertyInfo x)

1
backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/QueryContentsByQuery.cs

@ -9,7 +9,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes; using MongoDB.Bson.Serialization.Attributes;
using MongoDB.Driver; using MongoDB.Driver;
using Squidex.Domain.Apps.Entities.Apps; using Squidex.Domain.Apps.Entities.Apps;

8
backend/src/Squidex.Domain.Apps.Entities.MongoDb/Rules/MongoRuleEventEntity.cs

@ -31,6 +31,14 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Rules
[BsonElement] [BsonElement]
public DomainId RuleId { get; set; } public DomainId RuleId { get; set; }
[BsonRequired]
[BsonElement]
public Instant Created { get; set; }
[BsonRequired]
[BsonElement]
public Instant LastModified { get; set; }
[BsonRequired] [BsonRequired]
[BsonElement] [BsonElement]
[BsonRepresentation(BsonType.String)] [BsonRepresentation(BsonType.String)]

2
backend/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InvitationEventConsumer.cs

@ -7,7 +7,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using NodaTime; using NodaTime;
using Squidex.Domain.Apps.Entities.Apps.Notifications; using Squidex.Domain.Apps.Entities.Notifications;
using Squidex.Domain.Apps.Events.Apps; using Squidex.Domain.Apps.Events.Apps;
using Squidex.Infrastructure; using Squidex.Infrastructure;
using Squidex.Infrastructure.EventSourcing; using Squidex.Infrastructure.EventSourcing;

2
backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/UsageNotifierGrain.cs

@ -8,7 +8,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Squidex.Domain.Apps.Entities.Apps.Notifications; using Squidex.Domain.Apps.Entities.Notifications;
using Squidex.Infrastructure; using Squidex.Infrastructure;
using Squidex.Infrastructure.Orleans; using Squidex.Infrastructure.Orleans;
using Squidex.Infrastructure.States; using Squidex.Infrastructure.States;

2
backend/src/Squidex.Domain.Apps.Entities/Assets/AssetDomainObject.cs

@ -166,7 +166,7 @@ namespace Squidex.Domain.Apps.Entities.Assets
{ {
MimeType = command.File.MimeType, MimeType = command.File.MimeType,
FileVersion = Snapshot.FileVersion + 1, FileVersion = Snapshot.FileVersion + 1,
FileSize = command.File.FileSize, FileSize = command.File.FileSize
}); });
RaiseEvent(@event); RaiseEvent(@event);

1
backend/src/Squidex.Domain.Apps.Entities/Assets/AssetFolderDomainObject.cs

@ -18,7 +18,6 @@ using Squidex.Infrastructure.EventSourcing;
using Squidex.Infrastructure.Log; using Squidex.Infrastructure.Log;
using Squidex.Infrastructure.Reflection; using Squidex.Infrastructure.Reflection;
using Squidex.Infrastructure.States; using Squidex.Infrastructure.States;
using Squidex.Infrastructure.Translations;
namespace Squidex.Domain.Apps.Entities.Assets namespace Squidex.Domain.Apps.Entities.Assets
{ {

1
backend/src/Squidex.Domain.Apps.Entities/Assets/Guards/GuardAssetFolder.cs

@ -5,7 +5,6 @@
// All rights reserved. Licensed under the MIT license. // All rights reserved. Licensed under the MIT license.
// ========================================================================== // ==========================================================================
using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Squidex.Domain.Apps.Entities.Assets.Commands; using Squidex.Domain.Apps.Entities.Assets.Commands;
using Squidex.Infrastructure; using Squidex.Infrastructure;

2
backend/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs

@ -220,7 +220,7 @@ namespace Squidex.Domain.Apps.Entities.Contents
} }
} }
private async Task<Urls?> ReadUrlsAsync(IBackupReader reader) private static async Task<Urls?> ReadUrlsAsync(IBackupReader reader)
{ {
try try
{ {

1
backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AppMutationsGraphType.cs

@ -7,6 +7,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using GraphQL.Types; using GraphQL.Types;
using Squidex.Domain.Apps.Entities.Contents.GraphQL.Types.Utils;
using Squidex.Domain.Apps.Entities.Schemas; using Squidex.Domain.Apps.Entities.Schemas;
namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types

1
backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AssetActions.cs

@ -5,7 +5,6 @@
// All rights reserved. Licensed under the MIT license. // All rights reserved. Licensed under the MIT license.
// ========================================================================== // ==========================================================================
using System;
using GraphQL; using GraphQL;
using GraphQL.Resolvers; using GraphQL.Resolvers;
using GraphQL.Types; using GraphQL.Types;

4
backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ContentActions.cs

@ -263,7 +263,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types
Name = "data", Name = "data",
Description = "The data for the content.", Description = "The data for the content.",
DefaultValue = null, DefaultValue = null,
ResolvedType = new NonNullGraphType(inputType), ResolvedType = new NonNullGraphType(inputType)
}, },
new QueryArgument(AllTypes.None) new QueryArgument(AllTypes.None)
{ {
@ -305,7 +305,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types
Name = "data", Name = "data",
Description = "The data for the content.", Description = "The data for the content.",
DefaultValue = null, DefaultValue = null,
ResolvedType = new NonNullGraphType(inputType), ResolvedType = new NonNullGraphType(inputType)
}, },
new QueryArgument(AllTypes.None) new QueryArgument(AllTypes.None)
{ {

2
backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Utils/EntitySavedGraphType.cs

@ -9,7 +9,7 @@ using GraphQL.Resolvers;
using GraphQL.Types; using GraphQL.Types;
using Squidex.Infrastructure.Commands; using Squidex.Infrastructure.Commands;
namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types.Utils
{ {
public sealed class EntitySavedGraphType : ObjectGraphType<EntitySavedResult> public sealed class EntitySavedGraphType : ObjectGraphType<EntitySavedResult>
{ {

8
backend/src/Squidex.Domain.Apps.Entities/Contents/Text/TextIndexingProcess.cs

@ -321,12 +321,12 @@ namespace Squidex.Domain.Apps.Entities.Contents.Text
} }
} }
public TextIndexingProcess(ITextIndex textIndexer, ITextIndexerState textIndexerState) public TextIndexingProcess(ITextIndex textIndex, ITextIndexerState textIndexerState)
{ {
Guard.NotNull(textIndexer, nameof(textIndexer)); Guard.NotNull(textIndex, nameof(textIndex));
Guard.NotNull(textIndexerState, nameof(textIndexerState)); Guard.NotNull(textIndexerState, nameof(textIndexerState));
this.textIndex = textIndexer; this.textIndex = textIndex;
this.textIndexerState = textIndexerState; this.textIndexerState = textIndexerState;
} }
@ -336,7 +336,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.Text
await textIndexerState.ClearAsync(); await textIndexerState.ClearAsync();
} }
public async Task On(IEnumerable<Envelope<IEvent>> @events) public async Task On(IEnumerable<Envelope<IEvent>> events)
{ {
var states = await QueryStatesAsync(events); var states = await QueryStatesAsync(events);

2
backend/src/Squidex.Domain.Apps.Entities/History/HistoryService.cs

@ -63,7 +63,7 @@ namespace Squidex.Domain.Apps.Entities.History
return repository.ClearAsync(); return repository.ClearAsync();
} }
public async Task On(IEnumerable<Envelope<IEvent>> @events) public async Task On(IEnumerable<Envelope<IEvent>> events)
{ {
var targets = new List<(Envelope<AppEvent> Event, HistoryEvent? HistoryEvent)>(); var targets = new List<(Envelope<AppEvent> Event, HistoryEvent? HistoryEvent)>();

2
backend/src/Squidex.Domain.Apps.Entities/Notifications/INotificationSender.cs

@ -8,7 +8,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Squidex.Shared.Users; using Squidex.Shared.Users;
namespace Squidex.Domain.Apps.Entities.Apps.Notifications namespace Squidex.Domain.Apps.Entities.Notifications
{ {
public interface INotificationSender public interface INotificationSender
{ {

2
backend/src/Squidex.Domain.Apps.Entities/Notifications/NoopNotificationSender.cs

@ -8,7 +8,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Squidex.Shared.Users; using Squidex.Shared.Users;
namespace Squidex.Domain.Apps.Entities.Apps.Notifications namespace Squidex.Domain.Apps.Entities.Notifications
{ {
public sealed class NoopNotificationSender : INotificationSender public sealed class NoopNotificationSender : INotificationSender
{ {

2
backend/src/Squidex.Domain.Apps.Entities/Notifications/NotificationEmailSender.cs

@ -14,7 +14,7 @@ using Squidex.Infrastructure.Email;
using Squidex.Infrastructure.Log; using Squidex.Infrastructure.Log;
using Squidex.Shared.Users; using Squidex.Shared.Users;
namespace Squidex.Domain.Apps.Entities.Apps.Notifications namespace Squidex.Domain.Apps.Entities.Notifications
{ {
public sealed class NotificationEmailSender : INotificationSender public sealed class NotificationEmailSender : INotificationSender
{ {

2
backend/src/Squidex.Domain.Apps.Entities/Notifications/NotificationEmailTextOptions.cs

@ -5,7 +5,7 @@
// All rights reserved. Licensed under the MIT license. // All rights reserved. Licensed under the MIT license.
// ========================================================================== // ==========================================================================
namespace Squidex.Domain.Apps.Entities.Apps.Notifications namespace Squidex.Domain.Apps.Entities.Notifications
{ {
public sealed class NotificationEmailTextOptions public sealed class NotificationEmailTextOptions
{ {

8
backend/src/Squidex.Infrastructure/Assets/ImageSharp/ImageSharpAssetThumbnailGenerator.cs

@ -34,7 +34,7 @@ namespace Squidex.Infrastructure.Assets.ImageSharp
if (!options.IsValid) if (!options.IsValid)
{ {
source.CopyTo(destination); await source.CopyToAsync(destination);
return; return;
} }
@ -84,7 +84,7 @@ namespace Squidex.Infrastructure.Assets.ImageSharp
image.Mutate(x => x.Resize(resizeOptions)); image.Mutate(x => x.Resize(resizeOptions));
} }
image.Save(destination, encoder); await image.SaveAsync(destination, encoder);
} }
} }
finally finally
@ -93,7 +93,7 @@ namespace Squidex.Infrastructure.Assets.ImageSharp
} }
} }
private static IImageEncoder GetEncoder(ResizeOptions options, SixLabors.ImageSharp.Formats.IImageFormat? format) private static IImageEncoder GetEncoder(ResizeOptions options, IImageFormat? format)
{ {
var encoder = Configuration.Default.ImageFormatsManager.FindEncoder(format); var encoder = Configuration.Default.ImageFormatsManager.FindEncoder(format);
@ -171,7 +171,7 @@ namespace Squidex.Infrastructure.Assets.ImageSharp
image.Mutate(x => x.AutoOrient()); image.Mutate(x => x.AutoOrient());
image.Save(destination, encoder); await image.SaveAsync(destination, encoder);
return GetImageInfo(image); return GetImageInfo(image);
} }

2
backend/src/Squidex.Infrastructure/EventSourcing/Grains/BatchSubscriber.cs

@ -88,7 +88,7 @@ namespace Squidex.Infrastructure.EventSourcing.Grains
{ {
var sender = eventSubscription.Sender; var sender = eventSubscription.Sender;
foreach (var jobsBySender in jobs.GroupBy<Job, object>(x => x.Sender)) foreach (var jobsBySender in jobs.GroupBy(x => x.Sender))
{ {
if (sender != null && ReferenceEquals(jobsBySender.Key, sender)) if (sender != null && ReferenceEquals(jobsBySender.Key, sender))
{ {

2
backend/src/Squidex.Infrastructure/EventSourcing/IEventConsumer.cs

@ -37,7 +37,7 @@ namespace Squidex.Infrastructure.EventSourcing
return Task.CompletedTask; return Task.CompletedTask;
} }
async Task On(IEnumerable<Envelope<IEvent>> @events) async Task On(IEnumerable<Envelope<IEvent>> events)
{ {
foreach (var @event in events) foreach (var @event in events)
{ {

4
backend/src/Squidex.Infrastructure/Migrations/Migrator.cs

@ -35,8 +35,6 @@ namespace Squidex.Infrastructure.Migrations
public async Task MigrateAsync(CancellationToken ct = default) public async Task MigrateAsync(CancellationToken ct = default)
{ {
var version = 0;
try try
{ {
while (!await migrationStatus.TryLockAsync()) while (!await migrationStatus.TryLockAsync())
@ -48,7 +46,7 @@ namespace Squidex.Infrastructure.Migrations
await Task.Delay(LockWaitMs, ct); await Task.Delay(LockWaitMs, ct);
} }
version = await migrationStatus.GetVersionAsync(); var version = await migrationStatus.GetVersionAsync();
while (!ct.IsCancellationRequested) while (!ct.IsCancellationRequested)
{ {

2
backend/src/Squidex.Infrastructure/Reflection/Internal/ReflectionExtensions.cs

@ -10,7 +10,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
namespace Squidex.Infrastructure.Reflection namespace Squidex.Infrastructure.Reflection.Internal
{ {
public static class ReflectionExtensions public static class ReflectionExtensions
{ {

9
backend/src/Squidex.Infrastructure/Translations/ResourcesLocalizer.cs

@ -78,13 +78,13 @@ namespace Squidex.Infrastructure.Translations
{ {
if (variable.EndsWith("|lower")) if (variable.EndsWith("|lower"))
{ {
variable = variable[0..^6]; variable = variable[..^6];
shouldLower = true; shouldLower = true;
} }
if (variable.EndsWith("|upper")) if (variable.EndsWith("|upper"))
{ {
variable = variable[0..^6]; variable = variable[..^6];
shouldUpper = true; shouldUpper = true;
} }
} }
@ -111,11 +111,6 @@ namespace Squidex.Infrastructure.Translations
} }
} }
if (variableValue == null)
{
variableValue = variableName;
}
variableValue ??= variableName; variableValue ??= variableName;
if (variableValue!.Length > 0) if (variableValue!.Length > 0)

2
backend/src/Squidex.Infrastructure/Validation/LocalizedEmailAddressAttribute.cs

@ -12,7 +12,7 @@ using Squidex.Text;
namespace Squidex.Infrastructure.Validation namespace Squidex.Infrastructure.Validation
{ {
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] [AttributeUsage(AttributeTargets.Property)]
public class LocalizedEmailAddressAttribute : ValidationAttribute public class LocalizedEmailAddressAttribute : ValidationAttribute
{ {
public override bool IsValid(object value) public override bool IsValid(object value)

2
backend/src/Squidex.Infrastructure/Validation/LocalizedRangeAttribute.cs

@ -12,7 +12,7 @@ using Squidex.Text;
namespace Squidex.Infrastructure.Validation namespace Squidex.Infrastructure.Validation
{ {
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] [AttributeUsage(AttributeTargets.Property)]
public sealed class LocalizedRangeAttribute : RangeAttribute public sealed class LocalizedRangeAttribute : RangeAttribute
{ {
public LocalizedRangeAttribute(int minimum, int maximum) public LocalizedRangeAttribute(int minimum, int maximum)

2
backend/src/Squidex.Infrastructure/Validation/LocalizedRegularExpressionAttribute.cs

@ -12,7 +12,7 @@ using Squidex.Text;
namespace Squidex.Infrastructure.Validation namespace Squidex.Infrastructure.Validation
{ {
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] [AttributeUsage(AttributeTargets.Property)]
public sealed class LocalizedRegularExpressionAttribute : RegularExpressionAttribute public sealed class LocalizedRegularExpressionAttribute : RegularExpressionAttribute
{ {
public LocalizedRegularExpressionAttribute(string pattern) public LocalizedRegularExpressionAttribute(string pattern)

2
backend/src/Squidex.Infrastructure/Validation/LocalizedRequiredAttribute.cs

@ -12,7 +12,7 @@ using Squidex.Text;
namespace Squidex.Infrastructure.Validation namespace Squidex.Infrastructure.Validation
{ {
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] [AttributeUsage(AttributeTargets.Property)]
public class LocalizedRequiredAttribute : RequiredAttribute public class LocalizedRequiredAttribute : RequiredAttribute
{ {
public override string FormatErrorMessage(string name) public override string FormatErrorMessage(string name)

3
backend/src/Squidex/Areas/Frontend/Middlewares/WebpackMiddleware.cs

@ -5,10 +5,7 @@
// All rights reserved. Licensed under the MIT license. // All rights reserved. Licensed under the MIT license.
// ========================================================================== // ==========================================================================
using System.IO;
using System.Net;
using System.Net.Http; using System.Net.Http;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;

2
backend/src/Squidex/Config/Domain/NotificationsServices.cs

@ -9,7 +9,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Squidex.Domain.Apps.Entities.Apps.Invitation; using Squidex.Domain.Apps.Entities.Apps.Invitation;
using Squidex.Domain.Apps.Entities.Apps.Notifications; using Squidex.Domain.Apps.Entities.Notifications;
using Squidex.Infrastructure.Email; using Squidex.Infrastructure.Email;
using Squidex.Infrastructure.EventSourcing; using Squidex.Infrastructure.EventSourcing;

10
backend/src/Squidex/wwwroot/scripts/sidebar-search.html

@ -1,4 +1,4 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
@ -80,7 +80,7 @@
search.addWidgets([ search.addWidgets([
instantsearch.widgets.searchBox({ instantsearch.widgets.searchBox({
container: '#searchbox', container: '#searchbox'
}), }),
instantsearch.widgets.hits({ instantsearch.widgets.hits({
@ -92,11 +92,11 @@
<div class="hit-name"> <div class="hit-name">
${instantsearch.highlight({ ${instantsearch.highlight({
attribute: 'firstname', attribute: 'firstname',
hit, hit
})} })}
${instantsearch.highlight({ ${instantsearch.highlight({
attribute: 'lastname', attribute: 'lastname',
hit, hit
})} })}
<div> <div>
@ -106,7 +106,7 @@
</div> </div>
`; `;
} }
}, }
}) })
]); ]);

8
backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/EventEnricherTests.cs

@ -124,13 +124,13 @@ namespace Squidex.Domain.Apps.Core.Operations.HandleRules
A.CallTo(() => userResolver.FindByIdAsync(actor.Identifier)) A.CallTo(() => userResolver.FindByIdAsync(actor.Identifier))
.Returns(user); .Returns(user);
var @event1 = var event1 =
Envelope.Create<AppEvent>(new ContentCreated Envelope.Create<AppEvent>(new ContentCreated
{ {
Actor = actor Actor = actor
}); });
var @event2 = var event2 =
Envelope.Create<AppEvent>(new ContentCreated Envelope.Create<AppEvent>(new ContentCreated
{ {
Actor = actor Actor = actor
@ -139,8 +139,8 @@ namespace Squidex.Domain.Apps.Core.Operations.HandleRules
var enrichedEvent1 = new EnrichedContentEvent(); var enrichedEvent1 = new EnrichedContentEvent();
var enrichedEvent2 = new EnrichedContentEvent(); var enrichedEvent2 = new EnrichedContentEvent();
await sut.EnrichAsync(enrichedEvent1, @event1); await sut.EnrichAsync(enrichedEvent1, event1);
await sut.EnrichAsync(enrichedEvent2, @event2); await sut.EnrichAsync(enrichedEvent2, event2);
Assert.Equal(user, enrichedEvent1.User); Assert.Equal(user, enrichedEvent1.User);
Assert.Equal(user, enrichedEvent2.User); Assert.Equal(user, enrichedEvent2.User);

1
backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleEventFormatterCompareTests.cs

@ -5,7 +5,6 @@
// All rights reserved. Licensed under the MIT license. // All rights reserved. Licensed under the MIT license.
// ========================================================================== // ==========================================================================
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Security.Claims; using System.Security.Claims;
using System.Threading.Tasks; using System.Threading.Tasks;

2
backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/ReferencesValidatorTests.cs

@ -14,7 +14,7 @@ using Squidex.Domain.Apps.Core.ValidateContent.Validators;
using Squidex.Infrastructure; using Squidex.Infrastructure;
using Xunit; using Xunit;
namespace Squidex.Domain.Apps.Core.Operations.ValidateContent namespace Squidex.Domain.Apps.Core.Operations.ValidateContent.Validators
{ {
public class ReferencesValidatorTests : IClassFixture<TranslationsFixture> public class ReferencesValidatorTests : IClassFixture<TranslationsFixture>
{ {

4
backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Invitation/InvitationEventConsumerTests.cs

@ -9,7 +9,7 @@ using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using FakeItEasy; using FakeItEasy;
using NodaTime; using NodaTime;
using Squidex.Domain.Apps.Entities.Apps.Notifications; using Squidex.Domain.Apps.Entities.Notifications;
using Squidex.Domain.Apps.Events.Apps; using Squidex.Domain.Apps.Events.Apps;
using Squidex.Infrastructure; using Squidex.Infrastructure;
using Squidex.Infrastructure.EventSourcing; using Squidex.Infrastructure.EventSourcing;
@ -17,7 +17,7 @@ using Squidex.Infrastructure.Log;
using Squidex.Shared.Users; using Squidex.Shared.Users;
using Xunit; using Xunit;
namespace Squidex.Domain.Apps.Entities.Apps.Invitation.Notifications namespace Squidex.Domain.Apps.Entities.Apps.Invitation
{ {
public class InvitationEventConsumerTests public class InvitationEventConsumerTests
{ {

1
backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLMutationTests.cs

@ -5,7 +5,6 @@
// All rights reserved. Licensed under the MIT license. // All rights reserved. Licensed under the MIT license.
// ========================================================================== // ==========================================================================
using System;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using FakeItEasy; using FakeItEasy;

1
backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/ReferenceFluidExtensionTests.cs

@ -5,7 +5,6 @@
// All rights reserved. Licensed under the MIT license. // All rights reserved. Licensed under the MIT license.
// ========================================================================== // ==========================================================================
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using FakeItEasy; using FakeItEasy;

2
backend/tests/Squidex.Domain.Apps.Entities.Tests/Notifications/NotificationEmailSenderTests.cs

@ -18,7 +18,7 @@ using Squidex.Shared.Identity;
using Squidex.Shared.Users; using Squidex.Shared.Users;
using Xunit; using Xunit;
namespace Squidex.Domain.Apps.Entities.Apps.Notifications namespace Squidex.Domain.Apps.Entities.Notifications
{ {
public class NotificationEmailSenderTests public class NotificationEmailSenderTests
{ {

1
backend/tests/Squidex.Infrastructure.Tests/Commands/CommandContextTests.cs

@ -5,7 +5,6 @@
// All rights reserved. Licensed under the MIT license. // All rights reserved. Licensed under the MIT license.
// ========================================================================== // ==========================================================================
using System;
using FakeItEasy; using FakeItEasy;
using Squidex.Infrastructure.TestHelpers; using Squidex.Infrastructure.TestHelpers;
using Xunit; using Xunit;

1
backend/tests/Squidex.Infrastructure.Tests/Reflection/ReflectionExtensionTests.cs

@ -6,6 +6,7 @@
// ========================================================================== // ==========================================================================
using System.Linq; using System.Linq;
using Squidex.Infrastructure.Reflection.Internal;
using Xunit; using Xunit;
namespace Squidex.Infrastructure.Reflection namespace Squidex.Infrastructure.Reflection

4
backend/tests/Squidex.Web.Tests/Pipeline/RequestExceptionMiddlewareTests.cs

@ -29,12 +29,12 @@ namespace Squidex.Web.Pipeline
public RequestExceptionMiddlewareTests() public RequestExceptionMiddlewareTests()
{ {
next = new RequestDelegate(context => next = context =>
{ {
isNextCalled = true; isNextCalled = true;
return Task.CompletedTask; return Task.CompletedTask;
}); };
httpContext.Features.Set(responseFeature); httpContext.Features.Set(responseFeature);

2
backend/tests/Squidex.Web.Tests/Pipeline/UsageMiddlewareTests.cs

@ -162,7 +162,7 @@ namespace Squidex.Web.Pipeline
var tempFileName = Path.GetTempFileName(); var tempFileName = Path.GetTempFileName();
try try
{ {
File.WriteAllText(tempFileName, "Hello World"); await File.WriteAllTextAsync(tempFileName, "Hello World");
await sut.InvokeAsync(httpContext, async x => await sut.InvokeAsync(httpContext, async x =>
{ {

Loading…
Cancel
Save