Fix panel tooltip descriptionLink field mapping and schema validation

What does this MR do and why?

Fixes descriptionLink field hash key mismatch in CustomizableDashboardPanelTooltip and adds missing required field in conditional schema validation.

GitLab Duo generated summary

This change improves the analytics dashboard tooltip feature by adding better validation and testing. The main updates include:

  1. Enhanced validation rules: The system now properly validates that when a tooltip description contains link placeholders (%{linkStart} and %{linkEnd}), it must also include a corresponding link URL descriptionLink field.
  2. Improved GraphQL API: Added a new field mapping (hash_key) to make the tooltip link data accessible through the API.
  3. Better error handling: The validation now catches cases where someone tries to use link placeholders in tooltip text without providing an actual link, preventing broken tooltips from appearing.
  4. Comprehensive testing: Added new test cases that verify both valid tooltips (with proper links) and invalid ones (missing required link URLs), ensuring the validation works correctly.
  5. Test data updates: Updated example dashboard files to include proper tooltip examples that demonstrate both correct usage and invalid configurations.

The changes ensure that analytics dashboard tooltips with links work properly and provide clear error messages when configured incorrectly, making the feature more reliable for users creating custom dashboards.

References

How to set up and validate locally

bundle exec rspec ee/spec/requests/api/graphql/product_analytics/panels_spec.rb

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #550270 (closed)

Edited by Rudy Crespo

Merge request reports

Loading