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

Fixes #38015 - Handle empty content counts on Proxy UI #11232

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

pavanshekar
Copy link
Contributor

What are the changes introduced in this pull request?

Updated the SmartProxyExpandableTable component to use optional chaining for safer property access and added a test case to validate correct behavior and UI rendering.

Considerations taken when implementing this change?

Ensured the component handles content_counts as an empty object {} without errors, maintains backward compatibility, and preserves UI consistency with appropriate placeholders for missing data.

What are the testing steps for this pull request?

Set content_counts = {}:

  1. Got to Rails Console:
    bundle exec rails console
  2. Assign Empty Object {} to the respective SmartProxy's content_counts attribute:
    sp = SmartProxy.find(smartproxy_id)
    sp.content_counts = {}
  3. Save the changes:
    sp.save

Check the UI

  1. Go to Infrastructure -> Smart Proxies -> Any Proxy -> Content
  2. Expand Env -> Expand Content View
  3. It should not give console error and able to view the fields with the value "N/A" for Packages and Additional Content

Copy link
Member

@sjha4 sjha4 left a comment

Choose a reason for hiding this comment

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

Ack 👍🏼

@sjha4 sjha4 merged commit 257c4ca into Katello:master Nov 26, 2024
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants