From 92a88efa65d4f5cde57507d2dd36b16ecbc7773e Mon Sep 17 00:00:00 2001 From: Tobias Klika Date: Wed, 7 Oct 2020 00:07:52 +0200 Subject: [PATCH] ++ --- zero.Core/Extensions/ServiceCollectionExtensions.cs | 8 ++++---- zero.Debug/TestData/TestPlugin.cs | 8 ++++++-- zero.Web.UI/App/editor/editor.vue | 11 +++++++---- zero.Web.UI/Sass/Modules/_button.scss | 3 ++- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/zero.Core/Extensions/ServiceCollectionExtensions.cs b/zero.Core/Extensions/ServiceCollectionExtensions.cs index 826b7fce..6c93cc89 100644 --- a/zero.Core/Extensions/ServiceCollectionExtensions.cs +++ b/zero.Core/Extensions/ServiceCollectionExtensions.cs @@ -13,13 +13,13 @@ namespace zero.Core.Extensions /// /// Adds all found implementations based on the service type and assembly discovery rules /// - public static void AddAll(this IServiceCollection services, ServiceLifetime lifetime = ServiceLifetime.Transient) => services.AddAll(typeof(TService), lifetime); + public static void AddAll(this IServiceCollection services, ServiceLifetime lifetime = ServiceLifetime.Transient, bool asSelf = false) => services.AddAll(typeof(TService), lifetime, asSelf); /// /// Adds all found implementations based on the service type and assembly discovery rules /// - public static void AddAll(this IServiceCollection services, Type serviceType, ServiceLifetime lifetime = ServiceLifetime.Transient) + public static void AddAll(this IServiceCollection services, Type serviceType, ServiceLifetime lifetime = ServiceLifetime.Transient, bool asSelf = false) { if (AssemblyDiscovery.Current == null) { @@ -42,7 +42,7 @@ namespace zero.Core.Extensions foreach ((Type, Type) match in matches) { - services.Add(new ServiceDescriptor(match.Item1, match.Item2, lifetime)); + services.Add(new ServiceDescriptor(asSelf ? match.Item2 : match.Item1, match.Item2, lifetime)); } } // add implementations with specific service types @@ -50,7 +50,7 @@ namespace zero.Core.Extensions { foreach (Type type in AssemblyDiscovery.Current.GetTypes(serviceType)) { - services.Add(new ServiceDescriptor(serviceType, type, lifetime)); + services.Add(new ServiceDescriptor(asSelf ? type : serviceType, type, lifetime)); } } } diff --git a/zero.Debug/TestData/TestPlugin.cs b/zero.Debug/TestData/TestPlugin.cs index dac39157..2bc2b332 100644 --- a/zero.Debug/TestData/TestPlugin.cs +++ b/zero.Debug/TestData/TestPlugin.cs @@ -4,8 +4,10 @@ using System.Collections.Generic; using zero.Commerce.Options; using zero.Core.Options; using zero.Core.Plugins; +using zero.Core.Extensions; using zero.Debug.Sync; using zero.Debug.TestData; +using zero.Core.Messages; namespace zero.TestData { @@ -52,8 +54,10 @@ namespace zero.TestData opts.ChannelFeatures.Add("channel.altFrontend", "Alternative header", "Render a simplified header in the frontend"); }); - services.AddTransient(); // TODO auto-register handlers - services.AddTransient(); + services.AddAll(typeof(IMessageHandler<>), ServiceLifetime.Transient, true); + + //services.AddTransient(); // TODO auto-register handlers + //services.AddTransient(); services.AddTransient(); } } diff --git a/zero.Web.UI/App/editor/editor.vue b/zero.Web.UI/App/editor/editor.vue index cb8bffbf..f285795e 100644 --- a/zero.Web.UI/App/editor/editor.vue +++ b/zero.Web.UI/App/editor/editor.vue @@ -11,13 +11,14 @@
- +

This entity is bound to a parent and automatically synchronised.

- + +
@@ -353,7 +354,8 @@ { display: grid; grid-template-columns: auto minmax(0, 1fr); - grid-gap: 20px; + grid-gap: 16px; + padding-bottom: 10px; align-items: center; font-size: var(--font-size); line-height: 1.5; @@ -366,8 +368,9 @@ i { - font-size: 32px; + font-size: 28px; color: var(--color-text); + margin-top: -2px; } & + .ui-button diff --git a/zero.Web.UI/Sass/Modules/_button.scss b/zero.Web.UI/Sass/Modules/_button.scss index 972c4fa6..6893ca84 100644 --- a/zero.Web.UI/Sass/Modules/_button.scss +++ b/zero.Web.UI/Sass/Modules/_button.scss @@ -71,7 +71,8 @@ button::-moz-focus-inner &.type-small { - height: 32px; + height: 34px; + font-size: var(--font-size-s); padding: 0 12px; }