grafana/public/app/core
Piotr Jamróz fd218edca4
Explore: List query templates (#86897)
* Create basic feature toggle

* Rename context to reflect it contains query history and query library

* Update icons and variants

* Rename hooks

* Update tests

* Fix mock

* Add tracking

* Turn button into a toggle

* Make dropdown active as well

This is required to have better UI and an indication of selected state in split view

* Update Query Library icon

This is to make it consistent with the toolbar button

* Hide query history button when query library is available

This is to avoid confusing UX with 2 button triggering the drawer but with slightly different behavior

* Make the drawer bigger for query library

To avoid confusion for current users and test it internally a bit more it's behind a feature toggle. Bigger drawer may obstruct the view and add more friction in the UX.

* Fix tests

The test was failing because queryLibraryAvailable was set to true for tests. This change makes it more explicit what use case is being tested

* Remove active state underline from the dropdown

* Add basic types and api methods

This is just moved from the app. To be cleaned up and refactored later.

* Move API utils from Query Library app to Grafana packages

* Move API utils from Query Library app to Grafana packages

* Move API utils from Query Library app to Grafana packages

* Add basic table for query templates

* Add sorting

* Style cells

* Style table cells

* Allow closing Query Library drawer from the toolbar

* Remove Private Query toggle

It will be moved to the kebab

* Add empty state

* Remove variables detection for now

Just to simplify the PR, it's not needed for Explore yet.

* Simplify getting useDatasource.tsx

* Rename cell

* Move QueryTemplatesTable to a separate folder

* Use RTK Query to get list of query templates

* Clean up query templates table

* Simplify useDatasource hook

* Add a test

* Retrigger the build

* Remove unused code

* Small clean up

* Update import

* Add reduxjs/toolkit as a peer dependecy

* Revert "Add reduxjs/toolkit as a peer dependecy"

This reverts commit aa9da6e442.

* Update import

* Add reduxjs/toolkit as a peer dependecy

* Revert "Add reduxjs/toolkit as a peer dependecy"

This reverts commit 2e68a62ab6.

* Add @reduxjs/toolkit as peer dependency

* Add @reduxjs/toolkit as peer dependecy

* Move reactjs/toolkit to dev dependecies

* Minor clean up and use react-redux as a peer dependency

* Move query library code to core features

* Update code owners

* Update export

* Update exports

* Use Redux store instead of APIProvider

* Await for query templates to show during the test

* Add more explicit docs that the feature is experimental

---------

Co-authored-by: Kristina Durivage <kristina.durivage@grafana.com>
2024-05-14 10:05:39 +02:00
..
actions Team LBAC: Add epilogue to permissions (#82523) 2024-02-21 09:26:09 +00:00
components Spinner: Change spinner icon when prefers-reduced-motion is set (#87641) 2024-05-13 11:32:02 +01:00
context ModalsContext: Unify modals context and manager (#84916) 2024-03-28 13:26:57 +01:00
copy Chore: ESlint import order (#44959) 2022-04-22 14:33:13 +01:00
history Explore: Add tests around query history errors (#86810) 2024-04-26 08:09:31 -05:00
hooks Navigation: Fix broken layout at 544px (#63793) 2023-03-01 15:31:32 +00:00
icons Grafana UI: Make it possible to bundle package with plugins (#76191) 2023-10-13 14:11:41 +02:00
internationalization I18n: Support for Enterprise translations (#86215) 2024-04-18 16:25:27 +01:00
navigation DockedMegaMenu: Clean up toggle and old code (#81878) 2024-02-06 13:43:11 +00:00
reducers Explore: List query templates (#86897) 2024-05-14 10:05:39 +02:00
selectors Chore: Remove newBrowseDashboards feature toggle (#78190) 2023-11-22 15:22:00 +00:00
services Revert "Panel: Keyboard focus shortcuts prioritization" (#87213) 2024-05-08 14:53:20 +02:00
specs Remove explicit imports of whatwg-fetch from individual test files 2024-04-18 12:23:38 +01:00
utils Chore: Use getNextRefId instead of deprecated getNextRefIdChar (#87460) 2024-05-10 12:00:17 +01:00
app_events.ts EventBus: Introduces new event bus with emitter backward compatible interface (#27564) 2020-11-03 13:08:54 +01:00
config.ts Chore: ESlint import order (#44959) 2022-04-22 14:33:13 +01:00
constants.ts Dashboards: POC split between visualizations and widgets (#70850) 2023-07-12 10:09:22 -03:00
core.ts TopNav: KioskMode rewrite move to AppChrome responsibility and make it a global feature (#55149) 2022-09-15 14:04:58 +02:00
lodash_extended.ts Performance: Standardize lodash imports to use destructured members (#33040) 2021-04-21 09:38:00 +02:00
log_events.ts Panel monitoring (#75456) 2023-10-09 08:19:08 +03:00
monacoEnv.ts Monaco Editor: Load via ESM (#78261) 2024-02-22 12:31:40 +01:00
profiler.ts Chore: Improve some types (#64675) 2023-03-14 09:51:44 +00:00
store.ts any/type assertion fixes (#57009) 2022-10-17 10:10:10 +01:00
TableModel.ts Chore: improve typings (#87306) 2024-05-03 17:21:37 +01:00
time_series2.ts Chore: ESlint import order (#44959) 2022-04-22 14:33:13 +01:00
trustedTypePolicies.ts Sandbox: use same trusted types default policy than grafana main realm (#75539) 2023-09-27 16:50:23 +02:00