Skip to content
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

Fix the rendering of array values in the table view #477

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions js/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ angular.module('kibana.filters', [])
}
};
}).filter('stringify', function() {
return function(arr, start, end) {
if(!_.isUndefined(arr)) {
return arr.toString();
return function(val, start, end) {
if(_.isArray(val)) {
return val.join(', ');
}
else if(!_.isUndefined(val)) {
return val.toString();
}
};

Expand Down
4 changes: 2 additions & 2 deletions panels/table/module.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h5>Fields <i class=" icon-chevron-sign-left pointer " ng-click="panel.field_lis
<tbody ng-repeat="event in data | slice:panel.offset:panel.offset+panel.size" ng-class-odd="'odd'">
<tr ng-click="toggle_details(event)" class="pointer">
<!--<td ng-repeat="field in panel.fields" ng-bind-html-unsafe="(event.highlight[field]||event._source[field]) | tableFieldFormat:field:event:this |tableHighlight | tableTruncate:panel.trimFactor:panel.fields.length"></td>-->
<td ng-repeat="field in panel.fields" ng-bind-html-unsafe="(event.highlight[field]||event._source[field]) |tableHighlight | tableTruncate:panel.trimFactor:panel.fields.length"></td>
<td ng-repeat="field in panel.fields" ng-bind-html-unsafe="(event.highlight[field]||event._source[field])|stringify|tableHighlight|tableTruncate:panel.trimFactor:panel.fields.length"></td>
</tr>
<tr ng-show="event.kibana.details">
<td colspan=1000>
Expand All @@ -75,7 +75,7 @@ <h5>Fields <i class=" icon-chevron-sign-left pointer " ng-click="panel.field_lis
<i class='icon-ban-circle pointer' ng-click="build_search(key,value,true)"></i>
</td>
<!-- At some point we need to create a more efficient way of applying the filter pipeline -->
<td style="white-space:pre-wrap" ng-bind-html-unsafe="value|noXml|urlLink"></td>
<td style="white-space:pre-wrap" ng-bind-html-unsafe="value|stringify|noXml|urlLink"></td>
</tr>
</table>
</td>
Expand Down