[ 
https://issues.apache.org/jira/browse/ATLAS-5183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18051419#comment-18051419
 ] 

ASF subversion and git services commented on ATLAS-5183:
--------------------------------------------------------

Commit f8bdcaa0729251356f5fd96aa2dff18a8594e7f1 in atlas's branch 
refs/heads/atlas-2.5 from Prasad Pawar
[ https://gitbox.apache.org/repos/asf?p=atlas.git;h=f8bdcaa07 ]

ATLAS-5183: React UI: Business metadata attribute filters send incomplete 
attribute name in entityFilters API payload (#493)
( cherry-picked from d7cfa0822eb6f707dc79de0eff8ef617dbbaf92c)


> 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
>            Priority: Major
>              Labels: atlas-react
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
>  
> 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)

Reply via email to