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

Interactive Legend: Predominance expression where clause #419

Merged
merged 3 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/instant-apps-components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v1.0.0-beta.259

### instant-apps-interactive-legend

- fix: predominance expression where clause

## v1.0.0-beta.258

### General
Expand Down
4 changes: 2 additions & 2 deletions packages/instant-apps-components/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/instant-apps-components/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"homepage": "https://esri.github.io/instant-apps-components",
"name": "@esri/instant-apps-components",
"version": "1.0.0-beta.258",
"version": "1.0.0-beta.259",
"description": "Reusable ArcGIS Instant Apps web components.",
"main": "dist/index.cjs.js",
"module": "dist/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,7 @@ export function handlePredominanceExpression(elementInfo: any, featureLayerView:
if (elementInfo.value === field) {
return;
}
const sqlQuery = `(${elementInfo.value} > ${field} OR (${field} IS NULL AND ${elementInfo.value} <> 0 AND ${elementInfo.value} IS NOT NULL))`;

const sqlQuery = `(${elementInfo.value} > ${field} OR (${field} IS NULL AND ${elementInfo.value} IS NOT NULL AND (${elementInfo.value} > 0 AND ${elementInfo.value} < 0)))`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

How would this work? (${elementInfo.value} > 0 AND ${elementInfo.value} < 0)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oops you're right, I updated AND to OR. ${elementInfo.value} <> 0 wasn't working properly so I was trying to write an alternative to that.

expressionArr.push(sqlQuery);
});
return expressionArr.join(' AND ');
Expand Down
Loading