Incident timeline - remove autofocus directive and add input check
What does this MR do and why?
While working on !95983 (merged) I noticed a couple of minor issues in the code. This MR fixes those.
- Removes an unneeded directive from the component. The directive was originally used for autofocus on form opening, but later was replaced with a manual focus call without being fully cleaned up.
- Adds a check for a dom node before attempting to focus on it. This allows the parent component to be shallow-mounted / stubbed in test without throwing a JS error.
Screenshots or screen recordings
No visual changes.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Navigate to Monitor -> Incidents.
- Create a new incident.
- Select the timeline tab.
- Select 'Add new timeline event'.
- Ensure the date field is still autofocused, as expected.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Tristan Read