Skip to content

Commit

Permalink
Merge pull request #1644 from UUDigitalHumanitieslab/feature/minor-ac…
Browse files Browse the repository at this point in the history
…cessibility-improvements

Feature/minor accessibility improvements
  • Loading branch information
JeltevanBoheemen authored Aug 30, 2024
2 parents 8f21960 + 84fa318 commit 1d20509
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 13 deletions.
7 changes: 6 additions & 1 deletion frontend/src/app/document-view/document-view.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
</tr>
<ng-container *ngFor="let field of propertyFields">
<tr *ngIf="document.fieldValue(field)">
<th [iaBalloon]="field.description" iaBalloonPosition="up" iaBalloonLength="medium">{{field.displayName}}</th>
<th>
<span [iaBalloon]="field.description"
iaBalloonPosition="up" iaBalloonLength="medium">
{{field.displayName}}
</span>
</th>
<td *ngIf="!isUrlField(field) && !isGeoPointField(field)"
data-test-field-value
[attr.lang]="document.language(field)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
<table class="table is-fullwidth">
<ng-container *ngFor="let field of page.fields">
<tr *ngIf="document.fieldValue(field)">
<th [iaBalloon]="field.description" iaBalloonPosition="left" iaBalloonLength="medium">
{{field.displayName}}:
<th>
<span [iaBalloon]="field.description" iaBalloonPosition="left" iaBalloonLength="medium">
{{field.displayName}}:
</span>
</th>
<td *ngIf="document.highlight && document.highlight[field.name]; else unhighlightedRow"
[attr.lang]="document.language(field)">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/filter/filter-manager.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div>
<div class="field has-addons">
<div class="control is-expanded">
<h4 class="title">Filters</h4>
<h2 class="title">Filters</h2>
</div>
<p class="control" style="float:right">
<span *ngIf="anyActiveFilters$ | async" class="button icon filter-icon is-primary is-active is-medium is-round"
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/footer/footer.component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<footer class="footer">
<div class="footer">
<div class="container is-readable">
<div class="columns">
<div class="column">
Expand Down Expand Up @@ -29,4 +29,4 @@
</p>
</div>
</div>
</footer>
</div>
4 changes: 2 additions & 2 deletions frontend/src/app/services/download.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ describe('DownloadService', () => {
sort: [{ great_field: 'desc' }],
highlight: {
fragment_size: highlight,
pre_tags: ['<span class="highlight">'],
post_tags: ['</span>'],
pre_tags: ['<mark class="highlight">'],
post_tags: ['</mark>'],
order: 'score',
fields: [{ speech: {} }],
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/shared/pipes/regex-highlight.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class RegexHighlightPipe implements PipeTransform {
const highlightedText = parts.map(part => {
const sanitizedText = this.sanitizedLineBreaks(part.substring, '<br />');

return part.isHit ? `<span class="highlight">${sanitizedText}</span>` : sanitizedText;
return part.isHit ? `<mark class="highlight">${sanitizedText}</mark>` : sanitizedText;
}).join('');

return this.sanitizer.bypassSecurityTrustHtml(highlightedText);
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/utils/es-query.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ describe('es-query utils', () => {
expect(makeHighlightSpecification(mockCorpus3, 'test', 100)).toEqual({
highlight: {
fragment_size: 100,
pre_tags: ['<span class="highlight">'],
post_tags: ['</span>'],
pre_tags: ['<mark class="highlight">'],
post_tags: ['</mark>'],
order: 'score',
fields: [{speech: {}}]
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/utils/es-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ export const makeHighlightSpecification = (corpus: Corpus, queryText?: string, h
return {
highlight: {
fragment_size: highlightSize,
pre_tags: ['<span class="highlight">'],
post_tags: ['</span>'],
pre_tags: ['<mark class="highlight">'],
post_tags: ['</mark>'],
order: 'score',
fields: highlightFields.map((field) =>
field.displayType === 'text_content' &&
Expand Down

0 comments on commit 1d20509

Please sign in to comment.