diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.html b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.html index 24073d550..1b15f63c2 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.html +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.html @@ -68,11 +68,7 @@ {{'DATASET-WIZARD.THIRD-STEP.TITLE' | translate}}
-<<<<<<< HEAD - -======= - ->>>>>>> df51afe83344e5ee398f54d9a0a0b48f41588e16 +
diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.html b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.html index 0f777840f..936ffba0e 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.html +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.html @@ -11,11 +11,7 @@
{{form.get('extendedDescription').value}}
-<<<<<<< HEAD - -======= - ->>>>>>> df51afe83344e5ee398f54d9a0a0b48f41588e16 +
@@ -35,17 +31,10 @@
-<<<<<<< HEAD - +
- -======= - -
-
- ->>>>>>> df51afe83344e5ee398f54d9a0a0b48f41588e16 +
diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts index 54106ac10..3576ffdb0 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-composite-field/form-composite-field.component.ts @@ -11,6 +11,7 @@ import { VisibilityRulesService } from '../../visibility-rules/visibility-rules. export class FormCompositeFieldComponent { // @Input() compositeField: DatasetDescriptionCompositeFieldEditorModel; + @Input() datasetProfileId: String; @Input() form: FormGroup; //trackByFn = (index, item) => item ? item['id'] : null; @@ -29,7 +30,7 @@ export class FormCompositeFieldComponent { addMultipleField(fieldIndex: number) { // const field: DatasetDescriptionFieldEditorModel = this.compositeField.fields[fieldIndex].cloneForMultiplicity(fieldIndex, ''); // this.compositeField.fields[fieldIndex].multiplicityItems.push(field); - ((this.form.get('fields').get('' + fieldIndex).get('multiplicityItems'))).push(field.buildForm()); + // ((this.form.get('fields').get('' + fieldIndex).get('multiplicityItems'))).push(field.buildForm()); } // markForConsideration() { diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.html b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.html index 625a35701..d6250988e 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.html +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-field/form-field.component.html @@ -1,6 +1,6 @@
- +
{{this.form.get('title').value}}
{{this.form.get('description').value}}
{{this.form.get('extendedDescription').value}}
diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.html b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.html index e8234583d..a2daba3c3 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.html +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.html @@ -7,7 +7,6 @@

{{form.get('description').value}}

-
@@ -15,45 +14,30 @@
- +
-<<<<<<< HEAD - +
- + -======= - -
-
- - ->>>>>>> df51afe83344e5ee398f54d9a0a0b48f41588e16
- +
-<<<<<<< HEAD
- -======= -
-
- ->>>>>>> df51afe83344e5ee398f54d9a0a0b48f41588e16 +
-
\ No newline at end of file +
diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.ts index 82c1c5275..64eddba29 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.ts @@ -1,7 +1,5 @@ import { AfterViewInit, Component, Input, OnInit } from '@angular/core'; -import { FormArray, FormGroup } from '@angular/forms'; -import { CompositeField } from '../../../../../core/model/dataset-profile-definition/composite-field'; -import { DatasetDescriptionCompositeFieldEditorModel, DatasetDescriptionSectionEditorModel } from '../../dataset-description-form.model'; +import { FormGroup } from '@angular/forms'; import { FormFocusService } from '../../form-focus/form-focus.service'; import { VisibilityRulesService } from '../../visibility-rules/visibility-rules.service'; @@ -10,9 +8,10 @@ import { VisibilityRulesService } from '../../visibility-rules/visibility-rules. templateUrl: './form-section.component.html', styleUrls: ['./form-section.component.scss'] }) -export class FormSectionComponent implements OnInit, AfterViewInit { +export class FormSectionComponent implements OnInit { // @Input() section: DatasetDescriptionSectionEditorModel; + @Input() datasetProfileId: String; @Input() form: FormGroup; @Input() pathName: string; @Input() path: string; diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.html b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.html index 542bfdd75..205640833 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.html +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.html @@ -9,11 +9,7 @@ {{pageFormGroup.get('title').value}}
-<<<<<<< HEAD - -======= - ->>>>>>> df51afe83344e5ee398f54d9a0a0b48f41588e16 +
diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.ts index 28e47c915..0b7410146 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.component.ts @@ -55,7 +55,7 @@ export class DatasetDescriptionFormComponent extends BaseComponent implements On ngOnInit() { - this.visibilityRulesService.formGroup = this.form; + // this.visibilityRulesService.formGroup = this.form; this.visibilityRulesService.buildVisibilityRules(this.visibilityRules); // this.datasetProfileDefinitionModel = new DatasetDescriptionFormEditorModel().fromModel(this.dataModel); // this.visibilityRulesService.setModel(this.datasetProfileDefinitionModel); diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.model.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.model.ts index bf46926c1..a8b0889c7 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.model.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/dataset-description-form.model.ts @@ -241,6 +241,7 @@ export class DatasetDescriptionFieldEditorModel extends BaseFormModel { validationRequired: [{ value: this.validationRequired, disabled: true }], description: [{ value: this.description, disabled: true }], extendedDescription: [{ value: this.extendedDescription, disabled: true }], + title: [{ value: this.title, disabled: true }], }); const multiplicityItemsFormArray = new Array(); diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/helpers/dynamic-form-pending-questions/dynamic-form-pending-questions-display.component.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/helpers/dynamic-form-pending-questions/dynamic-form-pending-questions-display.component.ts index f64d3c45f..558f6f07e 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/helpers/dynamic-form-pending-questions/dynamic-form-pending-questions-display.component.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/helpers/dynamic-form-pending-questions/dynamic-form-pending-questions-display.component.ts @@ -38,8 +38,8 @@ export class DynamicFormPendingQuestionsDisplayComponent implements OnInit { const nestedCompositeFiels: CompositeField[] = nestedSections.flatMap(section => section.compositeFields).filter(x => x); const compositeFieldsUnion = compositeFields.concat(nestedCompositeFiels); //const fields: Field[] = compositeFields.flatMap(composite => composite.fields).concat(nestedCompositeFiels.flatMap(composite => composite.fields)); - const fields = compositeFieldsUnion.filter(compositeField => this.visibilityRulesService.checkElementVisibility(compositeField.id)) - .filter(compositeField => compositeField.fields.filter(x => x && x.validationRequired && this.visibilityRulesService.getFormGroup(x.id).value == null).length > 0); - fields.forEach(x => this.markForConsideration.markForConsideration(x)); + // const fields = compositeFieldsUnion.filter(compositeField => this.visibilityRulesService.checkElementVisibility(compositeField.id)) + // .filter(compositeField => compositeField.fields.filter(x => x && x.validationRequired && this.visibilityRulesService.getFormGroup(x.id).value == null).length > 0); + // fields.forEach(x => this.markForConsideration.markForConsideration(x)); } } diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service.ts b/dmp-frontend/src/app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service.ts index 617883b00..6e6bcf701 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service.ts +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/visibility-rules/visibility-rules.service.ts @@ -2,6 +2,7 @@ import { ApplicationRef, Injectable, NgZone } from '@angular/core'; import { Rule } from '../../../../core/model/dataset-profile-definition/rule'; import { VisibilityRule } from './models/visibility-rule'; import { VisibilityRulesContext } from './models/visibility-rules-context'; +import { isNumeric } from 'rxjs/internal/util/isNumeric'; @Injectable() export class VisibilityRulesService { @@ -41,7 +42,7 @@ export class VisibilityRulesService { public checkElementVisibility(id: string): boolean { if (this.visibilityRuleContext.rules.filter(item => item.targetControlId === id).length === 0) { return true; } - return this.elementVisibilityMap.has(id) && this.elementVisibilityMap.get(id); + return this.elementVisibilityMap.has(id) ? this.elementVisibilityMap.get(id) : false; } public buildVisibilityRules(item: Array) { @@ -58,7 +59,7 @@ export class VisibilityRulesService { for (let i = 0; i < visibilityRule.sourceVisibilityRules.length; i++) { //const pathKey = this.fieldsPathMemory[visibilityRule.sourceVisibilityRules[i].sourceControlId]; // if (this.formGroup.get(pathKey + '.value') && (this.parseValue(this.formGroup.get(pathKey + '.value').value) !== this.parseValue(visibilityRule.sourceVisibilityRules[i].sourceControlValue))) { - if (value && (this.parseValue(value) !== this.parseValue(visibilityRule.sourceVisibilityRules[i].sourceControlValue))) { + if (value != null && (this.parseValue(value) !== this.parseValue(visibilityRule.sourceVisibilityRules[i].sourceControlValue))) { // if (this.formGroup.get(pathKey).parent.get('id')) { // if (!this.checkElementVisibility(this.formGroup.get(pathKey).parent.get('id').value)) { // const targetPathKey = this.fieldsPathMemory[visibilityRule.targetControlId]; @@ -93,7 +94,14 @@ export class VisibilityRulesService { parseValue(value: any) { if (typeof value === 'string') { - if (value === 'true') { return true; } else if (value === 'false') { return false; } else { return this.translate(value); } + if (isNumeric(value)) { return value; } + else if (value === 'true') { + return true; + } + else if (value === 'false') { + return false; + } + else { return this.translate(value); } } else { return value; } }