Skip to content

Conversation

gjulivan
Copy link
Collaborator

Pull request type


Description

@gjulivan gjulivan requested a review from a team as a code owner May 22, 2025 11:19
@gjulivan gjulivan force-pushed the chart-backport-9-24 branch from 41ef887 to eb27151 Compare May 23, 2025 07:45
@gjulivan gjulivan changed the title [WC-2921] backport to 9.24 [WC-2921] backport charts to 9.24 May 23, 2025
@gjulivan gjulivan force-pushed the chart-backport-9-24 branch from eb27151 to a06e612 Compare May 26, 2025 17:52
@gjulivan gjulivan force-pushed the chart-backport-9-24 branch 4 times, most recently from c99cb3c to 35acb82 Compare June 3, 2025 20:54
@github-actions github-actions bot added the shared label Jun 3, 2025
@gjulivan gjulivan force-pushed the chart-backport-9-24 branch 3 times, most recently from 15771b6 to 74bd68b Compare June 5, 2025 07:21
@gjulivan gjulivan changed the title [WC-2921] backport charts to 9.24 [LTS] Charts to 9.24 Jun 5, 2025
@gjulivan gjulivan force-pushed the chart-backport-9-24 branch from 74bd68b to 5ac6dd8 Compare June 6, 2025 13:51
@Copilot Copilot AI review requested due to automatic review settings September 21, 2025 19:27
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request backports charts functionality from a newer version to make it compatible with Mendix 9.24. The changes include version downgrades, minimum version requirement updates, feature removals, and bug fixes to ensure compatibility with the target Mendix runtime.

Key changes include:

  • Version downgrades across all chart packages to align with LTS requirements
  • Removal of selection functionality from pie charts to maintain 9.24 compatibility
  • Enhanced error handling for chart click events and heatmap interactions
  • Improved data parsing and merging logic in custom charts

Reviewed Changes

Copilot reviewed 48 out of 51 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/shared/charts/src/helpers/useEditorStore.ts Reorders imports and changes data initialization from fallback pattern to JSON.stringify
packages/shared/charts/src/components/types.ts Adds PlotDatum import and extends interface with z property, updates onClick signature
packages/shared/charts/src/components/ChartView.tsx Adds try-catch error handling for chart click events with fallback behavior
packages/shared/charts/package.json Downgrades version from 2.2.0 to 2.1.1
packages/pluggableWidgets/pie-doughnut-chart-web/src/hooks/data.ts Removes seriesItemSelection functionality from pie chart data hooks
packages/pluggableWidgets/pie-doughnut-chart-web/src/PieChart.xml Removes seriesItemSelection property configuration from XML schema
packages/pluggableWidgets/pie-doughnut-chart-web/src/PieChart.tsx Removes seriesItemSelection parameter from component props
packages/pluggableWidgets/heatmap-chart-web/src/hooks/data.ts Adds comprehensive click handling with object mapping and data lookup for heatmaps
packages/pluggableWidgets/heatmap-chart-web/src/HeatMap.xml Adds dataSource attribute to onClickAction property
packages/pluggableWidgets/custom-chart-web/src/utils/utils.ts Refactors parsing functions and adds mergeChartProps utility with improved error handling
packages/pluggableWidgets/custom-chart-web/src/controllers/ChartPropsController.ts Simplifies chart props merging logic and fixes event data attribute handling
packages/pluggableWidgets/custom-chart-web/src/hooks/useCustomChart.ts Removes event data attribute useEffect handler
Multiple package.json and CHANGELOG.md files Consistent version downgrades and minimum Mendix version updates across all chart widgets
Multiple package.xml files Updates widget version numbers to match package.json changes
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

layout: pprint(fallback("")),
config: pprint(fallback("")),
data: data.map(trace => pprint(fallback(trace.name)))
data: data.map(trace => pprint(JSON.stringify(trace)))
Copy link
Preview

Copilot AI Sep 21, 2025

Choose a reason for hiding this comment

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

The data mapping logic has changed from using fallback(trace.name) to JSON.stringify(trace). This could break functionality if the trace object contains circular references or non-serializable data, and loses the fallback behavior for trace names. Consider preserving the original fallback logic or adding proper error handling for JSON.stringify.

Suggested change
data: data.map(trace => pprint(JSON.stringify(trace)))
data: data.map(trace => pprint(fallback(trace.name)))

Copilot uses AI. Check for mistakes.

const item = dataSourceItems[itemIndex];
onClick?.(item);
} catch (_e: any) {
// let the chart handle it's own onClick
Copy link
Preview

Copilot AI Sep 21, 2025

Choose a reason for hiding this comment

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

Grammatical error in comment: 'it's' should be 'its' (possessive form, not contraction).

Suggested change
// let the chart handle it's own onClick
// let the chart handle its own onClick

Copilot uses AI. Check for mistakes.

(item: ObjectItem, data: PlotDatum) => {
let selectedObjectItem: ObjectItem | undefined = item;
if (selectedObjectItem === null || selectedObjectItem === undefined) {
const selectedLocalHeatmapData = heatmapChartData.values().find(heatMapPointData => {
Copy link
Preview

Copilot AI Sep 21, 2025

Choose a reason for hiding this comment

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

Calling .values() on an array is incorrect. Arrays don't have a .values() method that returns an array to chain .find() on. This should be just heatmapChartData.find() since heatmapChartData is already an array.

Suggested change
const selectedLocalHeatmapData = heatmapChartData.values().find(heatMapPointData => {
const selectedLocalHeatmapData = heatmapChartData.find(heatMapPointData => {

Copilot uses AI. Check for mistakes.


## [6.1.0] - 2025-06-04

## # Breaking
Copy link
Preview

Copilot AI Sep 21, 2025

Choose a reason for hiding this comment

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

Invalid markdown header format. Should be ### Breaking or ## Breaking instead of ## # Breaking.

Suggested change
## # Breaking
### Breaking

Copilot uses AI. Check for mistakes.

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.

4 participants