Store table matches in table object

This commit is contained in:
David Kaltschmidt
2016-05-10 17:30:57 +02:00
parent 5ee0e082a5
commit 0573a20f07
3 changed files with 3 additions and 3 deletions

View File

@@ -212,7 +212,7 @@ export class NodeDetails extends React.Component {
</span>}
</div>
<NodeDetailsLabels rows={table.rows}
matches={nodeMatches.get('metadata')} />
matches={nodeMatches.get('tables')} />
</div>
);
}

View File

@@ -244,7 +244,7 @@ describe('SearchUtils', () => {
const nodes = nodeSets.someNodes;
const matches = fun(nodes, {query: 'Row Value 1'});
expect(matches.size).toEqual(1);
expect(matches.getIn(['n2', 'metadata', 'row1']).text).toBe('Row Value 1');
expect(matches.getIn(['n2', 'tables', 'row1']).text).toBe('Row Value 1');
});
});

View File

@@ -145,7 +145,7 @@ export function searchTopology(nodes, { prefix, query, metric, comp, value }) {
tables.forEach((table) => {
if (table.get('rows')) {
table.get('rows').forEach(field => {
const keyPath = [nodeId, 'metadata', field.get('id')];
const keyPath = [nodeId, 'tables', field.get('id')];
nodeMatches = findNodeMatch(nodeMatches, keyPath, field.get('value'),
query, prefix, field.get('label'));
});