Skip to content

Commit

Permalink
Adding scope to all table headers, fix elastic#12401 (elastic#15079)
Browse files Browse the repository at this point in the history
* Add scope for all th in Kibana

* Add scope to <th> in ui framework

* Update jest snapshots with scope

* Fix wrong usage of colgroup
  • Loading branch information
timroes committed Nov 21, 2017
1 parent 425239e commit 5d7d9c4
Show file tree
Hide file tree
Showing 26 changed files with 75 additions and 56 deletions.
6 changes: 3 additions & 3 deletions src/core_plugins/dev_mode/public/vis_debug_spy_panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
<label>Details</label>
<table class="table">
<tr>
<th>
<th scope="row">
Type Name
</th>
<td>
{{vis.type.name}}
</td>
</tr>
<tr>
<th>
<th scope="row">
Hierarchical Data
</th>
<td>
Expand All @@ -32,4 +32,4 @@
</div>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@
<div class="kuiSideBarSection">
<table class="vis-editor-agg-editor-ranges form-group" ng-show="vis.params.gauge.colorsRange.length">
<tr>
<th>
<th scope="col">
<label id="gaugeOptionsCustomRangeFrom">From</label>
</th>
<th colspan="2">
<th scope="col" colspan="2">
<label id="gaugeOptionsCustomRangeTo">To</label>
</th>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@
<div class="kuiSideBarSection">
<table class="vis-editor-agg-editor-ranges form-group" ng-show="vis.params.colorsRange.length">
<tr>
<th>
<th scope="col">
<label id="heatmapCustomRangeFrom">From</label>
</th>
<th colspan="2">
<th scope="col" colspan="2">
<label id="heatmapCustomRangeTo">To</label>
</th>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@
<table class="kuiTable" ng-if="listingController.items.length">
<thead>
<tr>
<th class="kuiTableHeaderCell kuiTableHeaderCell--checkBox" ng-if="!listingController.hideWriteControls">
<th
class="kuiTableHeaderCell kuiTableHeaderCell--checkBox"
ng-if="!listingController.hideWriteControls"
scope="col"
>
<div class="kuiTableHeaderCell__liner">
<input
type="checkbox"
Expand All @@ -140,7 +144,7 @@
</div>
</th>

<th class="kuiTableHeaderCell">
<th scope="col" class="kuiTableHeaderCell">
<button
class="kuiTableHeaderCellButton"
ng-class="{'kuiTableHeaderCellButton-isSorted': listingController.getSortedProperty().name == 'title'}"
Expand All @@ -157,7 +161,7 @@
</button>
</th>

<th class="kuiTableHeaderCell">
<th scope="col" class="kuiTableHeaderCell">
<button
class="kuiTableHeaderCellButton"
ng-class="{'kuiTableHeaderCellButton-isSorted': listingController.getSortedProperty().name == 'description'}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ <h1 class="kuiTitle">
<table class="kuiTable" ng-if="service.data.length" data-test-subj="objectsTable-{{service.title}}">
<thead>
<tr>
<th class="kuiTableHeaderCell kuiTableHeaderCell--checkBox">
<th scope="col" class="kuiTableHeaderCell kuiTableHeaderCell--checkBox">
<div class="kuiTableHeaderCell__liner">
<input
type="checkbox"
Expand All @@ -144,7 +144,7 @@ <h1 class="kuiTitle">
</div>
</th>

<th class="kuiTableHeaderCell">
<th scope="col" class="kuiTableHeaderCell">
<div class="kuiTableHeaderCell__liner">
Title
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,18 @@
<table class="kuiTable kuiVerticalRhythm">
<thead>
<tr>
<th class="kuiTableHeaderCell">
<th scope="col" class="kuiTableHeaderCell">
<div class="kuiTableRowCell__liner">
Name
</div>
</th>
<th class="kuiTableHeaderCell">
<th scope="col" class="kuiTableHeaderCell">
<div class="kuiTableRowCell__liner">
Value
</div>
</th>
<th
scope="col"
class="kuiTableHeaderCell kuiTableHeaderCell--alignRight"
style="width: 180px"
>
Expand Down
4 changes: 2 additions & 2 deletions src/core_plugins/metrics/public/components/markdown_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ class MarkdownEditor extends Component {
<table className="table">
<thead>
<tr>
<th>Name</th>
<th>Value</th>
<th scope="col">Name</th>
<th scope="col">Value</th>
</tr>
</thead>
<tbody>{rows}</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class TableVis extends Component {
className="tsvb-table__columnName"
onClick={handleClick}
key={item.id}
scope="col"
>
{headerContent}
</th>
Expand All @@ -137,7 +138,7 @@ class TableVis extends Component {
};
return (
<tr>
<th onClick={handleSortClick}>{label} {sortComponent}</th>
<th scope="col" onClick={handleSortClick}>{label} {sortComponent}</th>
{ columns }
</tr>
);
Expand Down
4 changes: 2 additions & 2 deletions src/core_plugins/status_page/public/status_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ <h4 ng-if="!ui.statuses && !ui.loading" class="statuses_missing">

<table class="statuses" data-test-subj="statusBreakdown" ng-if="ui.statuses">
<tr class="row">
<th class="col-xs-4">ID</th>
<th class="col-xs-8">Status</th>
<th class="col-xs-4" scope="col">ID</th>
<th class="col-xs-8" scope="col">Status</th>
</tr>
<tr
ng-repeat="status in ui.statuses"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ <h4>
<div class="suggestion-details" ng-show="suggestions.length === 1">
<table class="table table-striped table-condensed table-bordered">
<thead>
<th>Argument Name</th>
<th>Accepted Types</th>
<th>Information</th>
<th scope="col">Argument Name</th>
<th scope="col">Accepted Types</th>
<th scope="col">Information</th>
</thead>
<tr ng-repeat="arg in suggestion.args" ng-hide="$index < 1 && suggestion.chainable">
<td>{{arg.name}}</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,9 @@ <h2 class="kuiLocalDropdownTitle">
ng-show="function.args.length > (function.chainable ? 1: 0)"
>
<thead>
<th>Argument Name</th>
<th>Accepted Types</th>
<th>Information</th>
<th scope="col">Argument Name</th>
<th scope="col">Accepted Types</th>
<th scope="col">Information</th>
</thead>
<tr
ng-repeat="arg in function.args"
Expand Down
6 changes: 3 additions & 3 deletions src/ui/public/agg_response/hierarchical/_tooltip.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<table>
<thead>
<tr class="tooltip-label">
<th>field</th>
<th>value</th>
<th>{{metricCol.label}}</th>
<th scope="col">field</th>
<th scope="col">value</th>
<th scope="col">{{metricCol.label}}</th>
</tr>
</thead>
<tbody>
Expand Down
4 changes: 2 additions & 2 deletions src/ui/public/agg_table/agg_table_group.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<table ng-if="rows" class="table agg-table-group" ng-repeat="table in rows">
<thead>
<tr>
<th ng-if="table.tables">
<th ng-if="table.tables" scope="col">
<span class="agg-table-group-header">{{ table.title }}</span>
</th>
</tr>
Expand Down Expand Up @@ -33,7 +33,7 @@
<table ng-if="columns" class="table agg-table-group">
<thead>
<tr>
<th ng-repeat="table in columns" ng-if="table.tables">
<th ng-repeat="table in columns" ng-if="table.tables" scope="col">
<span class="agg-table-group-header">{{ table.title }}</span>
</th>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions src/ui/public/agg_types/controls/date_ranges.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div>
<table class="vis-editor-agg-editor-ranges form-group" ng-show="agg.params.ranges.length">
<tr>
<th>
<th scope="col">
<label id="visEditorDateRangeFrom{{agg.id}}">From</label>
</th>
<th colspan="2">
<th scope="col" colspan="2">
<label id="visEditorDateRangeTo{{agg.id}}">To</label>
</th>
</tr>
Expand Down
6 changes: 3 additions & 3 deletions src/ui/public/agg_types/controls/ip_ranges.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<div ng-show="agg.params.ipRangeType != 'mask'">
<table class="vis-editor-agg-editor-ranges form-group" ng-show="agg.params.ranges.fromTo.length">
<tr>
<th>
<th scope="col">
<label id="visEditorIpRangeFromLabel{{agg.id}}">From</label>
</th>
<th colspan="2">
<th scope="col" colspan="2">
<label id="visEditorIpRangeToLabel{{agg.id}}">To</label>
</th>
</tr>
Expand Down Expand Up @@ -65,7 +65,7 @@
<div ng-show="agg.params.ipRangeType == 'mask'">
<table class="vis-editor-agg-editor-ranges form-group" ng-show="agg.params.ranges.mask.length">
<tr>
<th>
<th scope="col">
<label id="visEditorIpRangeCidrLabel{{agg.id}}">CIDR Mask</label>
</th>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions src/ui/public/agg_types/controls/ranges.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<table class="vis-editor-agg-editor-ranges form-group" ng-show="agg.params.ranges.length">
<tr>
<th>
<th scope="col">
<label id="visEditorRangeFrom{{agg.id}}">From</label>
</th>
<th colspan="2">
<th scope="col" colspan="2">
<label id="visEditorRangeTo{{agg.id}}">To</label>
</th>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions src/ui/public/field_editor/field_editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ <h4>
The type of this field changes across indices. It is unavailable for many analysis functions. The indices per type are as follows:
<table class="table">
<thead>
<th> Field Type </th>
<th> Index Names </th>
<th scope="col"> Field Type </th>
<th scope="col"> Index Names </th>
</thead>
<tbody>
<tr ng-repeat="(type, indices) in editor.field.conflictDescriptions">
Expand Down
16 changes: 8 additions & 8 deletions src/ui/public/field_format_editor/editors/url/url.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
type="checkbox"
ng-model="editor.formatParams.openLinkInCurrentTab"
></input>

<span class="kuiCheckBoxLabel__text">
Open link in current tab
</span>
Expand Down Expand Up @@ -50,9 +50,9 @@ <h4 class="hintbox-heading">
<caption>Examples</caption>
<thead>
<tr>
<th>Value</th>
<th>Template</th>
<th>Result</th>
<th scope="col">Value</th>
<th scope="col">Template</th>
<th scope="col">Result</th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -110,10 +110,10 @@ <h4 class="hintbox-heading">
<caption>Examples</caption>
<thead>
<tr>
<th>Value</th>
<th>Url Template</th>
<th>Label Template</th>
<th>Result</th>
<th scope="col">Value</th>
<th scope="col">Url Template</th>
<th scope="col">Label Template</th>
<th scope="col">Result</th>
</tr>
</thead>
<tbody>
Expand Down
4 changes: 2 additions & 2 deletions src/ui/public/field_format_editor/samples/samples.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ <h4 class="hintbox-heading">
<table class="table">
<thead>
<tr>
<th>
<th scope="col">
Input
</th>
<th>
<th scope="col">
Formatted
</th>
</tr>
Expand Down
3 changes: 2 additions & 1 deletion src/ui/public/paginated_table/paginated_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<thead data-test-subj="paginated-table-header">
<tr>
<th
scope="col"
ng-repeat="col in columns"
ng-click="paginatedTable.sortColumn($index)"
kbn-accessible-click
Expand Down Expand Up @@ -35,7 +36,7 @@
</tbody>
<tfoot ng-if="showTotal">
<tr>
<th ng-repeat="col in columns" class="numeric-value">{{col.total}}</th>
<th scope="col" ng-repeat="col in columns" class="numeric-value">{{col.total}}</th>
</tr>
</tfoot>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,19 @@ export default () => {
<table className="kuiTable">
<thead>
<tr>
<th className="kuiTableHeaderCell kuiTableHeaderCell--checkBox">
<th scope="col" className="kuiTableHeaderCell kuiTableHeaderCell--checkBox">
<input type="checkbox" className="kuiCheckBox"/>
</th>
<th className="kuiTableHeaderCell">
<th scope="col" className="kuiTableHeaderCell">
Title
</th>
<th className="kuiTableHeaderCell">
<th scope="col" className="kuiTableHeaderCell">
Status
</th>
<th className="kuiTableHeaderCell">
<th scope="col" className="kuiTableHeaderCell">
Date created
</th>
<th className="kuiTableHeaderCell kuiTableHeaderCell--alignRight">
<th scope="col" className="kuiTableHeaderCell kuiTableHeaderCell--alignRight">
Orders of magnitude
</th>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ exports[`renders KuiTable 1`] = `
<tr>
<th
class="kuiTableHeaderCell"
scope="col"
>
<div
class="kuiTableHeaderCell__liner"
Expand All @@ -19,6 +20,7 @@ exports[`renders KuiTable 1`] = `
</th>
<th
class="kuiTableHeaderCell"
scope="col"
>
<div
class="kuiTableHeaderCell__liner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`renders KuiTableHeaderCell 1`] = `
aria-label="aria-label"
class="kuiTableHeaderCell testClass1 testClass2"
data-test-subj="test subject string"
scope="col"
>
<div
class="kuiTableHeaderCell__liner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ exports[`renders KuiTableHeaderCheckBoxCell 1`] = `
aria-label="aria-label"
class="kuiTableHeaderCell kuiTableHeaderCell--checkBox testClass1 testClass2"
data-test-subj="test subject string"
scope="col"
>
<div
class="kuiTableHeaderCell__liner"
Expand Down
Loading

0 comments on commit 5d7d9c4

Please sign in to comment.