From 2843ac666018f53c46d5447210b94ce8a43d46ad Mon Sep 17 00:00:00 2001 From: dtziotzios Date: Thu, 14 Mar 2019 11:29:35 +0200 Subject: [PATCH 1/9] Fixes bug on Composite Field when all child fields where deleted. --- .../dataset-profile-editor-composite-field.component.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts index 2ada995c2..256a522fc 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/composite-field/dataset-profile-editor-composite-field.component.ts @@ -1,6 +1,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormArray, FormControl, FormGroup } from '@angular/forms'; import { FieldEditorModel } from '../../../admin/field-editor-model'; +import { FieldSetEditorModel } from '../../../admin/field-set-editor-model'; @Component({ selector: 'app-dataset-profile-editor-composite-field-component', @@ -35,6 +36,10 @@ export class DatasetProfileEditorCompositeFieldComponent implements OnInit { } (this.form.get('fields') as FormArray).controls.splice(1); } + if ((this.form.get('fields')).length === 0) { + const field: FieldEditorModel = new FieldEditorModel(); + (this.form.get('fields')).push(field.buildForm()); + } } onIsMultiplicityEnabledChange(isMultiplicityEnabled: boolean) { From e90d23ae54b462eb1b0819a7c3422f627556bad2 Mon Sep 17 00:00:00 2001 From: dtziotzios Date: Thu, 14 Mar 2019 11:31:06 +0200 Subject: [PATCH 2/9] Adds tooltips on Quick wizard icons. --- .../dataset-editor/dataset-editor-wizard.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/dataset-editor-wizard.component.html b/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/dataset-editor-wizard.component.html index 0d859eb8a..f5672eb40 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/dataset-editor-wizard.component.html +++ b/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/dataset-editor-wizard.component.html @@ -4,10 +4,10 @@
- + format_align_left - + add From 3d3eff8a65378cc578d3421f0816919f3ecc824b Mon Sep 17 00:00:00 2001 From: dtziotzios Date: Thu, 14 Mar 2019 11:50:06 +0200 Subject: [PATCH 3/9] Adds Save and Finalize functionality on QuickWizard. Fixes Save on QuickWizard so one can save even if form is invalid. --- .../quick-wizard-editor.component.html | 8 ++++--- .../quick-wizard-editor.component.scss | 7 ++++++ .../quick-wizard-editor.component.ts | 22 ++++++------------- dmp-frontend/src/assets/i18n/en.json | 1 + 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.html b/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.html index 527fca52e..696a86617 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.html +++ b/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.html @@ -59,12 +59,14 @@
- \ No newline at end of file + diff --git a/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.scss b/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.scss index e69de29bb..3e178b79b 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.scss +++ b/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.scss @@ -0,0 +1,7 @@ +.saveAndFinalizeButton{ + float:right; +} +.saveButton{ + float:right; + margin-right: 15px; +} diff --git a/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts b/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts index 65b0c2376..429b8521d 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts +++ b/dmp-frontend/src/app/ui/quick-wizard/quick-wizard-editor/quick-wizard-editor.component.ts @@ -15,7 +15,6 @@ import { ProjectEditorWizardModel } from '../project-editor/project-editor-wizar import { QuickWizardEditorWizardModel } from './quick-wizard-editor.model'; - @Component({ selector: 'app-quick-wizard-editor-component', templateUrl: 'quick-wizard-editor.component.html', @@ -24,15 +23,10 @@ import { QuickWizardEditorWizardModel } from './quick-wizard-editor.model'; export class QuickWizardEditorComponent extends BaseComponent implements OnInit, IBreadCrumbComponent { breadCrumbs: Observable = Observable.of([]); - @ViewChild('stepper') stepper: MatStepper; isNew = true; - quickWizard: QuickWizardEditorWizardModel formGroup: FormGroup = null; - firstStepFormGroup: FormGroup; - secondFormGroup: FormGroup; - constructor( public snackBar: MatSnackBar, @@ -72,13 +66,18 @@ export class QuickWizardEditorComponent extends BaseComponent implements OnInit, formSubmit(): void { this.touchAllFormFields(this.formGroup); - if (!this.isFormValid()) { return; } if (this.formGroup.get('datasets') && this.formGroup.get('datasets').get('datasetsList') && (this.formGroup.get('datasets').get('datasetsList') as FormArray).length > 0) { this.onSubmit(); } else { return; } - } + } + + saveFinalize() { + if (!this.isFormValid()) { return; } + this.formGroup.get('status').setValue('1'); + this.onSubmit(); + } public isFormValid() { return this.formGroup.valid; @@ -100,7 +99,6 @@ export class QuickWizardEditorComponent extends BaseComponent implements OnInit, } onSubmit(): void { - if (!this.isFormValid()) { return; } this.quickWizardService.createQuickWizard(this.formGroup.getRawValue()) .pipe(takeUntil(this._destroyed)) .subscribe( @@ -109,7 +107,6 @@ export class QuickWizardEditorComponent extends BaseComponent implements OnInit, ); } - onCallbackSuccess(): void { this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success); this.router.navigate(['/home']); @@ -148,9 +145,4 @@ export class QuickWizardEditorComponent extends BaseComponent implements OnInit, return this.formGroup.get('project').get('label').value; } } - - - - - } diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index ee786cb29..5e8f603aa 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -680,6 +680,7 @@ "ACTIONS": { "DELETE": "Delete", "SAVE": "Save", + "SAVE-AND-FINALIZE":"Save and Finalize", "NEXT": "Next", "BACK": "Back", "CREATE-NEW":"Create new", From 3b3b5220891b09e58830176b0635894610f78359 Mon Sep 17 00:00:00 2001 From: dtziotzios Date: Thu, 14 Mar 2019 11:52:14 +0200 Subject: [PATCH 4/9] Moves datasetWizard style from html to its respective scss file. --- .../dataset-wizard.component.html | 10 ++++---- .../dataset-wizard.component.scss | 25 +++++++++++++++++++ 2 files changed, 30 insertions(+), 5 deletions(-) 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 f7e9ceff5..8c85c9e7f 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 @@ -18,18 +18,18 @@ -->
- - -
diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.scss b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.scss index e5fd8c323..56bc9cb23 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.scss +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.scss @@ -11,4 +11,29 @@ .description-action-row { margin-top: 1em; } + .deleteButton { + margin-top: 15px; + margin-bottom: 15px; + margin-right: 15px; + } + .saveButton { + margin-top: 15px; + margin-bottom: 15px; + margin-right: 15px; + } + .saveAndFinalizeButton { + margin-top: 15px; + margin-bottom: 15px; + margin-right: 15px; + } + .downloadPDF { + margin-top: 15px; + margin-bottom: 15px; + margin-right: 15px; + } + .downloadXML { + margin-top: 15px; + margin-bottom: 15px; + margin-right: 15px; + } } From 95fa905fd2eca33d8c0911d309b18255685f5517 Mon Sep 17 00:00:00 2001 From: dtziotzios Date: Thu, 14 Mar 2019 11:52:59 +0200 Subject: [PATCH 5/9] Deletes obsolete Model class. --- .../dmp-selector/dataset-dmp-selector.model.ts | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 dmp-frontend/src/app/ui/dataset-create-wizard/dmp-selector/dataset-dmp-selector.model.ts diff --git a/dmp-frontend/src/app/ui/dataset-create-wizard/dmp-selector/dataset-dmp-selector.model.ts b/dmp-frontend/src/app/ui/dataset-create-wizard/dmp-selector/dataset-dmp-selector.model.ts deleted file mode 100644 index 0d61eb041..000000000 --- a/dmp-frontend/src/app/ui/dataset-create-wizard/dmp-selector/dataset-dmp-selector.model.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { DmpModel } from "../../../core/model/dmp/dmp"; -import { DatasetProfileModel } from "../../../core/model/dataset/dataset-profile"; - -export class DatasetDmpSelectorModel{ - label?: string; - status?: number; -} From b7e06189453782b6cb296814812a6652fab176df Mon Sep 17 00:00:00 2001 From: dtziotzios Date: Thu, 14 Mar 2019 12:20:33 +0200 Subject: [PATCH 6/9] Polishes Section's Description and also Composite's field Description and Extended Description. --- .../dataset-profile-editor-section.component.html | 2 +- .../form-composite-field.component.html | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.html b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.html index 355a94f4b..f34dc1eee 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.html +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/components/section/dataset-profile-editor-section.component.html @@ -22,7 +22,7 @@ - + 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 8ac054ea8..2f675c6dd 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 @@ -36,10 +36,10 @@ {{form.get('title').value}} info - -
{{form.get('description').value}}
-
- {{form.get('extendedDescription').value}}
+ +
{{form.get('description').value}}
+
+ {{form.get('extendedDescription').value}}
- \ No newline at end of file + From 2cbaa05f950bf9d759b0d9a13b2351ee541a02c1 Mon Sep 17 00:00:00 2001 From: dtziotzios Date: Thu, 14 Mar 2019 12:58:24 +0200 Subject: [PATCH 7/9] Restyles and repositions "Add one more Fieldset" button. --- .../form-section/form-section.component.html | 14 ++++++++------ .../form-section/form-section.component.scss | 4 ++++ dmp-frontend/src/assets/i18n/en.json | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) 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 d978a7f7f..021b90bfc 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 @@ -14,14 +14,10 @@
-
- -
+ +
@@ -35,6 +31,12 @@
+
+ +
diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.scss b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.scss index b0da624db..f8a8dab85 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.scss +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.scss @@ -2,6 +2,9 @@ .expansion-panel { margin-bottom: 1em; } + .addOneFieldButton { + margin-top: -15px; + } } .styleBorder{ border: 0.2em solid lightgray; @@ -12,3 +15,4 @@ padding-bottom: 18px; color: black; } + diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index 5e8f603aa..f9f47474b 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -98,7 +98,7 @@ "ADDITIONAL-INFORMATION":"Additional Information", "MULTIPLICITY-MIN": "Multiplicity Min", "MULTIPLICITY-MAX": "Multiplicity Max", - "MULTIPLICITY-ADD-ONE-FIELD": "Add one more fieldset +", + "MULTIPLICITY-ADD-ONE-FIELD": "Add one more fieldset", "ORDER": "Order" }, "ACTIONS": { From 06f45326a6493f3ec19c0855cc69b8b5bd6cfca0 Mon Sep 17 00:00:00 2001 From: dtziotzios Date: Thu, 14 Mar 2019 16:30:34 +0200 Subject: [PATCH 8/9] Fixes autocomplete on quick wizard not working when filling out the dataset. --- .../dataset-editor/dataset-editor-wizard.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/dataset-editor-wizard.component.html b/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/dataset-editor-wizard.component.html index f5672eb40..0a663a6d2 100644 --- a/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/dataset-editor-wizard.component.html +++ b/dmp-frontend/src/app/ui/quick-wizard/dataset-editor/dataset-editor-wizard.component.html @@ -45,7 +45,7 @@ - +
From 8c241fd47fb823fa32954129b5833195459d39ac Mon Sep 17 00:00:00 2001 From: dtziotzios Date: Thu, 14 Mar 2019 17:39:30 +0200 Subject: [PATCH 9/9] Polishing position and fixes bug on "add one field" button. --- .../components/form-section/form-section.component.html | 2 +- .../components/form-section/form-section.component.scss | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 021b90bfc..e159a3c75 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 @@ -32,7 +32,7 @@
+ class="col-12 addOneFieldButton"> diff --git a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.scss b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.scss index f8a8dab85..d9df0bba6 100644 --- a/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.scss +++ b/dmp-frontend/src/app/ui/misc/dataset-description-form/components/form-section/form-section.component.scss @@ -4,6 +4,7 @@ } .addOneFieldButton { margin-top: -15px; + margin-left: -11px; } } .styleBorder{