-
Notifications
You must be signed in to change notification settings - Fork 41
Restrict dashEnableCharts to Enterprise AG Charts loading, auto-enable enableCharts, and support AG Charts license key
#448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Copilot
wants to merge
17
commits into
v35
Choose a base branch
from
copilot/fix-ag-charts-in-33-3-3
base: v35
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
16afc80
Initial plan
Copilot e2c504b
fix: add lazy AG Charts module loading via dashEnableCharts
Copilot a1b9097
chore: address review feedback for chart module registration
Copilot 94d9b82
fix: restrict dashEnableCharts loading to enterprise grids only
Copilot 59ee922
fix: auto-enable enableCharts when dashEnableCharts is set
Copilot 2c07239
fix: auto-enable charts and guard conflicting enableCharts=false
Copilot 01d7df9
adjustments for community default
BSd3v b361cef
fix for lint
BSd3v 2326ff5
fix: add AG Charts enterprise license key support
Copilot 10f59b6
adjustments to only have `dashEnableCharts` be community or enterprise
BSd3v 5180197
Merge branch 'v35' into copilot/fix-ag-charts-in-33-3-3
BSd3v d477ea6
adding changelog entry
BSd3v f3f5255
fix: handle null dashGridOptions in chart guard logic
Copilot cecca00
revert: undo null normalization in dashGridOptions handling
Copilot 9c23036
Merge branch 'v35' into copilot/fix-ag-charts-in-33-3-3
BSd3v 3587408
updates for tests loading the modules
BSd3v 7040eb6
fixing issue with dashGridOptions not existing
BSd3v File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| import dash_ag_grid as dag | ||
| from dash import Dash, html | ||
| from . import utils | ||
| from dash.testing.wait import until | ||
|
|
||
|
|
||
| def _make_chart_grid(**extra_props): | ||
| return [ | ||
| html.Div(id='loaded', children='true'), | ||
| dag.AgGrid( | ||
| id="grid", | ||
| columnDefs=[{"field": "make"}, {"field": "model"}, {"field": "price"}], | ||
| rowData=[ | ||
| {"make": "Toyota", "model": "Celica", "price": 35000}, | ||
| {"make": "Ford", "model": "Mondeo", "price": 32000}, | ||
| {"make": "Porsche", "model": "Boxster", "price": 72000}, | ||
| ], | ||
| **extra_props, | ||
| ) | ||
| ] | ||
|
|
||
|
|
||
| def _make_basic_grid(**extra_props): | ||
| return [ | ||
| html.Div(id='loaded', children='true'), | ||
| dag.AgGrid( | ||
| id="grid", | ||
| columnDefs=[{"field": "make"}, {"field": "model"}, {"field": "price"}], | ||
| rowData=[ | ||
| {"make": "Toyota", "model": "Celica", "price": 35000}, | ||
| {"make": "Ford", "model": "Mondeo", "price": 32000}, | ||
| {"make": "Porsche", "model": "Boxster", "price": 72000}, | ||
| ], | ||
| **extra_props, | ||
| ) | ||
| ] | ||
|
|
||
|
|
||
| def test_charts001_enables_enterprise_charts_modules_with_true(dash_duo): | ||
| app = Dash(__name__) | ||
| app.layout = html.Div( | ||
| _make_chart_grid(enableEnterpriseModules=True, dashEnableCharts='community') | ||
| ) | ||
|
|
||
| dash_duo.start_server(app) | ||
|
|
||
| grid = utils.Grid(dash_duo, "grid") | ||
| grid.wait_for_cell_text(0, 0, "Toyota") | ||
|
|
||
| assert not any( | ||
| "AG Grid: error #200" in entry.get("message", "") | ||
| for entry in dash_duo.get_logs() | ||
| ) | ||
|
|
||
|
|
||
| def test_charts002_enables_enterprise_charts_modules(dash_duo): | ||
| app = Dash(__name__) | ||
| app.layout = html.Div( | ||
| _make_chart_grid( | ||
| enableEnterpriseModules=True, | ||
| dashEnableCharts="enterprise", | ||
| ) | ||
| ) | ||
|
|
||
| dash_duo.start_server(app) | ||
|
|
||
| grid = utils.Grid(dash_duo, "grid") | ||
| grid.wait_for_cell_text(0, 0, "Toyota") | ||
|
|
||
| assert not any( | ||
| "AG Grid: error #200" in entry.get("message", "") | ||
| for entry in dash_duo.get_logs() | ||
| ) | ||
|
|
||
|
|
||
| def test_charts003_keeps_enterprise_grid_without_charts(dash_duo): | ||
| app = Dash(__name__) | ||
| app.layout = html.Div(_make_basic_grid(enableEnterpriseModules=True)) | ||
|
|
||
| dash_duo.start_server(app) | ||
|
|
||
| grid = utils.Grid(dash_duo, "grid") | ||
| grid.wait_for_cell_text(0, 0, "Toyota") | ||
|
|
||
|
|
||
| def test_charts004_rejects_charts_on_community_grid(dash_duo): | ||
| app = Dash(__name__) | ||
| app.layout = html.Div(_make_chart_grid(dashEnableCharts='community')) | ||
|
|
||
| dash_duo.start_server(app) | ||
| until(lambda: dash_duo.find_element('#loaded').text == 'true', 10) | ||
|
|
||
| assert any( | ||
| "dashEnableCharts is only supported when enableEnterpriseModules is true." | ||
| in entry.get("message", "") | ||
| for entry in dash_duo.get_logs() | ||
| ) | ||
|
|
||
|
|
||
| def test_charts005_rejects_enablecharts_without_dashenablecharts(dash_duo): | ||
| app = Dash(__name__) | ||
| app.layout = html.Div( | ||
| _make_chart_grid(dashGridOptions={"enableCharts": True}) | ||
| ) | ||
|
|
||
| dash_duo.start_server(app) | ||
| until(lambda: dash_duo.find_element('#loaded').text == 'true', 10) | ||
|
|
||
| assert any( | ||
| "enableCharts is set, but chart modules are not loaded." | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This error message is not very helpful. Shouldn't it be something like: |
||
| in entry.get("message", "") | ||
| for entry in dash_duo.get_logs() | ||
| ) | ||
|
|
||
|
|
||
| def test_charts006_rejects_conflicting_enablecharts_false(dash_duo): | ||
| app = Dash(__name__) | ||
| app.layout = html.Div( | ||
| _make_chart_grid( | ||
| enableEnterpriseModules=True, | ||
| dashEnableCharts='community', | ||
| dashGridOptions={"enableCharts": False}, | ||
| ) | ||
| ) | ||
|
|
||
| dash_duo.start_server(app) | ||
| until(lambda: dash_duo.find_element('#loaded').text == 'true', 10) | ||
|
|
||
| assert any( | ||
| "dashEnableCharts cannot be combined with dashGridOptions.enableCharts=false." | ||
| in entry.get("message", "") | ||
| for entry in dash_duo.get_logs() | ||
| ) | ||
|
|
||
|
|
||
| def test_charts007_accepts_charts_license_key_prop(dash_duo): | ||
| app = Dash(__name__) | ||
| app.layout = html.Div( | ||
| _make_chart_grid( | ||
| enableEnterpriseModules=True, | ||
| dashEnableCharts="enterprise", | ||
| licenseKey="grid-key", | ||
| chartsLicenseKey="charts-key", | ||
| ) | ||
| ) | ||
|
|
||
| dash_duo.start_server(app) | ||
|
|
||
| grid = utils.Grid(dash_duo, "grid") | ||
| grid.wait_for_cell_text(0, 0, "Toyota") | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this prop type doesn't make sense if it can actually be a boolean as well. How about:
Should there be a default set as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can't be. The string just wasn't updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about renaming
dashEnableChartsto something likechartMode. It's confusing to have bothenableChartsanddashEnableCharts