Files
graylog2-server/graylog2-web-interface/docs/common-functionality.md
maxiadlovskii 868b639103 Implement foundation for keyboard shortcuts (#16396)
* Add hotkeys provider and usehotkeys hook

* refactoring

* Improving types.

* REmove not needed state in `HotkeysProvider`.

* Rename view scope to general.

* Categorize undo redo as search and dashboard hotkeys.

* Use mantine component to display keyboard keys in modal.

* Improve styling of hotkeys modal.

* Rename hotkeys to keyboard shortcuts in UI.

* Rename `hotKeysCollection` to `hotKeysCollections`.

* Adding documentation.

* Rename `useHotKeys` hook to `useHotkey`.

* Add feature flag for hotkeys functionality.

* Add telemetry for hotkeys, rename action keys to make sure we can use them as `app_action_value`.

* fix: show only enabled scopes in modal

* Make Option type explicit

* remove telemetryAppPathname

* remove scopes from options object

* Do not show browser dialog when saving view, when it is not dirty or loaded.

* Cleanup code

* Create container for hotkeys modal, to ensure we render related logic only when modal is visible.

* Alwyas allow triggering "save search as" action.

* Fixing test

* Adding test for `HotkeysContianerModal`.

* Adding further tests.

* Reimplement telemetry.

* Adding further test.

* Change registered hotkeys.

* Update feature flag description.

---------

Co-authored-by: Linus Pahl <linus@graylog.com>
Co-authored-by: Dennis Oelkers <dennis@graylog.com>
2023-09-27 15:17:37 +02:00

251 B

Setting up keyboard shortcuts

If you want to add a keyboard shortcut, you need to:

  • extend the hotkeysCollections in the hotkeysProvider.
  • call useHotkey hook in the place which provides the functionality you want to execute on keypress.