Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Alert page breaks when target query returns null result #4250

Merged
merged 2 commits into from
Oct 16, 2019

Conversation

ranbena
Copy link
Contributor

@ranbena ranbena commented Oct 16, 2019

  • Bug Fix

Description

Fixes #4249.

The new Alert doesn't assumes query result value.
Added condition in case result is an empty array.

Now empty data looks like this, instead of breaking:

Screen Shot 2019-10-16 at 10 27 04

@ranbena ranbena self-assigned this Oct 16, 2019
@@ -34,7 +34,7 @@ DisabledInput.propTypes = {
};

export default function Criteria({ columnNames, resultValues, alertOptions, onChange, editMode }) {
const columnValue = resultValues && head(resultValues)[alertOptions.column];
const columnValue = !isEmpty(resultValues) ? head(resultValues)[alertOptions.column] : null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use head and not resultValues[0]?

@@ -34,7 +34,7 @@ DisabledInput.propTypes = {
};

export default function Criteria({ columnNames, resultValues, alertOptions, onChange, editMode }) {
const columnValue = resultValues && head(resultValues)[alertOptions.column];
const columnValue = !isEmpty(resultValues) ? head(resultValues)[alertOptions.column] : null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use head and not resultValues[0]?

@arikfr arikfr merged commit 72bb5d2 into master Oct 16, 2019
@susodapop
Copy link
Contributor

When will this be merged into SaaS?

@guidopetri guidopetri deleted the alert-empty-result branch July 22, 2023 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alert page breaks when target query returns null result
3 participants