Browse Source

More logging and bugfixes

pull/1/head
Sebastian 9 years ago
parent
commit
4acd38151a
  1. 2
      src/Squidex.Infrastructure/CQRS/Events/EventReceiver.cs
  2. 9
      src/Squidex.Read/Schemas/SchemaHistoryEventsCreator.cs
  3. 10
      src/Squidex/Config/Domain/EventBusModule.cs
  4. 2
      src/Squidex/Properties/launchSettings.json
  5. 2
      src/Squidex/app/features/schemas/pages/schema/schema-page.component.ts
  6. 6
      src/Squidex/app/framework/angular/control-errors.component.scss
  7. 2
      src/Squidex/app/theme/_bootstrap.scss
  8. 4
      src/Squidex/app/theme/_panels.scss

2
src/Squidex.Infrastructure/CQRS/Events/EventReceiver.cs

@ -77,6 +77,8 @@ namespace Squidex.Infrastructure.CQRS.Events
{ {
DispatchConsumers(catchConsumers, @event); DispatchConsumers(catchConsumers, @event);
} }
logger.LogDebug("Event {0} handled", @event.Payload.GetType().Name);
}); });
isSubscribed = true; isSubscribed = true;

9
src/Squidex.Read/Schemas/SchemaHistoryEventsCreator.cs

@ -87,6 +87,14 @@ namespace Squidex.Read.Schemas
var result = ForEvent(@event.Payload, channel).AddParameter("Name", schemaName); var result = ForEvent(@event.Payload, channel).AddParameter("Name", schemaName);
var fieldAdded = @event.Payload as FieldAdded;
if (fieldAdded != null)
{
result.AddParameter("Field", fieldAdded.Name);
}
else
{
var fieldEvent = @event.Payload as FieldEvent; var fieldEvent = @event.Payload as FieldEvent;
if (fieldEvent != null) if (fieldEvent != null)
@ -95,6 +103,7 @@ namespace Squidex.Read.Schemas
result.AddParameter("Field", fieldName); result.AddParameter("Field", fieldName);
} }
}
return result; return result;
} }

10
src/Squidex/Config/Domain/EventBusModule.cs

@ -27,9 +27,9 @@ namespace Squidex.Config.Domain
protected override void Load(ContainerBuilder builder) protected override void Load(ContainerBuilder builder)
{ {
var storeType = Configuration.GetValue<string>("squidex:eventBus:type"); var eventBusType = Configuration.GetValue<string>("squidex:eventBus:type");
if (string.IsNullOrWhiteSpace(storeType)) if (string.IsNullOrWhiteSpace(eventBusType))
{ {
throw new ConfigurationException("You must specify the event bus type in the 'squidex:eventBus:type' configuration section."); throw new ConfigurationException("You must specify the event bus type in the 'squidex:eventBus:type' configuration section.");
} }
@ -41,14 +41,14 @@ namespace Squidex.Config.Domain
.AsSelf() .AsSelf()
.SingleInstance(); .SingleInstance();
if (string.Equals(storeType, "Memory", StringComparison.OrdinalIgnoreCase)) if (string.Equals(eventBusType, "Memory", StringComparison.OrdinalIgnoreCase))
{ {
builder.RegisterType<InMemoryEventBus>() builder.RegisterType<InMemoryEventBus>()
.As<IEventStream>() .As<IEventStream>()
.As<IEventPublisher>() .As<IEventPublisher>()
.SingleInstance(); .SingleInstance();
} }
if (string.Equals(storeType, "RabbitMq", StringComparison.OrdinalIgnoreCase)) else if (string.Equals(eventBusType, "RabbitMq", StringComparison.OrdinalIgnoreCase))
{ {
var connectionString = Configuration.GetValue<string>("squidex:eventBus:rabbitMq:connectionString"); var connectionString = Configuration.GetValue<string>("squidex:eventBus:rabbitMq:connectionString");
@ -74,7 +74,7 @@ namespace Squidex.Config.Domain
} }
else else
{ {
throw new ConfigurationException($"Unsupported store type '{storeType}' for key 'squidex:eventStore:type', supported: Memory, RabbmitMq."); throw new ConfigurationException($"Unsupported store type '{eventBusType}' for key 'squidex:eventStore:type', supported: Memory, RabbmitMq.");
} }
} }
} }

2
src/Squidex/Properties/launchSettings.json

@ -16,8 +16,10 @@
}, },
"Squidex": { "Squidex": {
"commandName": "Project", "commandName": "Project",
"commandLineArgs": "replay",
"launchUrl": "http://localhost:5000", "launchUrl": "http://localhost:5000",
"environmentVariables": { "environmentVariables": {
"SQUIDEX__EVENTBUS__TYPE": "Memory",
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
} }
} }

2
src/Squidex/app/features/schemas/pages/schema/schema-page.component.ts

@ -65,7 +65,7 @@ export class SchemaPageComponent extends AppComponentBase implements OnInit {
[ [
Validators.required, Validators.required,
Validators.maxLength(40), Validators.maxLength(40),
ValidatorsEx.pattern('[a-z0-9]+(\-[a-z0-9]+)*', 'Name can contain lower case letters (a-z), numbers and dashes (not at the end).') ValidatorsEx.pattern('[a-z0-9]+(\-[a-z0-9]+)*', 'Name must be a valid javascript name in camel case.')
]] ]]
}); });

6
src/Squidex/app/framework/angular/control-errors.component.scss

@ -1,2 +1,8 @@
@import '_mixins'; @import '_mixins';
@import '_vars'; @import '_vars';
:host {
align-self: flex-start;
min-width: 100%;
max-width: 100%;
}

2
src/Squidex/app/theme/_bootstrap.scss

@ -110,10 +110,8 @@ body {
} }
@mixin link-button($color) { @mixin link-button($color) {
& {
color: $color; color: $color;
cursor: pointer; cursor: pointer;
}
&:focus { &:focus {
outline-color: transparent; outline-color: transparent;

4
src/Squidex/app/theme/_panels.scss

@ -7,7 +7,6 @@
} }
@mixin panel-icon { @mixin panel-icon {
& {
color: $color-panel-icon; color: $color-panel-icon;
font-size: 1.2rem; font-size: 1.2rem;
font-weight: 400; font-weight: 400;
@ -15,7 +14,6 @@
text-align: center; text-align: center;
padding: .6rem; padding: .6rem;
cursor: pointer; cursor: pointer;
}
&:hover, &:hover,
&:focus { &:focus {
@ -138,6 +136,8 @@
&-close { &-close {
@include absolute($panel-padding - .3rem, $panel-padding - .8rem, auto, auto); @include absolute($panel-padding - .3rem, $panel-padding - .8rem, auto, auto);
@include panel-icon; @include panel-icon;
font-size: 1rem;
font-weight: 300;
} }
} }

Loading…
Cancel
Save