Skip to content

Commit a2102c0

Browse files
CLARIN-DSpace v9/Port #1300 (accessibility sweep) to the v9 base (#1509)
* Port #1300 to dtq-dev-9-base: UFAL/Accessibility existing issues all (ufal#139) Source: d154682 (dtq-dev PR #1300) Adapted to v9: DsLangPipe reaches its six consumers through each standalone component's imports[] instead of the removed shared.module.ts; the clarin-description-item-field loop uses @for; the vanilla-9-only #linkImg metadata-values template gets the lang binding too; the custom theme's full-file-section override mirrors the new imports[]; the footer's <br/>-in-<ul> fix is already on 9-base as li.list-spacer, so only the heading levels and the matching .h4 SCSS selectors are ported. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Cover the one behavioural change of #1300 with a real spec clarin-description-item-field is the only component this port changes behaviourally: it used to join every description value into a single innerHTML with <br>, and now renders one <div> per value so each can carry its own lang. That component had no spec on dtq-dev-9-base. dtq-dev has one, but it is a bare "should create" smoke test that would not have caught any of this, and the source commit did not touch it. Adds five cases against the new shape: one element per value, per-value BCP 47 lang, no lang attribute for the wildcard language, makeLinks still producing anchors through [innerHTML], and the empty-metadata case. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent c453631 commit a2102c0

42 files changed

Lines changed: 373 additions & 52 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h4 class="card-title" [innerHTML]="dsoTitle"></h4>
4040
@if (dso.hasMetadata('dc.description')) {
4141
<p class="item-description card-text">
4242
<ds-truncatable-part [id]="dso.id" [minLines]="3">
43-
<span [innerHTML]="firstMetadataValue('dc.description')"></span>
43+
<span [innerHTML]="firstMetadataValue('dc.description')" [attr.lang]="dso.firstMetadata('dc.description')?.language | dsLang"></span>
4444
</ds-truncatable-part>
4545
</p>
4646
}

src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal-volume/journal-volume-search-result-grid-element.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { listableObjectComponent } from '../../../../../shared/object-collection
1010
import { ItemSearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component';
1111
import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component';
1212
import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component';
13+
import { DsLangPipe } from '../../../../../shared/utils/ds-lang.pipe';
1314
import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbnail.component';
1415

1516
@listableObjectComponent('JournalVolumeSearchResult', ViewMode.GridElement)
@@ -20,6 +21,7 @@ import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbn
2021
animations: [focusShadow],
2122
imports: [
2223
AsyncPipe,
24+
DsLangPipe,
2325
RouterLink,
2426
ThemedBadgesComponent,
2527
ThemedThumbnailComponent,

src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ <h4 class="card-title" [innerHTML]="dsoTitle"></h4>
4646
@if (dso.hasMetadata('dc.description')) {
4747
<p class="item-description card-text">
4848
<ds-truncatable-part [id]="dso.id" [minLines]="3">
49-
<span [innerHTML]="firstMetadataValue('dc.description')"></span>
49+
<span [innerHTML]="firstMetadataValue('dc.description')" [attr.lang]="dso.firstMetadata('dc.description')?.language | dsLang"></span>
5050
</ds-truncatable-part>
5151
</p>
5252
}

src/app/entity-groups/journal-entities/item-grid-elements/search-result-grid-elements/journal/journal-search-result-grid-element.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { listableObjectComponent } from '../../../../../shared/object-collection
1010
import { ItemSearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component';
1111
import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component';
1212
import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component';
13+
import { DsLangPipe } from '../../../../../shared/utils/ds-lang.pipe';
1314
import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbnail.component';
1415

1516
@listableObjectComponent('JournalSearchResult', ViewMode.GridElement)
@@ -20,6 +21,7 @@ import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbn
2021
animations: [focusShadow],
2122
imports: [
2223
AsyncPipe,
24+
DsLangPipe,
2325
RouterLink,
2426
ThemedBadgesComponent,
2527
ThemedThumbnailComponent,

src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ <h4 class="card-title" [innerHTML]="dsoTitle"></h4>
3232
@if (dso.hasMetadata('dc.description')) {
3333
<p class="item-description card-text text-muted">
3434
<ds-truncatable-part [id]="dso.id" [minLines]="3">
35-
<span [innerHTML]="firstMetadataValue('dc.description')"></span>
35+
<span [innerHTML]="firstMetadataValue('dc.description')" [attr.lang]="dso.firstMetadata('dc.description')?.language | dsLang"></span>
3636
</ds-truncatable-part>
3737
</p>
3838
}

src/app/entity-groups/research-entities/item-grid-elements/search-result-grid-elements/project/project-search-result-grid-element.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { listableObjectComponent } from '../../../../../shared/object-collection
1010
import { ItemSearchResultGridElementComponent } from '../../../../../shared/object-grid/search-result-grid-element/item-search-result/item/item-search-result-grid-element.component';
1111
import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component';
1212
import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component';
13+
import { DsLangPipe } from '../../../../../shared/utils/ds-lang.pipe';
1314
import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbnail.component';
1415

1516
@listableObjectComponent('ProjectSearchResult', ViewMode.GridElement)
@@ -20,6 +21,7 @@ import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbn
2021
animations: [focusShadow],
2122
imports: [
2223
AsyncPipe,
24+
DsLangPipe,
2325
RouterLink,
2426
ThemedBadgesComponent,
2527
ThemedThumbnailComponent,

src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<span
4545
class="item-list-org-unit-description">
4646
<ds-truncatable-part [id]="dso.id" [minLines]="3"><span
47-
[innerHTML]="firstMetadataValue('dc.description')"></span>
47+
[innerHTML]="firstMetadataValue('dc.description')" [attr.lang]="dso.firstMetadata('dc.description')?.language | dsLang"></span>
4848
</ds-truncatable-part>
4949
</span>
5050
}

src/app/entity-groups/research-entities/item-list-elements/search-result-list-elements/org-unit/org-unit-search-result-list-element.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { listableObjectComponent } from '../../../../../shared/object-collection
1212
import { ItemSearchResultListElementComponent } from '../../../../../shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component';
1313
import { TruncatableComponent } from '../../../../../shared/truncatable/truncatable.component';
1414
import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component';
15+
import { DsLangPipe } from '../../../../../shared/utils/ds-lang.pipe';
1516
import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbnail.component';
1617

1718
@listableObjectComponent('OrgUnitSearchResult', ViewMode.ListElement)
@@ -21,6 +22,7 @@ import { ThemedThumbnailComponent } from '../../../../../thumbnail/themed-thumbn
2122
templateUrl: './org-unit-search-result-list-element.component.html',
2223
imports: [
2324
AsyncPipe,
25+
DsLangPipe,
2426
NgClass,
2527
RouterLink,
2628
ThemedBadgesComponent,

src/app/entity-groups/research-entities/item-list-elements/sidebar-search-list-elements/org-unit/org-unit-sidebar-search-list-element.component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { ItemSearchResult } from '../../../../../shared/object-collection/shared
1212
import { listableObjectComponent } from '../../../../../shared/object-collection/shared/listable-object/listable-object.decorator';
1313
import { SidebarSearchListElementComponent } from '../../../../../shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component';
1414
import { TruncatablePartComponent } from '../../../../../shared/truncatable/truncatable-part/truncatable-part.component';
15+
import { metadataLangToBcp47 } from '../../../../../shared/utils/metadata-language.util';
1516

1617
@listableObjectComponent('OrgUnitSearchResult', ViewMode.ListElement, Context.SideBarSearchModal)
1718
@listableObjectComponent('OrgUnitSearchResult', ViewMode.ListElement, Context.SideBarSearchModalCurrent)
@@ -39,4 +40,11 @@ export class OrgUnitSidebarSearchListElementComponent extends SidebarSearchListE
3940
getDescription(): string {
4041
return this.firstMetadataValue('dc.description');
4142
}
43+
44+
/**
45+
* Get the language of the Org Unit description.
46+
*/
47+
getDescriptionLang(): string | null {
48+
return metadataLangToBcp47(this.dso.firstMetadata('dc.description')?.language);
49+
}
4250
}

src/app/entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<ng-template #descTemplate>
22
<span class="text-muted">
33
<span class="item-list-job-title">
4-
<span [innerHTML]="mdRepresentation.firstMetadataValue(['dc.description'], undefined, true)"></span>
4+
<span [innerHTML]="mdRepresentation.firstMetadataValue(['dc.description'], undefined, true)" [attr.lang]="mdRepresentation.firstMetadata(['dc.description'])?.language | dsLang"></span>
55
</span>
66
</span>
77
</ng-template>

0 commit comments

Comments
 (0)