Remove U as precision option, make default nanoseconds

pull/10616/head
Deniz Kusefoglu 2018-12-14 13:28:55 -08:00
parent e68949074a
commit a86f6cd4a4
3 changed files with 5 additions and 8 deletions

View File

@ -14,17 +14,15 @@ interface Props {
}
const writePrecisions: WritePrecision[] = [
WritePrecision.Ns,
WritePrecision.Us,
WritePrecision.Ms,
WritePrecision.S,
WritePrecision.U,
WritePrecision.Us,
WritePrecision.Ns,
]
const transformPrecision = {
const makePrecisionReadable = {
[WritePrecision.Ns]: Precision.Nanoseconds,
[WritePrecision.Us]: Precision.Microseconds,
[WritePrecision.U]: Precision.U,
[WritePrecision.S]: Precision.Seconds,
[WritePrecision.Ms]: Precision.Milliseconds,
}
@ -42,7 +40,7 @@ class PrecisionDropdown extends PureComponent<Props> {
>
{writePrecisions.map(value => (
<Dropdown.Item key={value} value={value} id={value}>
{transformPrecision[value]}
{makePrecisionReadable[value]}
</Dropdown.Item>
))}
</Dropdown>

View File

@ -31,7 +31,7 @@ export const INITIAL_STATE: DataLoadersState = {
lineProtocolBody: '',
activeLPTab: LineProtocolTab.UploadFile,
lpStatus: RemoteDataState.NotStarted,
precision: WritePrecision.Ms,
precision: WritePrecision.Ns,
telegrafConfigID: null,
pluginBundles: [],
}

View File

@ -162,7 +162,6 @@ export enum Precision {
Milliseconds = 'Milliseconds',
Seconds = 'Seconds',
Microseconds = 'Microseconds',
U = 'U',
Nanoseconds = 'Nanoseconds',
}