Skip to content

Commit

Permalink
Add missing discover labels (elastic#16030) (elastic#16058)
Browse files Browse the repository at this point in the history
* Add missing discover labels

* Add aria-pressed for column toggle
  • Loading branch information
timroes authored Jan 16, 2018
1 parent 139ecb3 commit 385ebe4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/core_plugins/kbn_doc_views/public/views/table.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<span ng-if="mapping[field].filterable">
<button
class="doc-viewer-button"
aria-label="Filter for value"
ng-click="filter(mapping[field], flattened[field], '+')"
data-test-subj="addInclusiveFilterButton"
>
Expand All @@ -21,6 +22,7 @@

<button
class="doc-viewer-button"
aria-label="Filter out value"
ng-click="filter(mapping[field], flattened[field],'-')"
>
<i
Expand All @@ -36,6 +38,8 @@
<span ng-if="canToggleColumns()">
<button
class="doc-viewer-button"
aria-label="Toggle column in table"
aria-pressed="{{isColumnActive(field)}}"
ng-click="toggleColumn(field)"
>
<i
Expand All @@ -48,6 +52,7 @@
<span ng-if="!indexPattern.metaFields.includes(field) && !mapping[field].scripted">
<button
class="doc-viewer-button"
aria-label="Filter for field present"
ng-click="filter('_exists_', field, '+')"
>
<i
Expand Down
4 changes: 4 additions & 0 deletions src/core_plugins/kbn_doc_views/public/views/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ DocViewsRegistryProvider.register(function () {
}
};

$scope.isColumnActive = function isColumnActive(columnName) {
return $scope.columns.includes(columnName);
};

$scope.showArrayInObjectsWarning = function (row, field) {
const value = $scope.flattened[field];
return Array.isArray(value) && typeof value[0] === 'object';
Expand Down
2 changes: 2 additions & 0 deletions src/ui/public/doc_table/components/table_row/cell.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
data-column="<%- column %>"
tooltip="Filter for value"
tooltip-append-to-body="1"
aria-label="Filter for value"
></button>

<button
ng-click="inlineFilter($event, '-')"
class="fa fa-search-minus docTableRowFilterButton"
data-column="<%- column %>"
tooltip="Filter out value"
aria-label="Filter out value"
tooltip-append-to-body="1"
></button>
<% } %>
Expand Down
6 changes: 5 additions & 1 deletion src/ui/public/doc_table/components/table_row/open.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<td ng-click="toggleRow()" data-test-subj="docTableExpandToggleColumn">
<button class="discover-table-open-button">
<button
class="discover-table-open-button"
aria-label="Toggle row details"
aria-expanded="{{!!open}}"
>
<span
class="kuiIcon"
ng-class="{ 'fa-caret-down': open, 'fa-caret-right': !open }"
Expand Down

0 comments on commit 385ebe4

Please sign in to comment.