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. 17
      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. 6
      src/Squidex/app/theme/_bootstrap.scss
  8. 18
      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);
}
logger.LogDebug("Event {0} handled", @event.Payload.GetType().Name);
});
isSubscribed = true;

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

@ -87,13 +87,22 @@ namespace Squidex.Read.Schemas
var result = ForEvent(@event.Payload, channel).AddParameter("Name", schemaName);
var fieldEvent = @event.Payload as FieldEvent;
var fieldAdded = @event.Payload as FieldAdded;
if (fieldEvent != null)
if (fieldAdded != null)
{
var fieldName = schemaEntity.Schema.Fields.GetOrDefault(fieldEvent.FieldId)?.Name;
result.AddParameter("Field", fieldAdded.Name);
}
else
{
var fieldEvent = @event.Payload as FieldEvent;
if (fieldEvent != null)
{
var fieldName = schemaEntity.Schema.Fields.GetOrDefault(fieldEvent.FieldId)?.Name;
result.AddParameter("Field", fieldName);
result.AddParameter("Field", fieldName);
}
}
return result;

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

@ -27,9 +27,9 @@ namespace Squidex.Config.Domain
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.");
}
@ -41,14 +41,14 @@ namespace Squidex.Config.Domain
.AsSelf()
.SingleInstance();
if (string.Equals(storeType, "Memory", StringComparison.OrdinalIgnoreCase))
if (string.Equals(eventBusType, "Memory", StringComparison.OrdinalIgnoreCase))
{
builder.RegisterType<InMemoryEventBus>()
.As<IEventStream>()
.As<IEventPublisher>()
.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");
@ -74,7 +74,7 @@ namespace Squidex.Config.Domain
}
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": {
"commandName": "Project",
"commandLineArgs": "replay",
"launchUrl": "http://localhost:5000",
"environmentVariables": {
"SQUIDEX__EVENTBUS__TYPE": "Memory",
"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.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 '_vars';
:host {
align-self: flex-start;
min-width: 100%;
max-width: 100%;
}

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

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

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

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

Loading…
Cancel
Save