Browse Source

API client extended.

pull/253/head
Sebastian Stehle 8 years ago
parent
commit
2eed29f7d9
  1. 6
      src/Squidex/app/shared/services/schemas.fields.spec.ts
  2. 9
      src/Squidex/app/shared/services/schemas.service.ts

6
src/Squidex/app/shared/services/schemas.fields.spec.ts

@ -117,7 +117,7 @@ describe('TagsField', () => {
});
describe('BooleanField', () => {
const field = createField(new BooleanFieldPropertiesDto(null, null, null, true, false, 'Checkbox'));
const field = createField(new BooleanFieldPropertiesDto(null, null, null, true, false, false, 'Checkbox'));
it('should create validators', () => {
expect(field.createValidators(false).length).toBe(1);
@ -230,7 +230,7 @@ describe('JsonField', () => {
});
describe('NumberField', () => {
const field = createField(new NumberFieldPropertiesDto(null, null, null, true, false, 'Input', undefined, 3, 1, [1, 2, 3]));
const field = createField(new NumberFieldPropertiesDto(null, null, null, true, false, false, 'Input', undefined, 3, 1, [1, 2, 3]));
it('should create validators', () => {
expect(field.createValidators(false).length).toBe(4);
@ -276,7 +276,7 @@ describe('ReferencesField', () => {
});
describe('StringField', () => {
const field = createField(new StringFieldPropertiesDto(null, null, null, true, false, 'Input', undefined, 'pattern', undefined, 3, 1, ['1', '2']));
const field = createField(new StringFieldPropertiesDto(null, null, null, true, false, false, 'Input', undefined, 'pattern', undefined, 3, 1, ['1', '2']));
it('should create validators', () => {
expect(field.createValidators(false).length).toBe(5);

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

@ -40,13 +40,13 @@ export function createProperties(fieldType: string, values: Object | null = null
switch (fieldType) {
case 'Number':
properties = new NumberFieldPropertiesDto(null, null, null, false, false, 'Input');
properties = new NumberFieldPropertiesDto(null, null, null, false, false, false, 'Input');
break;
case 'String':
properties = new StringFieldPropertiesDto(null, null, null, false, false, 'Input');
properties = new StringFieldPropertiesDto(null, null, null, false, false, false, 'Input');
break;
case 'Boolean':
properties = new BooleanFieldPropertiesDto(null, null, null, false, false, 'Checkbox');
properties = new BooleanFieldPropertiesDto(null, null, null, false, false, false, 'Checkbox');
break;
case 'DateTime':
properties = new DateTimeFieldPropertiesDto(null, null, null, false, false, 'DateTime');
@ -355,6 +355,7 @@ export class StringFieldPropertiesDto extends FieldPropertiesDto {
constructor(label: string | null, hints: string | null, placeholder: string | null,
isRequired: boolean,
isListField: boolean,
public readonly isInlineEditable: boolean,
public readonly editor: string,
public readonly defaultValue?: string,
public readonly pattern?: string,
@ -415,6 +416,7 @@ export class NumberFieldPropertiesDto extends FieldPropertiesDto {
constructor(label: string | null, hints: string | null, placeholder: string | null,
isRequired: boolean,
isListField: boolean,
public readonly isInlineEditable: boolean,
public readonly editor: string,
public readonly defaultValue?: number,
public readonly maxValue?: number,
@ -523,6 +525,7 @@ export class BooleanFieldPropertiesDto extends FieldPropertiesDto {
constructor(label: string | null, hints: string | null, placeholder: string | null,
isRequired: boolean,
isListField: boolean,
public readonly isInlineEditable: boolean,
public readonly editor: string,
public readonly defaultValue?: boolean
) {

Loading…
Cancel
Save