From 410583a5f2a72b35f8c45c28b137808376c74f36 Mon Sep 17 00:00:00 2001 From: apapachristou Date: Fri, 25 Sep 2020 15:55:06 +0300 Subject: [PATCH] Moves fields language, visibility, publication data, contact from license tab to main --- .../ui/dmp/editor/dmp-editor.component.html | 4 +- .../license-info/license-info.component.html | 81 +--------------- .../license-info/license-info.component.ts | 10 +- .../editor/main-info/main-info.component.html | 92 +++++++++++++++++-- .../editor/main-info/main-info.component.scss | 28 ++++-- .../editor/main-info/main-info.component.ts | 25 ++++- 6 files changed, 136 insertions(+), 104 deletions(-) diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html index 2e535a1d5..cff0b741e 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html @@ -33,9 +33,9 @@
{{'DMP-EDITOR.STEPPER.USER-GUIDE' | translate}}
    -
  1. {{'DMP-EDITOR.STEPPER.MAIN-INFO' | translate}} (4)
  2. +
  3. {{'DMP-EDITOR.STEPPER.MAIN-INFO' | translate}} (8)
  4. {{'DMP-EDITOR.STEPPER.FUNDING-INFO' | translate}} (3)
  5. -
  6. {{'DMP-EDITOR.STEPPER.LICENSE-INFO' | translate}} (5)
  7. +
  8. {{'DMP-EDITOR.STEPPER.LICENSE-INFO' | translate}} (1)
  9. {{'DMP-EDITOR.STEPPER.DATASET-INFO' | translate}}
  10. diff --git a/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.html b/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.html index ed02d2bfa..1e28f56e4 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.html +++ b/dmp-frontend/src/app/ui/dmp/editor/license-info/license-info.component.html @@ -3,30 +3,10 @@ {{'DMP-EDITOR.LICENSE-INFO.INTRO' | translate}}
- +
-
4.1 {{'DMP-EDITOR.FIELDS.LANGUAGE' | translate}}
- -
- - - - {{ lang.name }} - - - - {{formGroup.get('extraProperties').get('language').getError('backendError').message}} - - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
-
- -
-
-
4.2 {{'DMP-EDITOR.FIELDS.LICENSE' | translate}}
+
4.1 {{'DMP-EDITOR.FIELDS.LICENSE' | translate}}
{{'DMP-EDITOR.LICENSE-INFO.HINT' | translate}}
@@ -40,63 +20,6 @@
- -
-
-
4.3 {{'DMP-EDITOR.FIELDS.VISIBILITY' | translate}}
- -
- - - - {{vis.name | translate}} - - - - {{formGroup.get('extraProperties').get('visible').getError('backendError').message}} - - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
-
- -
-
-
4.4 {{'DMP-EDITOR.FIELDS.PUBLICATION' | translate}}
- -
- - - - - - {{formGroup.get('extraProperties').get('publicDate').getError('backendError').message}} - - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
-
-
-
-
4.5 {{'DMP-EDITOR.FIELDS.CONTACT' | translate}}
- -
- - - - {{vis.name | translate}} - - - - {{formGroup.get('extraProperties').get('contact').getError('backendError').message}} - - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
-
+
+
+
1.3 {{'DMP-EDITOR.FIELDS.LANGUAGE' | translate}}
+ +
+ + + + {{ lang.name }} + + + + {{formGroup.get('extraProperties').get('language').getError('backendError').message}} + + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+
+ +
+
+
1.4 {{'DMP-EDITOR.FIELDS.VISIBILITY' | translate}}
+ +
+ + + + {{vis.name | translate}} + + + + {{formGroup.get('extraProperties').get('visible').getError('backendError').message}} + + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+
-
1.3 {{'DMP-EDITOR.FIELDS.RESEARCHERS' | translate}}
+
1.5 {{'DMP-EDITOR.FIELDS.RESEARCHERS' | translate}}
info {{'DMP-EDITOR.MAIN-INFO.TYPING' | translate}}
-
+
@@ -51,15 +91,17 @@ add_circle --> - {{'DMP-EDITOR.FUNDING-INFO.FIND' | translate}} - {{'DMP-EDITOR.ACTIONS.INSERT-MANUALLY' | translate}} +
+ {{'DMP-EDITOR.FUNDING-INFO.FIND' | translate}} + {{'DMP-EDITOR.ACTIONS.INSERT-MANUALLY' | translate}} +
-
1.4 {{'DMP-EDITOR.FIELDS.ORGANISATIONS' | translate}}
+
1.6 {{'DMP-EDITOR.FIELDS.ORGANISATIONS' | translate}}
{{'DMP-EDITOR.FIELDS.ORGANISATIONS-HINT' | translate}}
info {{'DMP-EDITOR.MAIN-INFO.TYPING' | translate}}
@@ -75,12 +117,50 @@ add_circle --> -
+
{{'DMP-EDITOR.FUNDING-INFO.FIND' | translate}} {{'DMP-EDITOR.ACTIONS.INSERT-MANUALLY' | translate}}
+ +
+
+
1.7 {{'DMP-EDITOR.FIELDS.PUBLICATION' | translate}}
+ +
+ + + + + + {{formGroup.get('extraProperties').get('publicDate').getError('backendError').message}} + + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+
+ +
+
+
1.8 {{'DMP-EDITOR.FIELDS.CONTACT' | translate}}
+ +
+ + + + {{vis.name | translate}} + + + + {{formGroup.get('extraProperties').get('contact').getError('backendError').message}} + + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+
diff --git a/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.scss b/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.scss index d125f68cf..f2f676312 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.scss +++ b/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.scss @@ -34,7 +34,13 @@ } .title-form, - .description-form { + .contact-form, + .description-form, + .publication-form, + .organisations-form, + .researchers-form, + .language-form, + .visibility-form { text-align: left; font-weight: 400; font-size: 16px; @@ -78,35 +84,43 @@ ::ng-deep .title-form .mat-form-field-appearance-outline .mat-form-field-outline { background: #fafafa !important; } - ::ng-deep .description-form .mat-form-field-appearance-outline .mat-form-field-outline { background: #fafafa !important; } - ::ng-deep .organizations-form .mat-form-field-appearance-outline .mat-form-field-outline { background: #fafafa !important; } - ::ng-deep .author-form .mat-form-field-appearance-outline .mat-form-field-outline { background: #fafafa !important; } +::ng-deep .contact-form .mat-form-field-appearance-outline .mat-form-field-outline { + background: #fafafa !important; +} +::ng-deep publication-form .mat-form-field-appearance-outline .mat-form-field-outline { + background: #fafafa !important; +} ::ng-deep .title-form .mat-form-field-appearance-outline .mat-form-field-infix { font-size: 1rem; padding: 0.6em 0 1em 0 !important; } - ::ng-deep .description-form .mat-form-field-appearance-outline .mat-form-field-infix { font-size: 1rem; padding: 0.6em 0 1em 0 !important; } - ::ng-deep .organizations-form .mat-form-field-appearance-outline .mat-form-field-infix { font-size: 1rem; padding: 0.6em 0 1em 0 !important; } - ::ng-deep .author-form .mat-form-field-appearance-outline .mat-form-field-infix { font-size: 1rem; padding: 0.6em 0 1em 0 !important; } +::ng-deep .contact-form .mat-form-field-appearance-outline .mat-form-field-infix { + font-size: 1rem; + padding: 0.6em 0 1em 0 !important; +} +::ng-deep .publication-form .mat-form-field-appearance-outline .mat-form-field-infix { + font-size: 1rem; + padding: 0.6em 0 1em 0 !important; +} diff --git a/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts b/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts index 217e5ab41..21178b255 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/main-info/main-info.component.ts @@ -18,6 +18,13 @@ import { DataTableRequest } from '@app/core/model/data-table/data-table-request' import { DmpCriteria } from '@app/core/query/dmp/dmp-criteria'; import { DmpStatus } from '@app/core/common/enum/dmp-status'; import { DmpService } from '@app/core/services/dmp/dmp.service'; +import { LanguageInfo } from '@app/core/model/language-info'; +import { LanguageInfoService } from '@app/core/services/culture/language-info-service'; + +interface Visible { + value: boolean; + name: string; +} @Component({ selector: 'main-info', @@ -34,6 +41,10 @@ export class MainInfoComponent extends BaseComponent implements OnInit { @Output() onFormChanged: EventEmitter = new EventEmitter(); public formControl = new FormControl(); + visibles: Visible[] = [ + { value: true, name: 'DMP-EDITOR.VISIBILITY.PUBLIC' }, + { value: false, name: 'DMP-EDITOR.VISIBILITY.RESTRICTED' } + ] organisationsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = { filterFn: this.filterOrganisations.bind(this), @@ -63,7 +74,8 @@ export class MainInfoComponent extends BaseComponent implements OnInit { private configurationService: ConfigurationService, private externalSourcesService: ExternalSourcesService, private dmpService: DmpService, - private dialog: MatDialog + private dialog: MatDialog, + private languageInfoService: LanguageInfoService ) { super(); } @@ -172,4 +184,15 @@ export class MainInfoComponent extends BaseComponent implements OnInit { // else { return item['label']; } return item['label'] ? item['label'] : null; } + + getLanguageInfos(): LanguageInfo[] { + return this.languageInfoService.getLanguageInfoValues(); + } + + getAssociates(): any[] { + let associates: any[] = []; + //associates = (this.formGroup.get('researchers').value as any[]); + associates = associates.concat(this.formGroup.get('associatedUsers').value); + return associates; + } }