Commit Graph

9 Commits

Author SHA1 Message Date
rusackas
39018c56ac fix(explore): url-encode dashboardPageId in generateExploreUrl
Addresses a GHAS DOM-text-as-HTML finding on DrillDetailModal.tsx
(window.location.href = url) and a related CWE-20 flag: the dashboard
page id was concatenated into the explore URL unencoded.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-26 09:04:08 -07:00
Maxime Beauchemin
d4d02c5104 refactor: Add generateExploreUrl utility to centralize URL generation
Simplifies repeated postFormData + mountExploreUrl + dashboard_page_id pattern
used across 6+ files by providing a clean, type-safe async utility.

Benefits:
- DrillDetailModal: 15 lines → 5 lines (67% reduction)
- Centralized URL generation logic for better maintainability
- Type-safe options parameter for chartId, tabId, dashboardPageId
- Comprehensive test coverage with 4 test scenarios
- Better error handling and promise chain management

Files refactored:
- DrillDetailModal: Simplified async URL generation
- DrillByModal: Clean promise chain with proper error handling
- SqlLab ResultSet: Modern async/await pattern
- Added comprehensive utility tests

All component tests passing 

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 21:24:42 -07:00
Gabriel Torres Ruiz
057218d87f feat: Add confirmation modal for unsaved changes (#33809) 2025-07-01 19:38:51 +03:00
Elizabeth Thompson
32bb1ce3ff feat!: pass datasource_type and datasource_id to form_data (#19981)
* pass datasource_type and datasource_id to form_data

* add datasource_type to delete command

* add datasource_type to delete command

* fix old keys implementation

* add more tests
2022-06-02 16:48:16 -07:00
Kamil Gabryjelski
9cdaa28042 Revert "feat(explore): Show confirmation modal if user exits Explore without saving changes (#19993)" (#20092)
This reverts commit ca9766c109.
2022-05-17 14:56:31 +02:00
Kamil Gabryjelski
ca9766c109 feat(explore): Show confirmation modal if user exits Explore without saving changes (#19993)
* feat(explore): Show confirmation modal if user exits Explore without saving changes

* Fix calling cleanup func unnecessarily

* Fix comparing AdhocMetric instance with JSON object

* Replace sliceFormData with the initial form data
2022-05-12 12:24:29 +02:00
Ville Brofeldt
bd63a1bd98 fix(chart): deprecate persisting url_params (#18960)
* fix(chart): deprecate peristing url_params

* remove duplicated backend logic

* use omitBy

* simplify omit
2022-03-02 07:44:36 +02:00
Michael S. Molina
48a80950de feat: Improve state key generation for dashboards and charts (#18576)
* feat: Improve state key generation for dashboards and charts
2022-02-14 17:09:06 -03:00
Michael S. Molina
4b61c76742 fix: Explore long URL problem (#18181)
* fix: Explore long URL problem

* Fixes lint problems

* Fixes default value

* Removes duplicated test

* Fixes share menu items

* Fixes tests

* Debounces form_data updates

* Rewrites debounce function

* Moves history update outside the functional component

* Mocks lodash function in tests

* Fixes Cypress test

* Fixes Cypress test #2
2022-01-28 17:42:16 -03:00