|
|
@ -6,7 +6,8 @@ |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, QueryList, SimpleChanges, ViewChildren } from '@angular/core'; |
|
|
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnChanges, QueryList, SimpleChanges, ViewChildren } from '@angular/core'; |
|
|
import { AppLanguageDto, ComponentFieldPropertiesDto, ComponentForm, EditContentForm, FieldDto, FieldSection, ModalModel, ResourceOwner, SchemaDto, Types } from '@app/shared'; |
|
|
import { Observable } from 'rxjs'; |
|
|
|
|
|
import { AppLanguageDto, ComponentFieldPropertiesDto, ComponentForm, disabled$, EditContentForm, FieldDto, FieldSection, ModalModel, ResourceOwner, SchemaDto, Types } from '@app/shared'; |
|
|
import { ComponentSectionComponent } from './component-section.component'; |
|
|
import { ComponentSectionComponent } from './component-section.component'; |
|
|
|
|
|
|
|
|
@Component({ |
|
|
@Component({ |
|
|
@ -43,6 +44,8 @@ export class ComponentComponent extends ResourceOwner implements OnChanges { |
|
|
public schemasDropdown = new ModalModel(); |
|
|
public schemasDropdown = new ModalModel(); |
|
|
public schemasList: ReadonlyArray<SchemaDto> = []; |
|
|
public schemasList: ReadonlyArray<SchemaDto> = []; |
|
|
|
|
|
|
|
|
|
|
|
public isDisabled?: Observable<boolean>; |
|
|
|
|
|
|
|
|
constructor( |
|
|
constructor( |
|
|
private readonly changeDetector: ChangeDetectorRef, |
|
|
private readonly changeDetector: ChangeDetectorRef, |
|
|
) { |
|
|
) { |
|
|
@ -53,6 +56,8 @@ export class ComponentComponent extends ResourceOwner implements OnChanges { |
|
|
if (changes['formModel']) { |
|
|
if (changes['formModel']) { |
|
|
this.unsubscribeAll(); |
|
|
this.unsubscribeAll(); |
|
|
|
|
|
|
|
|
|
|
|
this.isDisabled = disabled$(this.formModel.form); |
|
|
|
|
|
|
|
|
this.own( |
|
|
this.own( |
|
|
this.formModel.form.valueChanges |
|
|
this.formModel.form.valueChanges |
|
|
.subscribe(() => { |
|
|
.subscribe(() => { |
|
|
|