fix(dashboards): opt widgets out of global filters their object lacks (2.2.1)#458
Merged
Merged
Conversation
… (2.2.1) 2.2.0 fixed only the built-in `dateRange` picker, but ObjectStack 15 (framework#2501) injects EVERY dashboard filter — dateRange AND every globalFilters[] entry — into each widget's analytics query. Widgets on objects without the filtered column still crashed with `SqliteError: no such column: <field>` and rendered as error cards. - Executive `Lead Source` filter: crm_account has no `lead_source`, so total_accounts / new_accounts_by_month / accounts_by_industry threw `no such column: lead_source`. Add `lead_source: false` to their filterBindings (contact/lead keep filtering — they have the field). - CRM `Owner` filter: crm_product has no `owner`, so top_products would crash the same way. Add `owner: false` to its filterBindings. - Audited the full filter×object matrix: Sales (all opportunity_metrics) and Service (created_date/owner/priority all on crm_case) need nothing. Browser-verified by actually SELECTING the filter values (Lead Source = Web): account widgets stay populated, contact/lead filter correctly, zero analytics errors in the server log. verify (validate/build/test 17/17) green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Follow-up patch (2.2.1) to #457. The 2.2.0 dashboard fix only covered the built-in
dateRangepicker, but ObjectStack 15 (framework#2501) injects every dashboard filter —dateRangeand eachglobalFilters[]entry — into every widget's analytics query. Widgets on objects that lack the filtered column still crashed withSqliteError: no such column: <field>and rendered as error cards.Reported: on the Executive dashboard, selecting the Lead Source filter errored out most charts.
Fix
Lead Source—crm_accounthas nolead_source, sototal_accounts/new_accounts_by_month/accounts_by_industrythrewno such column: lead_source. Addedlead_source: falseto theirfilterBindings.crm_contact/crm_leaddo havelead_source, sototal_contacts/open_leadskeep filtering correctly.Owner—crm_producthas noowner, sotop_productswould crash the same way. Addedowner: falseto itsfilterBindings.opportunity_metrics) and Service (created_date/owner/priorityall exist oncrm_case) needed no change.Verification
Browser-verified by actually selecting the filter value (
Lead Source = Web), not just loading the page:lead_source); Contacts/Leads filter correctly; revenue widgets show empty results (no web-sourced closed-won this quarter) — zerono such column/ analytics errors in the server log.verify(validate + typecheck + build + vitest 17/17) green.Follow-up
The upstream platform issue for shifting this class of check to build time is objectstack-ai/objectstack#3365 (validate dashboard filter field-existence).
🤖 Generated with Claude Code