Skip to content

code monitoring: use monaco query input for trigger

Warren Gifford requested to merge jp/cmmonaco into main

Created by: limitedmage

Fixes #17320 (closed)

  • FormTriggerArea now uses MonacoQueryInput for the search query.
    • Some code needed to be reorganized to get the same look as before
    • isLIghtTheme and isSourcegraphDotCom had to be added as props because they are required by MonacoQueryInput. This added a bunch of prop drilling of these props through the code monitoring codebase.
  • The existing mock for window.matchMedia in hover.test.ts was moved to a place where it would always be executed by adding it to the Jes config. Monaco requires matchMedia but the version of Jest/JSDom we are using does not provide it.
  • The hack used to enable tabbing in Monaco needed a slight modification with setTimeout because it was not working with the hiding/reappearing MonacoQueryInput in the FromTriggerArea.
  • FormTriggerArea snapshot test was removed since the existing unit tests and storybook tests already provide that coverage from functional and visual standpoints.

Screenshot

image

Test plan

  • Manual testing different scenarios (create new monitor, edit existing monitor, continuously open and close the trigger area, etc)
  • Update unit tests to use Monaco query input (integration tests did not need updating)
  • Ensure all existing unit tests and integration tests pass
  • Ensure any

Merge request reports

Loading