grafana/public/app/features/dashboard/utils
Marcus Andersson b63c56903d
Plugins: Extend panel menu with commands from plugins (#63802)
* feat(plugins): introduce dashboard panel menu placement for adding menu items

* test: add test for getPanelMenu()

* added an unique identifier for each extension.

* added context to getPluginExtensions.

* wip

* Wip

* wiwip

* Wip

* feat: WWWIIIIPPPP 🧨

* Wip

* Renamed some of the types to align a bit better.

* added limit to how many extensions a plugin can register per placement.

* decreased number of items to 2

* will trim the lenght of titles to max 25 chars.

* wrapping configure function with error handling.

* added error handling for all scenarios.

* moved extension menu items to the bottom of the more sub menu.

* added tests for configuring the title.

* minor refactorings.

* changed so you need to specify the full path in package.json.

* wip

* removed unused type.

* big refactor to make things simpler and to centralize all configure error/validation handling.

* added missing import.

* fixed failing tests.

* fixed tests.

* revert(extensions): remove static extensions config in favour of registering via AppPlugin APIs

* removed the compose that didn't work for some reason.

* added tests just to verify that validation and error handling is tied together in configuration function.

* adding some more values to the context.

* draft validation.

* added missing tests for getPanelMenu.

* added more tests.

* refactor(extensions): move logic for validating extension link config to function

* Fixed ts errors.

* Started to add structure for supporting commands.

* fixed tests.

* adding commands to the registry

* tests: group test cases in describe blocks

* tests: add a little bit more refactoring to the tests

* tests: add a test case for checking correct placements

* feat: first version of the command handler

* feat: register panel menu items with commands

* refactor: make the 'configure' function not optional on `PluginExtensionRegistryItem`

* Wip

* Wip

* Wip

* added test to verify the default configure function.

* added some more tests to verify that commands have the proper error handling for its configure function.

* tests: fix TS errors in tests

* tests: add auxiliary functions

* refactor: small refactoring in tests

* refactor: refactoring tests for registryFactory

* refactor: refactoring tests for registryFactory

* refactor: refactoring tests for registryFactory

* refactor: refactoring tests for registryFactory

* refactor: refactoring tests for registryFactory

* refactor: refactoring tests for registryFactory

* refactor: refactoring tests for registryFactory

* refactor: refactoring tests for registryFactory

* draft of wrapping command handler with error handling.

* refactor: refactoring tests for registryFactory

* added test for edge case.

* replaced the registry item with a configure function.

* renamed the configure function type.

* refactoring of the registryfactory.

* added tests for handler error handling.

* fixed issue with assert function.

* added comment about the limited type.

* Update public/app/features/plugins/extensions/errorHandling.test.ts

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* Update public/app/features/plugins/extensions/errorHandling.test.ts

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* Update public/app/features/plugins/extensions/errorHandling.test.ts

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* added missing tests.

---------

Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2023-03-08 14:23:29 +01:00
..
getPanelMenu.test.ts Plugins: Extend panel menu with commands from plugins (#63802) 2023-03-08 14:23:29 +01:00
getPanelMenu.ts Plugins: Extend panel menu with commands from plugins (#63802) 2023-03-08 14:23:29 +01:00
getRefreshFromUrl.test.ts TimeRange: Fixes updating time range from url and browser history (#48657) 2022-05-04 11:36:15 +02:00
getRefreshFromUrl.ts TimeRange: Fixes updating time range from url and browser history (#48657) 2022-05-04 11:36:15 +02:00
loadSnapshotData.ts grafana/data: Move data frames processing functions from core (#60795) 2022-12-28 07:59:45 -08:00
panel.test.ts grafana/data: Move getPanelOptionsWithDefaults from core (#60813) 2022-12-29 05:48:22 -08:00
panel.ts Folder: Replace folderId with folderUid (#58393) 2022-11-17 09:22:57 +01:00
panelMerge.test.ts Chore: fix type errors in tests (#63270) 2023-02-14 16:46:42 +01:00
panelMerge.ts Chore: ESlint import order (#44959) 2022-04-22 14:33:13 +01:00
screen.ts PublicDashboard: Add RTK Query with loading and error state. Add MSW dependency for testing. (#55518) 2022-09-22 09:35:04 -03:00
timeRange.ts PublicDashboards: UI improvements (#55130) 2022-09-14 14:35:46 -03:00