Prasad P. Pawar created ATLAS-5183:
--------------------------------------
Summary: React UI: Business metadata attribute filters send
incomplete attribute name in entityFilters API payload
Key: ATLAS-5183
URL: https://issues.apache.org/jira/browse/ATLAS-5183
Project: Atlas
Issue Type: Bug
Components: atlas-webui
Affects Versions: 3.0.0
Reporter: Prasad P. Pawar
Assignee: Prasad P. Pawar
When filtering by business metadata attributes in React UI basic search, the
API payload's `entityFilters.criterion[].attributeName` contains only the
attribute name (e.g., `attr1`) instead of the full qualified name (e.g.,
`test_businessMetadata.attr1`). This causes incorrect API requests and
potential search failures.
Environment
- React UI (dashboard/)
- Basic Search functionality
- Business Metadata attribute filters
Steps to Reproduce
1. Navigate to React UI basic search
2. Select a business metadata attribute filter (e.g.,
`test_businessMetadata.attr1`)
3. Set a filter condition (e.g., `is_null`)
4. Click Search
5. Check the Network tab to inspect the API request payload
Actual Behavior
The API payload contains only the attribute name without the business metadata
prefix:
{code:java}
{
"entityFilters": {
"condition": "AND",
"criterion": [
{
"attributeName": "attr1",
"operator": "isNull",
"attributeValue": ""
}
]
}
}
{code}
h2. Root Cause
# The react-querybuilder library uses the name property as the field
identifier when storing selected filters in rule.field
# When creating business metadata filter objects in Filters.tsx, only the id
property was being updated with the full qualified name
(test_businessMetadata.attr1)
# The name property remained as just the attribute name (attr1)
# When generateUrl was called, it checked obj.field (which contained only
attr1) before checking obj.id
h2. Solution
# Updated dashboard/src/components/QueryBuilder/Filters.tsx: Modified business
metadata filter creation to update both id and name properties with the full
qualified name
# Updated dashboard/src/utils/CommonViewFunction.ts: Changed property priority
in generateUrl to prioritize field (used by react-querybuilder) over id
--
This message was sent by Atlassian Jira
(v8.20.10#820010)