Skip to content

Conversation

bastilian
Copy link
Member

This fixes issues with syncing the state and URL of filters in the Systems table.

Description

Associated Jira ticket: # (issue)

Please include a summary of the change, what this fixes/creates/improves.

How to test the PR

Please include steps to test your PR.

Before the change

After the change

Dependent work link

Checklist:

  • The commit message has the Jira ticket linked
  • PR has a short description
  • Screenshots before and after the change are added
  • Tests for the changes have been added
  • README.md is updated if necessary
  • Needs additional dependent work

@codecov-commenter
Copy link

codecov-commenter commented Dec 12, 2023

Codecov Report

Attention: Patch coverage is 64.10256% with 14 lines in your changes missing coverage. Please review.

Project coverage is 64.00%. Comparing base (7f7bc89) to head (e7c00af).

Files Patch % Lines
src/SmartComponents/Systems/SystemsTable.js 36.36% 7 Missing ⚠️
src/Utilities/SystemsHelpers.js 16.66% 5 Missing ⚠️
src/Utilities/Helpers.js 90.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1152      +/-   ##
==========================================
- Coverage   64.14%   64.00%   -0.14%     
==========================================
  Files         124      124              
  Lines        3207     3234      +27     
  Branches      818      830      +12     
==========================================
+ Hits         2057     2070      +13     
- Misses       1150     1164      +14     

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

@bastilian bastilian force-pushed the RHINENG-2912-2 branch 2 times, most recently from 9fd240b to bc453aa Compare May 29, 2024 10:47
@bastilian bastilian changed the title fix(OperatingSystemFilter): RHINENG-2912 - Fix OS inventory filter conversion fix(OperatingSystemFilter): RHINENG-10345 - Fix OS inventory filter conversion May 29, 2024
@bastilian bastilian marked this pull request as ready for review May 29, 2024 10:48
@bastilian bastilian requested a review from a team as a code owner May 29, 2024 10:48
@gkarat gkarat added the bug Something isn't working label Jun 4, 2024
Copy link
Contributor

@gkarat gkarat left a comment

Choose a reason for hiding this comment

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

Looks good! I have tried to test it, couldn't find issues and the OS filter now operates as expected. There is one thing I would like to ask for in terms of tests before we can merge...

Comment on lines +162 to +164
...operatingSystemFilter ? {
filters: [...(osFilter || [])]
} : {},
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is something we could cover with tests: there is SystemTable.test.js available where we could add a scenario where query parameters contain filter[os]. And given that InventoryTable receives customFilters, we can assert on what the mocked component was called with and make sure osFilter is passed in the expected format. WDYT?

filter: queryParamsFilter, search, page, perPage, sort
} = queryParams;
const { os: operatingSystemFilter, ...filter } = queryParamsFilter || {};
const osFilter = operatingSystemFilter && [{
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we extract this into some utility function? The os filter exists in Advisory systems table as well. Probably we need to make same changes there as welll

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, a similar change is in advisor. We could look into moving this to a shared function, but the apps have always slightly different ways of providing the filter to their APIs and I'm not sure how much we could really share.

Copy link
Contributor

Choose a reason for hiding this comment

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

Aha, advisory application is a different example of how sharing might help. But, I meant the AdvisorySystems table in the patch itself

Copy link
Member Author

Choose a reason for hiding this comment

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

AH! I'll take a look!

Copy link
Member Author

@bastilian bastilian Jun 4, 2024

Choose a reason for hiding this comment

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

@mkholjuraev but, ähm, we are not showing the filter there yet. Do we want to enable it there as well now?

Copy link
Member Author

Choose a reason for hiding this comment

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

There we don't need the change, because the table is not querying against the Patch API, but the inventory API and the filter comes directly from there.

Copy link
Member Author

Choose a reason for hiding this comment

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

oh, I'm confused. ok looking more. before I say more. :D

@mkholjuraev
Copy link
Contributor

@bastilian can you please have a look at this PR. The OS filter is broken in both stage and prod and we are receiving more and more complaints unfortunately.

Copy link
Contributor

@mkholjuraev mkholjuraev left a comment

Choose a reason for hiding this comment

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

LGTM!

@mkholjuraev
Copy link
Contributor

/retest

2 similar comments
@niyazRedhat
Copy link
Contributor

/retest

@mtclinton
Copy link

/retest

@mkholjuraev mkholjuraev merged commit f3b1b3b into RedHatInsights:master Jul 3, 2024
@mkholjuraev
Copy link
Contributor

🎉 This PR is included in version 1.67.7 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants