Skip to content

Fixes #39380 - Update line chart to PatternFly5#612

Merged
Lukshio merged 2 commits into
theforeman:masterfrom
tlabaj:linechart
Jun 29, 2026
Merged

Fixes #39380 - Update line chart to PatternFly5#612
Lukshio merged 2 commits into
theforeman:masterfrom
tlabaj:linechart

Conversation

@tlabaj

@tlabaj tlabaj commented May 29, 2026

Copy link
Copy Markdown
Contributor

Fixes: #39380

This PR updates the Line Chart to use PF5 components.

Before:
linechart_before

After:
Screenshot 2026-06-03 at 11 24 23 AM

Comment thread webpack/lineChartRegistry.js Outdated

@Lukshio Lukshio left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hi, I know it's WIP, but just first round of review.

Comment thread app/assets/javascripts/foreman_openscap/scap_hosts_show.js
Comment thread webpack/components/LineChart/LineChartHelpers.js
Comment thread webpack/components/LineChart/index.js Outdated
Comment thread webpack/components/LineChart/index.js Outdated
@Lukshio

Lukshio commented Jun 3, 2026

Copy link
Copy Markdown

Hi, please commit new changes in new commits.

@tlabaj

tlabaj commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

Hi, please commit new changes in new commits.

Sure, I will do that going forward.

@Lukshio Lukshio left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code changes looks good

Comment thread webpack/components/LineChart/index.js Outdated
Comment on lines +23 to +33
import {
formatAxisTick,
formatTooltipTitle,
formatYAxisTick,
getLegendEvents,
getSeriesOpacity,
getXAxisTickValues,
InteractiveLegendLabel,
InteractiveLegendSymbol,
XAxisTickLabel,
} from 'foremanReact/components/common/charts/AreaChart/AreaChartLegend';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can you please open new PR in foreman core and move all imports to new /chars/helpers/LegendHelpers.js so it can be easily reused later? So it won't be matched to specific chart. The AreaChartLegend will then use new helper.

Path update will be needed after the change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Lukshio Here is the Foreman PR theforeman/foreman#11010

@Lukshio

Lukshio commented Jun 8, 2026

Copy link
Copy Markdown

@tlabaj ForemanCore PR is merged, you can edit import paths

@ofedoren

Copy link
Copy Markdown
Member

@tlabaj ForemanCore PR is merged, you can edit import paths

Friendly reminder: If a dependency in Foreman is required and was merged, please update https://github.com/theforeman/foreman_openscap/blob/master/lib/foreman_openscap/engine.rb#L43 accordingly

@Lukshio Lukshio left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code changes looks good, please update the engine.rb to new foreman version, and fix CI failures

@tlabaj

tlabaj commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Code changes looks good, please update the engine.rb to new foreman version, and fix CI failures

I updated the engine.rb file. Is it Ok to squash commits now to fix CI?

@Lukshio

Lukshio commented Jun 12, 2026

Copy link
Copy Markdown

I updated the engine.rb file. Is it Ok to squash commits now to fix CI?

@tlabaj Redmine is OK, but linter erros has be fixed.

@ofedoren

Copy link
Copy Markdown
Member

If it's going to be merged after linter fix, please squash before or on merge.

@ofedoren

Copy link
Copy Markdown
Member

Not a blocker, but a question: I've seen Foreman core already has a LineChart component (https://github.com/theforeman/foreman/blob/develop/webpack/assets/javascripts/react_app/components/common/charts/LineChart/index.js#L19), but this PR adds another one specifically for openscap. Why's that? Wouldn't it be better to migrate the core's one to PF5 and then re-use it here?..

@MariaAga

Copy link
Copy Markdown
Member

@ofedoren We prefer using PF directly and through wrappers, and matching each component use to the format of data it receives. From what I saw, trying to create wrappers that will match different types of needs and data, resulted in complicated code to re-use, read and update. (disclaimer: I did a quick look at the code only).
And we will be deprecating the foreman core line chart

@pnovotny

Copy link
Copy Markdown

QA-wise LGTM.
PR has been verified on top of Satellite stream snap. 194.

Results
Before:
compliance-hosts-before

After:
compliance-hosts-after

One small nitpick (non-blocking): while using float for the Y-axis is fine-ish (WRT scaling and such), using it in the tooltip with Passed/Failed/Othered rules looks a bit strange, as a rule is non-divisible.

@Lukshio

Lukshio commented Jun 29, 2026

Copy link
Copy Markdown

@tlabaj could you please change the float numbers?

@pnovotny

Copy link
Copy Markdown

Re-verified with the latest PackIt build. The float numbers are fixed. Everything else looks also fine 👍

line-chart-float-fixed

@Lukshio Lukshio left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

dev ack

@Lukshio Lukshio merged commit a276f0b into theforeman:master Jun 29, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants