mirror of
https://github.com/grafana/grafana.git
synced 2025-02-13 00:55:47 -06:00
* Initial support for grafana or cloud only alert managers * Handle missing alert manager * Refactor code, fix tests * Fix redirect url * Bring back the test * Improve missing alert manager warning, add useAlertManagerSourceName tests * Fix lint errors * Rename alert manager hook * Refactor alert manager label creation * Improve warnings' messages * Fix linter * Fix warning condition in RuleEditor
8 lines
293 B
TypeScript
8 lines
293 B
TypeScript
import { useMemo } from 'react';
|
|
|
|
import { getAlertManagerDataSourcesByPermission } from '../utils/datasource';
|
|
|
|
export function useAlertManagersByPermission(accessType: 'instance' | 'notification') {
|
|
return useMemo(() => getAlertManagerDataSourcesByPermission(accessType), [accessType]);
|
|
}
|