Rename default time format
parent
66d64413ad
commit
d055b3391b
|
@ -4,7 +4,7 @@ import QuestionMarkTooltip from 'src/shared/components/QuestionMarkTooltip'
|
|||
import {
|
||||
FORMAT_OPTIONS,
|
||||
TIME_FORMAT_CUSTOM,
|
||||
TIME_FORMAT_DEFAULT,
|
||||
DEFAULT_TIME_FORMAT,
|
||||
TIME_FORMAT_TOOLTIP_LINK,
|
||||
} from 'src/shared/constants/tableGraph'
|
||||
import {ErrorHandling} from 'src/shared/decorators/errors'
|
||||
|
@ -29,7 +29,7 @@ class GraphOptionsTimeFormat extends PureComponent<Props, State> {
|
|||
super(props)
|
||||
this.state = {
|
||||
customFormat: false,
|
||||
format: this.props.timeFormat || TIME_FORMAT_DEFAULT,
|
||||
format: this.props.timeFormat || DEFAULT_TIME_FORMAT,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import {map, reduce, filter} from 'fast.js'
|
|||
import {
|
||||
CELL_HORIZONTAL_PADDING,
|
||||
TIME_FIELD_DEFAULT,
|
||||
TIME_FORMAT_DEFAULT,
|
||||
DEFAULT_TIME_FORMAT,
|
||||
} from 'src/shared/constants/tableGraph'
|
||||
|
||||
const calculateTimeColumnWidth = timeFormat => {
|
||||
|
@ -106,7 +106,7 @@ export const calculateColumnWidths = (
|
|||
verticalTimeAxis
|
||||
) => {
|
||||
const timeFormatWidth = calculateTimeColumnWidth(
|
||||
timeFormat === '' ? TIME_FORMAT_DEFAULT : timeFormat
|
||||
timeFormat === '' ? DEFAULT_TIME_FORMAT : timeFormat
|
||||
)
|
||||
return reduce(
|
||||
data,
|
||||
|
|
|
@ -21,7 +21,7 @@ import {updateTableOptions} from 'src/dashboards/actions/cellEditorOverlay'
|
|||
import {
|
||||
NULL_ARRAY_INDEX,
|
||||
NULL_HOVER_TIME,
|
||||
TIME_FORMAT_DEFAULT,
|
||||
DEFAULT_TIME_FORMAT,
|
||||
TIME_FIELD_DEFAULT,
|
||||
ASCENDING,
|
||||
DESCENDING,
|
||||
|
@ -257,7 +257,7 @@ class TableGraph extends Component {
|
|||
const {tableOptions, colors} = parent.props
|
||||
|
||||
const {
|
||||
timeFormat = TIME_FORMAT_DEFAULT,
|
||||
timeFormat = DEFAULT_TIME_FORMAT,
|
||||
verticalTimeAxis = VERTICAL_TIME_AXIS_DEFAULT,
|
||||
fixFirstColumn = FIX_FIRST_COLUMN_DEFAULT,
|
||||
fieldNames = [TIME_FIELD_DEFAULT],
|
||||
|
@ -325,7 +325,7 @@ class TableGraph extends Component {
|
|||
|
||||
const cellContents = isTimeData
|
||||
? `${moment(cellData).format(
|
||||
timeFormat === '' ? TIME_FORMAT_DEFAULT : timeFormat
|
||||
timeFormat === '' ? DEFAULT_TIME_FORMAT : timeFormat
|
||||
)}`
|
||||
: fieldName || `${cellData}`
|
||||
|
||||
|
|
|
@ -20,11 +20,11 @@ export const VERTICAL_TIME_AXIS_DEFAULT = true
|
|||
|
||||
export const CELL_HORIZONTAL_PADDING = 30
|
||||
|
||||
export const TIME_FORMAT_DEFAULT = 'MM/DD/YYYY HH:mm:ss'
|
||||
export const DEFAULT_TIME_FORMAT = 'MM/DD/YYYY HH:mm:ss'
|
||||
export const TIME_FORMAT_CUSTOM = 'Custom'
|
||||
|
||||
export const FORMAT_OPTIONS = [
|
||||
{text: TIME_FORMAT_DEFAULT},
|
||||
{text: DEFAULT_TIME_FORMAT},
|
||||
{text: 'MM/DD/YYYY HH:mm:ss.SSS'},
|
||||
{text: 'YYYY-MM-DD HH:mm:ss'},
|
||||
{text: 'HH:mm:ss'},
|
||||
|
@ -36,7 +36,7 @@ export const FORMAT_OPTIONS = [
|
|||
|
||||
export const DEFAULT_TABLE_OPTIONS = {
|
||||
verticalTimeAxis: VERTICAL_TIME_AXIS_DEFAULT,
|
||||
timeFormat: TIME_FORMAT_DEFAULT,
|
||||
timeFormat: DEFAULT_TIME_FORMAT,
|
||||
sortBy: TIME_FIELD_DEFAULT,
|
||||
wrapping: 'truncate',
|
||||
fieldNames: [TIME_FIELD_DEFAULT],
|
||||
|
|
|
@ -9,7 +9,7 @@ import {
|
|||
|
||||
import {
|
||||
DEFAULT_SORT_DIRECTION,
|
||||
TIME_FORMAT_DEFAULT,
|
||||
DEFAULT_TIME_FORMAT,
|
||||
} from 'src/shared/constants/tableGraph'
|
||||
|
||||
describe('timeSeriesToDygraph', () => {
|
||||
|
@ -536,7 +536,7 @@ describe('transformTableData', () => {
|
|||
const sort = {field: 'f1', direction: DEFAULT_SORT_DIRECTION}
|
||||
const tableOptions = {
|
||||
verticalTimeAxis: true,
|
||||
timeFormat: TIME_FORMAT_DEFAULT,
|
||||
timeFormat: DEFAULT_TIME_FORMAT,
|
||||
}
|
||||
|
||||
const fieldNames = [
|
||||
|
@ -568,7 +568,7 @@ describe('transformTableData', () => {
|
|||
|
||||
const tableOptions = {
|
||||
verticalTimeAxis: true,
|
||||
timeFormat: TIME_FORMAT_DEFAULT,
|
||||
timeFormat: DEFAULT_TIME_FORMAT,
|
||||
}
|
||||
|
||||
const fieldNames = [
|
||||
|
@ -596,7 +596,7 @@ describe('transformTableData', () => {
|
|||
|
||||
const tableOptions = {
|
||||
verticalTimeAxis: true,
|
||||
timeFormat: TIME_FORMAT_DEFAULT,
|
||||
timeFormat: DEFAULT_TIME_FORMAT,
|
||||
}
|
||||
|
||||
const fieldNames = [
|
||||
|
@ -626,7 +626,7 @@ describe('if verticalTimeAxis is false', () => {
|
|||
|
||||
const tableOptions = {
|
||||
verticalTimeAxis: false,
|
||||
timeFormat: TIME_FORMAT_DEFAULT,
|
||||
timeFormat: DEFAULT_TIME_FORMAT,
|
||||
}
|
||||
|
||||
const fieldNames = [
|
||||
|
@ -658,7 +658,7 @@ describe('if verticalTimeAxis is false', () => {
|
|||
|
||||
const tableOptions = {
|
||||
verticalTimeAxis: false,
|
||||
timeFormat: TIME_FORMAT_DEFAULT,
|
||||
timeFormat: DEFAULT_TIME_FORMAT,
|
||||
}
|
||||
|
||||
const fieldNames = [
|
||||
|
|
Loading…
Reference in New Issue