Browse Source

Fixes to schemas.

pull/312/head
Sebastian Stehle 8 years ago
parent
commit
eb518eef8c
  1. 2
      src/Squidex.Domain.Apps.Entities/Apps/Templates/Builders/FieldBuilder.cs
  2. 2
      src/Squidex.Domain.Apps.Entities/Apps/Templates/Builders/StringFieldBuilder.cs
  3. 0
      src/Squidex.Domain.Apps.Entities/Apps/Templates/Builders/TagsFieldBuilder.cs
  4. 14
      src/Squidex.Domain.Apps.Entities/Apps/Templates/CreateIdentityCommandMiddleware.cs
  5. 2
      src/Squidex.Domain.Apps.Entities/Contents/SingletonCommandMiddleware.cs
  6. 3
      src/Squidex/Config/Domain/EntitiesServices.cs
  7. 2
      src/Squidex/app/features/administration/pages/restore/restore-page.component.html
  8. 2
      src/Squidex/app/features/content/shared/field-editor.component.html
  9. 2
      src/Squidex/app/framework/angular/forms/tag-editor.component.html
  10. 5
      src/Squidex/app/framework/angular/forms/tag-editor.component.scss
  11. 2
      src/Squidex/appsettings.json

2
src/Squidex.Domain.Apps.Entities/Apps/Templates/Builders/FieldBuilder.cs

@ -41,7 +41,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.Templates.Builders
public FieldBuilder Localizable() public FieldBuilder Localizable()
{ {
field.Partitioning = Partitioning.Invariant.Key; field.Partitioning = Partitioning.Language.Key;
return this; return this;
} }

2
src/Squidex.Domain.Apps.Entities/Apps/Templates/Builders/StringFieldBuilder.cs

@ -5,9 +5,9 @@
// All rights reserved. Licensed under the MIT license. // All rights reserved. Licensed under the MIT license.
// ========================================================================== // ==========================================================================
using System.Collections.Immutable;
using Squidex.Domain.Apps.Core.Schemas; using Squidex.Domain.Apps.Core.Schemas;
using Squidex.Domain.Apps.Entities.Schemas.Commands; using Squidex.Domain.Apps.Entities.Schemas.Commands;
using System.Collections.Immutable;
namespace Squidex.Domain.Apps.Entities.Apps.Templates.Builders namespace Squidex.Domain.Apps.Entities.Apps.Templates.Builders
{ {

0
src/Squidex.Domain.Apps.Entities/Apps/Templates/Builders/TagsBuilder.cs → src/Squidex.Domain.Apps.Entities/Apps/Templates/Builders/TagsFieldBuilder.cs

14
src/Squidex.Domain.Apps.Entities/Apps/Templates/CreateIdentityCommandMiddleware.cs

@ -52,7 +52,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.Templates
await Task.WhenAll( await Task.WhenAll(
CreateApiResourcesSchemaAsync(publish), CreateApiResourcesSchemaAsync(publish),
CreateAuthenticationSchemeSchemaAsync(publish), CreateAuthenticationSchemeSchemaAsync(publish),
CreateClientSchemaAsync(publish), CreateClientsSchemaAsync(publish),
CreateIdentityResourcesSchemaAsync(publish), CreateIdentityResourcesSchemaAsync(publish),
CreateSettingsSchemaAsync(publish), CreateSettingsSchemaAsync(publish),
CreateUsersSchemaAsync(publish), CreateUsersSchemaAsync(publish),
@ -97,10 +97,10 @@ namespace Squidex.Domain.Apps.Entities.Apps.Templates
return NamedId.Of(schema.SchemaId, schema.Name); return NamedId.Of(schema.SchemaId, schema.Name);
} }
private Task CreateClientSchemaAsync(Func<ICommand, Task> publish) private Task CreateClientsSchemaAsync(Func<ICommand, Task> publish)
{ {
var schema = var schema =
SchemaBuilder.Create("clients") SchemaBuilder.Create("Clients")
.AddString("Client Id", f => f .AddString("Client Id", f => f
.Required() .Required()
.Hints("Unique id of the client.")) .Hints("Unique id of the client."))
@ -208,7 +208,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.Templates
.Hints("The unique email to login.")) .Hints("The unique email to login."))
.AddString("Phone Number", f => f .AddString("Phone Number", f => f
.Hints("Phone number of the user.")) .Hints("Phone number of the user."))
.AddString("Roles", f => f .AddTags("Roles", f => f
.Hints("The roles of the user.")) .Hints("The roles of the user."))
.AddJson("Claims", f => f .AddJson("Claims", f => f
.Hints("The claims of the user.")) .Hints("The claims of the user."))
@ -225,13 +225,13 @@ namespace Squidex.Domain.Apps.Entities.Apps.Templates
.AsDateTime() .AsDateTime()
.Disabled() .Disabled()
.Hints("Indicates when the lockout ends.")) .Hints("Indicates when the lockout ends."))
.AddJson("Login", f => f .AddTags("Login Keys", f => f
.Disabled() .Disabled()
.Hints("Login information for querying.")) .Hints("Login information for querying."))
.AddJson("Logins ", f => f .AddJson("Logins", f => f
.Disabled() .Disabled()
.Hints("Login information.")) .Hints("Login information."))
.AddJson("Tokens ", f => f .AddJson("Tokens", f => f
.Disabled() .Disabled()
.Hints("Login tokens.")) .Hints("Login tokens."))
.AddNumber("Access Failed Count", f => f .AddNumber("Access Failed Count", f => f

2
src/Squidex.Domain.Apps.Entities/Contents/SingletonCommandMiddleware.cs

@ -33,7 +33,7 @@ namespace Squidex.Domain.Apps.Entities.Contents
var contentId = schemaId.Id; var contentId = schemaId.Id;
var content = new CreateContent { Data = data, ContentId = contentId, SchemaId = schemaId, Publish = true }; var content = new CreateContent { Data = data, ContentId = contentId, SchemaId = schemaId, Publish = true };
SimpleMapper.Map(context.Command, content); SimpleMapper.Map(createSchema, content);
await context.CommandBus.PublishAsync(content); await context.CommandBus.PublishAsync(content);
} }

3
src/Squidex/Config/Domain/EntitiesServices.cs

@ -176,6 +176,9 @@ namespace Squidex.Config.Domain
services.AddSingletonAs<CreateBlogCommandMiddleware>() services.AddSingletonAs<CreateBlogCommandMiddleware>()
.As<ICommandMiddleware>(); .As<ICommandMiddleware>();
services.AddSingletonAs<CreateIdentityCommandMiddleware>()
.As<ICommandMiddleware>();
services.AddSingletonAs<CreateProfileCommandMiddleware>() services.AddSingletonAs<CreateProfileCommandMiddleware>()
.As<ICommandMiddleware>(); .As<ICommandMiddleware>();
} }

2
src/Squidex/app/features/administration/pages/restore/restore-page.component.html

@ -2,7 +2,7 @@
<sqx-panel theme="light" desiredWidth="70rem"> <sqx-panel theme="light" desiredWidth="70rem">
<ng-container title> <ng-container title>
Restore Backup Restore Backup (BETA)
</ng-container> </ng-container>
<ng-container content> <ng-container content>

2
src/Squidex/app/features/content/shared/field-editor.component.html

@ -3,7 +3,7 @@
{{field.displayName}} <span class="field-required" [class.hidden]="!field.properties.isRequired">*</span> {{field.displayName}} <span class="field-required" [class.hidden]="!field.properties.isRequired">*</span>
</label> </label>
<span class="field-disabled" *ngIf="field.isDisabled">Disabled</span> <span class="field-disabled pl-1" *ngIf="field.isDisabled">Disabled</span>
<sqx-control-errors [for]="control" [fieldName]="field.displayName" [submitted]="form.submitted | async"></sqx-control-errors> <sqx-control-errors [for]="control" [fieldName]="field.displayName" [submitted]="form.submitted | async"></sqx-control-errors>

2
src/Squidex/app/framework/angular/forms/tag-editor.component.html

@ -11,7 +11,7 @@
[formControl]="addInput" [formControl]="addInput"
[attr.name]="inputName" [attr.name]="inputName"
[attr.placeholder]="placeholder" [attr.placeholder]="placeholder"
[class.hidden]="addInput.disabled" [disabled]="addInput.disabled"
autocomplete="off" autocomplete="off"
autocorrect="off" autocorrect="off"
autocapitalize="off"> autocapitalize="off">

5
src/Squidex/app/framework/angular/forms/tag-editor.component.scss

@ -12,6 +12,11 @@ $focus-color: #b3d3ff;
cursor: inherit; cursor: inherit;
} }
&.disabled,
&:disabled {
background: $color-input-disabled;
}
&.focus { &.focus {
@include box-shadow-raw(0 0 0 .2rem rgba(51, 137, 255, .25)); @include box-shadow-raw(0 0 0 .2rem rgba(51, 137, 255, .25));
border-color: $focus-color; border-color: $focus-color;

2
src/Squidex/appsettings.json

@ -24,7 +24,7 @@
*/ */
"regexSuggestions": { "regexSuggestions": {
// Regex for emails. // Regex for emails.
"Email": "^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\\\.[a-zA-Z0-9-]+)*$", "Email": "^[a-zA-Z0-9.!#$%&’*+\\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$",
// Regex for phone numbers. // Regex for phone numbers.
"Phone": "^\\(*\\+*[1-9]{0,3}\\)*-*[1-9]{0,3}[-. /]*\\(*[2-9]\\d{2}\\)*[-. /]*\\d{3}[-. /]*\\d{4} *e*x*t*\\.* *\\d{0,4}$", "Phone": "^\\(*\\+*[1-9]{0,3}\\)*-*[1-9]{0,3}[-. /]*\\(*[2-9]\\d{2}\\)*[-. /]*\\d{3}[-. /]*\\d{4} *e*x*t*\\.* *\\d{0,4}$",
// Regex for slugs (e.g. hello-world). // Regex for slugs (e.g. hello-world).

Loading…
Cancel
Save