Skip to content

site admin: Add search functionality to pings JSON view

Administrator requested to merge fkling/cm-pings-search into main

Created by: fkling

This adds search functionality to the JSON view, which was built into Monaco, but has to be enabled separately with CodeMirror.

This requires EditorState.readOnly.of(true) instead of EditorView.editable.of(false) so that the editor is focusable and Meta+f can enable the search feature.

2022-08-05_12-49

Note: the UI of the search input doesn't match the rest of the page, but that was already the case with Monaco, so it should be fine. Since CodeMirror allows us to render our own search input we could consider doing that in the future.

Test plan

Go to https://sourcegraph.test:3443/site-admin/pings, focus editor and press Meta+f.

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading