Fixes bug on save and finalize button on DMP wizard
This commit is contained in:
parent
5c1df31d88
commit
5d1d1e36d7
|
@ -39,7 +39,7 @@ export class ProjectFormModel {
|
||||||
baseContext.validation.push({ key: 'label', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'label')] });
|
baseContext.validation.push({ key: 'label', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'label')] });
|
||||||
baseContext.validation.push({ key: 'status', validators: [] });
|
baseContext.validation.push({ key: 'status', validators: [] });
|
||||||
baseContext.validation.push({ key: 'description', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'description')] });
|
baseContext.validation.push({ key: 'description', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'description')] });
|
||||||
baseContext.validation.push({ key: 'existProject', validators: [Validators.required, ValidJsonValidator, BackendErrorValidator(this.validationErrorModel, 'existProject')] });
|
baseContext.validation.push({ key: 'existProject', validators: [BackendErrorValidator(this.validationErrorModel, 'existProject')] });
|
||||||
return baseContext;
|
return baseContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,6 @@
|
||||||
<mat-form-field class="col-md-12 mt-2">
|
<mat-form-field class="col-md-12 mt-2">
|
||||||
<app-single-auto-complete [formControl]="formGroup.get('existFunder')" placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.SELECT-FUNDER' | translate}}" [configuration]="funderAutoCompleteConfiguration">
|
<app-single-auto-complete [formControl]="formGroup.get('existFunder')" placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.SELECT-FUNDER' | translate}}" [configuration]="funderAutoCompleteConfiguration">
|
||||||
</app-single-auto-complete>
|
</app-single-auto-complete>
|
||||||
<mat-error *ngIf="formGroup.hasError('backendError')">
|
|
||||||
{{formGroup.get('existFunder').getError('backendError').message}}</mat-error>
|
|
||||||
<mat-error *ngIf="formGroup.hasError('required')">
|
|
||||||
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,6 @@
|
||||||
<mat-form-field class="col-md-12 mt-2">
|
<mat-form-field class="col-md-12 mt-2">
|
||||||
<app-single-auto-complete [formControl]="formGroup.get('existProject')" placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.SELECT-PROJECT' | translate}}" [configuration]="projectAutoCompleteConfiguration">
|
<app-single-auto-complete [formControl]="formGroup.get('existProject')" placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.SELECT-PROJECT' | translate}}" [configuration]="projectAutoCompleteConfiguration">
|
||||||
</app-single-auto-complete>
|
</app-single-auto-complete>
|
||||||
<mat-error *ngIf="formGroup.hasError('backendError')">
|
|
||||||
{{formGroup.get('project').getError('backendError').message}}</mat-error>
|
|
||||||
<mat-error *ngIf="formGroup.hasError('required')">
|
|
||||||
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
|
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ import { DatasetEditorWizardComponent } from '../dataset-editor/dataset-editor-w
|
||||||
import { GrantEditorWizardModel } from '../grant-editor/grant-editor-wizard-model';
|
import { GrantEditorWizardModel } from '../grant-editor/grant-editor-wizard-model';
|
||||||
import { QuickWizardEditorWizardModel } from './quick-wizard-editor.model';
|
import { QuickWizardEditorWizardModel } from './quick-wizard-editor.model';
|
||||||
import { FunderFormModel } from '../../dmp/editor/grant-tab/funder-form-model';
|
import { FunderFormModel } from '../../dmp/editor/grant-tab/funder-form-model';
|
||||||
|
import { ProjectFormModel } from '../../dmp/editor/grant-tab/project-form-model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-quick-wizard-editor-component',
|
selector: 'app-quick-wizard-editor-component',
|
||||||
|
@ -53,6 +54,7 @@ export class QuickWizardEditorComponent extends BaseComponent implements OnInit,
|
||||||
this.quickWizard = new QuickWizardEditorWizardModel();
|
this.quickWizard = new QuickWizardEditorWizardModel();
|
||||||
this.quickWizard.grant = new GrantEditorWizardModel();
|
this.quickWizard.grant = new GrantEditorWizardModel();
|
||||||
this.quickWizard.funder = new FunderFormModel();
|
this.quickWizard.funder = new FunderFormModel();
|
||||||
|
this.quickWizard.project = new ProjectFormModel();
|
||||||
this.formGroup = this.quickWizard.buildForm();
|
this.formGroup = this.quickWizard.buildForm();
|
||||||
this.language.get('NAV-BAR.DMP-WIZARD').pipe(takeUntil(this._destroyed)).subscribe(x => {
|
this.language.get('NAV-BAR.DMP-WIZARD').pipe(takeUntil(this._destroyed)).subscribe(x => {
|
||||||
this.breadCrumbs = Observable.of([
|
this.breadCrumbs = Observable.of([
|
||||||
|
@ -125,7 +127,7 @@ export class QuickWizardEditorComponent extends BaseComponent implements OnInit,
|
||||||
}
|
}
|
||||||
|
|
||||||
public isFormValid() {
|
public isFormValid() {
|
||||||
return this.formGroup.valid;
|
return this.formGroup.get('grant').valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public touchAllFormFields(formControl: AbstractControl) {
|
public touchAllFormFields(formControl: AbstractControl) {
|
||||||
|
|
Loading…
Reference in New Issue