-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Discover screen-reader accessibility: #11598
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,14 +24,22 @@ <h5 ng-show="!field.details.error">Quick Count <kbn-info info="Top 5 values base | |
<div ng-if="!field.details.error"> | ||
<div ng-repeat="bucket in ::field.details.buckets" class="discover-field-details-item"> | ||
<div> | ||
<!-- Add/remove filter buttons --> | ||
<span ng-show="field.filterable" class="pull-right"> | ||
<i aria-hidden="true" class="fa fa-search-minus pull-right discover-field-details-filter" | ||
ng-click="onAddFilter(field, bucket.value, '-')" data-test-subj="minus-{{::field.name}}-{{::bucket.display}}"></i> | ||
<i aria-hidden="true" class="fa fa-search-plus pull-right discover-field-details-filter" | ||
ng-click="onAddFilter(field, bucket.value, '+')" data-test-subj="plus-{{::field.name}}-{{::bucket.display}}"></i> | ||
<span aria-hidden="true" class="fa fa-search-minus pull-right discover-field-details-filter" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not an accessibility thing, but we should never use |
||
ng-click="onAddFilter(field, bucket.value, '-')" data-test-subj="minus-{{::field.name}}-{{::bucket.display}}"></span> | ||
<span aria-hidden="true" class="fa fa-search-plus pull-right discover-field-details-filter" | ||
ng-click="onAddFilter(field, bucket.value, '+')" data-test-subj="plus-{{::field.name}}-{{::bucket.display}}"></span> | ||
</span> | ||
<div css-truncate css-truncate-expandable="true" class="discover-field-details-value" title="{{::bucket.display}}"> | ||
{{::bucket.display}} <i ng-show="bucket.display === ''">Empty string</i> | ||
|
||
<!-- Field value --> | ||
<div | ||
css-truncate | ||
css-truncate-expandable="true" | ||
class="discover-field-details-value" | ||
aria-label="Value: {{:: bucket.display === '' ? 'Empty string' : bucket.display }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No changes here, just formatting. |
||
> | ||
{{::bucket.display}} <em ng-show="bucket.display === ''">Empty string</em> | ||
</div> | ||
</div> | ||
<kbn-tooltip text="{{::bucket.count}}" placement="right" append-to-body="1"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,11 +142,9 @@ <h2>Searching</h2> | |
></doc-table> | ||
|
||
<div ng-if="rows.length == opts.sampleSize" class="discover-table-footer"> | ||
<center> | ||
These are the first {{opts.sampleSize}} documents matching | ||
your search, refine your search to see others. | ||
<a ng-click="toTop()" title="Back to top">Back to top.</a> | ||
</center> | ||
These are the first {{opts.sampleSize}} documents matching | ||
your search, refine your search to see others. | ||
<a ng-click="toTop()">Back to top.</a> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not accessibility related, just removed the |
||
</div> | ||
</div> | ||
</div> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,18 @@ <h3>Shard Failures</h3> | |
<ul> | ||
<li ng-repeat="failure in failures | limitTo: failuresShown"><strong>Index:</strong> {{failure.index}} <strong>Shard:</strong> {{failure.shard}} <strong>Reason:</strong> {{failure.reason}} </li> | ||
</ul> | ||
<a ng-click="showAllFailures()" ng-if="failures.length > failuresShown" title="Show More">Show More</a> | ||
<a ng-click="showLessFailures()" ng-if="failures.length === failuresShown && failures.length > 5" title="Show Less">Show Less</a> | ||
<a | ||
ng-click="showAllFailures()" | ||
ng-if="failures.length > failuresShown" | ||
> | ||
Show More | ||
</a> | ||
<a | ||
ng-click="showLessFailures()" | ||
ng-if="failures.length === failuresShown && failures.length > 5" | ||
> | ||
Show Less | ||
</a> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed unnecessary |
||
</div> | ||
|
||
<div ng-show="opts.timefield"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
import $ from 'jquery'; | ||
import 'ui/filters/short_dots'; | ||
import booleanFieldNameIcon from './field_name_icons/boolean_field_name_icon.html'; | ||
import conflictFieldNameIcon from './field_name_icons/conflict_field_name_icon.html'; | ||
import dateFieldNameIcon from './field_name_icons/date_field_name_icon.html'; | ||
import geoPointFieldNameIcon from './field_name_icons/geo_point_field_name_icon.html'; | ||
import ipFieldNameIcon from './field_name_icons/ip_field_name_icon.html'; | ||
import murmur3FieldNameIcon from './field_name_icons/murmur3_field_name_icon.html'; | ||
import numberFieldNameIcon from './field_name_icons/number_field_name_icon.html'; | ||
import sourceFieldNameIcon from './field_name_icons/source_field_name_icon.html'; | ||
import stringFieldNameIcon from './field_name_icons/string_field_name_icon.html'; | ||
import unknownFieldNameIcon from './field_name_icons/unknown_field_name_icon.html'; | ||
|
||
import { uiModules } from 'ui/modules'; | ||
const module = uiModules.get('kibana'); | ||
|
||
|
@@ -12,31 +23,25 @@ module.directive('fieldName', function ($compile, $rootScope, $filter) { | |
'fieldType': '=' | ||
}, | ||
link: function ($scope, $el) { | ||
const typeToIconMap = { | ||
boolean: booleanFieldNameIcon, | ||
conflict: conflictFieldNameIcon, | ||
date: dateFieldNameIcon, | ||
geo_point: geoPointFieldNameIcon, | ||
ip: ipFieldNameIcon, | ||
murmur3: murmur3FieldNameIcon, | ||
number: numberFieldNameIcon, | ||
source: sourceFieldNameIcon, | ||
string: stringFieldNameIcon, | ||
}; | ||
|
||
const typeIcon = function (fieldType) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😍 |
||
switch (fieldType) { | ||
case 'source': | ||
return '<i title="source" class="fa fa-file-text-o "></i>'; | ||
case 'string': | ||
return '<i title="string"><strong>t</strong></i>'; | ||
case 'murmur3': | ||
return '<i title="murmur3"><strong>h</strong></i>'; | ||
case 'number': | ||
return '<i title="number"><strong>#</strong></i>'; | ||
case 'date': | ||
return '<i title="date" class="fa fa-clock-o"></i>'; | ||
case 'ip': | ||
return '<i title="ip" class="fa fa-laptop"></i>'; | ||
case 'geo_point': | ||
return '<i title="geo_point" class="fa fa-globe"></i>'; | ||
case 'boolean': | ||
return '<i title="boolean" class="fa fa-adjust"></i>'; | ||
case 'conflict': | ||
return '<i title="conflict" class="fa fa-warning"></i>'; | ||
default: | ||
return '<i title="unknown"><strong>?</strong></i>'; | ||
function typeIcon(fieldType) { | ||
if (typeToIconMap.hasOwnProperty(fieldType)) { | ||
return typeToIconMap[fieldType]; | ||
} | ||
}; | ||
|
||
return unknownFieldNameIcon; | ||
} | ||
|
||
$rootScope.$watchMulti.call($scope, [ | ||
'field', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<span | ||
aria-label="Boolean field" | ||
class="field-name-icon kuiIcon fa-adjust" | ||
></span> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<span | ||
aria-label="Conflicting field" | ||
class="field-name-icon kuiIcon fa-warning" | ||
></span> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<span | ||
aria-label="Date field" | ||
class="field-name-icon kuiIcon fa-clock-o" | ||
></span> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<span | ||
aria-label="Geo-point field" | ||
class="field-name-icon kuiIcon fa-globe" | ||
></span> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<span | ||
aria-label="IP address field" | ||
class="field-name-icon kuiIcon fa-laptop" | ||
></span> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<span | ||
aria-label="Murmur3 field" | ||
class="field-name-icon" | ||
> | ||
<strong aria-hidden>h</strong> | ||
</span> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<span | ||
aria-label="Number field" | ||
class="field-name-icon" | ||
> | ||
<strong aria-hidden="true">#</strong> | ||
</span> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<span | ||
aria-label="Source field" | ||
class="field-name-icon kuiIcon fa-file-text-o" | ||
></span> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<span | ||
aria-label="String field" | ||
class="field-name-icon" | ||
> | ||
<strong aria-hidden="true">t</strong> | ||
</span> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<span | ||
aria-label="Unknown field" | ||
class="field-name-icon" | ||
> | ||
<strong aria-hidden>?</strong> | ||
</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use verbs to communicate to the screen reader what clicking this button will do.