From dfcdd4ede51b1a0952127b7ef51ce7cd82615bd2 Mon Sep 17 00:00:00 2001 From: Alex Zhou Date: Wed, 27 Nov 2024 14:09:44 -0700 Subject: [PATCH] ANT-3235 --- package-lock.json | 4 +-- package.json | 2 +- .../ScheduleBuilder/ScheduleBuilder.js | 33 +++++-------------- 3 files changed, 12 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index b3fcb9fe..7422fe9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "react-autoql", - "version": "8.8.50", + "version": "8.8.51", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "react-autoql", - "version": "8.8.50", + "version": "8.8.51", "license": "ISC", "dependencies": { "@react-icons/all-files": "^4.1.0", diff --git a/package.json b/package.json index fef1962b..d64e48be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-autoql", - "version": "8.8.50", + "version": "8.8.51", "description": "React Widget Library", "main": "dist/autoql.cjs.js", "module": "dist/autoql.esm.js", diff --git a/src/components/Notifications/ScheduleBuilder/ScheduleBuilder.js b/src/components/Notifications/ScheduleBuilder/ScheduleBuilder.js index 54169527..992f1c21 100644 --- a/src/components/Notifications/ScheduleBuilder/ScheduleBuilder.js +++ b/src/components/Notifications/ScheduleBuilder/ScheduleBuilder.js @@ -88,7 +88,7 @@ export default class ScheduleBuilder extends React.Component { conditionType: EXISTS_TYPE, showTypeSelector: true, dataAlert: undefined, - onCompleteChange: () => { }, + onCompleteChange: () => {}, } componentDidMount = () => { @@ -163,7 +163,6 @@ export default class ScheduleBuilder extends React.Component { getInitialStateFromDataAlert = (props, state) => { const { dataAlert } = props - try { const evalFrequency = dataAlert?.evaluation_frequency @@ -178,16 +177,6 @@ export default class ScheduleBuilder extends React.Component { state.isCustomEvaluationFrequencyInputVisible = true } - if ( - !state.resetPeriodSelectValue && - props.dataAlertType !== SCHEDULED_TYPE && - this.SUPPORTED_CONDITION_TYPES.includes(COMPARE_TYPE) - ) { - // We don't want to support null reset_periods for compare type data alerts - // To avoid continuous triggering of the alert. Use default value in this case - state.resetPeriodSelectValue = this.timeRange ?? this.DEFAULT_RESET_PERIOD_SELECT_VALUE - } - if (state.resetPeriodSelectValue === null) { state.resetPeriodSelectValue = 'NONE' } @@ -219,8 +208,9 @@ export default class ScheduleBuilder extends React.Component { } getSummary = () => { - return `${this.state.resetPeriodSelectValue} ${this.getDayOfSelection(this.state.resetPeriodSelectValue)} ${this.state.intervalTimeSelectValue?.value - } ${this.state.timezone}` + return `${this.state.resetPeriodSelectValue} ${this.getDayOfSelection(this.state.resetPeriodSelectValue)} ${ + this.state.intervalTimeSelectValue?.value + } ${this.state.timezone}` } getData = () => { @@ -391,7 +381,7 @@ export default class ScheduleBuilder extends React.Component { } dayOfMonthSelector = () => { - const dayOptions = Array.from({ length: 31 }, (_, i) => i + 1); + const dayOptions = Array.from({ length: 31 }, (_, i) => i + 1) const formattedOptions = dayOptions.map((value) => ({ value, label: , @@ -413,7 +403,6 @@ export default class ScheduleBuilder extends React.Component { /> - ) } @@ -597,14 +586,10 @@ export default class ScheduleBuilder extends React.Component { return (