Skip to content

Remove dataTransform from DataDisplay - #5662

Merged
greenbonebot merged 11 commits into
mainfrom
data-display-types
Oct 1, 2026
Merged

greenbonebot merged 11 commits into
mainfrom
data-display-types

Conversation

@bjoernricks

@bjoernricks bjoernricks commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

What

Remove dataTransform from DataDisplay

  • Expect already transformed data for DataDisplay component
  • Move isLoading meaning already into the loader and change it to reflect tanstack query's behavior
  • Change interface of dataRow prop of DataDisplay to not require array data as input
  • Adapt all chart displays to the new behavior
  • use createDisplay to generate all chart displays

Why

Make the DataDisplay easier to understand and allow to replace Loaders with something else in future easily. This reduced the complexity of the display types a lot. This PR is allows for easier refactoring of the charts in future.

References

https://jira.greenbone.net/browse/GEA-2019

Checklist

  • I have added tests for the changes
  • I have used the following LLMs/AI tools in this pull request:

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 8cfddfb.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@codecov

codecov Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.22642% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.36%. Comparing base (1f6be87) to head (8cfddfb).

Files with missing lines Patch % Lines
...bilities/dashboard/VulnerabilitiesHostsDisplay.tsx 76.74% 8 Missing and 2 partials ⚠️
...eb/pages/notes/dashboard/NoteActiveDaysDisplay.tsx 85.71% 4 Missing ⚠️
...web/pages/notes/dashboard/NoteWordCloudDisplay.tsx 88.00% 3 Missing ⚠️
src/web/pages/nvts/dashboard/NvtFamilyDisplay.tsx 89.28% 3 Missing ⚠️
src/web/pages/nvts/dashboard/NvtQodTypeDisplay.tsx 92.00% 2 Missing ⚠️
.../overrides/dashboard/OverrideActiveDaysDisplay.tsx 92.85% 2 Missing ⚠️
src/web/pages/nvts/dashboard/NvtQodDisplay.tsx 95.45% 1 Missing ⚠️
...s/overrides/dashboard/OverrideWordCloudDisplay.tsx 95.83% 1 Missing ⚠️
...ts/dashboard/ResultDescriptionWordCloudDisplay.tsx 95.83% 1 Missing ⚠️
...pages/results/dashboard/ResultWordCloudDisplay.tsx 95.83% 1 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5662      +/-   ##
==========================================
+ Coverage   87.06%   87.36%   +0.30%     
==========================================
  Files        1304     1304              
  Lines       34137    34292     +155     
  Branches    10325    10287      -38     
==========================================
+ Hits        29721    29959     +238     
+ Misses       3977     3919      -58     
+ Partials      439      414      -25     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bjoernricks
bjoernricks force-pushed the data-display-types branch 2 times, most recently from 5952029 to ab9a232 Compare September 30, 2026 08:08
@bjoernricks
bjoernricks marked this pull request as ready for review September 30, 2026 08:08
@bjoernricks
bjoernricks requested a review from a team as a code owner September 30, 2026 08:08
@greenbonebot
greenbonebot enabled auto-merge (rebase) September 30, 2026 08:08
Comment thread src/web/components/dashboard/display/severity/SeverityClassDisplay.tsx Outdated
This change will make all DataDisplay much easier to understand. They
just render some specific kind of data. No transformed data no
transformed props.
Remove transforming of the input data and expect the transformed data
directly.
dataTransform prop got removed and the re-usable chart displays expect
the already transformed data now.
Update the loader to use the same meaning for isLoading as tenstack
query. isLoading is only true if there isn't any data yet. This allows
to remove this extra logic from DataDisplay that did exactly this and
changed the isLoading meaning for its children.
Create all chart displays in the same manner by using the createDisplay
function. This avoids duplicate code and will be easier for future
refactoring.
Ensure the click handlers on the chart displays work as expected and
legends are not toggleable were disabled.
The return data is now an array with a total property.
@greenbonebot
greenbonebot merged commit 38bbd98 into main Oct 1, 2026
25 checks passed
@greenbonebot
greenbonebot deleted the data-display-types branch October 1, 2026 10:13
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.

3 participants