Merge pull request #15454 from influxdata/fix/upgrade-typescript
chore: upgrade typescriptpull/15443/head^2
commit
ca1cc04ca1
|
@ -113,7 +113,7 @@
|
|||
"ts-loader": "^5.3.3",
|
||||
"ts-node": "^8.3.0",
|
||||
"tslib": "^1.9.0",
|
||||
"typescript": "3.3.3",
|
||||
"typescript": "3.6.4",
|
||||
"webpack": "^4.37.0",
|
||||
"webpack-cli": "^3.3.6",
|
||||
"webpack-dev-server": "^3.7.2",
|
||||
|
|
|
@ -72,19 +72,13 @@ const updateMaxWidths = (
|
|||
const maxWidths = fastReduce<string>(
|
||||
row,
|
||||
(acc: ColumnWidths, col: string, c: number) => {
|
||||
const isLabel =
|
||||
(verticalTimeAxis && isTopRow) || (!verticalTimeAxis && c === 0)
|
||||
const foundField = fieldOptions.find(field => field.internalName === col)
|
||||
|
||||
const foundField =
|
||||
isLabel && _.isString(col)
|
||||
? fieldOptions.find(field => field.internalName === col)
|
||||
: null
|
||||
|
||||
let colValue = `${col}`
|
||||
let colValue: string | number = `${col}`
|
||||
if (foundField && foundField.displayName) {
|
||||
colValue = foundField.displayName
|
||||
} else if (_.isNumber(col) && decimalPlaces.isEnforced) {
|
||||
colValue = col.toFixed(decimalPlaces.digits)
|
||||
} else if (!isNaN(+col) && decimalPlaces.isEnforced) {
|
||||
colValue = (+col).toFixed(decimalPlaces.digits)
|
||||
}
|
||||
|
||||
const columnLabel = topRow[c]
|
||||
|
|
|
@ -58,7 +58,6 @@ export const telegrafPluginsInfo: TelegrafPluginInfo = {
|
|||
defaults: {
|
||||
name: TelegrafPluginInputCpu.NameEnum.Cpu,
|
||||
type: TelegrafPluginInputCpu.TypeEnum.Input,
|
||||
config: {},
|
||||
},
|
||||
templateID: '0000000000000009',
|
||||
},
|
||||
|
@ -67,7 +66,6 @@ export const telegrafPluginsInfo: TelegrafPluginInfo = {
|
|||
defaults: {
|
||||
name: TelegrafPluginInputDisk.NameEnum.Disk,
|
||||
type: TelegrafPluginInputDisk.TypeEnum.Input,
|
||||
config: {},
|
||||
},
|
||||
templateID: '0000000000000009',
|
||||
},
|
||||
|
@ -76,7 +74,6 @@ export const telegrafPluginsInfo: TelegrafPluginInfo = {
|
|||
defaults: {
|
||||
name: TelegrafPluginInputDiskio.NameEnum.Diskio,
|
||||
type: TelegrafPluginInputDiskio.TypeEnum.Input,
|
||||
config: {},
|
||||
},
|
||||
templateID: '0000000000000009',
|
||||
},
|
||||
|
@ -112,7 +109,6 @@ export const telegrafPluginsInfo: TelegrafPluginInfo = {
|
|||
defaults: {
|
||||
name: TelegrafPluginInputKernel.NameEnum.Kernel,
|
||||
type: TelegrafPluginInputDiskio.TypeEnum.Input,
|
||||
config: {},
|
||||
},
|
||||
},
|
||||
[TelegrafPluginInputKubernetes.NameEnum.Kubernetes]: {
|
||||
|
@ -142,7 +138,6 @@ export const telegrafPluginsInfo: TelegrafPluginInfo = {
|
|||
defaults: {
|
||||
name: TelegrafPluginInputMem.NameEnum.Mem,
|
||||
type: TelegrafPluginInputMem.TypeEnum.Input,
|
||||
config: {},
|
||||
},
|
||||
templateID: '0000000000000009',
|
||||
},
|
||||
|
@ -151,7 +146,6 @@ export const telegrafPluginsInfo: TelegrafPluginInfo = {
|
|||
defaults: {
|
||||
name: TelegrafPluginInputNet.NameEnum.Net,
|
||||
type: TelegrafPluginInputNet.TypeEnum.Input,
|
||||
config: {},
|
||||
},
|
||||
templateID: '0000000000000009',
|
||||
},
|
||||
|
@ -160,7 +154,6 @@ export const telegrafPluginsInfo: TelegrafPluginInfo = {
|
|||
defaults: {
|
||||
name: TelegrafPluginInputNetResponse.NameEnum.NetResponse,
|
||||
type: TelegrafPluginInputNetResponse.TypeEnum.Input,
|
||||
config: {},
|
||||
},
|
||||
},
|
||||
[TelegrafPluginInputNginx.NameEnum.Nginx]: {
|
||||
|
@ -168,7 +161,6 @@ export const telegrafPluginsInfo: TelegrafPluginInfo = {
|
|||
defaults: {
|
||||
name: TelegrafPluginInputNginx.NameEnum.Nginx,
|
||||
type: TelegrafPluginInputNginx.TypeEnum.Input,
|
||||
config: {urls: []},
|
||||
},
|
||||
templateID: '0000000000000006',
|
||||
},
|
||||
|
@ -177,7 +169,6 @@ export const telegrafPluginsInfo: TelegrafPluginInfo = {
|
|||
defaults: {
|
||||
name: TelegrafPluginInputProcesses.NameEnum.Processes,
|
||||
type: TelegrafPluginInputProcesses.TypeEnum.Input,
|
||||
config: {},
|
||||
},
|
||||
templateID: '0000000000000009',
|
||||
},
|
||||
|
@ -222,7 +213,6 @@ export const telegrafPluginsInfo: TelegrafPluginInfo = {
|
|||
defaults: {
|
||||
name: TelegrafPluginInputSwap.NameEnum.Swap,
|
||||
type: TelegrafPluginInputSwap.TypeEnum.Input,
|
||||
config: {},
|
||||
},
|
||||
templateID: '0000000000000009',
|
||||
},
|
||||
|
@ -231,7 +221,6 @@ export const telegrafPluginsInfo: TelegrafPluginInfo = {
|
|||
defaults: {
|
||||
name: TelegrafPluginInputSystem.NameEnum.System,
|
||||
type: TelegrafPluginInputSystem.TypeEnum.Input,
|
||||
config: {},
|
||||
},
|
||||
templateID: '0000000000000009',
|
||||
},
|
||||
|
@ -240,7 +229,6 @@ export const telegrafPluginsInfo: TelegrafPluginInfo = {
|
|||
defaults: {
|
||||
name: TelegrafPluginInputTail.NameEnum.Tail,
|
||||
type: TelegrafPluginInputTail.TypeEnum.Input,
|
||||
config: {},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ export const isPluginUniqueToBundle = (
|
|||
bundle: BundleName,
|
||||
bundles: BundleName[]
|
||||
): boolean => {
|
||||
return bundles.reduce((acc, b) => {
|
||||
return bundles.reduce((acc: boolean, b) => {
|
||||
if (b === bundle) {
|
||||
return acc
|
||||
}
|
||||
|
|
|
@ -202,11 +202,11 @@ class TableCell extends PureComponent<Props> {
|
|||
}
|
||||
|
||||
if (
|
||||
_.isNumber(data) &&
|
||||
!isNaN(+data) &&
|
||||
decimalPlaces.isEnforced &&
|
||||
decimalPlaces.digits < 100
|
||||
) {
|
||||
return data.toFixed(decimalPlaces.digits)
|
||||
return (+data).toFixed(decimalPlaces.digits)
|
||||
}
|
||||
|
||||
return _.defaultTo(data, '').toString()
|
||||
|
|
|
@ -92,11 +92,11 @@ export default class CSVTemplateBuilder extends PureComponent<Props, State> {
|
|||
this.setState({csv})
|
||||
}
|
||||
|
||||
private getUniqueValuesFromCSV(csv: string) {
|
||||
private getUniqueValuesFromCSV(csv: string): string[] {
|
||||
const parsedTVS = Papa.parse(csv)
|
||||
const templateValuesData: string[][] = _.get(parsedTVS, 'data', [[]])
|
||||
|
||||
const valueSet = new Set()
|
||||
const valueSet: Set<string> = new Set()
|
||||
for (const row of templateValuesData) {
|
||||
for (const value of row) {
|
||||
const trimmedValue = trimAndRemoveQuotes(value)
|
||||
|
|
|
@ -93,7 +93,7 @@ const getVarChildren = (
|
|||
*/
|
||||
const collectAncestors = (
|
||||
node: VariableNode,
|
||||
acc = new Set()
|
||||
acc: Set<VariableNode> = new Set()
|
||||
): VariableNode[] => {
|
||||
for (const parent of node.parents) {
|
||||
if (!acc.has(parent)) {
|
||||
|
@ -119,7 +119,7 @@ const findSubgraph = (
|
|||
graph: VariableNode[],
|
||||
variables: Variable[]
|
||||
): VariableNode[] => {
|
||||
const subgraph = new Set()
|
||||
const subgraph: Set<VariableNode> = new Set()
|
||||
|
||||
for (const node of graph) {
|
||||
const shouldKeep =
|
||||
|
@ -204,7 +204,7 @@ const constVariableValues = (
|
|||
*/
|
||||
export const collectDescendants = (
|
||||
node: VariableNode,
|
||||
acc = new Set()
|
||||
acc: Set<VariableNode> = new Set()
|
||||
): VariableNode[] => {
|
||||
for (const child of node.children) {
|
||||
if (!acc.has(child)) {
|
||||
|
|
|
@ -36,7 +36,7 @@ export const csvToMap = (csv: string): MapResult => {
|
|||
return {values, errors}
|
||||
}
|
||||
|
||||
export const trimAndRemoveQuotes = elt => {
|
||||
export const trimAndRemoveQuotes = (elt: string): string => {
|
||||
const trimmed = elt.trim()
|
||||
const dequoted = trimmed.replace(/(^")|("$)/g, '')
|
||||
|
||||
|
|
|
@ -11868,10 +11868,10 @@ typedarray@^0.0.6:
|
|||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
||||
|
||||
typescript@3.3.3:
|
||||
version "3.3.3"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.3.tgz#f1657fc7daa27e1a8930758ace9ae8da31403221"
|
||||
integrity sha512-Y21Xqe54TBVp+VDSNbuDYdGw0BpoR/Q6wo/+35M8PAU0vipahnyduJWirxxdxjsAkS7hue53x2zp8gz7F05u0A==
|
||||
typescript@3.6.4:
|
||||
version "3.6.4"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.4.tgz#b18752bb3792bc1a0281335f7f6ebf1bbfc5b91d"
|
||||
integrity sha512-unoCll1+l+YK4i4F8f22TaNVPRHcD9PA3yCuZ8g5e0qGqlVlJ/8FSateOLLSagn+Yg5+ZwuPkL8LFUc0Jcvksg==
|
||||
|
||||
ua-parser-js@^0.7.18:
|
||||
version "0.7.18"
|
||||
|
|
Loading…
Reference in New Issue