2024-02-26 18:40:31 +01:00
< div class = "prefilling-source-editor" >
< div class = "col-md-8 offset-md-2 colums-gapped" * ngIf = "formGroup" >
< div class = "row justify-content-between align-items-center" >
< div class = "col" >
< h3 * ngIf = "isNew" > {{'PREFILLING-SOURCE-EDITOR.NEW' | translate}}< / h3 >
< app-navigation-breadcrumb / >
< / div >
< div class = "col-auto" >
< button mat-button class = "action-btn" ( click ) = " cancel ( ) " type = "button" > {{'PREFILLING-SOURCE-EDITOR.ACTIONS.CANCEL' | translate}}< / button >
< / div >
< div class = "col-auto" * ngIf = "canDelete" >
< button mat-button class = "action-btn" type = "button" ( click ) = " delete ( ) " >
< mat-icon > delete< / mat-icon >
{{'PREFILLING-SOURCE-EDITOR.ACTIONS.DELETE' | translate}}
< / button >
< / div >
< div class = "col-auto" * ngIf = "canSave" >
< button mat-button class = "action-btn" ( click ) = " formSubmit ( ) " >
< mat-icon > save< / mat-icon >
{{'PREFILLING-SOURCE-EDITOR.ACTIONS.SAVE' | translate}}
< / button >
< / div >
< / div >
< form * ngIf = "formGroup" ( ngSubmit ) = " formSubmit ( ) " >
< mat-card appearance = "outlined" >
< mat-card-header >
< mat-card-title * ngIf = "isNew" > {{'PREFILLING-SOURCE-EDITOR.NEW' | translate}}< / mat-card-title >
< / mat-card-header >
< mat-card-content >
< div class = "row" >
< div class = "col-12" >
< mat-form-field class = "w-100" >
< mat-label > {{'PREFILLING-SOURCE-EDITOR.FIELDS.LABEL' | translate}}< / mat-label >
< input matInput type = "text" name = "label" [ formControl ] = " formGroup . get ( ' label ' ) " required >
< mat-error * ngIf = "formGroup.get('label').hasError('backendError')" > {{formGroup.get('label').getError('backendError').message}}< / mat-error >
< mat-error * ngIf = "formGroup.get('label').hasError('required')" > {{'GENERAL.VALIDATION.REQUIRED' | translate}}< / mat-error >
< / mat-form-field >
< / div >
<!-- Fields -->
< div class = "col-12" >
< div * ngFor = "let field of formGroup.get('definition').get('fields').controls; let fieldIndex=index;" class = "row mb-3" >
< div class = "col-12" >
< div class = "row mb-3 d-flex align-items-center" >
< div class = "col-auto d-flex" >
< mat-card-title > {{'PREFILLING-SOURCE-EDITOR.FIELDS.FIELD' | translate}} {{fieldIndex + 1}}< / mat-card-title >
< / div >
< div class = "col-auto d-flex" >
< button mat-icon-button class = "action-list-icon" matTooltip = "{{'PREFILLING-SOURCE-EDITOR.ACTIONS.REMOVE-FIELD' | translate}}" ( click ) = " removeField ( fieldIndex ) " [ disabled ] = " formGroup . disabled " >
< mat-icon > delete< / mat-icon >
< / button >
< / div >
< / div >
< div class = "row" >
< div class = "col" >
< mat-form-field class = "w-100" >
< mat-label > {{'PREFILLING-SOURCE-EDITOR.FIELDS.CODE' | translate}}< / mat-label >
< input matInput type = "text" name = "code" [ formControl ] = " field . get ( ' code ' ) " >
< mat-error * ngIf = "field.get('code').hasError('backendError')" > {{field.get('code').getError('backendError').message}}< / mat-error >
< mat-error * ngIf = "field.get('code').hasError('required')" > {{'GENERAL.VALIDATION.REQUIRED' | translate}}< / mat-error >
< / mat-form-field >
< / div >
< div class = "col" >
< mat-form-field class = "w-100" >
< mat-label > {{'PREFILLING-SOURCE-EDITOR.FIELDS.SYSTEM-TARGET' | translate}}< / mat-label >
2024-02-28 12:29:53 +01:00
< mat-select [ formControl ] = " field . get ( ' systemFieldTarget ' ) " >
< mat-option * ngFor = "let systemFieldTarget of prefillingSourceSystemTargetTypeEnumValues" [ value ] = " systemFieldTarget " > {{enumUtils.toPrefillingSourceSystemTargetTypeString(systemFieldTarget)}}< / mat-option >
< / mat-select >
2024-02-26 18:40:31 +01:00
< mat-error * ngIf = "field.get('systemFieldTarget').hasError('required')" > {{'GENERAL.VALIDATION.REQUIRED' | translate}}< / mat-error >
< / mat-form-field >
< / div >
2024-02-28 12:29:53 +01:00
< div class = "col-12" >
2024-02-26 18:40:31 +01:00
< mat-form-field class = "w-100" >
< mat-label > {{'PREFILLING-SOURCE-EDITOR.FIELDS.SEMANTIC-TARGET' | translate}}< / mat-label >
< app-single-auto-complete placeholder = "{{'PREFILLING-SOURCE-EDITOR.FIELDS.SEMANTIC-TARGET' | translate}}" [ formControl ] = " field . get ( ' semanticTarget ' ) " [ configuration ] = " semanticsService . singleAutocompleteConfiguration " > < / app-single-auto-complete >
< mat-error * ngIf = "field.get('semanticTarget').hasError('backendError')" > {{field.get('semanticTarget').getError('backendError').message}}< / mat-error >
< mat-error * ngIf = "field.get('semanticTarget').hasError('required')" > {{'GENERAL.VALIDATION.REQUIRED' | translate}}< / mat-error >
< / mat-form-field >
< / div >
< div class = "col" >
< mat-form-field class = "w-100" >
< mat-label > {{'PREFILLING-SOURCE-EDITOR.FIELDS.TRIM-REGEX' | translate}}< / mat-label >
< input matInput type = "text" name = "trimRegex" [ formControl ] = " field . get ( ' trimRegex ' ) " >
< mat-error * ngIf = "field.get('trimRegex').hasError('backendError')" > {{field.get('trimRegex').getError('backendError').message}}< / mat-error >
< mat-error * ngIf = "field.get('trimRegex').hasError('required')" > {{'GENERAL.VALIDATION.REQUIRED' | translate}}< / mat-error >
< / mat-form-field >
< / div >
< div class = "col" >
< mat-form-field class = "w-100" >
< mat-label > {{'PREFILLING-SOURCE-EDITOR.FIELDS.FIXED-VALUE' | translate}}< / mat-label >
< input matInput type = "text" name = "fixedValue" [ formControl ] = " field . get ( ' fixedValue ' ) " >
< mat-error * ngIf = "field.get('fixedValue').hasError('backendError')" > {{field.get('fixedValue').getError('backendError').message}}< / mat-error >
< mat-error * ngIf = "field.get('fixedValue').hasError('required')" > {{'GENERAL.VALIDATION.REQUIRED' | translate}}< / mat-error >
< / mat-form-field >
< / div >
< / div >
< / div >
< / div >
2024-02-28 12:29:53 +01:00
< button mat-button class = "action-btn" type = "button" ( click ) = " addField ( ) " [ disabled ] = " formGroup . disabled " > {{'PREFILLING-SOURCE-EDITOR.ACTIONS.ADD-FIELD' | translate}}< / button >
2024-02-26 18:40:31 +01:00
< button mat-button class = "action-btn" * ngIf = "formGroup.get('definition').get('fields').value != ''"
2024-02-28 12:29:53 +01:00
type="button" (click)="submitFields()" [disabled]="!formGroup.get('definition').get('fields').valid">{{'PREFILLING-SOURCE-EDITOR.ACTIONS.SUBMIT-FIELDS' | translate}}< / button >
2024-02-26 18:40:31 +01:00
< / div >
< / div >
< / mat-card-content >
< / mat-card >
< mat-card appearance = "outlined" >
< mat-card-header >
< mat-card-title > {{'PREFILLING-SOURCE-EDITOR.FIELDS.SOURCE-CONFIGURATION' | translate}}< / mat-card-title >
< / mat-card-header >
< mat-card-content >
< app-external-fetcher-source-component [ formGroup ] = " formGroup . get ( ' definition ' ) . get ( ' searchConfiguration ' ) " [ validationErrorModel ] = " editorModel . validationErrorModel " [ validationRootPath ] = " ' definition . searchConfiguration . ' " > < / app-external-fetcher-source-component >
< div >
2024-02-27 15:27:26 +01:00
< mat-checkbox [ formControl ] = " formGroup . get ( ' definition ' ) . get ( ' getEnabled ' ) " ( change ) = " getEnabledChanged ( $ event ) " >
2024-02-26 18:40:31 +01:00
{{'PREFILLING-SOURCE-EDITOR.FIELDS.GET-SOURCE-CONFIGURATION' | translate}}
< mat-error * ngIf = "formGroup.get('definition').get('getEnabled').hasError('backendError')" > {{formGroup.get('definition').get('getEnabled').getError('backendError').message}}< / mat-error >
< mat-error * ngIf = "formGroup.get('definition').get('getEnabled').hasError('required')" > {{'GENERAL.VALIDATION.REQUIRED' | translate}}< / mat-error >
< / mat-checkbox >
< / div >
< / mat-card-content >
< / mat-card >
< mat-card appearance = "outlined" * ngIf = "formGroup.get('definition').get('getEnabled').value == true" >
< mat-card-header >
< mat-card-title > {{'PREFILLING-SOURCE-EDITOR.FIELDS.GET-SOURCE-CONFIGURATION' | translate}}< / mat-card-title >
< / mat-card-header >
< mat-card-content >
< app-external-fetcher-source-component [ formGroup ] = " formGroup . get ( ' definition ' ) . get ( ' getConfiguration ' ) " [ validationErrorModel ] = " editorModel . validationErrorModel " [ validationRootPath ] = " ' definition . getConfiguration . ' " > < / app-external-fetcher-source-component >
< / mat-card-content >
< / mat-card >
< / form >
< / div >
< / div >