diff --git a/example/package/react-autoql-0.0.0-semantically-released.tgz b/example/package/react-autoql-0.0.0-semantically-released.tgz index b9b09b26a..598a7da59 100644 Binary files a/example/package/react-autoql-0.0.0-semantically-released.tgz and b/example/package/react-autoql-0.0.0-semantically-released.tgz differ diff --git a/src/components/Charts/Bars/Bars.js b/src/components/Charts/Bars/Bars.js index 56e69e191..d801782ea 100644 --- a/src/components/Charts/Bars/Bars.js +++ b/src/components/Charts/Bars/Bars.js @@ -64,7 +64,7 @@ export default class Bars extends Component { } let width = Math.abs(xScale(value) - scaleZero(xScale)) - if (Number.isNaN(width)) { + if (isNaN(width)) { width = 0 } diff --git a/src/components/Charts/Circles/Circles.js b/src/components/Charts/Circles/Circles.js index 6cf722f8c..910417eff 100644 --- a/src/components/Charts/Circles/Circles.js +++ b/src/components/Charts/Circles/Circles.js @@ -80,7 +80,7 @@ export default class Circles extends Component { if (!columns[colIndex].isSeriesHidden) { const rawValue = row[colIndex] const valueNumber = Number(rawValue) - const value = !Number.isNaN(valueNumber) ? valueNumber : 0 + const value = !isNaN(valueNumber) ? valueNumber : 0 const xLabel = row[stringColumnIndex] const yLabel = legendLabels[i].label diff --git a/src/components/Charts/Squares/Squares.js b/src/components/Charts/Squares/Squares.js index 289675660..1d245c96d 100644 --- a/src/components/Charts/Squares/Squares.js +++ b/src/components/Charts/Squares/Squares.js @@ -79,7 +79,7 @@ export default class Squares extends Component { if (!columns[colIndex].isSeriesHidden) { const rawValue = row[colIndex] const valueNumber = Number(rawValue) - const value = !Number.isNaN(valueNumber) ? valueNumber : 0 + const value = !isNaN(valueNumber) ? valueNumber : 0 const xLabel = row[stringColumnIndex] const yLabel = legendLabels[i].label diff --git a/src/components/Charts/StackedBars/StackedBars.js b/src/components/Charts/StackedBars/StackedBars.js index 057d25789..84657b494 100644 --- a/src/components/Charts/StackedBars/StackedBars.js +++ b/src/components/Charts/StackedBars/StackedBars.js @@ -56,7 +56,7 @@ export default class StackedColumns extends Component { if (!columns[colIndex].isSeriesHidden) { const rawValue = d[colIndex] const valueNumber = Number(rawValue) - const value = !Number.isNaN(valueNumber) ? valueNumber : 0 + const value = !isNaN(valueNumber) ? valueNumber : 0 if (!value) { return null diff --git a/src/components/Charts/StackedColumns/StackedColumns.js b/src/components/Charts/StackedColumns/StackedColumns.js index 55faaf953..a26e58c48 100644 --- a/src/components/Charts/StackedColumns/StackedColumns.js +++ b/src/components/Charts/StackedColumns/StackedColumns.js @@ -56,7 +56,7 @@ export default class StackedColumns extends Component { if (!columns[colIndex].isSeriesHidden) { const rawValue = d[colIndex] const valueNumber = Number(rawValue) - const value = !Number.isNaN(valueNumber) ? valueNumber : 0 + const value = !isNaN(valueNumber) ? valueNumber : 0 if (!value) { return null diff --git a/src/components/Charts/helpers.js b/src/components/Charts/helpers.js index 37435b9f0..dd50a2e46 100644 --- a/src/components/Charts/helpers.js +++ b/src/components/Charts/helpers.js @@ -335,7 +335,7 @@ export const getMaxValueFromKeyValueObj = (obj) => { maxValue = obj[Object.keys(obj)[0]] } else if (size > 1) { const numberValues = [...Object.values(obj)].filter((value) => { - return !Number.isNaN(Number(value)) + return !isNaN(Number(value)) }) maxValue = Math.max(...numberValues) } @@ -350,7 +350,7 @@ export const getMinValueFromKeyValueObj = (obj) => { minValue = obj[Object.keys(obj)[0]] } else if (size > 1) { const numberValues = [...Object.values(obj)].filter((value) => { - return !Number.isNaN(Number(value)) + return !isNaN(Number(value)) }) minValue = Math.min(...numberValues) } diff --git a/src/components/Dashboard/DashboardTile/DashboardTile.js b/src/components/Dashboard/DashboardTile/DashboardTile.js index d1ee1d8f7..1bd715998 100644 --- a/src/components/Dashboard/DashboardTile/DashboardTile.js +++ b/src/components/Dashboard/DashboardTile/DashboardTile.js @@ -827,7 +827,7 @@ export class DashboardTile extends React.Component { percentString.substring(0, percentString.length - 1) ) - if (!Number.isNaN(percentNumber)) { + if (!isNaN(percentNumber)) { this.debouncedSetParamsForTile({ secondDisplayPercentage: percentNumber, }) diff --git a/src/components/Notifications/Rule/Rule.js b/src/components/Notifications/Rule/Rule.js index 541b0faf8..59f7beb2e 100644 --- a/src/components/Notifications/Rule/Rule.js +++ b/src/components/Notifications/Rule/Rule.js @@ -165,7 +165,7 @@ export default class Rule extends React.Component { } isNumerical = (num) => { - return !Number.isNaN(Number(num)) + return !isNaN(Number(num)) } isComplete = () => { @@ -232,7 +232,7 @@ export default class Rule extends React.Component { }) } else if ( !this.state.input2Value || - !Number.isNaN(Number(this.state.input2Value)) + !isNaN(Number(this.state.input2Value)) ) { this.setState({ isSecondTermValid: true, diff --git a/src/components/Notifications/RuleSimple/RuleSimple.js b/src/components/Notifications/RuleSimple/RuleSimple.js index a9a8f8eee..6a8203982 100644 --- a/src/components/Notifications/RuleSimple/RuleSimple.js +++ b/src/components/Notifications/RuleSimple/RuleSimple.js @@ -172,7 +172,7 @@ export default class RuleSimple extends React.Component { // If just one word, strip everything but numbers const strippedSymbolsStr = parseNum(num) - return !Number.isNaN(Number(strippedSymbolsStr)) + return !isNaN(Number(strippedSymbolsStr)) } isComplete = () => { diff --git a/src/components/QueryOutput/QueryOutput.js b/src/components/QueryOutput/QueryOutput.js index 4a44172ef..104452e76 100644 --- a/src/components/QueryOutput/QueryOutput.js +++ b/src/components/QueryOutput/QueryOutput.js @@ -447,8 +447,8 @@ export class QueryOutput extends React.Component { !tableConfig || !tableConfig.numberColumnIndices || !tableConfig.stringColumnIndices || - Number.isNaN(Number(tableConfig.numberColumnIndex)) || - Number.isNaN(Number(tableConfig.stringColumnIndex)) + isNaN(Number(tableConfig.numberColumnIndex)) || + isNaN(Number(tableConfig.stringColumnIndex)) ) { return false } diff --git a/src/components/Steps/Steps.js b/src/components/Steps/Steps.js index 59163eb18..94fdb8bf7 100644 --- a/src/components/Steps/Steps.js +++ b/src/components/Steps/Steps.js @@ -32,7 +32,7 @@ export default class Steps extends React.Component { console.error(new Error('No steps were provided')) } else if ( this.props.initialActiveStep != null && - !Number.isNaN(this.props.initialActiveStep) && + !isNaN(this.props.initialActiveStep) && !_get(this.props.steps, `${this.props.initialActiveStep}`) ) { console.error(new Error('Initial active step provided is invalid')) @@ -49,7 +49,7 @@ export default class Steps extends React.Component { } nextStep = () => { - const nextStep = Number.isNaN(this.state.activeStep) + const nextStep = isNaN(this.state.activeStep) ? 0 : this.state.activeStep + 1 this.onStepTitleClick(nextStep) @@ -109,9 +109,10 @@ export default class Steps extends React.Component { // be dynamically adjusted when the content changes clearTimeout(this.autoHideTimeout) this.autoHideTimeout = setTimeout(() => { - const activeContentContainerAfterTransition = document.querySelector( - `#react-autoql-step-content-${this.COMPONENT_KEY}-${i}` - ) + const activeContentContainerAfterTransition = + document.querySelector( + `#react-autoql-step-content-${this.COMPONENT_KEY}-${i}` + ) if (activeContentContainerAfterTransition) { activeContentContainerAfterTransition.style.height = 'auto' } diff --git a/src/js/Util.js b/src/js/Util.js index b351d52cd..843be3673 100644 --- a/src/js/Util.js +++ b/src/js/Util.js @@ -53,7 +53,7 @@ export const formatEpochDate = (value, col = {}, config = {}) => { const title = col.title let date = dayjs.unix(value).utc().format(dayMonthYear) - if (Number.isNaN(Number(value))) { + if (isNaN(Number(value))) { // Not an epoch time. Try converting using dayjs if (title && title.toLowerCase().includes('year')) { date = dayjs(value).format(year) @@ -982,7 +982,7 @@ export const dateSortFn = (a, b) => { let bDate = Number(b) // If one is not a number, use dayjs to format - if (Number.isNaN(aDate) || Number.isNaN(bDate)) { + if (isNaN(aDate) || isNaN(bDate)) { aDate = dayjs(a).unix() bDate = dayjs(b).unix() }