Skip to content

Commit 15ff78d

Browse files
[DURACOM-426] accessibility fixes, fix issue with sticky popover directive, add descriptions to code
1 parent c37f216 commit 15ff78d

File tree

23 files changed

+144
-20
lines changed

23 files changed

+144
-20
lines changed

src/app/core/shared/item.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export class Item extends DSpaceObject implements ChildHALResource, HandleObject
103103
* A string representing the entity type of this Item
104104
*/
105105
@autoserializeAs(String, 'entityType')
106-
entityType: string;
106+
entityType: string;
107107

108108

109109
/**

src/app/core/submission/vocabularies/models/vocabulary-entry-detail.model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ export class VocabularyEntryDetail extends VocabularyEntry {
5151
* Will be undefined unless the submitter {@link HALLink} has been resolved.
5252
*/
5353
@link(VOCABULARY_ENTRY_DETAIL)
54-
parent?: Observable<RemoteData<VocabularyEntryDetail>>;
54+
parent?: Observable<RemoteData<VocabularyEntryDetail>>;
5555

5656
/**
5757
* The submitter for this SubmissionObject
5858
* Will be undefined unless the submitter {@link HALLink} has been resolved.
5959
*/
6060
@link(VOCABULARY_ENTRY_DETAIL, true)
61-
children?: Observable<RemoteData<PaginatedList<VocabularyEntryDetail>>>;
61+
children?: Observable<RemoteData<PaginatedList<VocabularyEntryDetail>>>;
6262

6363
}

src/app/core/submission/vocabularies/models/vocabulary-entry.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class VocabularyEntry extends ListableObject {
4949
* A value representing security level value of the metadata
5050
*/
5151
@autoserialize
52-
securityLevel: number;
52+
securityLevel: number;
5353

5454
/**
5555
* A string representing the kind of vocabulary entry

src/app/dso-shared/dso-edit-metadata/dso-edit-metadata-value/dso-edit-metadata-value.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
}
5555
@if(mdValue.editing) {
5656
<textarea class="form-control" rows="5" [(ngModel)]="mdValue.newValue.authority"
57+
[attr.aria-label]="(dsoType + '.edit.metadata.edit.authority') | translate"
5758
[dsDebounce]="300" (onDebounce)="confirm.emit(false)"></textarea>
5859
}
5960
</div>

src/app/shared/entity-icon/entity-icon.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export class EntityIconDirective implements OnInit {
119119
* @private
120120
*/
121121
private addIcon(entityStyle: AuthorityRefEntityStyleConfig): void {
122-
const iconElement = `<i class="${entityStyle.icon} ${entityStyle.style}"></i>`;
122+
const iconElement = `<i aria-hidden="true" class="${entityStyle.icon} ${entityStyle.style}"></i>`;
123123
if (this.iconPosition === 'after') {
124124
this.elem.nativeElement.insertAdjacentHTML('afterend', '&nbsp;' + iconElement);
125125
} else {

src/app/shared/form/builder/ds-dynamic-form-ui/models/dynamic-vocabulary.component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,13 @@ export abstract class DsDynamicVocabularyComponent extends DynamicFormControlCom
257257
}
258258
}
259259

260+
/**
261+
* Extracts and converts other information values from a vocabulary entry into FormFieldMetadataValueObject array.
262+
* This method processes values that may contain multiple entries separated by '|||' and authority values after '::'.
263+
* @param value The raw value string from otherInformation, possibly containing '|||' separators and '::' authority markers
264+
* @param key The otherInformation key (e.g., 'data-dc.contributor.affiliation')
265+
* @returns Array of FormFieldMetadataValueObject to populate form fields, or null if value is empty or key is 'alternative-names'
266+
*/
260267
getOtherInformationValue(value: string, key: string): FormFieldMetadataValueObject[] {
261268
if (!isNotEmpty(value) || key === 'alternative-names' ) {
262269
return null;

src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@
5454
(whenClickOnConfidenceNotAccepted)="whenClickOnConfidenceNotAccepted($event)"></i>
5555
}
5656
@if(otherInfoValues.length > 0 && (model.id === otherInfoKey || otherInfoKey === alternativeNamesKey || 'data-' + model.id === otherInfoKey)) {
57-
<i class="fa-solid fa-angle-down fa-fw fa-2x fa-fw position-absolute mt-1 p-0 additional-items-icon"
58-
(click)="toggleOtherInfoSelection()"
57+
<i
58+
class="fa-solid fa-angle-down fa-fw fa-2x fa-fw position-absolute mt-1 p-0 additional-items-icon"
59+
aria-hidden="true"
60+
(click)="toggleOtherInfoSelection()"
5961
></i>
6062
}
6163
</div>

src/app/shared/form/builder/ds-dynamic-form-ui/models/onebox/dynamic-onebox.component.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,12 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
398398
this.additionalInfoSelectIsOpen = !this.additionalInfoSelectIsOpen;
399399
}
400400

401+
/**
402+
* Handles the selection of an alternative information value from a list of multiple values.
403+
* This method is used when a vocabulary entry has multiple values for the same field
404+
* (e.g., alternative names or multiple affiliations separated by '|||').
405+
* @param info The selected alternative information value
406+
*/
401407
selectAlternativeInfo(info: string) {
402408
this.searching = true;
403409

@@ -434,6 +440,13 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
434440
}
435441

436442

443+
/**
444+
* Configures the component to handle multiple values for additional information fields.
445+
* This method is called when a vocabulary entry contains fields with multiple values
446+
* separated by '|||' (e.g., alternative names or multiple affiliations).
447+
* @param keys Array of keys from the otherInformation object to check for multiple values
448+
* @param item The vocabulary entry item containing the otherInformation data
449+
*/
437450
setMultipleValuesForOtherInfo(keys: string[], item: any) {
438451
const hasAlternativeNames = keys.includes(this.alternativeNamesKey);
439452

src/app/shared/image.utils.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ import {
44
} from 'rxjs';
55
import { map } from 'rxjs/operators';
66

7+
/**
8+
* Returns the appropriate placeholder image URL for a given DSpace entity type.
9+
* This utility is used throughout the application to display default/placeholder images
10+
* when entity thumbnails are not available or while they are loading.
11+
*
12+
* The method follows this resolution strategy:
13+
* 1. If no entityType is provided, returns the generic file placeholder
14+
* 2. Attempts to load an entity-specific placeholder (e.g., 'person-plsubmission-edit.component.tsaceholder.svg', 'orgunit-placeholder.svg')
15+
* 3. If the entity-specific placeholder doesn't exist, falls back to the generic file placeholder
16+
*
17+
* @param entityType The DSpace entity type (e.g., 'Person', 'OrgUnit', 'Project').
18+
* Case-insensitive as it will be converted to lowercase.
19+
*/
720
export const getDefaultImageUrlByEntityType = (entityType: string): Observable<string> => {
821
const fallbackImage = 'assets/images/file-placeholder.svg';
922

src/app/shared/metadata-link-view/metadata-link-view-avatar-popover/metadata-link-view-avatar-popover.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ import { getDefaultImageUrlByEntityType } from '../../image.utils';
1515
import { ThemedLoadingComponent } from '../../loading/themed-loading.component';
1616
import { SafeUrlPipe } from '../../utils/safe-url-pipe';
1717

18+
/**
19+
* Component that displays an avatar thumbnail within a popover.
20+
* This component is used by the MetadataLinkViewComponent to show entity avatars (e.g., person photos,
21+
* organization logos) in a popover when hovering over or clicking on metadata links.
22+
*
23+
* The popover displays:
24+
* - The entity's thumbnail image if available
25+
* - A placeholder image based on the entity type if no thumbnail is available
26+
*/
1827
@Component({
1928
selector: 'ds-metadata-link-view-avatar-popover',
2029
templateUrl: './metadata-link-view-avatar-popover.component.html',

0 commit comments

Comments
 (0)