Skip to content

fix: (UI)Globe/cloud button on Attack Paths page shows correct data - BED-6661#2340

Merged
nicole-m-martin merged 12 commits intomainfrom
BED-6661--globe
Feb 11, 2026
Merged

fix: (UI)Globe/cloud button on Attack Paths page shows correct data - BED-6661#2340
nicole-m-martin merged 12 commits intomainfrom
BED-6661--globe

Conversation

@nicole-m-martin
Copy link
Copy Markdown
Contributor

@nicole-m-martin nicole-m-martin commented Feb 3, 2026

Description

Updated the functionality for the "Globe/Cloud" button click in the graph view on Attack Paths page. This updates API endpoint to use /asset-group-tags/:agtId/members/counts and renders the Objects Accordion to show the Zone Membership panel when tier flag is enabled. Fixes the panel only showing 'Tier 0' data.

Motivation and Context

Resolves BED-6661 - UI - Clicking on globe/cloud on Attack Paths page shows only "Tier 0" data

How Has This Been Tested?

Manual Tested all Expected Behaviors:

Given I am on the attack paths page (with any zone or environment selected)
When I click on the globe or cloud
✅ Then I see a list of objects in both the selected zone and environment sorted by type

Given I clicked the globe
When I click Go to Privilege Zone Management
✅ Then I am taken to the summary view of Privilege Zone Management

Given I am viewing the Zone Membership panel on attack paths page
When I select a new zone or environment
✅ Then the zone membership panel remains displayed but with new environment/zone information.

Given I am view the zone membership panel on attack paths page,
When I navigate back through browser history
✅ Then I am shown the Findings panel.

Given I have link to BHE that was captured when the Zone Membership panel was open
When I open that link
✅ Then the Zone Membership panel is displayed with the expected zone and environment displayed.

Test file added: ZoneObjectsInformationPanel.test.tsx (In Bloodhound Enterprise)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

Summary by CodeRabbit

  • New Features
    • Exposed tag-object-counts hook as a public API with safer handling of optional environment parameters.
    • Objects list component now accepts tagId/ruleId/objectId and a customizable onObjectClick callback so external code can handle object clicks.
    • Objects list component is re-exported for easier consumption from the Privilege Zones module.

@nicole-m-martin nicole-m-martin self-assigned this Feb 3, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

Exports the useTagObjectCounts hook publicly and defensively handles optional environments. ObjectsAccordion gains tagId, ruleId, objectId props and an onObjectClick callback; internal navigation is replaced by delegating clicks to the callback. Barrel files now re-export ObjectsAccordion.

Changes

Cohort / File(s) Summary
Hook Export
packages/javascript/bh-shared-ui/src/hooks/useAssetGroupTags/useObjectCounts.ts
Made useTagObjectCounts a public export; query key construction now spreads (environments ?? []) and retains reject-on-missing-tagId behavior. Minor formatting cleanup.
ObjectsAccordion & Items
packages/javascript/bh-shared-ui/src/views/PrivilegeZones/Details/ObjectsAccordion.tsx, packages/javascript/bh-shared-ui/src/views/PrivilegeZones/Details/ObjectsAccordion.*.tsx
Added public props tagId, ruleId, objectId, and onObjectClick; removed internal path-based navigation in favor of invoking onObjectClick(item); active-row highlight now uses objectId; props propagated to item components.
Details Integration
packages/javascript/bh-shared-ui/src/views/PrivilegeZones/Details/Details.tsx
Wired ObjectsAccordion with onObjectClick handler that sets selected details tab and navigates to object details; passes tagId, ruleId, and memberId-derived objectId.
Tests Updated
packages/javascript/bh-shared-ui/src/views/PrivilegeZones/Details/ObjectsAccordion.rule.test.tsx, .../ObjectsAccordion.tag.test.tsx
Removed internal usePZPathParams mocks; tests now render ObjectsAccordion with explicit tagId, ruleId, and onObjectClick mocks and updated assertions to match new prop-driven behavior.
Barrel Exports
packages/javascript/bh-shared-ui/src/views/PrivilegeZones/Details/index.tsx, packages/javascript/bh-shared-ui/src/views/PrivilegeZones/index.tsx
Re-exported ObjectsAccordion from Details and added it to the PrivilegeZones barrel exports.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant User as User
participant ObjectsAccordion as ObjectsAccordion
participant Details as Details (parent)
participant Router as Router/Navigate
User->>ObjectsAccordion: click object row
ObjectsAccordion->>Details: onObjectClick(item)
Details->>Details: setSelectedDetailsTab(Object)
Details->>Router: navigate(objectDetailsLink)
Router-->>User: route to details

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • urangel
  • mistahj67
  • specter-flq
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: updating the Globe/cloud button to show correct zone and environment data, directly addressing the bug mentioned in BED-6661.
Description check ✅ Passed The PR description fully completes the required template with clear Description, Motivation and Context (with ticket reference), comprehensive testing details, and proper checklist completion.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch BED-6661--globe

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nicole-m-martin nicole-m-martin changed the title fix:(UI)Globe/cloud button on Attack Paths page shows correct data - BED-6661 fix: (UI)Globe/cloud button on Attack Paths page shows correct data - BED-6661 Feb 3, 2026
@nicole-m-martin nicole-m-martin added bug Something isn't working user interface A pull request containing changes affecting the UI code. labels Feb 3, 2026
@nicole-m-martin nicole-m-martin marked this pull request as draft February 5, 2026 01:20
@nicole-m-martin nicole-m-martin marked this pull request as ready for review February 5, 2026 23:08
@nicole-m-martin nicole-m-martin merged commit 52c2b19 into main Feb 11, 2026
13 checks passed
@nicole-m-martin nicole-m-martin deleted the BED-6661--globe branch February 11, 2026 00:48
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working user interface A pull request containing changes affecting the UI code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants