grafana/public/app/features/alerting
Virginia Cepeda e5cb1ceae0
Alerting: Suggest previously entered custom labels (#57783)
* [Alerting] - replace label inputs with dropdowns (#57019)

* Add AlertLabelDropdown component

It will be used to pick from or create new labels

* Adapt LabelsField component to use AlertLabelDropdown instead of inputs

* Add tests for LabelsField component

Plus a few other tests were adapted to work with the label dropdowns

* Use ref in component

* Fix showing placeholders in the label dropdowns

* Minor syntax change

* Remove unneeded import after rebase

* Display custom labels

When a label key is selected, its corresponding values are shown in the dropdown

* Add tooltip explaining where labels in the dropdowns come from

* Fix import of Stack component

* Avoid duplicated values

* Improvements based on review

* Display labels for currently selected datasource only

* Refactor AlertsField to allow to choose whether to suggest labels or not

* Suggest labels for NotificationStep and tests

* Don't suggest labels in TestContactPointModal

* [LabelsField] - refactor: get dataSourceName as a parameter

* [LabelsField] - extract common code into reusable components

* Display loading spinner while fetching rules

* LabelsField - refactor

Removing the suggest prop and the default dataSource 'grafana'. Instead, the component now relies on the dataSourceName param. If it's set it means we want to show suggestions so we fetch the labels, otherwise, if not set, we show the plain input texts without suggestions.

* Add test for LabelsField without suggestions

* Show custom labels for grafana managed alerts

When the dataSourceName in the NotificationsStep component has a null value, we can assume it's because we're dealing with grafana managed alerts. In that case we set the correct value.

* Fix tests after latest changes

Since we removed the combobox from the TestContactPoints modal, tests had to be adjusted

* Update texts

* initialize all new added inputs with empty data
2022-11-11 10:29:59 -03:00
..
components Chore: Migrate more usage of v1 themes to v2 (#57680) 2022-11-02 10:25:08 +00:00
partials Chore: Migrates remaining Angular modals to React (#33476) 2021-04-28 15:22:28 +02:00
state Alerting: Fix alert panel instance-based rules filtering (#52583) 2022-07-22 12:52:56 +02:00
unified Alerting: Suggest previously entered custom labels (#57783) 2022-11-11 10:29:59 -03:00
utils Alerting: Add relativeTimeRange from dataSource when using Resample expresions (#56652) 2022-10-17 12:29:05 +02:00
AlertHowToModal.tsx enable img-redundant-alt rule (#55833) 2022-09-27 10:26:32 -04:00
AlertRuleItem.test.tsx Chore: Remove remaining IconName type assertions (#54658) 2022-09-06 09:15:36 +01:00
AlertRuleItem.tsx React18: Update useCallback arg types where needed (#57084) 2022-10-17 14:52:12 +01:00
AlertRuleList.test.tsx Navigation: Use navid and pagnav in alert rules pages (#55722) 2022-10-04 14:36:36 +02:00
AlertRuleList.tsx any/type assertion fixes (#57009) 2022-10-17 10:10:10 +01:00
AlertTab.tsx Chore: Remove remaining IconName type assertions (#54658) 2022-09-06 09:15:36 +01:00
AlertTabCtrl.test.ts Alerting: Fixes so notification channels are properly deleted (#31040) 2021-02-09 15:29:50 +01:00
AlertTabCtrl.ts Chore: ESlint import order (#44959) 2022-04-22 14:33:13 +01:00
AlertTabIndex.tsx Chore: ESlint import order (#44959) 2022-04-22 14:33:13 +01:00
EditNotificationChannelPage.tsx Update a few more pages to use navId instead of navModel from store (#55342) 2022-09-19 13:21:41 +02:00
FeatureTogglePage.tsx TopNav: New page layouts (#51510) 2022-07-06 17:00:56 +02:00
getAlertingValidationMessage.test.ts Chore: more any/type assertion improvements (#57450) 2022-10-25 11:04:35 +02:00
getAlertingValidationMessage.ts Dashboard: replace datasource name with a reference object (#33817) 2021-10-29 10:57:24 -07:00
NewNotificationChannelPage.tsx TopNav: New page layouts (#51510) 2022-07-06 17:00:56 +02:00
NotificationsListPage.tsx TopNav: New page layouts (#51510) 2022-07-06 17:00:56 +02:00
routes.tsx Navigation: use navId and pageNav on Alerting - Contact Points page (#54451) 2022-09-06 16:25:07 +02:00
StateHistory.tsx Chore: ESlint import order (#44959) 2022-04-22 14:33:13 +01:00
TestRuleResult.test.tsx convert TestRuleResult to RTL (#53953) 2022-08-19 15:00:53 +01:00
TestRuleResult.tsx GrafanaUI: Add success state to ClipboardButton (#52069) 2022-07-20 10:33:46 +01:00