Skip to content

ROX-34553: Render resourceScope in table of ConfigReportsTab#20368

Open
pedrottimark wants to merge 1 commit intomasterfrom
ROX-34553-resourceScope-ConfigReportsTab
Open

ROX-34553: Render resourceScope in table of ConfigReportsTab#20368
pedrottimark wants to merge 1 commit intomasterfrom
ROX-34553-resourceScope-ConfigReportsTab

Conversation

@pedrottimark
Copy link
Copy Markdown
Contributor

@pedrottimark pedrottimark commented May 5, 2026

Description

Review: Hide space because of indentation changes.

Objective

Provide equivalent filter for scheduled reports as view-based reports

Problem

If you create image report configuration with entity (instead of collection) scope, COnfigReportsTab crashes, as expected.

Analysis

  1. ConfigReportsTab.tsx file renders Collection and assumes collection scope:

    const { collectionName, collectionId } =
        report.resourceScope.collectionScope;

Solution

  1. Edit ConfigReportsTab.tsx file.

    • Replace conditional rendering with Image vulnerability reports for title (and heading).
    • Replace Collection with Resources as table column heading.
    • Conditionally render either collection link or Custom scope
  2. Edit reportsTable.test.js file.

    • Replace Collection with Resources as table column heading.
  3. Edit ViewBasedReportsTab.tsx and VulnReportingLayout.tsx files.

    • Replace conditional rendering with Image vulnerability reports for title (and heading).

User-facing documentation

  • CHANGELOG.md update is not needed
  • documentation PR is not needed

Testing and quality

  • the change is production ready: the change is GA
  • CI results are inspected

Automated testing

  • added unit tests
  • edited e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

  1. npm run tsc in ui/apps/platform folder.
  2. npm run lint:fast-dev in ui/apps/platform folder.
  3. npm run start in ui/apps/platform folder with staging demo as central.

Manual testing

  1. Visit /main/vulnerabilities/reports/configuration and click link for report configuration that has collection scope.

    Original unconditional code:
    ConfigReportsTab_collectionScope_unconditional

    Replaced conditional code:
    ConfigReportsTab_collectionScope_conditional

  2. Temporarily edit code to add report configuration that has entity scope.

    Original unconditional code:
    ConfigReportsTab_entityScope_unconditional

    Replaced conditional code:
    ConfigReportsTab_entityScope_conditional

  3. Click Resources link that has collection scope.

    Replaced conditional code:
    CollectionsFormModal

@pedrottimark pedrottimark requested a review from a team as a code owner May 5, 2026 20:41
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

🚀 Build Images Ready

Images are ready for commit 84120f0. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.11.x-867-g84120f0a3c

@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.58%. Comparing base (cc014e8) to head (84120f0).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #20368      +/-   ##
==========================================
+ Coverage   49.56%   49.58%   +0.02%     
==========================================
  Files        2794     2797       +3     
  Lines      212518   212766     +248     
==========================================
+ Hits       105331   105509     +178     
- Misses      99453    99524      +71     
+ Partials     7734     7733       -1     
Flag Coverage Δ
go-unit-tests 49.58% <ø> (+0.02%) ⬆️

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.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant