Skip to content

Commit

Permalink
Addressed David's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fbarl committed Jan 13, 2017
1 parent f6feb56 commit 549bb20
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
6 changes: 3 additions & 3 deletions client/app/scripts/components/node-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import NodeDetailsTable from './node-details/node-details-table';
import Warning from './warning';


const logError = debug('scope:error');
const log = debug('scope:node-details');

function getTruncationText(count) {
return 'This section was too long to be handled efficiently and has been truncated'
Expand Down Expand Up @@ -213,7 +213,7 @@ class NodeDetails extends React.Component {
return (
<div className="node-details-content-section" key={table.id}>
<div className="node-details-content-section-header">
{table.label.length > 0 && table.label}
{table.label && table.label.length > 0 && table.label}
{table.truncationCount > 0 && <span
className="node-details-content-section-header-warning">
<Warning text={getTruncationText(table.truncationCount)} />
Expand Down Expand Up @@ -249,7 +249,7 @@ class NodeDetails extends React.Component {
);
}

logError(`Undefined type '${table.type}' for table ${table.id}`);
log(`Undefined type '${table.type}' for table ${table.id}`);
return null;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import React from 'react';
import sortBy from 'lodash/sortBy';
import { Map as makeMap } from 'immutable';
import { sortBy } from 'lodash';

import { NODE_DETAILS_DATA_ROWS_DEFAULT_LIMIT } from '../../constants/limits';

import {
isNumber, getTableColumnsStyles, genericTableEntryKey
isNumber,
getTableColumnsStyles,
genericTableEntryKey
} from '../../utils/node-details-utils';
import NodeDetailsTableHeaders from './node-details-table-headers';
import MatchedText from '../matched-text';
Expand All @@ -31,7 +34,7 @@ export default class NodeDetailsGenericTable extends React.Component {
super(props, context);
this.state = {
limit: NODE_DETAILS_DATA_ROWS_DEFAULT_LIMIT,
sortedBy: props.columns[0].id,
sortedBy: props.columns && props.columns[0].id,
sortedDesc: true
};
this.handleLimitClick = this.handleLimitClick.bind(this);
Expand Down
4 changes: 2 additions & 2 deletions client/app/scripts/utils/node-details-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export function isPropertyList(table) {
}

export function isNumber(data) {
return data.dataType && data.dataType === 'number';
return data && data.dataType && data.dataType === 'number';
}

export function isIP(data) {
return data.dataType && data.dataType === 'ip';
return data && data.dataType && data.dataType === 'ip';
}

export function genericTableEntryKey(row, column) {
Expand Down

0 comments on commit 549bb20

Please sign in to comment.