Rename fields on Dmp Wizard - (Issue #123) and fixes breadcrumb get language

This commit is contained in:
apapachristou 2019-06-26 10:39:25 +03:00
parent fb824c70e9
commit 9d92225f68
3 changed files with 19 additions and 11 deletions

View File

@ -24,15 +24,17 @@
<input matInput <input matInput
placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.LABEL' | translate}}" placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.LABEL' | translate}}"
type="text" name="label" [formControl]="formGroup.get('label')" required> type="text" name="label" [formControl]="formGroup.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')"> <mat-error *ngIf="formGroup.get('label').hasError('backendError')">
{{formGroup.get('label').getError('backendError').message}}</mat-error> {{formGroup.get('label').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('label').hasError('required')"> <mat-error *ngIf="formGroup.get('label').hasError('required')">
{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> {{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12 mt-2">
<textarea matInput class="description-area" <textarea matInput class="description-area"
placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.DESCRIPTION' | translate}}" placeholder="{{'QUICKWIZARD.CREATE-ADD.CREATE.QUICKWIZARD_CREATE.FIRST-STEP.FIELDS.DESCRIPTION' | translate}}"
[formControl]="formGroup.get('description')" required></textarea> [formControl]="formGroup.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')"> <mat-error *ngIf="formGroup.get('description').hasError('backendError')">
{{formGroup.get('description').getError('backendError').message}}</mat-error> {{formGroup.get('description').getError('backendError').message}}</mat-error>
<mat-error *ngIf="formGroup.get('description').hasError('required')"> <mat-error *ngIf="formGroup.get('description').hasError('required')">
@ -65,4 +67,4 @@
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
</form> </form>
</div> </div>

View File

@ -50,11 +50,15 @@ export class QuickWizardEditorComponent extends BaseComponent implements OnInit,
this.quickWizard = new QuickWizardEditorWizardModel(); this.quickWizard = new QuickWizardEditorWizardModel();
this.quickWizard.project = new ProjectEditorWizardModel(); this.quickWizard.project = new ProjectEditorWizardModel();
this.formGroup = this.quickWizard.buildForm(); this.formGroup = this.quickWizard.buildForm();
this.breadCrumbs = Observable.of([{ this.language.get('NAV-BAR.DMP-WIZARD').pipe(takeUntil(this._destroyed)).subscribe(x => {
parentComponentName: 'Dashboard', this.breadCrumbs = Observable.of([
label: this.language.instant('NAV-BAR.DMP-WIZARD'), {
url: '/quick-wizard' parentComponentName: 'Dashboard',
}]); label: x,
url: '/quick-wizard'
}]
);
})
} }
isActive(step: string): boolean { isActive(step: string): boolean {

View File

@ -874,16 +874,18 @@
"SAVE-AND-FINALIZE": "Save and Finalize", "SAVE-AND-FINALIZE": "Save and Finalize",
"NEXT": "Next", "NEXT": "Next",
"BACK": "Back", "BACK": "Back",
"CREATE-NEW": "Create new project", "CREATE-NEW": "Add project",
"EXIST": "Existing Project" "EXIST": "Existing Project"
}, },
"FIRST-STEP": { "FIRST-STEP": {
"TITLE": "Project", "TITLE": "Project",
"OR": "or", "OR": "or",
"FIELDS": { "FIELDS": {
"SELECT-PROJECT": "Pick the project the DMP is associate with", "SELECT-PROJECT": "Select the project that the DMP is associated with",
"LABEL": "Label", "LABEL": "Project Name",
"DESCRIPTION": "Description" "LABEL-HINT": "Add the name of the project as it appears in the call for grant proposal",
"DESCRIPTION": "Description",
"DESCRIPTION-HINT": "Briefly explain the aims and objectives of the project"
} }
}, },
"SECOND-STEP": { "SECOND-STEP": {