Commit Graph

13 Commits

Author SHA1 Message Date
Galen Kistler
fb290235fd
Prometheus: Fix empty query string (expr) breaking dashboard panel (#69938)
* empty string if query.expr is undefined or null
2023-06-12 14:42:59 -05:00
Brendan O'Handley
2e6c71fd39
Prometheus: Metric encyclopedia ux collab design (#68421)
* add class for full story click event on open modal

* move feedback link to modal top under header

* move results amount to bottom left

* move settings into modal, change language from exclude to include

* add metadata to backend search, use toggletip for settings, clean code

* style input row, remove labels and update settings button design

* remove alphabet search as requested by design

* display selected metric

* update style warning message for labels filtered metrics

* organize results footer

* update table design w fixed width and sticky header

* allow focus row on tab and use key Enter to select metric on keydown

* add rudderstack event for disable text wrap

* add messages for no metrics found, labels, search and none in data source.

* filter by type placeholder

* add min width to custom select option

* add text wrap for long metric names

* Have 4px margin b/w the search row and the 'currently selected' text. 16px between 'currently selected text' and the table

* Add some padding inside the first table header row (8 pixels on all sides)

* font-size of 12px for additional settings text

* 4px padding between additional settings text

* 24px margin between the last table cell and the pagination row

* # of Results per page font size 0.85rem

* 8px margin b/w the '# of results per page' and the dropdown

* fix test

* add infer type setting for testing

* use title on icon instead of wrapping in tooltip to fix test

* fix icon issue

* italicize inferred types, update setting text and add icon

* add space for label filters alert message

* make open button style consistent with advanced datasource picker

* keep copy for open modal button

* refactor rudderstack interactions and add inferType

* add event tracking for opening the modal

* galen's feedback, fix select horizontal scroll and results perpg bug

* ismail's feedback for metric types

* revert button in option for accessibility(galen) and style button with ghost mode

* change name to Metrics explorer

* fix hover/focus styles

* ismail's feedbcak, refactor hints, return empty string, remove @return

* Fix icon hovering: put tooltips back in over titles on icon

* make results not expand to fill table space and fix width for modal open option button
2023-05-26 12:39:34 -04:00
Brendan O'Handley
d31d1576fb
Prometheus: Metric encyclopedia improvements (#67084)
* move to me directory and sort by relevance

* refactor letter search, uFuzzy and styles out of ency

* begin state refactor

* refactor getMetaData useEffect call with useReducer

* refactor pagination with useReducer

* refactor fuzzy state for useReducer

* refactor all filters for useReducer

* remove haystacks arrays in favor of haystack dictionaries w object keys

* refactor out functions into state helpers

* switch label filter text color to work with light theme

* make each row clickable to select metric

* add pagination component

* fix max results

* make a better table with keystrokes, navigate to metric with up&down, select on enter, hide settings, make a nice button

* save space, give more real esate to the table

* add highlighting for fuzzy search matches

* add custom button in metric select option to open metric encyclopedia

* open the modal with enter keystroke

* remove unnecessary actions and variables from m.e.

* fix tests, clean code

* remove setting of selected idx on results row when hovering

* tests

* rename to metrics modal and have select option same as header

* reduce width for wider screens

* pass in initial metrics list and remove call to labels and series in metrics modal

* use createSlice from reduc toolkit to deduce actions

* save the metrics modal additional settings

* galen alphabet refactor suggestion

* remove extra row in results table

* fix storing settings, wrap in feature toggle

* remove metadata check & load because metric select already handles this

* Update public/app/plugins/datasource/prometheus/querybuilder/components/metrics-modal/LetterSearch.tsx

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>

* fix styles, show cursor as pointer for select option and clickable row

* taller modal for larger screens

* turn off metadata settings if usebackend is selected

* additional settings button space

* add pipe to ufuzzy metadata search

---------

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
2023-05-01 17:29:35 -04:00
Galen Kistler
5b7ef92399
Prometheus: Remove raw query toggle (#59069)
* remove the raw query option toggle from the prometheus query builder
2022-11-29 08:12:46 -06:00
Ivana Huckova
b8e4c2abeb
Loki: Move explain section to builder mode (#52879)
* Loki: Move explain to builder and code mode

* Update

* Update transition

* Fix tests

* Fix tests

* Prometheus: Move explain section to builder mode (#52935)

* Prometheus: Move explain section to builder mode

* Show explain switch before raw query switch

* Store explain switch value in localstorage

* Make explain available for code mode too

* Introduce useFlag hook for query editor switches

* Remove Explain mode

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
2022-07-29 17:09:43 +02:00
Andrej Ocenas
c63071f519
Prometheus/Loki: Show raw query by default in the builder(#50007) 2022-06-02 13:50:10 +02:00
Josh Hunt
3c6e0e8ef8
Chore: ESlint import order (#44959)
* Add and configure eslint-plugin-import

* Fix the lint:ts npm command

* Autofix + prettier all the files

* Manually fix remaining files

* Move jquery code in jest-setup to external file to safely reorder imports

* Resolve issue caused by circular dependencies within Prometheus

* Update .betterer.results

* Fix missing // @ts-ignore

* ignore iconBundle.ts

* Fix missing // @ts-ignore
2022-04-22 14:33:13 +01:00
Torkel Ödegaard
057ff5bcf5
Prometheus: Query builder UX tweaks and feedback link (#47655)
* Prometheus: Query builder UX tweaks and feedback link

* Remove .

* Fixed link

* added option to hide feedback links

* feedback link setting name change

* move config check

* fixed ts issue
2022-04-14 15:18:03 +02:00
Torkel Ödegaard
7bc12629fd
Prometheus: Fixing state timing issues (#45458) 2022-02-17 11:41:05 +01:00
Torkel Ödegaard
916f152a6f
Prometheus: Fixes issue adding rest params (#45364)
* Prometheus: Fixing issue adding rest param and adding test

* Rebuild when expr changes from outside
2022-02-16 08:05:16 +01:00
Ivana Huckova
9e2caa9ddc
Prometheus: Add hints to query builder (#45288)
* Add hints to query builder

* Move Query hints to own component

* Use replace 5m with  in rate queries

* Remove unused prop
2022-02-11 16:50:35 +01:00
Torkel Ödegaard
aa6cee1072
Prometheus: Specific code mode view that has no options, instead sharing options with builder (#45260)
* Prometheus: Adding a slimmed down code mode for new prometheus query ux

* Show Both option in Explore

* Prometheus: Adding query defaults handling

* More tweaks

* Fixing defaults and logic for when to show exemplars toggle

* Fixing tooltip text

* Set exemplars to false when setting query type instant

* Updated test
2022-02-11 14:43:52 +01:00
Andrej Ocenas
642f0a250d
Prometheus: Use single string expr as a state for the visual editor (#45232)
* Use just expr string as a state for whole editor

* Fix patterns

* Fix tests
2022-02-10 16:55:44 +01:00