diff --git a/CHANGELOG.md b/CHANGELOG.md index be71bec0..0a2b435f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to `dash-ag-grid` will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/). Links "DE#nnn" prior to version 2.0 point to the Dash Enterprise closed-source Dash AG Grid repo -## [31.3.1rc1] - 2025-02-10 +## [31.3.1] - 2025-03-17 ### Fixed - [#346](https://github.com/plotly/dash-ag-grid/pull/346) Fixes issue [#347](https://github.com/plotly/dash-ag-grid/issues/347) where styling wasnt considering if the grid had rows without `data`. This is related to the alteration in [#332](https://github.com/plotly/dash-ag-grid/pull/332) @@ -13,6 +13,9 @@ Links "DE#nnn" prior to version 2.0 point to the Dash Enterprise closed-source D ### Added - [#352](https://github.com/plotly/dash-ag-grid/pull/352) Adds `eventData` prop for devs to send arbitrary events from the grid events complete with an auto timestamp +### Changed +- [#362](https://github.com/plotly/dash-ag-grid/pull/362) bumping to v`31.3.4` for the grid + ## [31.3.0] - 2024-11-22 ### Fixed diff --git a/package-lock.json b/package-lock.json index b3eb5e26..454b649a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,21 +1,21 @@ { "name": "dash-ag-grid", - "version": "31.3.1rc1", + "version": "31.3.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "dash-ag-grid", - "version": "31.3.1rc1", + "version": "31.3.1", "license": "MIT", "dependencies": { "@emotion/react": "^11.11.3", "@emotion/styled": "^11.11.0", "@mui/icons-material": "^5.15.7", "@mui/material": "^5.15.7", - "ag-grid-community": "31.3.2", - "ag-grid-enterprise": "31.3.2", - "ag-grid-react": "31.3.2", + "ag-grid-community": "31.3.4", + "ag-grid-enterprise": "31.3.4", + "ag-grid-react": "31.3.4", "d3-format": "^3.1.0", "d3-time": "^3.1.0", "d3-time-format": "^4.1.0", @@ -3414,30 +3414,34 @@ } }, "node_modules/ag-charts-community": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/ag-charts-community/-/ag-charts-community-9.3.1.tgz", - "integrity": "sha512-/+dTQXSHbOwmynsKA32b5MmkwYM53sYuRkrL8ZPjTdwnR0uLKhSOrwMryx8U/HqN7YkprmQKtoiLNKU9MQ3hvw==" + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/ag-charts-community/-/ag-charts-community-9.3.2.tgz", + "integrity": "sha512-jw2llxTYzGAZ24m7eQsKS24BnJBhspZKsL03DbqH0wxLepbEcC3eeWICe+02TBQCbFVsWmSsYukjzQg3FkVWRw==", + "license": "MIT" }, "node_modules/ag-grid-community": { - "version": "31.3.2", - "resolved": "https://registry.npmjs.org/ag-grid-community/-/ag-grid-community-31.3.2.tgz", - "integrity": "sha512-GxqFRD0OcjaVRE1gwLgoP0oERNPH8Lk8wKJ1txulsxysEQ5dZWHhiIoXXSiHjvOCVMkK/F5qzY6HNrn6VeDMTQ==" + "version": "31.3.4", + "resolved": "https://registry.npmjs.org/ag-grid-community/-/ag-grid-community-31.3.4.tgz", + "integrity": "sha512-jOxQO86C6eLnk1GdP24HB6aqaouFzMWizgfUwNY5MnetiWzz9ZaAmOGSnW/XBvdjXvC5Fpk3gSbvVKKQ7h9kBw==", + "license": "MIT" }, "node_modules/ag-grid-enterprise": { - "version": "31.3.2", - "resolved": "https://registry.npmjs.org/ag-grid-enterprise/-/ag-grid-enterprise-31.3.2.tgz", - "integrity": "sha512-82p7ZQEiLOennoQ3PsPOsh0rI9p6eLKaV/yiD/BQb5rifVQE91N4bi2cFDwL283RWJrbOb7ZuGVdjr5OW5FEuA==", + "version": "31.3.4", + "resolved": "https://registry.npmjs.org/ag-grid-enterprise/-/ag-grid-enterprise-31.3.4.tgz", + "integrity": "sha512-kreGRsFjz41APXXchLcQFtginnrmIGQYH48p7ydz33x8v+aja06HS5yEM6NP8j+VVHX43LeXnsl5Y4TLRgSoeg==", + "license": "Commercial", "dependencies": { - "ag-charts-community": "9.3.1", - "ag-grid-community": "31.3.2" + "ag-charts-community": "9.3.2", + "ag-grid-community": "31.3.4" } }, "node_modules/ag-grid-react": { - "version": "31.3.2", - "resolved": "https://registry.npmjs.org/ag-grid-react/-/ag-grid-react-31.3.2.tgz", - "integrity": "sha512-SFHN05bsXp901rIT00Fa6iQLCtyavoJiKaXEDUtAU5LMu+GTkjs/FPQBQ8754omgdDFr4NsS3Ri6QbqBne3rug==", + "version": "31.3.4", + "resolved": "https://registry.npmjs.org/ag-grid-react/-/ag-grid-react-31.3.4.tgz", + "integrity": "sha512-WmPASHRFGSTxCMRStWG5bRtln0Ugsdqbb3+Y8sEyGHeLw4hXqfpqie3lT9kqCOl7wPWUjCpwmFdXzRnWPmyyeg==", + "license": "MIT", "dependencies": { - "ag-grid-community": "31.3.2", + "ag-grid-community": "31.3.4", "prop-types": "^15.8.1" }, "peerDependencies": { @@ -14698,30 +14702,30 @@ "requires": {} }, "ag-charts-community": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/ag-charts-community/-/ag-charts-community-9.3.1.tgz", - "integrity": "sha512-/+dTQXSHbOwmynsKA32b5MmkwYM53sYuRkrL8ZPjTdwnR0uLKhSOrwMryx8U/HqN7YkprmQKtoiLNKU9MQ3hvw==" + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/ag-charts-community/-/ag-charts-community-9.3.2.tgz", + "integrity": "sha512-jw2llxTYzGAZ24m7eQsKS24BnJBhspZKsL03DbqH0wxLepbEcC3eeWICe+02TBQCbFVsWmSsYukjzQg3FkVWRw==" }, "ag-grid-community": { - "version": "31.3.2", - "resolved": "https://registry.npmjs.org/ag-grid-community/-/ag-grid-community-31.3.2.tgz", - "integrity": "sha512-GxqFRD0OcjaVRE1gwLgoP0oERNPH8Lk8wKJ1txulsxysEQ5dZWHhiIoXXSiHjvOCVMkK/F5qzY6HNrn6VeDMTQ==" + "version": "31.3.4", + "resolved": "https://registry.npmjs.org/ag-grid-community/-/ag-grid-community-31.3.4.tgz", + "integrity": "sha512-jOxQO86C6eLnk1GdP24HB6aqaouFzMWizgfUwNY5MnetiWzz9ZaAmOGSnW/XBvdjXvC5Fpk3gSbvVKKQ7h9kBw==" }, "ag-grid-enterprise": { - "version": "31.3.2", - "resolved": "https://registry.npmjs.org/ag-grid-enterprise/-/ag-grid-enterprise-31.3.2.tgz", - "integrity": "sha512-82p7ZQEiLOennoQ3PsPOsh0rI9p6eLKaV/yiD/BQb5rifVQE91N4bi2cFDwL283RWJrbOb7ZuGVdjr5OW5FEuA==", + "version": "31.3.4", + "resolved": "https://registry.npmjs.org/ag-grid-enterprise/-/ag-grid-enterprise-31.3.4.tgz", + "integrity": "sha512-kreGRsFjz41APXXchLcQFtginnrmIGQYH48p7ydz33x8v+aja06HS5yEM6NP8j+VVHX43LeXnsl5Y4TLRgSoeg==", "requires": { - "ag-charts-community": "9.3.1", - "ag-grid-community": "31.3.2" + "ag-charts-community": "9.3.2", + "ag-grid-community": "31.3.4" } }, "ag-grid-react": { - "version": "31.3.2", - "resolved": "https://registry.npmjs.org/ag-grid-react/-/ag-grid-react-31.3.2.tgz", - "integrity": "sha512-SFHN05bsXp901rIT00Fa6iQLCtyavoJiKaXEDUtAU5LMu+GTkjs/FPQBQ8754omgdDFr4NsS3Ri6QbqBne3rug==", + "version": "31.3.4", + "resolved": "https://registry.npmjs.org/ag-grid-react/-/ag-grid-react-31.3.4.tgz", + "integrity": "sha512-WmPASHRFGSTxCMRStWG5bRtln0Ugsdqbb3+Y8sEyGHeLw4hXqfpqie3lT9kqCOl7wPWUjCpwmFdXzRnWPmyyeg==", "requires": { - "ag-grid-community": "31.3.2", + "ag-grid-community": "31.3.4", "prop-types": "^15.8.1" } }, diff --git a/package.json b/package.json index 28c09f9d..b4af6a8e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dash-ag-grid", - "version": "31.3.1rc1", + "version": "31.3.1", "description": "Dash wrapper around AG Grid, the best interactive data grid for the web.", "repository": { "type": "git", @@ -33,9 +33,9 @@ "dependencies": { "@emotion/react": "^11.11.3", "@emotion/styled": "^11.11.0", - "ag-grid-community": "31.3.2", - "ag-grid-enterprise": "31.3.2", - "ag-grid-react": "31.3.2", + "ag-grid-community": "31.3.4", + "ag-grid-enterprise": "31.3.4", + "ag-grid-react": "31.3.4", "@mui/icons-material": "^5.15.7", "@mui/material": "^5.15.7", "d3-format": "^3.1.0", diff --git a/src/lib/fragments/AgGrid.react.js b/src/lib/fragments/AgGrid.react.js index fa4931d0..4762646e 100644 --- a/src/lib/fragments/AgGrid.react.js +++ b/src/lib/fragments/AgGrid.react.js @@ -782,7 +782,10 @@ export default class DashAgGrid extends Component { // Call the API to select rows unless the update was triggered by a selection made in the UI if ( !equals(selectedRows, prevProps.selectedRows) && - !(loading_state && this.selectionEventFired) + // eslint-disable-next-line no-undefined + !(typeof loading_state !== 'undefined' + ? loading_state && this.selectionEventFired + : this.selectionEventFired) ) { if (!this.dataUpdates) { setTimeout(() => { @@ -899,10 +902,12 @@ export default class DashAgGrid extends Component { onSelectionChanged() { setTimeout(() => { if (!this.pauseSelections) { - // Flag that the selection event was fired - this.selectionEventFired = true; const selectedRows = this.state.gridApi.getSelectedRows(); - this.customSetProps({selectedRows}); + if (!equals(selectedRows, this.props.selectedRows)) { + // Flag that the selection event was fired + this.selectionEventFired = true; + this.customSetProps({selectedRows}); + } } }, 1); } diff --git a/tests/test_event_listeners.py b/tests/test_event_listeners.py index 867834ad..74634fc8 100644 --- a/tests/test_event_listeners.py +++ b/tests/test_event_listeners.py @@ -52,15 +52,13 @@ def test_el001_event_listener(dash_duo): # Test left click. grid.get_cell(1, 2).click() - cellClicked = dash_duo.find_element('#log').text - assert json.loads(cellClicked).get('value') == 15 + until(lambda: json.loads(dash_duo.find_element('#log').text).get('value') == 15, timeout=3) # Test right click action = utils.ActionChains(dash_duo.driver) action.context_click(grid.get_cell(0, 2)).perform() - cellClicked = dash_duo.find_element('#log').text - assert json.loads(cellClicked).get('value') == 13 - assert json.loads(cellClicked).get('contextMenu') + until(lambda: json.loads(dash_duo.find_element('#log').text).get('value') == 13, timeout=3) + until(lambda: json.loads(dash_duo.find_element('#log').text).get('contextMenu'), timeout=3) def test_el002_event_listener(dash_duo): app = Dash(__name__, suppress_callback_exceptions=True) @@ -86,7 +84,7 @@ def test_el002_event_listener(dash_duo): # Test left click. grid.get_cell(1, 2).click() - assert dash_duo.find_element('#log').text == "rawr" + until(lambda: dash_duo.find_element('#log').text == "rawr", timeout=3) def test_el003_event_listener(dash_duo): app = Dash(__name__, suppress_callback_exceptions=True)