Browse Source

Saving field fixed.

pull/253/head
Sebastian Stehle 8 years ago
parent
commit
76f1b3507a
  1. 8
      src/Squidex/app/features/schemas/pages/schema/field.component.scss
  2. 19
      src/Squidex/app/features/schemas/pages/schema/field.component.ts
  3. 2
      src/Squidex/app/features/schemas/pages/schema/schema-page.component.html
  4. 5
      src/Squidex/app/features/schemas/pages/schema/schema-page.component.ts
  5. 8
      src/Squidex/app/features/settings/pages/languages/languages-page.component.scss

8
src/Squidex/app/features/schemas/pages/schema/field.component.scss

@ -4,7 +4,13 @@
$field-header: #e7ebef;
.table-items-row-details {
cursor: default;
& {
cursor: default;
}
&::before {
right: 4.6rem;
}
}
.col {

19
src/Squidex/app/features/schemas/pages/schema/field.component.ts

@ -13,6 +13,7 @@ import {
createProperties,
fadeAnimation,
FieldDto,
FieldPropertiesDto,
ModalView,
SchemaDto
} from 'shared';
@ -45,7 +46,7 @@ export class FieldComponent implements OnInit {
public showing = new EventEmitter();
@Output()
public saving = new EventEmitter();
public saving = new EventEmitter<FieldPropertiesDto>();
@Output()
public enabling = new EventEmitter();
@ -107,22 +108,12 @@ export class FieldComponent implements OnInit {
if (this.editForm.valid) {
const properties = createProperties(this.field.properties['fieldType'], this.editForm.value);
const field =
new FieldDto(
this.field.fieldId,
this.field.name,
this.field.isLocked,
this.field.isHidden,
this.field.isHidden,
this.field.partitioning,
properties);
this.emitSaving(field);
this.emitSaving(properties);
}
}
private emitSaving(field: FieldDto) {
this.saving.emit(field);
private emitSaving(properties: FieldPropertiesDto) {
this.saving.emit(properties);
}
private resetEditForm() {

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

@ -69,7 +69,7 @@
(locking)="lockField(field)"
(showing)="showField(field)"
(hiding)="hideField(field)"
(saving)="saveField($event)"></sqx-field>
(saving)="saveField(field, $event)"></sqx-field>
</div>
<div class="table-items-footer">

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

@ -18,6 +18,7 @@ import {
createProperties,
fadeAnimation,
FieldDto,
FieldPropertiesDto,
fieldTypes,
HistoryChannelUpdated,
ImmutableArray,
@ -213,12 +214,12 @@ export class SchemaPageComponent implements OnDestroy, OnInit {
});
}
public saveField(field: FieldDto) {
public saveField(field: FieldDto, properties: FieldPropertiesDto) {
const requestDto = new UpdateFieldDto(field.properties);
this.schemasService.putField(this.ctx.appName, this.schema.name, field.fieldId, requestDto, this.schema.version)
.subscribe(dto => {
this.updateSchema(this.schema.updateField(field, this.ctx.userToken, dto.version));
this.updateSchema(this.schema.updateField(field.update(properties), this.ctx.userToken, dto.version));
}, error => {
this.ctx.notifyError(error);
});

8
src/Squidex/app/features/settings/pages/languages/languages-page.component.scss

@ -1,2 +1,8 @@
@import '_vars';
@import '_mixins';
@import '_mixins';
.table-item-row-details {
&::before {
right: 5.2rem;
}
}
Loading…
Cancel
Save