refer to ascending/descending instead of defaults

pull/10616/head
ebb-tide 2018-03-20 16:29:56 -07:00
parent c1ee8f1535
commit f014f9670b
2 changed files with 7 additions and 5 deletions

View File

@ -14,9 +14,11 @@ import {
NULL_HOVER_TIME,
TIME_FORMAT_DEFAULT,
TIME_COLUMN_DEFAULT,
DEFAULT_SORT,
ALT_SORT,
ASCENDING,
DESCENDING,
} from 'src/shared/constants/tableGraph'
const DEFAULT_SORT = DESCENDING
import {generateThresholdsListHexs} from 'shared/constants/colorOperations'
class TableGraph extends Component {
@ -119,7 +121,7 @@ class TableGraph extends Component {
if (clickToSortFieldIndex === newIndex) {
const direction =
clicktoSortDirection === DEFAULT_SORT ? ALT_SORT : DEFAULT_SORT
clicktoSortDirection === DESCENDING ? ASCENDING : DESCENDING
const sortedData = [
data[0],
..._.orderBy(_.drop(data, 1), clickToSortFieldIndex, [direction]),

View File

@ -8,8 +8,8 @@ export const TIME_FORMAT_CUSTOM = 'Custom'
export const TIME_COLUMN_DEFAULT = {internalName: 'time', displayName: ''}
export const DEFAULT_SORT = 'asc'
export const ALT_SORT = 'desc'
export const ASCENDING = 'asc'
export const DESCENDING = 'desc'
export const FORMAT_OPTIONS = [
{text: TIME_FORMAT_DEFAULT},