Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Revert "Merge pull request elastic#1877 from lukasolson/issue-1874"
Browse files Browse the repository at this point in the history
This reverts commit 34466c6, reversing
changes made to 5cad53f.
  • Loading branch information
Spencer Alger committed Nov 11, 2014
1 parent ff1f3da commit afdd2fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 52 deletions.
8 changes: 1 addition & 7 deletions src/kibana/plugins/discover/directives/table_row.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,7 @@ define(function (require) {
}

// The fields to loop over
if (!row._fields) {
row._fields = _.union(
_.keys(row._source),
config.get('metaFields')
);
row._fields.sort();
}
row._fields = row._fields || _.keys(row._source).concat(config.get('metaFields')).sort();
row._mode = 'table';

// empty the details and rebuild it
Expand Down
46 changes: 1 addition & 45 deletions test/unit/specs/apps/discover/directives/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ define(function (require) {
timestamp: {
indexed: true,
type: 'date'
}
},
};

// Sets up the directive, take an element, and a list of properties to attach to the parent scope.
Expand Down Expand Up @@ -357,50 +357,6 @@ define(function (require) {
});
});

describe('kbnTableRow meta', function () {
var $elem = angular.element(
'<tr kbn-table-row="row" ' +
'columns="columns" ' +
'sorting="sorting"' +
'filtering="filtering"' +
'mapping="mapping"' +
'timefield="timefield" ' +
'></tr>'
);
var $details;

beforeEach(function () {
var row = getFakeRow(0, mapping);
mapping._id = {indexed: true, type: 'string'};
row._source._id = 'foo';

init($elem, {
row: row,
columns: [],
sorting: [],
filtering: sinon.spy(),
maxLength: 50,
mapping: mapping
});

sinon.stub(config, 'get').withArgs('metaFields').returns(['_id']);

// Open the row
$scope.toggleRow();
$scope.$digest();
$details = $elem.next();
});

afterEach(function () {
delete mapping._id;
destroy();
});

it('should render even when the row source contains a field with the same name as a meta field', function () {
expect($details.find('tr').length).to.be(4);
});
});

describe('row diffing', function () {
var $row;
var $scope;
Expand Down

0 comments on commit afdd2fe

Please sign in to comment.