grafana/public/app
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
..
angular Chore: fix type errors in tests (#63270) 2023-02-14 16:46:42 +01:00
core Update Monthly patch updates (#64323) 2023-03-08 09:38:06 +00:00
features Plugins: Extend panel menu with commands from plugins (#63802) 2023-03-08 14:23:29 +01:00
partials Chore: Migrates remaining Angular modals to React (#33476) 2021-04-28 15:22:28 +02:00
plugins Elastic Search: Fix BasePipelineMetricAggregation schema type (#64335) 2023-03-08 13:12:44 +02:00
polyfills WIP Chore: reduce strict errors (#40462) 2021-10-15 08:57:55 +02:00
routes chore: remove export service POC from main (#63945) 2023-03-01 12:42:53 -05:00
store PublicDashboard: Add RTK Query with loading and error state. Add MSW dependency for testing. (#55518) 2022-09-22 09:35:04 -03:00
types Update Monthly patch updates (#64323) 2023-03-08 09:38:06 +00:00
app.ts Plugins: Extend panel menu with links from plugins (#63089) 2023-03-02 15:42:00 +01:00
AppWrapper.tsx Plugins: Case-sensitive routes for standalone pages (#62779) 2023-02-03 09:01:34 +01:00
dev.ts Chore: Make "why-did-you-render" a dynamic import (#53121) 2022-08-08 15:33:49 +01:00
index.ts Type window.nonce (#51200) 2022-06-22 09:28:05 +01:00