diff --git a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts index 4eee5e892..5d6d75a02 100644 --- a/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/dataset-profile/editor/dataset-profile-editor.component.ts @@ -391,6 +391,8 @@ export class DatasetProfileEditorComponent extends BaseComponent implements OnIn private showValidationErrorsDialog(projectOnly?: boolean) { const dialogRef = this.dialog.open(FormValidationErrorsDialogComponent, { disableClose: true, + autoFocus: false, + restoreFocus: false, data: { errorMessages: this.errorMessages, projectOnly: projectOnly diff --git a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts index 7865b44ac..772e07e39 100644 --- a/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dataset/dataset-wizard/dataset-wizard.component.ts @@ -564,6 +564,8 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr private showValidationErrorsDialog(projectOnly?: boolean) { const dialogRef = this.dialog.open(FormValidationErrorsDialogComponent, { disableClose: true, + autoFocus: false, + restoreFocus: false, data: { formGroup: this.formGroup, projectOnly: projectOnly diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts index ee934b36f..0920d4fc5 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts @@ -472,6 +472,8 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC private showValidationErrorsDialog(projectOnly?: boolean) { const dialogRef = this.dialog.open(FormValidationErrorsDialogComponent, { disableClose: true, + autoFocus: false, + restoreFocus: false, data: { formGroup: this.formGroup, projectOnly: projectOnly diff --git a/dmp-frontend/src/app/ui/dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component.html b/dmp-frontend/src/app/ui/dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component.html index 8d2cf7362..91a1c74f9 100644 --- a/dmp-frontend/src/app/ui/dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component.html +++ b/dmp-frontend/src/app/ui/dmp/start-new-dataset-dialogue/start-new-dataset-dialog.component.html @@ -20,7 +20,7 @@
-
+
diff --git a/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.html b/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.html index 1126efc31..465324b54 100644 --- a/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.html +++ b/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.html @@ -1,11 +1,18 @@
-

{{'GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.WARNING' | translate}}

-
-
    -
  • {{error}}
  • -
+
+ {{'GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.WARNING' | translate}} + close
-
- +
+
+
    +
  • {{error}}
  • +
+
+
+
+
+ +
diff --git a/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.scss b/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.scss index 66c7f2cf2..71cc68947 100644 --- a/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.scss +++ b/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.scss @@ -1,5 +1,89 @@ +.form-content-editor-content { + width: 33rem; + min-height: 14rem; + padding: 0.28rem 0.34rem 0rem 0.625rem; +} + +.logo { + width: 8.44rem; +} + +.close-icon { + cursor: pointer; +} + +.content { + margin: 2.17rem 0rem 1.1875rem 0rem; + min-height: 6rem; +} + +.text { + font-size: 1.25rem; + font-weight: lighter; + color: #000000; + opacity: 0.8; +} + +.title { + text-align: left; + font-weight: 500; + font-size: 1.25rem; + letter-spacing: 0px; + color: #f16868; + opacity: 1; +} + +.text { + margin-bottom: 2.9375rem; + line-height: 1.9rem; +} + +.cancel-btn { + background: #ffffff 0% 0% no-repeat padding-box; + border: 1px solid #b5b5b5; + border-radius: 30px; + width: 101px; + height: 43px; + color: #212121; + font-weight: 500; +} + +.next-btn { + background: #ffffff 0% 0% no-repeat padding-box; + border: 1px solid #129d99; + border-radius: 30px; + opacity: 1; + width: 101px; + height: 43px; + color: #129d99; + font-weight: 500; +} + +.disabled-btn { + border: 1px solid #b5b5b5; + border-radius: 30px; + opacity: 1; + width: 101px; + height: 43px; + color: #b5b5b5; + font-weight: 500; +} + +.actions { + display: flex; + flex-direction: row; +} + +.error-list { + margin-bottom: 0; + padding-left: 1.5rem; + li { + line-height: 1.6rem; + } +} + #warningText { - color: red; - text-decoration: underline; - text-decoration-color: red; -} \ No newline at end of file + color: red; + text-decoration: underline; + text-decoration-color: red; +} diff --git a/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts b/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts index c0d389bbc..400ecba9b 100644 --- a/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts +++ b/dmp-frontend/src/common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component.ts @@ -51,7 +51,8 @@ export class FormValidationErrorsDialogComponent { getErrorMessage(formControl: FormControl): string[] { const errors: string[] = []; Object.keys(formControl.errors).forEach(key => { - if (key === 'required') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + this.getPlaceHolder(formControl) + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.REQUIRED')); } + if (key === 'required') { errors.push(this.language.instant(this.getPlaceHolder(formControl) + ": " + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.REQUIRED'))); } + // if (key === 'required') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + this.getPlaceHolder(formControl) + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.REQUIRED')); } else if (key === 'email') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + this.getPlaceHolder(formControl) + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.EMAIL')); } else if (key === 'min') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + this.getPlaceHolder(formControl) + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MIN-VALUE', { 'min': formControl.getError('min').min })); } else if (key === 'max') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + this.getPlaceHolder(formControl) + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MAX-VALUE', { 'max': formControl.getError('max').max })); } @@ -61,22 +62,23 @@ export class FormValidationErrorsDialogComponent { } getPlaceHolder(formControl: any): string { - // if (formControl.nativeElement.localName === 'input') { - // return formControl.nativeElement.getAttribute('placeholder'); - // } else if (formControl.nativeElement.localName === 'mat-select') { - // return formControl.nativeElement.getAttribute('aria-label'); - // } else if (formControl.nativeElement.localName === 'app-single-auto-complete') { - // return (Array.from(formControl.nativeElement.firstChild.children).filter((x: any) => x.localName === 'input')[0] as any).getAttribute('placeholder'); - // } else if (formControl.nativeElement.localName === 'app-multiple-auto-complete') { - // return (Array.from(formControl.nativeElement.firstChild.children).filter((x: any) => x.localName === 'input')[0] as any).getAttribute('placeholder'); - // } + if (formControl.nativeElement.localName === 'input') { + return formControl.nativeElement.getAttribute('placeholder'); + } else if (formControl.nativeElement.localName === 'mat-select') { + return formControl.nativeElement.getAttribute('aria-label'); + } else if (formControl.nativeElement.localName === 'app-single-auto-complete') { + return (Array.from(formControl.nativeElement.firstChild.children).filter((x: any) => x.localName === 'input')[0] as any).getAttribute('placeholder'); + } else if (formControl.nativeElement.localName === 'app-multiple-auto-complete') { + return (Array.from(formControl.nativeElement.firstChild.children).filter((x: any) => x.localName === 'input')[0] as any).getAttribute('placeholder'); + } - let result = ''; - try { - result = (Array.from(formControl.nativeElement.parentElement.children).filter((x: any) => Array.from(x.classList).includes('mat-form-field-label-wrapper'))[0] as any).innerText; - result = result.replace(' *', ''); - } catch (error) { } + // Needs to have in in html in order to fill results + // let result = ''; + // try { + // result = (Array.from(formControl.nativeElement.parentElement.children).filter((x: any) => Array.from(x.classList).includes('mat-form-field-label-wrapper'))[0] as any).innerText; + // result = result.replace(' *', ''); + // } catch (error) { } - return result; + // return result; } }