20 lines
810 B
TypeScript
20 lines
810 B
TypeScript
|
import { FormGroup } from '@angular/forms';
|
||
|
import { FieldDataEditorModel } from './field-data-editor-model';
|
||
|
import { DatePickerFieldData, ExternalDatasetsFieldData, DataRepositoriesFieldData, RegistriesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
|
||
|
|
||
|
export class RegistriesDataEditorModel extends FieldDataEditorModel<RegistriesDataEditorModel> {
|
||
|
public label: string;
|
||
|
|
||
|
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
|
||
|
const formGroup = this.formBuilder.group({
|
||
|
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RegistriesDataEditorModel.label')) }]
|
||
|
});
|
||
|
return formGroup;
|
||
|
}
|
||
|
|
||
|
fromModel(item: RegistriesFieldData): RegistriesDataEditorModel {
|
||
|
this.label = item.label;
|
||
|
return this;
|
||
|
}
|
||
|
}
|