forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PMM-12741 Add check for alerting enabled
- Loading branch information
1 parent
f0d8b6b
commit c7eef3e
Showing
4 changed files
with
36 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './usePerconaAlertingEnabled'; |
8 changes: 8 additions & 0 deletions
8
public/app/percona/integrated-alerting/hooks/usePerconaAlertingEnabled.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { getPerconaSettings } from 'app/percona/shared/core/selectors'; | ||
import { useSelector } from 'app/types'; | ||
|
||
export const usePerconaAlertingEnabled = (): boolean => { | ||
const { result: settings } = useSelector(getPerconaSettings); | ||
|
||
return !!settings?.alertingEnabled; | ||
}; |