Skip to content

Add routing to incident tabs

James Rushford requested to merge add-routing-to-incident-tabs into master

What does this MR do and why?

_Describe in detail what your merge request does and why.

Adds a client-side router to incidents, to allow linking directly to a specific tab in the url.

Requires !108671 (merged) to be merged first so that tests can make use of spec/support/shared_examples/features/incident_details_routing_shared_examples.rb

Backend Changes:

  • Pass Current Incident tab to Incidents
  • Pass Current URL to Incident so it can be used as base url for frontend router

Frontend Changes:

  • Create Vue router in Incidents
  • Update URL when switching tabs
  • Render tab according to URL params on load
  • In addition, this MR also makes use of hasLinkedAlerts within incident tabs to determine if alerts are present rather than requiring an apollo query to determine if tab should be present.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Screen_Recording_2023-01-24_at_12.29.36

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Ensure you are running enterprise edition
  2. Go to a project's settings, then Monitor
  3. Expand Alerts
  4. Add a new integration, HTTP endpoint is fine, give a mock name, in customise alert you can paste { "events": [{ "application": "Name of application" }] }
  5. Click "save and create test alert
  6. Navigate to Monitor -> Alerts
  7. Open the new test alert 7.a (If it isn't there, you can navigate back to integration settings, open the settings for the new integration, go to the tab called "send test alert" and paste this { "events": [{ "application": "Name of application" }] } and send
  8. in the Alert click "create incident on the top right of the alert page
  9. Within incident page, navigate to tabs and observe URL changes
  10. Make sure to visit the issues list and view the created incident as an issue

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

issue: #367856

Edited by James Rushford

Merge request reports