refer to ascending/descending instead of defaults
parent
c1ee8f1535
commit
f014f9670b
|
@ -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]),
|
||||
|
|
|
@ -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},
|
||||
|
|
Loading…
Reference in New Issue