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

UI: Fix selection of domain filters in the SearchView component #10386

Merged

Conversation

bernardodemarco
Copy link
Collaborator

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:

2025-02-12.10-33-42.mp4

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:

if (Array.isArray(arrayField)) {
this.fillFormFieldValues()
}
if (networkIndex > -1) {
this.fields[networkIndex].loading = false
}
this.fillFormFieldValues()

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

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)
  • 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
  • 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.

@bernardodemarco
Copy link
Collaborator Author

@blueorangutan ui

@blueorangutan
Copy link

@bernardodemarco a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 15.98%. Comparing base (42a77c7) to head (c2920b4).
Report is 3 commits behind head on 4.20.

Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #10386      +/-   ##
============================================
- Coverage     15.98%   15.98%   -0.01%     
+ Complexity    13077    13076       -1     
============================================
  Files          5649     5649              
  Lines        495617   495624       +7     
  Branches      59997    60003       +6     
============================================
- Hits          79247    79237      -10     
- Misses       407520   407544      +24     
+ Partials       8850     8843       -7     
Flag Coverage Δ
uitests 4.01% <ø> (-0.01%) ⬇️
unittests 16.82% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/10386 (QA-JID-551)

@bernardodemarco
Copy link
Collaborator Author

@blueorangutan ui

@blueorangutan
Copy link

@bernardodemarco a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/10386 (QA-JID-552)

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

@DaanHoogland DaanHoogland merged commit 69285a6 into apache:4.20 Feb 14, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants