Fixed #7182: Required field names appearing in the warning modal.

dataset-wizard.component.ts & dmp-editor.component.ts & form-validation-errors-dialog.component.ts:
a. For 'mat-select', use placeholder instead of aria-label.
b. [Bug fix] For 'app-multiple-auto-complete' dig into 2 more levels (formControl.nativeElement.firstChild.firstChild.firstChild.children) --> reason: commit de99784b5e: moved <input> inside <mat-chip-list>.
This commit is contained in:
Konstantina Galouni 2021-11-16 11:47:24 +02:00
parent 7820235258
commit 7a7f12b83a
3 changed files with 32 additions and 31 deletions

View File

@ -651,11 +651,11 @@ export class DatasetWizardComponent extends CheckDeactivateBaseComponent impleme
|| formControl.nativeElement.localName === 'richTextarea') {
return formControl.nativeElement.getAttribute('placeholder');
} else if (formControl.nativeElement.localName === 'mat-select') {
return formControl.nativeElement.getAttribute('aria-label');
return formControl.nativeElement.getAttribute('placeholder');
} 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');
return (Array.from(formControl.nativeElement.firstChild.firstChild.firstChild.children).filter((x: any) => x.localName === 'input')[0] as any).getAttribute('placeholder');
}
}

View File

@ -825,11 +825,11 @@ export class DmpEditorComponent extends CheckDeactivateBaseComponent implements
|| formControl.nativeElement.localName === 'richTextarea') {
return formControl.nativeElement.getAttribute('placeholder');
} else if (formControl.nativeElement.localName === 'mat-select') {
return formControl.nativeElement.getAttribute('aria-label');
return formControl.nativeElement.getAttribute('placeholder');
} 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');
return (Array.from(formControl.nativeElement.firstChild.firstChild.firstChild.children).filter((x: any) => x.localName === 'input')[0] as any).getAttribute('placeholder');
}
}

View File

@ -70,14 +70,15 @@ export class FormValidationErrorsDialogComponent {
}
getPlaceHolder(formControl: any): string {
if (formControl.nativeElement.localName === 'input' || formControl.nativeElement.localName === 'textarea') {
if (formControl.nativeElement.localName === 'input' || formControl.nativeElement.localName === 'textarea'
|| formControl.nativeElement.localName === 'richTextarea') {
return formControl.nativeElement.getAttribute('placeholder');
} else if (formControl.nativeElement.localName === 'mat-select') {
return formControl.nativeElement.getAttribute('aria-label');
return formControl.nativeElement.getAttribute('placeholder');
} 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');
return (Array.from(formControl.nativeElement.firstChild.firstChild.firstChild.children).filter((x: any) => x.localName === 'input')[0] as any).getAttribute('placeholder');
}
// Needs to have <mat-label> in <mat-form-field> in html in order to fill results