Fixes funder selection preview as mandatory in DMP (Issue #182)
This commit is contained in:
parent
ca16a26f56
commit
916728bb1f
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
import {of as observableOf, Observable } from 'rxjs';
|
import { of as observableOf, Observable } from 'rxjs';
|
||||||
|
|
||||||
import {map, takeUntil } from 'rxjs/operators';
|
import { map, takeUntil } from 'rxjs/operators';
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { FormGroup } from '@angular/forms';
|
import { FormGroup } from '@angular/forms';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
|
@ -230,6 +230,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC
|
||||||
|
|
||||||
public isFormValid() {
|
public isFormValid() {
|
||||||
return this.formGroup.get('label').valid && this.formGroup.get('profiles').valid &&
|
return this.formGroup.get('label').valid && this.formGroup.get('profiles').valid &&
|
||||||
|
(this.formGroup.get('funder').get('label').valid || this.formGroup.get('funder').get('existFunder').valid) &&
|
||||||
(this.formGroup.get('grant').get('label').valid || this.formGroup.get('grant').get('existGrant').valid);
|
(this.formGroup.get('grant').get('label').valid || this.formGroup.get('grant').get('existGrant').valid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-6 pb-2 pl-4 pt-4" *ngIf="!isCreateNewFunder">
|
<div class="col-6 pb-2 pl-4 pt-4" *ngIf="!isCreateNewFunder">
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<app-single-auto-complete [formControl]="funderFormGroup.get('existFunder')" placeholder="{{'DMP-EDITOR.FIELDS.FUNDER' | translate}}" [configuration]="funderAutoCompleteConfiguration">
|
<app-single-auto-complete required='true' [formControl]="funderFormGroup.get('existFunder')" placeholder="{{'DMP-EDITOR.FIELDS.FUNDER' | translate}}" [configuration]="funderAutoCompleteConfiguration">
|
||||||
</app-single-auto-complete>
|
</app-single-auto-complete>
|
||||||
<mat-hint>{{'DMP-EDITOR.FIELDS.EXTERNAL-SOURCE-HINT' | translate}}</mat-hint>
|
<mat-hint>{{'DMP-EDITOR.FIELDS.EXTERNAL-SOURCE-HINT' | translate}}</mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
Loading…
Reference in New Issue