Add option to hide GLQL panel actions dropdown

What does this MR do and why?

GLQL panels on analytics dashboards always showed a kebab actions dropdown (View source, Copy source, Copy contents, Reload) in the panel header, with no way to turn it off. GlDashboardPanel in @gitlab/ui only renders that dropdown when a panel has at least one action, and analytics_dashboard_panel.vue starts each panel with an empty actions list that only the visualization's set-actions event fills in. glql.vue emitted set-actions unconditionally, so every GLQL panel got the dropdown regardless of its display type, while native visualization types such as BarChart, which never emit set-actions, have never shown one.

This adds a showActions boolean to the shared Options definition in ee/app/validators/json_schemas/analytics_visualization.json, and glql.vue now emits an empty action list when options.showActions is false. The option lives on the shared Options schema, the same place existing type-specific keys such as stacked, unit, and refetchOnSort already sit, because that definition is shared across all visualization types. glql.vue also declares an options prop for the first time: analytics_dashboard_panel.vue already passed :options down, but the prop was undeclared, so it landed in $attrs and was discarded. An absent showActions, or showActions: true, leaves today's behaviour unchanged.

Opting out suppresses the dropdown even in the panel's error state, rather than keeping a Reload action there, so a panel that asked to hide its actions does not have them reappear the moment it breaks. glql.vue still emits set-alerts on a resolver error, so the panel still gets its alert border and error popover. The canRetry key in that payload used to be hardcoded to false, since the kebab's Reload was the only recovery path. With actions hidden that assumption breaks, so the error branch now sets canRetry to the negation of showActions: an opted-out panel gets a Retry button in the popover, while a default panel keeps canRetry: false and still relies on the kebab's Reload.

No shipped dashboard sets showActions in this MR, so there is no user-visible change yet. Adding it to a panel, for example the stat row on the DAP Impact dashboard at ee/lib/gitlab/analytics/dashboards/system/dap_impact.yaml, is a separate change.

References

There is no issue associated with this change yet.

Screenshots or screen recordings

The I haven't included a yaml file update in this MR, will handle ti separately, but here's what it will look like.

Before After
Screenshot_2026-09-02_at_19.26.58 Screenshot_2026-09-02_at_19.31.14

How to set up and validate locally

  1. In ee/lib/gitlab/analytics/dashboards/system/dap_impact.yaml, find the "Active projects (WIP)" panel and change its visualization.options from {} to { showActions: false }.
  2. Restart Rails so the system dashboard loader picks up the YAML change, since it memoises the parsed dashboards:
    gdk restart rails-web
  3. Visit /explore/analytics_dashboards/dap_impact and confirm the "Active projects (WIP)" panel no longer shows a kebab menu, while the other panels on the dashboard still show theirs.

Tests

  • spec/frontend/analytics/analytics_dashboards/components/visualizations/glql_spec.js adds cases under the existing panel actions describe: no actions are emitted once the resolver returns results with showActions: false; no actions are emitted when the resolver reports an error with showActions: false; the resolver error still forwards a full set-alerts payload including canRetry: true when opted out; and the base action set is still emitted with an explicit showActions: true.
  • ee/spec/models/analytics/dashboards/visualization_spec.rb adds a showActions option validation describe confirming the schema accepts a boolean and rejects a string with property '/options/showActions' is not of type: boolean.

Verification

  • node_modules/.bin/jest --config jest.config.js spec/frontend/analytics/analytics_dashboards/components/visualizations/glql_spec.js: 27 tests, all passing.
  • bundle exec rspec ee/spec/models/analytics/dashboards/visualization_spec.rb -e "showActions option validation": 2 examples, 0 failures.
  • bundle exec rubocop on the changed spec: no offences.
  • ESLint and Prettier on the changed JS and Vue files: clean.
  • Mutation check: removing the guard so set-actions is emitted unconditionally again fails the 2 new opt-out tests, and restoring the hardcoded canRetry: false fails the opted-out error test, confirming they guard the change rather than passing trivially.
  • Wider run: jest spec/frontend/analytics/analytics_dashboards ee/spec/frontend/analytics/analytics_dashboards passes 755 tests. 5 suites in that path fail to load locally for an unrelated reason: missing GraphQL test fixtures (bin/rake frontend:fixtures has not been run in this checkout). Those suites are data source specs that do not import the changed component.
  • No manual browser check was run.

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.

Edited by Brandon Labuschagne

Merge request reports

Loading
Loading