Skip to content

Commit 47b0f14

Browse files
committed
Fix a11y Labeling on PendingUpdatesSummary
The school label for this select is buried within the SVG, safari doesn't love that. Might be a bug in Safari, or possibly the check, but the fix is easy and harmless so going this way.
1 parent acdcc38 commit 47b0f14

File tree

1 file changed

+51
-53
lines changed

1 file changed

+51
-53
lines changed

packages/frontend/app/components/pending-updates-summary.gjs

Lines changed: 51 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { cached, tracked } from '@glimmer/tracking';
44
import { filter } from 'rsvp';
55
import { TrackedAsyncData } from 'ember-async-data';
66
import { findById } from 'ilios-common/utils/array-helpers';
7-
import { uniqueId, get, hash } from '@ember/helper';
7+
import { get, hash } from '@ember/helper';
88
import FaIcon from 'ilios-common/components/fa-icon';
99
import t from 'ember-intl/helpers/t';
1010
import gt from 'ember-truth-helpers/helpers/gt';
@@ -88,60 +88,58 @@ export default class PendingUpdatesSummaryComponent extends Component {
8888
});
8989
}
9090
<template>
91-
{{#let (uniqueId) as |template-id|}}
92-
<div
93-
class="pending-updates-summary small-component {{if this.haveUpdates 'alert'}}"
94-
data-test-pending-updates-summary
95-
...attributes
96-
>
97-
<h3 data-test-title>
98-
{{#if this.haveUpdates}}
99-
<FaIcon @icon="triangle-exclamation" class="no" />
91+
<div
92+
class="pending-updates-summary small-component {{if this.haveUpdates 'alert'}}"
93+
data-test-pending-updates-summary
94+
...attributes
95+
>
96+
<h3 data-test-title>
97+
{{#if this.haveUpdates}}
98+
<FaIcon @icon="triangle-exclamation" class="no" />
99+
{{/if}}
100+
{{t "general.pendingUpdatesSummaryTitle"}}
101+
</h3>
102+
<div id="schoolsfilter" class="filter" data-test-schools>
103+
<label class="inline-label">
104+
<FaIcon @icon="building-columns" @title={{t "general.school"}} />
105+
</label>
106+
<div id="school-selection" class="inline-data">
107+
{{#if (gt @schools.length 1)}}
108+
<select
109+
aria-label={{t "general.school"}}
110+
{{on "change" (pick "target.value" (set this "selectedSchoolId"))}}
111+
>
112+
{{#each (sortBy "title" @schools) as |school|}}
113+
<option value={{school.id}} selected={{eq school.id this.bestSelectedSchool.id}}>
114+
{{school.title}}
115+
</option>
116+
{{/each}}
117+
</select>
118+
{{else}}
119+
{{this.bestSelectedSchool.title}}
100120
{{/if}}
101-
{{t "general.pendingUpdatesSummaryTitle"}}
102-
</h3>
103-
<div id="schoolsfilter" class="filter" data-test-schools>
104-
<label class="inline-label" for="schools-{{template-id}}">
105-
<FaIcon @icon="building-columns" @title={{t "general.school"}} />
106-
</label>
107-
<div id="school-selection" class="inline-data">
108-
{{#if (gt @schools.length 1)}}
109-
<select
110-
id="schools-{{template-id}}"
111-
{{on "change" (pick "target.value" (set this "selectedSchoolId"))}}
112-
>
113-
{{#each (sortBy "title" @schools) as |school|}}
114-
<option value={{school.id}} selected={{eq school.id this.bestSelectedSchool.id}}>
115-
{{school.title}}
116-
</option>
117-
{{/each}}
118-
</select>
119-
{{else}}
120-
{{this.bestSelectedSchool.title}}
121-
{{/if}}
122-
</div>
123121
</div>
124-
{{#if this.areUpdatesLoaded}}
125-
<p data-test-summary>
126-
{{t "general.pendingUpdatesSummary" count=(get this.updates "length")}}
127-
</p>
128-
{{#if (get this.updates "length")}}
129-
<div class="actions" data-test-actions>
130-
<LinkTo
131-
@route="pending-user-updates"
132-
@query={{hash school=this.bestSelectedSchool.id}}
133-
data-test-manage
134-
>
135-
<button type="button">
136-
{{t "general.manage"}}
137-
</button>
138-
</LinkTo>
139-
</div>
140-
{{/if}}
141-
{{else}}
142-
<LoadingSpinner />
143-
{{/if}}
144122
</div>
145-
{{/let}}
123+
{{#if this.areUpdatesLoaded}}
124+
<p data-test-summary>
125+
{{t "general.pendingUpdatesSummary" count=(get this.updates "length")}}
126+
</p>
127+
{{#if (get this.updates "length")}}
128+
<div class="actions" data-test-actions>
129+
<LinkTo
130+
@route="pending-user-updates"
131+
@query={{hash school=this.bestSelectedSchool.id}}
132+
data-test-manage
133+
>
134+
<button type="button">
135+
{{t "general.manage"}}
136+
</button>
137+
</LinkTo>
138+
</div>
139+
{{/if}}
140+
{{else}}
141+
<LoadingSpinner />
142+
{{/if}}
143+
</div>
146144
</template>
147145
}

0 commit comments

Comments
 (0)