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

[bug] Hide empty usage box when RadiusGroup has no checks #819 #845

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Unnati-Gupta24
Copy link

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Reference to Existing Issue

Closes #819 .

Description of Changes

Fixed an issue where an empty box was being displayed in the status page when a user's RadiusGroup had no defined checks. For example, when a user belonged to the power-users group which doesn't define any usage checks, an empty box would still appear where usage information should be shown.

Changes

Modified client/components/status/status.js to properly handle cases when the API returns no checks:

  • Added check for empty checks array before setting userChecks
  • Explicitly set userChecks to null and disable radius usage display when no checks exist
  • Only enable radius usage display when there are actual checks to show

Before this change, even with no checks, the UI would still show an empty box. Now, when a user's RadiusGroup has no checks defined, no empty box will be displayed, providing a cleaner user interface.

Screenshot

a1 All tests has been passed after changes

@pandafy kindly review this

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.

[bug] Don't show "limit-info" div if API returns list for checks
1 participant