diff --git a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.html b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.html index 45a4dc9bb3a..6f7e7de0148 100644 --- a/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.html +++ b/src/app/entity-groups/research-entities/submission/item-list-elements/org-unit/org-unit-suggestions/org-unit-input-suggestions.component.html @@ -3,7 +3,9 @@ (keydown.arrowdown)="shiftFocusDown($event)" (keydown.arrowup)="shiftFocusUp($event)" (keydown.esc)="close()" (dsClickOutside)="close();"> + + + + { expect(comp).toBeTruthy(); }); + describe('the accessible name of the suggestion input', () => { + beforeEach(() => { + comp.name = 'author'; + comp.placeholder = 'Search for an author'; + fixture.detectChanges(); + }); + + it('should label the input with a label that resolves to it', () => { + const input: HTMLInputElement = el.querySelector('input.suggestion_input'); + const label: HTMLLabelElement = el.querySelector('label'); + + expect(input.id).toBeTruthy(); + expect(label).toBeTruthy(); + // a placeholder is not a label: the association has to be real + expect(label.htmlFor).toEqual(input.id); + expect(label.textContent.trim()).toEqual('Search for an author'); + // and the label must not be rendered visibly (Bootstrap 5 dropped the old screen-reader class) + expect(Array.from(label.classList)).toContain('visually-hidden'); + }); + + it('should derive the id from the name input so two instances do not collide', () => { + const input: HTMLInputElement = el.querySelector('input.suggestion_input'); + const firstId: string = input.id; + + comp.name = 'subject'; + fixture.detectChanges(); + const label: HTMLLabelElement = el.querySelector('label'); + + expect(input.id).not.toEqual(firstId); + expect(label.htmlFor).toEqual(input.id); + }); + }); + describe('when the input field is in focus', () => { beforeEach(() => { diff --git a/src/app/shared/input-suggestions/validation-suggestions/validation-suggestions.component.html b/src/app/shared/input-suggestions/validation-suggestions/validation-suggestions.component.html index f0867ad8744..fc54140203d 100644 --- a/src/app/shared/input-suggestions/validation-suggestions/validation-suggestions.component.html +++ b/src/app/shared/input-suggestions/validation-suggestions/validation-suggestions.component.html @@ -3,7 +3,9 @@ (keydown.arrowdown)="shiftFocusDown($event)" (keydown.arrowup)="shiftFocusUp($event)" (keydown.esc)="close()" (dsClickOutside)="checkIfValidInput(form);close();"> - {{placeholder}} + {{'submission.workflow.tasks.claimed.reject.reason.title {{'submission.workflow.tasks.claimed.reject.reason.info' | translate}}
+ diff --git a/src/themes/dspace/app/home-page/home-news/home-news.component.html b/src/themes/dspace/app/home-page/home-news/home-news.component.html index d98da7be07c..45b6a6321b1 100644 --- a/src/themes/dspace/app/home-page/home-news/home-news.component.html +++ b/src/themes/dspace/app/home-page/home-news/home-news.component.html @@ -34,7 +34,7 @@

DSpace 9

- + Photo by @inspiredimages diff --git a/src/themes/dspace/app/home-page/home-news/home-news.component.ts b/src/themes/dspace/app/home-page/home-news/home-news.component.ts index 5a7d52d83ea..0303002e546 100644 --- a/src/themes/dspace/app/home-page/home-news/home-news.component.ts +++ b/src/themes/dspace/app/home-page/home-news/home-news.component.ts @@ -1,4 +1,5 @@ import { Component } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; import { HomeNewsComponent as BaseComponent } from '../../../../../app/home-page/home-news/home-news.component'; @@ -6,6 +7,9 @@ import { HomeNewsComponent as BaseComponent } from '../../../../../app/home-page selector: 'ds-themed-home-news', styleUrls: ['./home-news.component.scss'], templateUrl: './home-news.component.html', + imports: [ + TranslateModule, + ], }) /**