diff --git a/backend/extensions/Squidex.Extensions/Actions/Comment/CommentActionHandler.cs b/backend/extensions/Squidex.Extensions/Actions/Comment/CommentActionHandler.cs index 7264542b9..86e1c072b 100644 --- a/backend/extensions/Squidex.Extensions/Actions/Comment/CommentActionHandler.cs +++ b/backend/extensions/Squidex.Extensions/Actions/Comment/CommentActionHandler.cs @@ -34,7 +34,7 @@ namespace Squidex.Extensions.Actions.Comment { var ruleJob = new CreateComment { - AppId = contentEvent.AppId, + AppId = contentEvent.AppId }; ruleJob.Text = await FormatAsync(action.Text, @event); diff --git a/backend/extensions/Squidex.Extensions/Actions/CreateContent/CreateContentActionHandler.cs b/backend/extensions/Squidex.Extensions/Actions/CreateContent/CreateContentActionHandler.cs index 3e87610d1..b7108e782 100644 --- a/backend/extensions/Squidex.Extensions/Actions/CreateContent/CreateContentActionHandler.cs +++ b/backend/extensions/Squidex.Extensions/Actions/CreateContent/CreateContentActionHandler.cs @@ -43,7 +43,7 @@ namespace Squidex.Extensions.Actions.CreateContent { var ruleJob = new Command { - AppId = @event.AppId, + AppId = @event.AppId }; var schema = await appProvider.GetSchemaAsync(@event.AppId.Id, action.Schema, true); diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/ContentSchemaBuilder.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/ContentSchemaBuilder.cs index 54c05fe0c..4dd3deb8a 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/GenerateJsonSchema/ContentSchemaBuilder.cs +++ b/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), ["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), - ["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) }, Type = JsonObjectType.Object diff --git a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentDataObject.cs b/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentDataObject.cs index 148434072..fa8fc2836 100644 --- a/backend/src/Squidex.Domain.Apps.Core.Operations/Scripting/ContentWrapper/ContentDataObject.cs +++ b/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) { - if (fieldsToDelete == null) - { - fieldsToDelete = new HashSet(); - } - var propertyName = property.AsString(); + fieldsToDelete ??= new HashSet(); fieldsToDelete.Add(propertyName); + fieldProperties?.Remove(propertyName); MarkChanged(); diff --git a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/Adapt.cs b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/Adapt.cs index 1f0559a08..719233d18 100644 --- a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/Adapt.cs +++ b/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 PropertyMap = typeof(MongoContentEntity).GetProperties() .ToDictionary( - x => ToElementName(x), - x => ToName(x), + ToElementName, + ToName, StringComparer.OrdinalIgnoreCase); private static string ToName(PropertyInfo x) diff --git a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/QueryContentsByQuery.cs b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/QueryContentsByQuery.cs index 01c6e1bdb..da70459a9 100644 --- a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/QueryContentsByQuery.cs +++ b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Contents/Operations/QueryContentsByQuery.cs @@ -9,7 +9,6 @@ using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; -using MongoDB.Bson; using MongoDB.Bson.Serialization.Attributes; using MongoDB.Driver; using Squidex.Domain.Apps.Entities.Apps; diff --git a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Rules/MongoRuleEventEntity.cs b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Rules/MongoRuleEventEntity.cs index c593753ca..20744a37d 100644 --- a/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Rules/MongoRuleEventEntity.cs +++ b/backend/src/Squidex.Domain.Apps.Entities.MongoDb/Rules/MongoRuleEventEntity.cs @@ -31,6 +31,14 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Rules [BsonElement] public DomainId RuleId { get; set; } + [BsonRequired] + [BsonElement] + public Instant Created { get; set; } + + [BsonRequired] + [BsonElement] + public Instant LastModified { get; set; } + [BsonRequired] [BsonElement] [BsonRepresentation(BsonType.String)] diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InvitationEventConsumer.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InvitationEventConsumer.cs index 5a994c13a..9f0c958bf 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InvitationEventConsumer.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/Invitation/InvitationEventConsumer.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using NodaTime; -using Squidex.Domain.Apps.Entities.Apps.Notifications; +using Squidex.Domain.Apps.Entities.Notifications; using Squidex.Domain.Apps.Events.Apps; using Squidex.Infrastructure; using Squidex.Infrastructure.EventSourcing; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/UsageNotifierGrain.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/UsageNotifierGrain.cs index 45c455d11..b8aa330f5 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/UsageNotifierGrain.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/Plans/UsageNotifierGrain.cs @@ -8,7 +8,7 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; -using Squidex.Domain.Apps.Entities.Apps.Notifications; +using Squidex.Domain.Apps.Entities.Notifications; using Squidex.Infrastructure; using Squidex.Infrastructure.Orleans; using Squidex.Infrastructure.States; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetDomainObject.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetDomainObject.cs index 7e4b3a29c..e422d8961 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetDomainObject.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetDomainObject.cs @@ -166,7 +166,7 @@ namespace Squidex.Domain.Apps.Entities.Assets { MimeType = command.File.MimeType, FileVersion = Snapshot.FileVersion + 1, - FileSize = command.File.FileSize, + FileSize = command.File.FileSize }); RaiseEvent(@event); diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetFolderDomainObject.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetFolderDomainObject.cs index 6666a8a46..3f5c25297 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetFolderDomainObject.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/AssetFolderDomainObject.cs @@ -18,7 +18,6 @@ using Squidex.Infrastructure.EventSourcing; using Squidex.Infrastructure.Log; using Squidex.Infrastructure.Reflection; using Squidex.Infrastructure.States; -using Squidex.Infrastructure.Translations; namespace Squidex.Domain.Apps.Entities.Assets { diff --git a/backend/src/Squidex.Domain.Apps.Entities/Assets/Guards/GuardAssetFolder.cs b/backend/src/Squidex.Domain.Apps.Entities/Assets/Guards/GuardAssetFolder.cs index 70a24f426..21aa6665d 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Assets/Guards/GuardAssetFolder.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Assets/Guards/GuardAssetFolder.cs @@ -5,7 +5,6 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -using System; using System.Threading.Tasks; using Squidex.Domain.Apps.Entities.Assets.Commands; using Squidex.Infrastructure; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs index ae4d05ce1..f0c97bd1e 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/BackupContents.cs @@ -220,7 +220,7 @@ namespace Squidex.Domain.Apps.Entities.Contents } } - private async Task ReadUrlsAsync(IBackupReader reader) + private static async Task ReadUrlsAsync(IBackupReader reader) { try { diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AppMutationsGraphType.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AppMutationsGraphType.cs index fd1b0c19e..46822dfc3 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AppMutationsGraphType.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AppMutationsGraphType.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using GraphQL.Types; +using Squidex.Domain.Apps.Entities.Contents.GraphQL.Types.Utils; using Squidex.Domain.Apps.Entities.Schemas; namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AssetActions.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AssetActions.cs index 23cf13eaa..9cf14ff05 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AssetActions.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/AssetActions.cs @@ -5,7 +5,6 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -using System; using GraphQL; using GraphQL.Resolvers; using GraphQL.Types; diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ContentActions.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ContentActions.cs index 936d0291c..1581c371d 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/ContentActions.cs +++ b/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", Description = "The data for the content.", DefaultValue = null, - ResolvedType = new NonNullGraphType(inputType), + ResolvedType = new NonNullGraphType(inputType) }, new QueryArgument(AllTypes.None) { @@ -305,7 +305,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.GraphQL.Types Name = "data", Description = "The data for the content.", DefaultValue = null, - ResolvedType = new NonNullGraphType(inputType), + ResolvedType = new NonNullGraphType(inputType) }, new QueryArgument(AllTypes.None) { diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Utils/EntitySavedGraphType.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Utils/EntitySavedGraphType.cs index 5d01f83bd..976732567 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Utils/EntitySavedGraphType.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Contents/GraphQL/Types/Utils/EntitySavedGraphType.cs @@ -9,7 +9,7 @@ using GraphQL.Resolvers; using GraphQL.Types; 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 { diff --git a/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/TextIndexingProcess.cs b/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/TextIndexingProcess.cs index ef54f6863..7e4cd154d 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Contents/Text/TextIndexingProcess.cs +++ b/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)); - this.textIndex = textIndexer; + this.textIndex = textIndex; this.textIndexerState = textIndexerState; } @@ -336,7 +336,7 @@ namespace Squidex.Domain.Apps.Entities.Contents.Text await textIndexerState.ClearAsync(); } - public async Task On(IEnumerable> @events) + public async Task On(IEnumerable> events) { var states = await QueryStatesAsync(events); diff --git a/backend/src/Squidex.Domain.Apps.Entities/History/HistoryService.cs b/backend/src/Squidex.Domain.Apps.Entities/History/HistoryService.cs index b994ec7d7..293d08510 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/History/HistoryService.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/History/HistoryService.cs @@ -63,7 +63,7 @@ namespace Squidex.Domain.Apps.Entities.History return repository.ClearAsync(); } - public async Task On(IEnumerable> @events) + public async Task On(IEnumerable> events) { var targets = new List<(Envelope Event, HistoryEvent? HistoryEvent)>(); diff --git a/backend/src/Squidex.Domain.Apps.Entities/Notifications/INotificationSender.cs b/backend/src/Squidex.Domain.Apps.Entities/Notifications/INotificationSender.cs index 0ea909ec3..2dbd3e149 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Notifications/INotificationSender.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Notifications/INotificationSender.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; using Squidex.Shared.Users; -namespace Squidex.Domain.Apps.Entities.Apps.Notifications +namespace Squidex.Domain.Apps.Entities.Notifications { public interface INotificationSender { diff --git a/backend/src/Squidex.Domain.Apps.Entities/Notifications/NoopNotificationSender.cs b/backend/src/Squidex.Domain.Apps.Entities/Notifications/NoopNotificationSender.cs index 00f18548e..bd37c0193 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Notifications/NoopNotificationSender.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Notifications/NoopNotificationSender.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; using Squidex.Shared.Users; -namespace Squidex.Domain.Apps.Entities.Apps.Notifications +namespace Squidex.Domain.Apps.Entities.Notifications { public sealed class NoopNotificationSender : INotificationSender { diff --git a/backend/src/Squidex.Domain.Apps.Entities/Notifications/NotificationEmailSender.cs b/backend/src/Squidex.Domain.Apps.Entities/Notifications/NotificationEmailSender.cs index 92c1e545a..d9ccf9334 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Notifications/NotificationEmailSender.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Notifications/NotificationEmailSender.cs @@ -14,7 +14,7 @@ using Squidex.Infrastructure.Email; using Squidex.Infrastructure.Log; using Squidex.Shared.Users; -namespace Squidex.Domain.Apps.Entities.Apps.Notifications +namespace Squidex.Domain.Apps.Entities.Notifications { public sealed class NotificationEmailSender : INotificationSender { diff --git a/backend/src/Squidex.Domain.Apps.Entities/Notifications/NotificationEmailTextOptions.cs b/backend/src/Squidex.Domain.Apps.Entities/Notifications/NotificationEmailTextOptions.cs index 3a7d392c9..93f7a2788 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Notifications/NotificationEmailTextOptions.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Notifications/NotificationEmailTextOptions.cs @@ -5,7 +5,7 @@ // 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 { diff --git a/backend/src/Squidex.Infrastructure/Assets/ImageSharp/ImageSharpAssetThumbnailGenerator.cs b/backend/src/Squidex.Infrastructure/Assets/ImageSharp/ImageSharpAssetThumbnailGenerator.cs index 4c62c5f39..18e9c682b 100644 --- a/backend/src/Squidex.Infrastructure/Assets/ImageSharp/ImageSharpAssetThumbnailGenerator.cs +++ b/backend/src/Squidex.Infrastructure/Assets/ImageSharp/ImageSharpAssetThumbnailGenerator.cs @@ -34,7 +34,7 @@ namespace Squidex.Infrastructure.Assets.ImageSharp if (!options.IsValid) { - source.CopyTo(destination); + await source.CopyToAsync(destination); return; } @@ -84,7 +84,7 @@ namespace Squidex.Infrastructure.Assets.ImageSharp image.Mutate(x => x.Resize(resizeOptions)); } - image.Save(destination, encoder); + await image.SaveAsync(destination, encoder); } } 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); @@ -171,7 +171,7 @@ namespace Squidex.Infrastructure.Assets.ImageSharp image.Mutate(x => x.AutoOrient()); - image.Save(destination, encoder); + await image.SaveAsync(destination, encoder); return GetImageInfo(image); } diff --git a/backend/src/Squidex.Infrastructure/EventSourcing/Grains/BatchSubscriber.cs b/backend/src/Squidex.Infrastructure/EventSourcing/Grains/BatchSubscriber.cs index f271b8ae6..b6fc92c0f 100644 --- a/backend/src/Squidex.Infrastructure/EventSourcing/Grains/BatchSubscriber.cs +++ b/backend/src/Squidex.Infrastructure/EventSourcing/Grains/BatchSubscriber.cs @@ -88,7 +88,7 @@ namespace Squidex.Infrastructure.EventSourcing.Grains { var sender = eventSubscription.Sender; - foreach (var jobsBySender in jobs.GroupBy(x => x.Sender)) + foreach (var jobsBySender in jobs.GroupBy(x => x.Sender)) { if (sender != null && ReferenceEquals(jobsBySender.Key, sender)) { diff --git a/backend/src/Squidex.Infrastructure/EventSourcing/IEventConsumer.cs b/backend/src/Squidex.Infrastructure/EventSourcing/IEventConsumer.cs index 078cc039a..1ce73e313 100644 --- a/backend/src/Squidex.Infrastructure/EventSourcing/IEventConsumer.cs +++ b/backend/src/Squidex.Infrastructure/EventSourcing/IEventConsumer.cs @@ -37,7 +37,7 @@ namespace Squidex.Infrastructure.EventSourcing return Task.CompletedTask; } - async Task On(IEnumerable> @events) + async Task On(IEnumerable> events) { foreach (var @event in events) { diff --git a/backend/src/Squidex.Infrastructure/Migrations/Migrator.cs b/backend/src/Squidex.Infrastructure/Migrations/Migrator.cs index 5aff98ff6..290aa5b24 100644 --- a/backend/src/Squidex.Infrastructure/Migrations/Migrator.cs +++ b/backend/src/Squidex.Infrastructure/Migrations/Migrator.cs @@ -35,8 +35,6 @@ namespace Squidex.Infrastructure.Migrations public async Task MigrateAsync(CancellationToken ct = default) { - var version = 0; - try { while (!await migrationStatus.TryLockAsync()) @@ -48,7 +46,7 @@ namespace Squidex.Infrastructure.Migrations await Task.Delay(LockWaitMs, ct); } - version = await migrationStatus.GetVersionAsync(); + var version = await migrationStatus.GetVersionAsync(); while (!ct.IsCancellationRequested) { diff --git a/backend/src/Squidex.Infrastructure/Reflection/Internal/ReflectionExtensions.cs b/backend/src/Squidex.Infrastructure/Reflection/Internal/ReflectionExtensions.cs index 55354eb13..9ae41b54a 100644 --- a/backend/src/Squidex.Infrastructure/Reflection/Internal/ReflectionExtensions.cs +++ b/backend/src/Squidex.Infrastructure/Reflection/Internal/ReflectionExtensions.cs @@ -10,7 +10,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; -namespace Squidex.Infrastructure.Reflection +namespace Squidex.Infrastructure.Reflection.Internal { public static class ReflectionExtensions { diff --git a/backend/src/Squidex.Infrastructure/Translations/ResourcesLocalizer.cs b/backend/src/Squidex.Infrastructure/Translations/ResourcesLocalizer.cs index aaba74405..cf54cb817 100644 --- a/backend/src/Squidex.Infrastructure/Translations/ResourcesLocalizer.cs +++ b/backend/src/Squidex.Infrastructure/Translations/ResourcesLocalizer.cs @@ -78,13 +78,13 @@ namespace Squidex.Infrastructure.Translations { if (variable.EndsWith("|lower")) { - variable = variable[0..^6]; + variable = variable[..^6]; shouldLower = true; } if (variable.EndsWith("|upper")) { - variable = variable[0..^6]; + variable = variable[..^6]; shouldUpper = true; } } @@ -111,11 +111,6 @@ namespace Squidex.Infrastructure.Translations } } - if (variableValue == null) - { - variableValue = variableName; - } - variableValue ??= variableName; if (variableValue!.Length > 0) diff --git a/backend/src/Squidex.Infrastructure/Validation/LocalizedEmailAddressAttribute.cs b/backend/src/Squidex.Infrastructure/Validation/LocalizedEmailAddressAttribute.cs index e16ff40aa..fb224e3ab 100644 --- a/backend/src/Squidex.Infrastructure/Validation/LocalizedEmailAddressAttribute.cs +++ b/backend/src/Squidex.Infrastructure/Validation/LocalizedEmailAddressAttribute.cs @@ -12,7 +12,7 @@ using Squidex.Text; namespace Squidex.Infrastructure.Validation { - [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] + [AttributeUsage(AttributeTargets.Property)] public class LocalizedEmailAddressAttribute : ValidationAttribute { public override bool IsValid(object value) diff --git a/backend/src/Squidex.Infrastructure/Validation/LocalizedRangeAttribute.cs b/backend/src/Squidex.Infrastructure/Validation/LocalizedRangeAttribute.cs index 068fc4e73..ca3e41fd6 100644 --- a/backend/src/Squidex.Infrastructure/Validation/LocalizedRangeAttribute.cs +++ b/backend/src/Squidex.Infrastructure/Validation/LocalizedRangeAttribute.cs @@ -12,7 +12,7 @@ using Squidex.Text; namespace Squidex.Infrastructure.Validation { - [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] + [AttributeUsage(AttributeTargets.Property)] public sealed class LocalizedRangeAttribute : RangeAttribute { public LocalizedRangeAttribute(int minimum, int maximum) diff --git a/backend/src/Squidex.Infrastructure/Validation/LocalizedRegularExpressionAttribute.cs b/backend/src/Squidex.Infrastructure/Validation/LocalizedRegularExpressionAttribute.cs index e837aaeab..174ef3ced 100644 --- a/backend/src/Squidex.Infrastructure/Validation/LocalizedRegularExpressionAttribute.cs +++ b/backend/src/Squidex.Infrastructure/Validation/LocalizedRegularExpressionAttribute.cs @@ -12,7 +12,7 @@ using Squidex.Text; namespace Squidex.Infrastructure.Validation { - [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] + [AttributeUsage(AttributeTargets.Property)] public sealed class LocalizedRegularExpressionAttribute : RegularExpressionAttribute { public LocalizedRegularExpressionAttribute(string pattern) diff --git a/backend/src/Squidex.Infrastructure/Validation/LocalizedRequiredAttribute.cs b/backend/src/Squidex.Infrastructure/Validation/LocalizedRequiredAttribute.cs index 2eebfda78..50b0c334b 100644 --- a/backend/src/Squidex.Infrastructure/Validation/LocalizedRequiredAttribute.cs +++ b/backend/src/Squidex.Infrastructure/Validation/LocalizedRequiredAttribute.cs @@ -12,7 +12,7 @@ using Squidex.Text; namespace Squidex.Infrastructure.Validation { - [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] + [AttributeUsage(AttributeTargets.Property)] public class LocalizedRequiredAttribute : RequiredAttribute { public override string FormatErrorMessage(string name) diff --git a/backend/src/Squidex/Areas/Frontend/Middlewares/WebpackMiddleware.cs b/backend/src/Squidex/Areas/Frontend/Middlewares/WebpackMiddleware.cs index 694167c1f..64cd52412 100644 --- a/backend/src/Squidex/Areas/Frontend/Middlewares/WebpackMiddleware.cs +++ b/backend/src/Squidex/Areas/Frontend/Middlewares/WebpackMiddleware.cs @@ -5,10 +5,7 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -using System.IO; -using System.Net; using System.Net.Http; -using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; diff --git a/backend/src/Squidex/Config/Domain/NotificationsServices.cs b/backend/src/Squidex/Config/Domain/NotificationsServices.cs index 18660e001..d85ca41c8 100644 --- a/backend/src/Squidex/Config/Domain/NotificationsServices.cs +++ b/backend/src/Squidex/Config/Domain/NotificationsServices.cs @@ -9,7 +9,7 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; 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.EventSourcing; diff --git a/backend/src/Squidex/wwwroot/scripts/sidebar-search.html b/backend/src/Squidex/wwwroot/scripts/sidebar-search.html index 8ba7ff6a3..9a8e59d13 100644 --- a/backend/src/Squidex/wwwroot/scripts/sidebar-search.html +++ b/backend/src/Squidex/wwwroot/scripts/sidebar-search.html @@ -1,4 +1,4 @@ - + @@ -80,7 +80,7 @@ search.addWidgets([ instantsearch.widgets.searchBox({ - container: '#searchbox', + container: '#searchbox' }), instantsearch.widgets.hits({ @@ -92,11 +92,11 @@
${instantsearch.highlight({ attribute: 'firstname', - hit, + hit })} ${instantsearch.highlight({ attribute: 'lastname', - hit, + hit })}
@@ -106,7 +106,7 @@
`; } - }, + } }) ]); diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/EventEnricherTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/EventEnricherTests.cs index c51b52099..820e5698c 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/EventEnricherTests.cs +++ b/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)) .Returns(user); - var @event1 = + var event1 = Envelope.Create(new ContentCreated { Actor = actor }); - var @event2 = + var event2 = Envelope.Create(new ContentCreated { Actor = actor @@ -139,8 +139,8 @@ namespace Squidex.Domain.Apps.Core.Operations.HandleRules var enrichedEvent1 = new EnrichedContentEvent(); var enrichedEvent2 = new EnrichedContentEvent(); - await sut.EnrichAsync(enrichedEvent1, @event1); - await sut.EnrichAsync(enrichedEvent2, @event2); + await sut.EnrichAsync(enrichedEvent1, event1); + await sut.EnrichAsync(enrichedEvent2, event2); Assert.Equal(user, enrichedEvent1.User); Assert.Equal(user, enrichedEvent2.User); diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleEventFormatterCompareTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleEventFormatterCompareTests.cs index 2798e91bc..5f38269c0 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleEventFormatterCompareTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/HandleRules/RuleEventFormatterCompareTests.cs @@ -5,7 +5,6 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -using System; using System.Collections.Generic; using System.Security.Claims; using System.Threading.Tasks; diff --git a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/ReferencesValidatorTests.cs b/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/ReferencesValidatorTests.cs index 41b2338aa..3b0fd1bcd 100644 --- a/backend/tests/Squidex.Domain.Apps.Core.Tests/Operations/ValidateContent/Validators/ReferencesValidatorTests.cs +++ b/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 Xunit; -namespace Squidex.Domain.Apps.Core.Operations.ValidateContent +namespace Squidex.Domain.Apps.Core.Operations.ValidateContent.Validators { public class ReferencesValidatorTests : IClassFixture { diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Invitation/InvitationEventConsumerTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Invitation/InvitationEventConsumerTests.cs index 5968ee59a..02570b44e 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Invitation/InvitationEventConsumerTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Invitation/InvitationEventConsumerTests.cs @@ -9,7 +9,7 @@ using System; using System.Threading.Tasks; using FakeItEasy; using NodaTime; -using Squidex.Domain.Apps.Entities.Apps.Notifications; +using Squidex.Domain.Apps.Entities.Notifications; using Squidex.Domain.Apps.Events.Apps; using Squidex.Infrastructure; using Squidex.Infrastructure.EventSourcing; @@ -17,7 +17,7 @@ using Squidex.Infrastructure.Log; using Squidex.Shared.Users; using Xunit; -namespace Squidex.Domain.Apps.Entities.Apps.Invitation.Notifications +namespace Squidex.Domain.Apps.Entities.Apps.Invitation { public class InvitationEventConsumerTests { diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLMutationTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLMutationTests.cs index c8c04ff66..81476b43c 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLMutationTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/GraphQL/GraphQLMutationTests.cs @@ -5,7 +5,6 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -using System; using System.Text.RegularExpressions; using System.Threading.Tasks; using FakeItEasy; diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/ReferenceFluidExtensionTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/ReferenceFluidExtensionTests.cs index 66632b4ea..a2c3eb5d0 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/ReferenceFluidExtensionTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Contents/ReferenceFluidExtensionTests.cs @@ -5,7 +5,6 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -using System; using System.Collections.Generic; using System.Threading.Tasks; using FakeItEasy; diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Notifications/NotificationEmailSenderTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Notifications/NotificationEmailSenderTests.cs index 7b321c3e8..05c010679 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Notifications/NotificationEmailSenderTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Notifications/NotificationEmailSenderTests.cs @@ -18,7 +18,7 @@ using Squidex.Shared.Identity; using Squidex.Shared.Users; using Xunit; -namespace Squidex.Domain.Apps.Entities.Apps.Notifications +namespace Squidex.Domain.Apps.Entities.Notifications { public class NotificationEmailSenderTests { diff --git a/backend/tests/Squidex.Infrastructure.Tests/Commands/CommandContextTests.cs b/backend/tests/Squidex.Infrastructure.Tests/Commands/CommandContextTests.cs index 6fcfcb452..96e3f11ab 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/Commands/CommandContextTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/Commands/CommandContextTests.cs @@ -5,7 +5,6 @@ // All rights reserved. Licensed under the MIT license. // ========================================================================== -using System; using FakeItEasy; using Squidex.Infrastructure.TestHelpers; using Xunit; diff --git a/backend/tests/Squidex.Infrastructure.Tests/Reflection/ReflectionExtensionTests.cs b/backend/tests/Squidex.Infrastructure.Tests/Reflection/ReflectionExtensionTests.cs index 183cd3a3e..a9020517b 100644 --- a/backend/tests/Squidex.Infrastructure.Tests/Reflection/ReflectionExtensionTests.cs +++ b/backend/tests/Squidex.Infrastructure.Tests/Reflection/ReflectionExtensionTests.cs @@ -6,6 +6,7 @@ // ========================================================================== using System.Linq; +using Squidex.Infrastructure.Reflection.Internal; using Xunit; namespace Squidex.Infrastructure.Reflection diff --git a/backend/tests/Squidex.Web.Tests/Pipeline/RequestExceptionMiddlewareTests.cs b/backend/tests/Squidex.Web.Tests/Pipeline/RequestExceptionMiddlewareTests.cs index ed18f50fb..cdfa9334c 100644 --- a/backend/tests/Squidex.Web.Tests/Pipeline/RequestExceptionMiddlewareTests.cs +++ b/backend/tests/Squidex.Web.Tests/Pipeline/RequestExceptionMiddlewareTests.cs @@ -29,12 +29,12 @@ namespace Squidex.Web.Pipeline public RequestExceptionMiddlewareTests() { - next = new RequestDelegate(context => + next = context => { isNextCalled = true; return Task.CompletedTask; - }); + }; httpContext.Features.Set(responseFeature); diff --git a/backend/tests/Squidex.Web.Tests/Pipeline/UsageMiddlewareTests.cs b/backend/tests/Squidex.Web.Tests/Pipeline/UsageMiddlewareTests.cs index 400f9878f..8d1389ff1 100644 --- a/backend/tests/Squidex.Web.Tests/Pipeline/UsageMiddlewareTests.cs +++ b/backend/tests/Squidex.Web.Tests/Pipeline/UsageMiddlewareTests.cs @@ -162,7 +162,7 @@ namespace Squidex.Web.Pipeline var tempFileName = Path.GetTempFileName(); try { - File.WriteAllText(tempFileName, "Hello World"); + await File.WriteAllTextAsync(tempFileName, "Hello World"); await sut.InvokeAsync(httpContext, async x => {