Browse Source

Merge branch 'master' of github.com:Squidex/squidex into orleans-learnings

pull/194/head
Sebastian Stehle 9 years ago
parent
commit
d1d355accd
  1. 2
      src/Squidex/app/features/content/pages/content/content-page.component.ts
  2. 6
      src/Squidex/app/shared/services/schemas.service.ts

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

@ -253,7 +253,7 @@ export class ContentPageComponent implements CanComponentDeactivate, OnDestroy,
fieldForm.controls[language.iso2Code].setValue(fieldValue[language.iso2Code]);
}
} else {
fieldForm.controls['iv'].setValue(fieldValue['iv']);
fieldForm.controls['iv'].setValue(fieldValue['iv'] === undefined ? null : fieldValue['iv']);
}
}

6
src/Squidex/app/shared/services/schemas.service.ts

@ -378,7 +378,11 @@ export class StringFieldPropertiesDto extends FieldPropertiesDto {
}
if (this.allowedValues && this.allowedValues.length > 0) {
validators.push(ValidatorsEx.validValues(this.allowedValues));
if (this.isRequired && !isOptional) {
validators.push(ValidatorsEx.validValues(this.allowedValues));
} else {
validators.push(ValidatorsEx.validValues(this.allowedValues.concat([null])));
}
}
return validators;

Loading…
Cancel
Save