bernardodemarco opened a new pull request, #10386:
URL: https://github.com/apache/cloudstack/pull/10386

   ### Description
   
   Currently, when a domain has associated accounts, it is not possible to 
select it as a filter option in the `SearchView` component. The following video 
shows the current UI behavior:
   
   
https://github.com/user-attachments/assets/8e337680-d0b0-4f6a-9253-fc485592b005
   
   When the user selects a filter option, the method `onSelectFieldChange` in 
the `SearchView` component is executed. Then, it checks if the changed field 
name is equal to `domainid`; if so, it executes the method 
`fetchDynamicFieldData` to fetch only the accounts of the selected domain.
   
   However, the `fetchDynamicFieldData` method is always executing, in its 
`finally` block, the `fillFormFieldValues` method:
   
   
https://github.com/apache/cloudstack/blob/a7beaaf73b819af51294cc35df0830d2a8a2fbc7/ui/src/components/view/SearchView.vue#L716-L722
   
   The `fillFormFieldValues` method populates the filters values based on the 
query strings existing in the URL. Therefore, since the URL query strings are 
empty, the `domainid` field is set to `undefined`, and the selected domain 
automatically disappears.
   
   Additionally, two other bugs have been identified:
   - When clearing the selected filters of the `SearchView` component, the 
fetched accounts are not refreshed;
   - When the `SearchView` component only displays the domain filter, after 
selecting a domain, an exception is thrown at the browser's console:
   
![image](https://github.com/user-attachments/assets/497d5fe7-671d-4ac4-9f48-967bf60a8c20)
   
   This PR fixes the above-mentioned issues.   
    
    ---
    
    Fixes #10310
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [X] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] build/CI
   - [ ] test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [X] Minor
   - [ ] Trivial
   
   ### Screenshots (if appropriate):
   
   ### How Has This Been Tested?
   
   - Created three domains and accounts within each one of them.
   - Accessed the `SearchView` component in the Events page.
   - Checked that it was possible to select domains.
   - Checked that the accounts were correctly fetched based on the selected 
domain.
   - Checked that the fetched accounts are refreshed when clearing the filters.
   - Accessed the Accounts page and checked that when searching for accounts of 
a given domain, no exceptions are thrown at the browser's console.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to