Adds funder, project fields on DMP wizard

This commit is contained in:
apapachristou 2019-08-28 16:53:17 +03:00
parent 27e9e2ac97
commit 6f6ee9876b
16 changed files with 341 additions and 96 deletions

View File

@ -68,11 +68,11 @@
<div class="row" *ngIf="!isFinalized">
<div class="col-12 add-entity" *ngIf="isCreateNew" (click)="create()">
<mat-icon>settings_backup_restore</mat-icon>
<span>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.EXIST' | translate}}</span>
<span>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.EXIST-GRANT' | translate}}</span>
</div>
<div class="col-12 add-entity" *ngIf="!isCreateNew" (click)="create()">
<mat-icon>add</mat-icon>
<span>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.CREATE-NEW' | translate}}</span>
<span>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.CREATE-NEW-GRANT' | translate}}</span>
</div>
</div>
</div>

View File

@ -95,7 +95,7 @@ export class GrantTabComponent implements OnInit {
const funderRequestItem: RequestItem<FunderCriteria> = new RequestItem();
funderRequestItem.criteria = new FunderCriteria();
funderRequestItem.criteria.like = query;
return this.funderService.getWithExternal(funderRequestItem);
return this.funderService.getWithExternal(funderRequestItem)
}
create() {

View File

@ -0,0 +1,52 @@
<div class="funder-editor">
<form *ngIf="formGroup" [formGroup]="formGroup">
<mat-card>
<mat-card-header></mat-card-header>
<mat-card-content>
<div class="row" *ngIf="!isNew">
<p class="col-md-12"><b>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.ABOUT-FUNDER' | translate}}</b></p>
<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>
<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>
</div>
<div class="row" *ngIf="isNew">
<p class="col-md-12"><b>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.ABOUT-NEW-FUNDER' | translate}}</b></p>
<mat-form-field class="col-md-12">
<input matInput placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.FUNDER-LABEL' | translate}}" 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>
<div class="row">
<div class="align-self-center mt-2 col">
<hr>
</div>
<h3 class="col-auto">
{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.OR' | translate}}
</h3>
<div class="align-self-center mt-2 col">
<hr>
</div>
</div>
<div class="row">
<div class="col"></div>
<button mat-raised-button class="col-auto" color="primary" type="button" *ngIf="!isNew" (click)="create()">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.CREATE-NEW-FUNDER' | translate}}</button>
<button mat-raised-button class="col-auto" color="primary" type="button" *ngIf="isNew" (click)="create()">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.EXIST-FUNDER' | translate}}</button>
<div class="col"></div>
</div>
</mat-card-content>
</mat-card>
</form>
</div>

View File

@ -0,0 +1,63 @@
import { Component, OnInit, Input } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { SingleAutoCompleteConfiguration } from '../../../library/auto-complete/single/single-auto-complete-configuration';
import { FunderService } from '../../../core/services/funder/funder.service';
import { RequestItem } from '../../../core/query/request-item';
import { FunderCriteria } from '../../../core/query/funder/funder-criteria';
import { FunderFormModel } from '../../dmp/editor/grant-tab/funder-form-model';
@Component({
selector: 'app-quick-wizard-funder-editor-component',
templateUrl: './funder-editor-wizard.component.html',
styleUrls: ['./funder-editor-wizard.component.scss']
})
export class FunderEditorWizardComponent implements OnInit {
isNew = false;
funder: FunderFormModel;
@Input() formGroup: FormGroup;
funderAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
constructor(
private funderService: FunderService
) { }
ngOnInit() {
this.funderAutoCompleteConfiguration = {
filterFn: this.searchFunder.bind(this),
initialItems: (extraData) => this.searchFunder(''),
displayFn: (item) => item['label'],
titleFn: (item) => item['label']
};
if (!this.formGroup) {
this.funder = new FunderFormModel();
this.formGroup = this.funder.buildForm();
}
this.formGroup.get('existFunder').enable();
this.formGroup.get('label').disable();
}
searchFunder(query: string) {
const funderRequestItem: RequestItem<FunderCriteria> = new RequestItem();
funderRequestItem.criteria = new FunderCriteria();
funderRequestItem.criteria.like = query;
return this.funderService.getWithExternal(funderRequestItem);
}
create() {
this.isNew = !this.isNew;
if (this.isNew) {
this.formGroup.get('existFunder').disable();
this.formGroup.get('existFunder').reset();
this.formGroup.get('label').enable();
} else {
this.formGroup.get('existFunder').enable();
this.formGroup.get('label').disable();
this.formGroup.get('label').reset();
}
}
}

View File

@ -1,45 +1,40 @@
<div class="grant-editor">
<form *ngIf="formGroup" [formGroup]="formGroup">
<form *ngIf="grantformGroup" [formGroup]="grantformGroup">
<mat-card>
<mat-card-header>
</mat-card-header>
<mat-card-header></mat-card-header>
<mat-card-content>
<!-- <div *ngIf="funderFormGroup">
<app-quick-wizard-funder-editor-component class="col-12" [formGroup]="funderFormGroup"></app-quick-wizard-funder-editor-component>
</div> -->
<div class="row" *ngIf="!isNew">
<p class="col-md-12"><b>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.ABOUT' | translate}}</b></p>
<p class="col-md-12"><b>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.ABOUT-GRANT' | translate}}</b></p>
<mat-form-field class="col-md-12 mt-2">
<app-single-auto-complete required='true' [formControl]="formGroup.get('existGrant')"
placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.SELECT-GRANT' | translate}}"
[configuration]="grantAutoCompleteConfiguration">
<app-single-auto-complete required='true' [formControl]="grantformGroup.get('existGrant')" placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.SELECT-GRANT' | translate}}" [configuration]="grantAutoCompleteConfiguration">
</app-single-auto-complete>
<mat-error *ngIf="formGroup.hasError('backendError')">
{{formGroup.get('grant').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.hasError('required')">
<mat-error *ngIf="grantformGroup.hasError('backendError')">
{{grantformGroup.get('grant').getError('backendError').message}}</mat-error>
<mat-error *ngIf="grantformGroup.hasError('required')">
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
<div class="row" *ngIf="isNew">
<p class="col-md-12"><b>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.ABOUT-NEW' | translate}}</b></p>
<p class="col-md-12"><b>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.ABOUT-NEW-GRANT' | translate}}</b></p>
<mat-form-field class="col-md-12">
<input matInput
placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.GRANT-LABEL' | translate}}"
type="text" name="label" [formControl]="formGroup.get('label')" required>
<input matInput placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.GRANT-LABEL' | translate}}" type="text" name="label" [formControl]="grantformGroup.get('label')" required>
<mat-hint>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.LABEL-HINT' | translate}}</mat-hint>
<mat-error *ngIf="formGroup.get('label').hasError('backendError')">
{{formGroup.get('label').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('label').hasError('required')">
<mat-error *ngIf="grantformGroup.get('label').hasError('backendError')">
{{grantformGroup.get('label').getError('backendError').message}}</mat-error>
<mat-error *ngIf="grantformGroup.get('label').hasError('required')">
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
<mat-form-field class="col-md-12 mt-2">
<textarea matInput class="description-area"
placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.DESCRIPTION' | translate}}"
[formControl]="formGroup.get('description')" required></textarea>
<textarea matInput class="description-area" placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.DESCRIPTION' | translate}}" [formControl]="grantformGroup.get('description')" required></textarea>
<mat-hint>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.DESCRIPTION-HINT' | translate}}</mat-hint>
<mat-error *ngIf="formGroup.get('description').hasError('backendError')">
{{formGroup.get('description').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('description').hasError('required')">
<mat-error *ngIf="grantformGroup.get('description').hasError('backendError')">
{{grantformGroup.get('description').getError('backendError').message}}</mat-error>
<mat-error *ngIf="grantformGroup.get('description').hasError('required')">
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
@ -58,10 +53,8 @@
<div class="row">
<div class="col"></div>
<button mat-raised-button class="col-auto" color="primary" type="button" *ngIf="!isNew"
(click)="create()">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.CREATE-NEW' | translate}}</button>
<button mat-raised-button class="col-auto" color="primary" type="button" *ngIf="isNew"
(click)="create()">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.EXIST' | translate}}</button>
<button mat-raised-button class="col-auto" color="primary" type="button" *ngIf="!isNew" (click)="create()">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.CREATE-NEW-GRANT' | translate}}</button>
<button mat-raised-button class="col-auto" color="primary" type="button" *ngIf="isNew" (click)="create()">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.EXIST-GRANT' | translate}}</button>
<div class="col"></div>
</div>

View File

@ -26,8 +26,8 @@ export class GrantEditorWizardComponent extends BaseComponent implements OnInit,
isNew = false;
grant: GrantEditorWizardModel;
@Input() formGroup: FormGroup;
//formGroup: FormGroup = null;
@Input() grantformGroup: FormGroup;
@Input() funderFormGroup: FormGroup;
private uiNotificationService: UiNotificationService
grantAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
@ -57,17 +57,18 @@ export class GrantEditorWizardComponent extends BaseComponent implements OnInit,
filterFn: this.searchGrant.bind(this),
initialItems: (extraData) => this.searchGrant(''),
displayFn: (item) => item['label'],
titleFn: (item) => item['label']
titleFn: (item) => item['label'],
subtitleFn: (item) => item ? item['source'] : null
};
if (!this.formGroup) {
if (!this.grantformGroup) {
this.grant = new GrantEditorWizardModel();
this.formGroup = this.grant.buildForm();
this.grantformGroup = this.grant.buildForm();
}
this.formGroup.get('existGrant').enable();
this.formGroup.get('label').disable();
this.formGroup.get('description').disable();
this.grantformGroup.get('existGrant').enable();
this.grantformGroup.get('label').disable();
this.grantformGroup.get('description').disable();
// this.route.params
// .pipe(takeUntil(this._destroyed))
@ -98,7 +99,7 @@ export class GrantEditorWizardComponent extends BaseComponent implements OnInit,
}
public isFormValid() {
return this.formGroup.valid;
return this.grantformGroup.valid;
}
public touchAllFormFields(formControl: AbstractControl) {
@ -123,7 +124,7 @@ export class GrantEditorWizardComponent extends BaseComponent implements OnInit,
onCallbackError(errorResponse: any) {
this.setErrorModel(errorResponse.error.payload);
this.validateAllFormFields(this.formGroup);
this.validateAllFormFields(this.grantformGroup);
}
public setErrorModel(validationErrorModel: ValidationErrorModel) {
@ -151,22 +152,25 @@ export class GrantEditorWizardComponent extends BaseComponent implements OnInit,
const grantRequestItem: RequestItem<GrantCriteria> = new RequestItem();
grantRequestItem.criteria = new GrantCriteria();
grantRequestItem.criteria.like = query;
if (this.funderFormGroup.get('existFunder').value) {
grantRequestItem.criteria.funderReference = this.funderFormGroup.controls['existFunder'].value.reference;
}
return this.grantService.getWithExternal(grantRequestItem);
}
create() {
this.isNew = !this.isNew;
if (this.isNew) {
this.formGroup.get('existGrant').disable();
this.formGroup.get('existGrant').reset();
this.formGroup.get('label').enable();
this.formGroup.get('description').enable();
this.grantformGroup.get('existGrant').disable();
this.grantformGroup.get('existGrant').reset();
this.grantformGroup.get('label').enable();
this.grantformGroup.get('description').enable();
} else {
this.formGroup.get('existGrant').enable();
this.formGroup.get('label').disable();
this.formGroup.get('label').reset();
this.formGroup.get('description').disable();
this.formGroup.get('description').reset();
this.grantformGroup.get('existGrant').enable();
this.grantformGroup.get('label').disable();
this.grantformGroup.get('label').reset();
this.grantformGroup.get('description').disable();
this.grantformGroup.get('description').reset();
}
}
}

View File

@ -0,0 +1,60 @@
<div class="project-editor">
<form *ngIf="formGroup" [formGroup]="formGroup">
<mat-card>
<mat-card-header></mat-card-header>
<mat-card-content>
<div class="row" *ngIf="!isNew">
<p class="col-md-12"><b>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.ABOUT-PROJECT' | translate}}</b></p>
<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>
<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>
</div>
<div class="row" *ngIf="isNew">
<p class="col-md-12"><b>{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.ABOUT-NEW-PROJECT' | translate}}</b></p>
<mat-form-field class="col-md-12">
<input matInput placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.PROJECT-LABEL' | translate}}" 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>
<mat-form-field class="col-md-12 mt-2">
<textarea matInput class="description-area" placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.DESCRIPTION' | translate}}" [formControl]="formGroup.get('description')" required></textarea>
<mat-error *ngIf="formGroup.get('description').hasError('backendError')">
{{formGroup.get('description').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('description').hasError('required')">
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field>
</div>
<div class="row">
<div class="align-self-center mt-2 col">
<hr>
</div>
<h3 class="col-auto">
{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.OR' | translate}}
</h3>
<div class="align-self-center mt-2 col">
<hr>
</div>
</div>
<div class="row">
<div class="col"></div>
<button mat-raised-button class="col-auto" color="primary" type="button" *ngIf="!isNew" (click)="create()">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.CREATE-NEW-PROJECT' | translate}}</button>
<button mat-raised-button class="col-auto" color="primary" type="button" *ngIf="isNew" (click)="create()">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.EXIST-PROJECT' | translate}}</button>
<div class="col"></div>
</div>
</mat-card-content>
</mat-card>
</form>
</div>

View File

@ -0,0 +1,66 @@
import { Component, OnInit, Input } from '@angular/core';
import { SingleAutoCompleteConfiguration } from '../../../library/auto-complete/single/single-auto-complete-configuration';
import { FormGroup } from '@angular/forms';
import { ProjectService } from '../../../core/services/project/project.service';
import { RequestItem } from '../../../core/query/request-item';
import { ProjectCriteria } from '../../../core/query/project/project-criteria';
import { ProjectFormModel } from '../../dmp/editor/grant-tab/project-form-model';
@Component({
selector: 'app-quick-wizard-project-editor-component',
templateUrl: './project-editor-wizard.component.html',
styleUrls: ['./project-editor-wizard.component.scss']
})
export class ProjectEditorWizardComponent implements OnInit {
isNew = false;
project: ProjectFormModel;
@Input() formGroup: FormGroup;
projectAutoCompleteConfiguration: SingleAutoCompleteConfiguration;
constructor(
private projectService: ProjectService
) { }
ngOnInit() {
this.projectAutoCompleteConfiguration = {
filterFn: this.searchProject.bind(this),
initialItems: (extraData) => this.searchProject(''),
displayFn: (item) => item['label'],
titleFn: (item) => item['label']
};
if (!this.formGroup) {
this.project = new ProjectFormModel();
this.formGroup = this.project.buildForm();
}
this.formGroup.get('existProject').enable();
this.formGroup.get('label').disable();
this.formGroup.get('description').disable();
}
searchProject(query: string) {
const projectRequestItem: RequestItem<ProjectCriteria> = new RequestItem();
projectRequestItem.criteria = new ProjectCriteria();
projectRequestItem.criteria.like = query;
return this.projectService.getWithExternal(projectRequestItem);
}
create() {
this.isNew = !this.isNew;
if (this.isNew) {
this.formGroup.get('existProject').disable();
this.formGroup.get('existProject').reset();
this.formGroup.get('label').enable();
this.formGroup.get('description').enable();
} else {
this.formGroup.get('existProject').enable();
this.formGroup.get('label').disable();
this.formGroup.get('label').reset();
this.formGroup.get('description').disable();
this.formGroup.get('description').reset();
}
}
}

View File

@ -10,14 +10,15 @@
<ng-template matStepLabel>
{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.TITLE' | translate}}
</ng-template>
<div *ngIf="formGroup.get('grant')">
<app-quick-wizard-grant-editor-component class="col-12"
[formGroup]="formGroup.get('grant')">
</app-quick-wizard-grant-editor-component>
<div *ngIf="formGroup.get('funder')">
<app-quick-wizard-funder-editor-component class="col-12" [formGroup]="formGroup.get('funder')"></app-quick-wizard-funder-editor-component>
</div>
<app-quick-wizard-grant-editor-component class="col-12" [grantformGroup]="formGroup.get('grant')" [funderFormGroup]="formGroup.get('funder')"></app-quick-wizard-grant-editor-component>
<div *ngIf="formGroup.get('project')">
<app-quick-wizard-project-editor-component class="col-12" [formGroup]="formGroup.get('project')"></app-quick-wizard-project-editor-component>
</div>
<div class="navigation-buttons-container">
<button style="float:right;" matStepperNext mat-raised-button
color="primary">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.NEXT' | translate}}</button>
<button style="float:right;" matStepperNext mat-raised-button color="primary">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.NEXT' | translate}}</button>
</div>
</mat-step>
<mat-step [stepControl]="formGroup.get('dmp')">
@ -26,14 +27,11 @@
</ng-template>
<ng-container *ngIf="formGroup.get('grant').valid">
<div>
<app-quick-wizard-dmp-editor-component class="col-12" [formGroup]="formGroup.get('dmp')"
[datasetFormGroup]="formGroup.get('datasets')"
[dmpLabel]=" getGrantLabel()">
<app-quick-wizard-dmp-editor-component class="col-12" [formGroup]="formGroup.get('dmp')" [datasetFormGroup]="formGroup.get('datasets')" [dmpLabel]=" getGrantLabel()">
</app-quick-wizard-dmp-editor-component>
</div>
<div class="navigation-buttons-container">
<button matStepperPrevious mat-raised-button
color="primary">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.BACK' | translate}}</button>
<button matStepperPrevious mat-raised-button color="primary">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.BACK' | translate}}</button>
<button style="float:right;" matStepperNext mat-raised-button color="primary">
{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.NEXT' | translate}}</button>
</div>
@ -47,9 +45,7 @@
<ng-container *ngIf="formGroup.get('dmp').valid && isActive('step3')">
<div *ngIf="formGroup.get('datasets')" class="row">
<!-- <div *ngIf="this.isActiveStep(3)" class="row"> -->
<app-dataset-editor-wizard-component class="col-12" [formGroup]="formGroup"
[datasetProfile]="formGroup.get('dmp').get('datasetProfile')"
[datasetLabel]="formGroup.get('dmp').get('label').value">
<app-dataset-editor-wizard-component class="col-12" [formGroup]="formGroup" [datasetProfile]="formGroup.get('dmp').get('datasetProfile')" [datasetLabel]="formGroup.get('dmp').get('label').value">
</app-dataset-editor-wizard-component>
<!-- <app-dataset-description-form class="col-12" *ngIf="formGroup && datasetWizardModel && datasetWizardModel.datasetProfileDefinition"
[form]="this.formGroup.get('datasetProfileDefinition')" [visibilityRules]="datasetWizardModel.datasetProfileDefinition.rules"
@ -60,12 +56,9 @@
<!-- </div> -->
</div>
<div class="navigation-buttons-container mt-3">
<button matStepperPrevious mat-raised-button
color="primary">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.BACK' | translate}}</button>
<button class="saveAndFinalizeButton" matStepperNext mat-raised-button (click)='saveFinalize()' [disabled]="!isFormValid() || !hasDatasets()"
color="primary">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.SAVE-AND-FINALIZE' | translate}}</button>
<button class="saveButton" matStepperNext mat-raised-button (click)='formSubmit()' [disabled]="!hasDatasets()"
color="primary">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.SAVE' | translate}}</button>
<button matStepperPrevious mat-raised-button color="primary">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.BACK' | translate}}</button>
<button class="saveAndFinalizeButton" matStepperNext mat-raised-button (click)='saveFinalize()' [disabled]="!isFormValid() || !hasDatasets()" color="primary">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.SAVE-AND-FINALIZE' | translate}}</button>
<button class="saveButton" matStepperNext mat-raised-button (click)='formSubmit()' [disabled]="!hasDatasets()" color="primary">{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.ACTIONS.SAVE' | translate}}</button>
</div>
</ng-container>
</mat-step>

View File

@ -19,6 +19,7 @@ import { IBreadCrumbComponent } from '../../misc/breadcrumb/definition/IBreadCru
import { DatasetEditorWizardComponent } from '../dataset-editor/dataset-editor-wizard.component';
import { GrantEditorWizardModel } from '../grant-editor/grant-editor-wizard-model';
import { QuickWizardEditorWizardModel } from './quick-wizard-editor.model';
import { FunderFormModel } from '../../dmp/editor/grant-tab/funder-form-model';
@Component({
selector: 'app-quick-wizard-editor-component',
@ -51,6 +52,7 @@ export class QuickWizardEditorComponent extends BaseComponent implements OnInit,
ngOnInit(): void {
this.quickWizard = new QuickWizardEditorWizardModel();
this.quickWizard.grant = new GrantEditorWizardModel();
this.quickWizard.funder = new FunderFormModel();
this.formGroup = this.quickWizard.buildForm();
this.language.get('NAV-BAR.DMP-WIZARD').pipe(takeUntil(this._destroyed)).subscribe(x => {
this.breadCrumbs = Observable.of([

View File

@ -9,9 +9,15 @@ import { BackendErrorValidator } from "../../../common/forms/validation/custom-v
import { ValidationErrorModel } from "../../../common/forms/validation/error-model/validation-error-model";
import { DatasetEditorWizardModel } from "../dataset-editor/dataset-editor-wizard-model";
import { DatasetWizardEditorModel } from "../../dataset/dataset-wizard/dataset-wizard-editor.model";
import { FunderModel } from "../../../core/model/funder/funder";
import { FunderFormModel } from "../../dmp/editor/grant-tab/funder-form-model";
import { ProjectFormModel } from "../../dmp/editor/grant-tab/project-form-model";
import { ProjectModel } from "../../../core/model/project/project";
export class QuickWizardEditorWizardModel {
public grant: GrantEditorWizardModel;
public grant: GrantEditorWizardModel;
public funder: FunderFormModel;
public project: ProjectFormModel;
public dmp: DmpEditorWizardModel;
public datasets: DatasetEditorWizardModel;
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel();
@ -19,7 +25,17 @@ export class QuickWizardEditorWizardModel {
fromModelGrant(item: GrantListingModel): QuickWizardEditorWizardModel {
this.grant.fromModel(item);
return this;
}
}
fromModelFunder(item: FunderModel): QuickWizardEditorWizardModel {
this.funder.fromModel(item);
return this;
}
fromModelProject(item: ProjectModel): QuickWizardEditorWizardModel {
this.project.fromModel(item);
return this;
}
fromModelDmp(item: DmpModel): QuickWizardEditorWizardModel {
this.dmp.fromModel(item);
@ -29,12 +45,14 @@ export class QuickWizardEditorWizardModel {
fromModelDataset(item: DatasetWizardEditorModel[]): QuickWizardEditorWizardModel {
this.datasets.fromModel(item);
return this;
}
}
buildForm(context: ValidationContext = null): FormGroup {
// if (context == null) { context = this.createValidationContext(); }
const formGroup = new FormBuilder().group({
grant: new GrantEditorWizardModel().buildForm(),
grant: new GrantEditorWizardModel().buildForm(),
funder: new FunderFormModel().buildForm(),
project: new ProjectFormModel().buildForm(),
dmp: new DmpEditorWizardModel().buildForm(),
datasets: new DatasetEditorWizardModel().buildForm()

View File

@ -11,6 +11,8 @@ import { AutoCompleteModule } from '../../library/auto-complete/auto-complete.mo
import { DatasetEditorWizardComponent } from './dataset-editor/dataset-editor-wizard.component';
import { DatasetDescriptionFormModule } from '../misc/dataset-description-form/dataset-description-form.module';
import { DmpModule } from '../dmp/dmp.module';
import { FunderEditorWizardComponent } from './funder-editor/funder-editor-wizard.component';
import { ProjectEditorWizardComponent } from './project-editor/project-editor-wizard.component';
@NgModule({
@ -29,6 +31,8 @@ import { DmpModule } from '../dmp/dmp.module';
DmpEditorWizardComponent,
QuickWizardEditorComponent,
DatasetEditorWizardComponent,
FunderEditorWizardComponent,
ProjectEditorWizardComponent
],
exports: [
DatasetEditorWizardComponent,

View File

@ -988,8 +988,10 @@
"SAVE-AND-FINALIZE": "Save and Finalize",
"NEXT": "Next",
"BACK": "Back",
"CREATE-NEW": "Add Grant",
"EXIST": "Use Existing Grant",
"CREATE-NEW-GRANT": "Add Grant",
"EXIST-GRANT": "Use Existing Grant",
"CREATE-NEW-FUNDER": "Add Funder",
"EXIST-FUNDER": "Use Existing Funder",
"CREATE-NEW-PROJECT": "Add Project",
"EXIST-PROJECT": "Use Existing Project",
"CREATE-NEW-FUNDER": "Add Funder",
@ -997,11 +999,17 @@
},
"FIRST-STEP": {
"TITLE": "Grant",
"ABOUT": "Find the grant that your DMP is associated with and link it to funders' information. If the grant is not listed or you are creating a DMP for a grant proposal or for other purposes, use \"Add Grant\"",
"ABOUT-NEW": "If you are creating a DMP for a grant proposal, institutional or research community use or training and educational purposes, add information below by creating a new grant.",
"ABOUT-GRANT": "Find the grant that your DMP is associated with and link it to funders' information. If the grant is not listed or you are creating a DMP for a grant proposal or for other purposes, use \"Add Grant\"",
"ABOUT-NEW-GRANT": "If you are creating a DMP for a grant proposal, institutional or research community use or training and educational purposes, add information below by creating a new grant.",
"ABOUT-FUNDER": "Find the funder that you wish to associate with the DMP that will be created and then select a grant that funder is linked with. If the funder is not listed, use \"Add Funder\"",
"ABOUT-NEW-FUNDER": "If you you are creating a DMP for a grant proposal, institutional or research community use or training and educational purposes and you wish to associate it with a funder that is not listed then create a new funder",
"ABOUT-PROJECT": "Find the project that your DMP is associated with. If the project is not listed, use \"Add Project\"",
"ABOUT-NEW-PROJECT": "",
"OR": "or",
"FIELDS": {
"SELECT-GRANT": "Select the grant that the DMP is associated with",
"SELECT-FUNDER": "Select the funder of the grant that the DMP is associated with",
"SELECT-PROJECT": "Select the project that the DMP is associated with",
"GRANT-LABEL": "Grant Name",
"FUNDER-LABEL": "Funder Name",
"PROJECT-LABEL": "Project Name",

View File

@ -32,7 +32,6 @@ $theme: mat-light-theme($primary, $accent);
.lightblue-btn {
background-color: rgba(0, 112, 192, 1) !important;
// background-color: rgb(70, 135, 240) !important;
}
.listing-item {
@ -57,7 +56,6 @@ $theme: mat-light-theme($primary, $accent);
padding: 0.1em 1em;
border-radius: 10em;
background-color: rgba(0, 112, 192, 1);
// background-color: rgb(70, 135, 230);
color: #fff;
text-transform: uppercase;
font-weight: 500;
@ -119,22 +117,6 @@ $theme: mat-light-theme($primary, $accent);
margin-bottom: 0px;
}
// .template-name {
// padding-left: 0px;
// border: 1px solid rgb(218, 227, 243);
// color: rgb(43, 104, 209);
// background-color: rgb(236, 241, 249);
// border-radius: 10em;
// justify-content: center;
// text-transform: uppercase;
// display: flex;
// width: 25em;
// height: 1.8em;
// margin-top: 15px;
// font-size: 13px;
// font-weight: 500;
// }
.draft-bookmark {
color: #e7e6e6;
display: inline;