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pF,OAAOuL,IAAoBtC,EAAAA,MAA8B,UAAChB,EAAWsD,UAAZ,QAAC,EAA6B1C,UAEzF,CAACZ,IAagBkH,kBAVMzP,EAAAA,EAAAA,cACtB+L,IAA6B,MAC5B,MAAMF,GAAkBC,EAAAA,EAAAA,IAAmBC,GACrC5C,EAAM,UAAGZ,EAAWsD,UAAd,aAAG,EAA6B1C,OAE5C,OAAOsV,QAAQtV,KAEjB,CAACZ,O,2DCvBE,SAASzB,IACd,OAAO8B,EAAAA,EAAAA,UAAQ,KAAM8V,EAAAA,EAAAA,OAAkB","sources":["webpack://grafana/./public/app/core/hooks/useCleanup.ts","webpack://grafana/./public/app/features/alerting/AlertHowToModal.tsx","webpack://grafana/./public/app/features/alerting/AlertRuleItem.tsx","webpack://grafana/./public/app/features/alerting/components/DeprecationNotice.tsx","webpack://grafana/./public/app/features/alerting/state/selectors.ts","webpack://grafana/./public/app/features/alerting/AlertRuleList.tsx","webpack://grafana/./public/app/features/alerting/state/actions.ts","webpack://grafana/./public/app/features/alerting/unified/components/rules/NoRulesCTA.tsx","webpack://grafana/./public/app/features/alerting/unified/components/rules/RuleListErrors.tsx","webpack://grafana/./public/app/features/alerting/unified/components/rules/EditCloudGroupModal.tsx","webpack://grafana/./public/app/features/alerting/unified/components/StateColoredText.tsx","webpack://grafana/./public/app/features/alerting/unified/components/rules/RuleStats.tsx","webpack://grafana/./public/app/features/alerting/unified/components/rules/RulesGroup.tsx","webpack://grafana/./public/app/features/alerting/unified/components/rules/CloudRules.tsx","webpack://grafana/./public/app/features/alerting/unified/components/rules/GrafanaRules.tsx","webpack://grafana/./public/app/features/alerting/unified/components/rules/RuleListStateSection.tsx","webpack://grafana/./public/app/features/alerting/unified/components/rules/RulesFilter.tsx","webpack://grafana/./public/app/features/alerting/unified/hooks/useFilteredRules.ts","webpack://grafana/./public/app/features/alerting/unified/RuleList.tsx","webpack://grafana/./public/app/features/alerting/unified/components/rules/RuleListGroupView.tsx","webpack://grafana/./public/app/features/alerting/unified/components/rules/RuleListStateView.tsx","webpack://grafana/./public/app/features/alerting/unified/components/AlertingPageWrapper.tsx","webpack://grafana/./public/app/features/alerting/unified/components/Authorize.tsx","webpack://grafana/./public/app/features/alerting/unified/components/DynamicTableWithGuidelines.tsx","webpack://grafana/./public/app/features/alerting/unified/components/RuleLocation.tsx","webpack://grafana/./public/app/features/alerting/unified/components/rules/ActionIcon.tsx","webpack://grafana/./public/app/features/alerting/unified/components/rules/RuleDetails.tsx","webpack://grafana/./public/app/features/alerting/unified/components/rules/RulesTable.tsx","webpack://grafana/./public/app/features/alerting/unified/hooks/useHasRuler.ts","webpack://grafana/./public/app/features/alerting/unified/utils/accessControlHooks.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport { useDispatch } from 'react-redux';\n\nimport { cleanUpAction, StateSelector } from '../actions/cleanUp';\n\nexport function useCleanup<T>(stateSelector: StateSelector<T>) {\n const dispatch = useDispatch();\n //bit of a hack to unburden user from having to wrap stateSelcetor in a useCallback. Otherwise cleanup would happen on every render\n const selectorRef = useRef(stateSelector);\n selectorRef.current = stateSelector;\n useEffect(() => {\n return () => {\n dispatch(cleanUpAction({ stateSelector: selectorRef.current }));\n };\n }, [dispatch]);\n}\n","import React from 'react';\n\nimport { Modal, VerticalGroup } from '@grafana/ui';\n\nexport interface AlertHowToModalProps {\n onDismiss: () => void;\n}\n\nexport function AlertHowToModal({ onDismiss }: AlertHowToModalProps): JSX.Element {\n return (\n <Modal title=\"Adding an Alert\" isOpen onDismiss={onDismiss} onClickBackdrop={onDismiss}>\n <VerticalGroup spacing=\"sm\">\n <img src=\"public/img/alert_howto_new.png\" alt=\"link to how to alert image\" />\n <p>\n Alerts are added and configured in the Alert tab of any dashboard graph panel, letting you build and visualize\n an alert using existing queries.\n </p>\n <p>Remember to save the dashboard to persist your alert rule changes.</p>\n </VerticalGroup>\n </Modal>\n );\n}\n","import React, { useCallback } from 'react';\n// @ts-ignore\nimport Highlighter from 'react-highlight-words';\n\nimport { Icon, IconName, Button, LinkButton, Card } from '@grafana/ui';\n\nimport { AlertRule } from '../../types';\n\nexport interface Props {\n rule: AlertRule;\n search: string;\n onTogglePause: () => void;\n}\n\nconst AlertRuleItem = ({ rule, search, onTogglePause }: Props) => {\n const ruleUrl = `${rule.url}?editPanel=${rule.panelId}&tab=alert`;\n const renderText = useCallback(\n (text) => (\n <Highlighter\n key={text}\n highlightClassName=\"highlight-search-match\"\n textToHighlight={text}\n searchWords={[search]}\n />\n ),\n [search]\n );\n\n return (\n <Card>\n <Card.Heading>{renderText(rule.name)}</Card.Heading>\n <Card.Figure>\n <Icon size=\"xl\" name={rule.stateIcon as IconName} className={`alert-rule-item__icon ${rule.stateClass}`} />\n </Card.Figure>\n <Card.Meta>\n <span key=\"state\">\n <span key=\"text\" className={`${rule.stateClass}`}>\n {renderText(rule.stateText)}{' '}\n </span>\n for {rule.stateAge}\n </span>\n {rule.info ? renderText(rule.info) : null}\n </Card.Meta>\n <Card.Actions>\n <Button\n key=\"play\"\n variant=\"secondary\"\n icon={rule.state === 'paused' ? 'play' : 'pause'}\n onClick={onTogglePause}\n >\n {rule.state === 'paused' ? 'Resume' : 'Pause'}\n </Button>\n <LinkButton key=\"edit\" variant=\"secondary\" href={ruleUrl} icon=\"cog\">\n Edit alert\n </LinkButton>\n </Card.Actions>\n </Card>\n );\n};\n\nexport default AlertRuleItem;\n","import React, { FC } from 'react';\n\nimport { Alert } from '@grafana/ui';\n\nexport const LOCAL_STORAGE_KEY = 'grafana.legacyalerting.unifiedalertingpromo';\n\nconst DeprecationNotice: FC<{}> = () => (\n <Alert severity=\"warning\" title=\"Grafana legacy alerting is going away soon\">\n <p>\n You are using Grafana legacy alerting, it has been deprecated and will be removed in the next major version of\n Grafana.\n <br />\n We encourage you to upgrade to the new Grafana alerting experience.\n </p>\n <p>\n See{' '}\n <a href=\"https://grafana.com/docs/grafana/latest/alerting/unified-alerting/difference-old-new/\">\n What’s New with Grafana alerting\n </a>{' '}\n to learn more about what&lsquo;s new or learn{' '}\n <a href=\"https://grafana.com/docs/grafana/latest/alerting/unified-alerting/opt-in/\">\n how to enable the new Grafana alerting feature\n </a>\n .\n </p>\n </Alert>\n);\n\nexport { DeprecationNotice };\n","import { AlertRule, AlertRulesState, NotificationChannelState, StoreState } from 'app/types';\n\nexport const getSearchQuery = (state: AlertRulesState) => state.searchQuery;\n\nexport const getAlertRuleItems = (state: StoreState): AlertRule[] => {\n const regex = new RegExp(state.alertRules.searchQuery, 'i');\n\n return state.alertRules.items.filter((item) => {\n return regex.test(item.name) || regex.test(item.stateText) || regex.test(item.info!);\n });\n};\n\nexport const getNotificationChannel = (state: NotificationChannelState, channelId: number) => {\n if (state.notificationChannel.id === channelId) {\n return state.notificationChannel;\n }\n\n return null;\n};\n","import React, { PureComponent } from 'react';\nimport { connect, ConnectedProps } from 'react-redux';\n\nimport { SelectableValue } from '@grafana/data';\nimport { config, locationService } from '@grafana/runtime';\nimport { Button, FilterInput, LinkButton, Select, VerticalGroup } from '@grafana/ui';\nimport appEvents from 'app/core/app_events';\nimport Page from 'app/core/components/Page/Page';\nimport { GrafanaRouteComponentProps } from 'app/core/navigation/types';\nimport { getNavModel } from 'app/core/selectors/navModel';\nimport { AlertRule, StoreState } from 'app/types';\n\nimport { ShowModalReactEvent } from '../../types/events';\n\nimport { AlertHowToModal } from './AlertHowToModal';\nimport AlertRuleItem from './AlertRuleItem';\nimport { DeprecationNotice } from './components/DeprecationNotice';\nimport { getAlertRulesAsync, togglePauseAlertRule } from './state/actions';\nimport { setSearchQuery } from './state/reducers';\nimport { getAlertRuleItems, getSearchQuery } from './state/selectors';\n\nfunction mapStateToProps(state: StoreState) {\n return {\n navModel: getNavModel(state.navIndex, 'alert-list'),\n alertRules: getAlertRuleItems(state),\n search: getSearchQuery(state.alertRules),\n isLoading: state.alertRules.isLoading,\n };\n}\n\nconst mapDispatchToProps = {\n getAlertRulesAsync,\n setSearchQuery,\n togglePauseAlertRule,\n};\n\nconst connector = connect(mapStateToProps, mapDispatchToProps);\n\ninterface OwnProps extends GrafanaRouteComponentProps<{}, { state: string }> {}\n\nexport type Props = OwnProps & ConnectedProps<typeof connector>;\n\nexport class AlertRuleListUnconnected extends PureComponent<Props> {\n stateFilters = [\n { label: 'All', value: 'all' },\n { label: 'OK', value: 'ok' },\n { label: 'Not OK', value: 'not_ok' },\n { label: 'Alerting', value: 'alerting' },\n { label: 'No data', value: 'no_data' },\n { label: 'Paused', value: 'paused' },\n { label: 'Pending', value: 'pending' },\n ];\n\n componentDidMount() {\n this.fetchRules();\n }\n\n componentDidUpdate(prevProps: Props) {\n if (prevProps.queryParams.state !== this.props.queryParams.state) {\n this.fetchRules();\n }\n }\n\n async fetchRules() {\n await this.props.getAlertRulesAsync({ state: this.getStateFilter() });\n }\n\n getStateFilter(): string {\n return this.props.queryParams.state ?? 'all';\n }\n\n onStateFilterChanged = (option: SelectableValue) => {\n locationService.partial({ state: option.value });\n };\n\n onOpenHowTo = () => {\n appEvents.publish(new ShowModalReactEvent({ component: AlertHowToModal }));\n };\n\n onSearchQueryChange = (value: string) => {\n this.props.setSearchQuery(value);\n };\n\n onTogglePause = (rule: AlertRule) => {\n this.props.togglePauseAlertRule(rule.id, { paused: rule.state !== 'paused' });\n };\n\n alertStateFilterOption = ({ text, value }: { text: string; value: string }) => {\n return (\n <option key={value} value={value}>\n {text}\n </option>\n );\n };\n\n render() {\n const { navModel, alertRules, search, isLoading } = this.props;\n\n return (\n <Page navModel={navModel}>\n <Page.Contents isLoading={isLoading}>\n <div className=\"page-action-bar\">\n <div className=\"gf-form gf-form--grow\">\n <FilterInput placeholder=\"Search alerts\" value={search} onChange={this.onSearchQueryChange} />\n </div>\n <div className=\"gf-form\">\n <label className=\"gf-form-label\" htmlFor=\"alert-state-filter\">\n States\n </label>\n\n <div className=\"width-13\">\n <Select\n inputId={'alert-state-filter'}\n options={this.stateFilters}\n onChange={this.onStateFilterChanged}\n value={this.getStateFilter()}\n />\n </div>\n </div>\n <div className=\"page-action-bar__spacer\" />\n {config.unifiedAlertingEnabled && (\n <LinkButton variant=\"primary\" href=\"alerting/ng/new\">\n Add NG Alert\n </LinkButton>\n )}\n <Button variant=\"secondary\" onClick={this.onOpenHowTo}>\n How to add an alert\n </Button>\n </div>\n <DeprecationNotice />\n <VerticalGroup spacing=\"none\">\n {alertRules.map((rule) => {\n return (\n <AlertRuleItem\n rule={rule as AlertRule}\n key={rule.id}\n search={search}\n onTogglePause={() => this.onTogglePause(rule as AlertRule)}\n />\n );\n })}\n </VerticalGroup>\n </Page.Contents>\n </Page>\n );\n }\n}\n\nexport default connector(AlertRuleListUnconnected);\n","import { getBackendSrv, locationService } from '@grafana/runtime';\nimport { notifyApp } from 'app/core/actions';\nimport { createErrorNotification, createSuccessNotification } from 'app/core/copy/appNotification';\nimport { AlertRuleDTO, NotifierDTO, ThunkResult } from 'app/types';\n\nimport { loadAlertRules, loadedAlertRules, notificationChannelLoaded, setNotificationChannels } from './reducers';\n\nexport function getAlertRulesAsync(options: { state: string }): ThunkResult<void> {\n return async (dispatch) => {\n dispatch(loadAlertRules());\n const rules: AlertRuleDTO[] = await getBackendSrv().get('/api/alerts', options);\n dispatch(loadedAlertRules(rules));\n };\n}\n\nexport function togglePauseAlertRule(id: number, options: { paused: boolean }): ThunkResult<void> {\n return async (dispatch) => {\n await getBackendSrv().post(`/api/alerts/${id}/pause`, options);\n const stateFilter = locationService.getSearchObject().state || 'all';\n dispatch(getAlertRulesAsync({ state: stateFilter.toString() }));\n };\n}\n\nexport function createNotificationChannel(data: any): ThunkResult<Promise<void>> {\n return async (dispatch) => {\n try {\n await getBackendSrv().post(`/api/alert-notifications`, data);\n dispatch(notifyApp(createSuccessNotification('Notification created')));\n locationService.push('/alerting/notifications');\n } catch (error) {\n dispatch(notifyApp(createErrorNotification(error.data.error)));\n }\n };\n}\n\nexport function updateNotificationChannel(data: any): ThunkResult<void> {\n return async (dispatch) => {\n try {\n await getBackendSrv().put(`/api/alert-notifications/${data.id}`, data);\n dispatch(notifyApp(createSuccessNotification('Notification updated')));\n } catch (error) {\n dispatch(notifyApp(createErrorNotification(error.data.error)));\n }\n };\n}\n\nexport function testNotificationChannel(data: any): ThunkResult<void> {\n return async (dispatch, getState) => {\n const channel = getState().notificationChannel.notificationChannel;\n await getBackendSrv().post('/api/alert-notifications/test', { id: channel.id, ...data });\n };\n}\n\nexport function loadNotificationTypes(): ThunkResult<void> {\n return async (dispatch) => {\n const alertNotifiers: NotifierDTO[] = await getBackendSrv().get(`/api/alert-notifiers`);\n\n const notificationTypes = alertNotifiers.sort((o1, o2) => {\n if (o1.name > o2.name) {\n return 1;\n }\n return -1;\n });\n\n dispatch(setNotificationChannels(notificationTypes));\n };\n}\n\nexport function loadNotificationChannel(id: number): ThunkResult<void> {\n return async (dispatch) => {\n await dispatch(loadNotificationTypes());\n const notificationChannel = await getBackendSrv().get(`/api/alert-notifications/${id}`);\n dispatch(notificationChannelLoaded(notificationChannel));\n };\n}\n","import React, { FC } from 'react';\n\nimport { CallToActionCard } from '@grafana/ui';\nimport EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA';\n\nimport { useRulesAccess } from '../../utils/accessControlHooks';\n\nexport const NoRulesSplash: FC = () => {\n const { canCreateGrafanaRules, canCreateCloudRules } = useRulesAccess();\n\n if (canCreateGrafanaRules || canCreateCloudRules) {\n return (\n <EmptyListCTA\n title=\"You haven`t created any alert rules yet\"\n buttonIcon=\"bell\"\n buttonLink={'alerting/new'}\n buttonTitle=\"New alert rule\"\n proTip=\"you can also create alert rules from existing panels and queries.\"\n proTipLink=\"https://grafana.com/docs/\"\n proTipLinkTitle=\"Learn more\"\n proTipTarget=\"_blank\"\n />\n );\n }\n return <CallToActionCard message=\"No rules exist yet.\" callToActionElement={<div />} />;\n};\n","import { css } from '@emotion/css';\nimport { SerializedError } from '@reduxjs/toolkit';\nimport pluralize from 'pluralize';\nimport React, { useMemo, ReactElement, useState, FC } from 'react';\nimport { useLocalStorage } from 'react-use';\n\nimport { DataSourceInstanceSettings, GrafanaTheme2 } from '@grafana/data';\nimport { Alert, Button, Tooltip, useStyles2 } from '@grafana/ui';\n\nimport { useUnifiedAlertingSelector } from '../../hooks/useUnifiedAlertingSelector';\nimport { getRulesDataSources, GRAFANA_RULES_SOURCE_NAME } from '../../utils/datasource';\nimport { isRulerNotSupportedResponse } from '../../utils/rules';\n\nexport function RuleListErrors(): ReactElement {\n const [expanded, setExpanded] = useState(false);\n const [closed, setClosed] = useLocalStorage('grafana.unifiedalerting.hideErrors', false);\n const dataSourceConfigRequests = useUnifiedAlertingSelector((state) => state.dataSources);\n const promRuleRequests = useUnifiedAlertingSelector((state) => state.promRules);\n const rulerRuleRequests = useUnifiedAlertingSelector((state) => state.rulerRules);\n const styles = useStyles2(getStyles);\n\n const errors = useMemo((): JSX.Element[] => {\n const [dataSourceConfigErrors, promRequestErrors, rulerRequestErrors] = [\n dataSourceConfigRequests,\n promRuleRequests,\n rulerRuleRequests,\n ].map((requests) =>\n getRulesDataSources().reduce<Array<{ error: SerializedError; dataSource: DataSourceInstanceSettings }>>(\n (result, dataSource) => {\n const error = requests[dataSource.name]?.error;\n if (requests[dataSource.name] && error && !isRulerNotSupportedResponse(requests[dataSource.name])) {\n return [...result, { dataSource, error }];\n }\n return result;\n },\n []\n )\n );\n const grafanaPromError = promRuleRequests[GRAFANA_RULES_SOURCE_NAME]?.error;\n const grafanaRulerError = rulerRuleRequests[GRAFANA_RULES_SOURCE_NAME]?.error;\n\n const result: JSX.Element[] = [];\n\n if (grafanaPromError) {\n result.push(<>Failed to load Grafana rules state: {grafanaPromError.message || 'Unknown error.'}</>);\n }\n if (grafanaRulerError) {\n result.push(<>Failed to load Grafana rules config: {grafanaRulerError.message || 'Unknown error.'}</>);\n }\n\n dataSourceConfigErrors.forEach(({ dataSource, error }) => {\n result.push(\n <>\n Failed to load the data source configuration for{' '}\n <a href={`datasources/edit/${dataSource.uid}`}>{dataSource.name}</a>: {error.message || 'Unknown error.'}\n </>\n );\n });\n\n promRequestErrors.forEach(({ dataSource, error }) =>\n result.push(\n <>\n Failed to load rules state from <a href={`datasources/edit/${dataSource.uid}`}>{dataSource.name}</a>:{' '}\n {error.message || 'Unknown error.'}\n </>\n )\n );\n\n rulerRequestErrors.forEach(({ dataSource, error }) =>\n result.push(\n <>\n Failed to load rules config from <a href={`datasources/edit/${dataSource.uid}`}>{dataSource.name}</a>:{' '}\n {error.message || 'Unknown error.'}\n </>\n )\n );\n\n return result;\n }, [dataSourceConfigRequests, promRuleRequests, rulerRuleRequests]);\n\n return (\n <>\n {!!errors.length && closed && (\n <ErrorSummaryButton count={errors.length} onClick={() => setClosed((closed) => !closed)} />\n )}\n {!!errors.length && !closed && (\n <Alert\n data-testid=\"cloud-rulessource-errors\"\n title=\"Errors loading rules\"\n severity=\"error\"\n onRemove={() => setClosed(true)}\n >\n {expanded && errors.map((item, idx) => <div key={idx}>{item}</div>)}\n {!expanded && (\n <>\n <div>{errors[0]}</div>\n {errors.length >= 2 && (\n <Button\n className={styles.moreButton}\n fill=\"text\"\n icon=\"angle-right\"\n size=\"sm\"\n onClick={() => setExpanded(true)}\n >\n {errors.length - 1} more {pluralize('error', errors.length - 1)}\n </Button>\n )}\n </>\n )}\n </Alert>\n )}\n </>\n );\n}\n\ninterface ErrorSummaryProps {\n count: number;\n onClick: () => void;\n}\n\nconst ErrorSummaryButton: FC<ErrorSummaryProps> = ({ count, onClick }) => {\n const styles = useStyles2(getStyles);\n\n return (\n <div className={styles.floatRight}>\n <Tooltip content=\"Show all errors\" placement=\"bottom\">\n <Button fill=\"text\" variant=\"destructive\" icon=\"exclamation-triangle\" onClick={onClick}>\n {count > 1 ? <>{count} errors</> : <>1 error</>}\n </Button>\n </Tooltip>\n </div>\n );\n};\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n moreButton: css`\n padding: 0;\n `,\n floatRight: css`\n display: flex;\n justify-content: flex-end;\n `,\n});\n","import { css } from '@emotion/css';\nimport React, { useEffect, useMemo } from 'react';\nimport { useDispatch } from 'react-redux';\n\nimport { Modal, Button, Form, Field, Input, useStyles2 } from '@grafana/ui';\nimport { useCleanup } from 'app/core/hooks/useCleanup';\nimport { CombinedRuleGroup, CombinedRuleNamespace } from 'app/types/unified-alerting';\n\nimport { useUnifiedAlertingSelector } from '../../hooks/useUnifiedAlertingSelector';\nimport { updateLotexNamespaceAndGroupAction } from '../../state/actions';\nimport { getRulesSourceName } from '../../utils/datasource';\nimport { initialAsyncRequestState } from '../../utils/redux';\nimport { durationValidationPattern } from '../../utils/time';\n\ninterface Props {\n namespace: CombinedRuleNamespace;\n group: CombinedRuleGroup;\n onClose: () => void;\n}\n\ninterface FormValues {\n namespaceName: string;\n groupName: string;\n groupInterval: string;\n}\n\nexport function EditCloudGroupModal(props: Props): React.ReactElement {\n const { namespace, group, onClose } = props;\n const styles = useStyles2(getStyles);\n const dispatch = useDispatch();\n const { loading, error, dispatched } =\n useUnifiedAlertingSelector((state) => state.updateLotexNamespaceAndGroup) ?? initialAsyncRequestState;\n\n const defaultValues = useMemo(\n (): FormValues => ({\n namespaceName: namespace.name,\n groupName: group.name,\n groupInterval: group.interval ?? '',\n }),\n [namespace, group]\n );\n\n // close modal if successfully saved\n useEffect(() => {\n if (dispatched && !loading && !error) {\n onClose();\n }\n }, [dispatched, loading, onClose, error]);\n\n useCleanup((state) => state.unifiedAlerting.updateLotexNamespaceAndGroup);\n\n const onSubmit = (values: FormValues) => {\n dispatch(\n updateLotexNamespaceAndGroupAction({\n rulesSourceName: getRulesSourceName(namespace.rulesSource),\n groupName: group.name,\n newGroupName: values.groupName,\n namespaceName: namespace.name,\n newNamespaceName: values.namespaceName,\n groupInterval: values.groupInterval || undefined,\n })\n );\n };\n\n return (\n <Modal\n className={styles.modal}\n isOpen={true}\n title=\"Edit namespace or rule group\"\n onDismiss={onClose}\n onClickBackdrop={onClose}\n >\n <Form defaultValues={defaultValues} onSubmit={onSubmit} key={JSON.stringify(defaultValues)}>\n {({ register, errors, formState: { isDirty } }) => (\n <>\n <Field label=\"Namespace\" invalid={!!errors.namespaceName} error={errors.namespaceName?.message}>\n <Input\n id=\"namespaceName\"\n {...register('namespaceName', {\n required: 'Namespace name is required.',\n })}\n />\n </Field>\n <Field label=\"Rule group\" invalid={!!errors.groupName} error={errors.groupName?.message}>\n <Input\n id=\"groupName\"\n {...register('groupName', {\n required: 'Rule group name is required.',\n })}\n />\n </Field>\n <Field\n label=\"Rule group evaluation interval\"\n invalid={!!errors.groupInterval}\n error={errors.groupInterval?.message}\n >\n <Input\n id=\"groupInterval\"\n placeholder=\"1m\"\n {...register('groupInterval', {\n pattern: durationValidationPattern,\n })}\n />\n </Field>\n\n <Modal.ButtonRow>\n <Button variant=\"secondary\" type=\"button\" disabled={loading} onClick={onClose} fill=\"outline\">\n Close\n </Button>\n <Button type=\"submit\" disabled={!isDirty || loading}>\n {loading ? 'Saving...' : 'Save changes'}\n </Button>\n </Modal.ButtonRow>\n </>\n )}\n </Form>\n </Modal>\n );\n}\n\nconst getStyles = () => ({\n modal: css`\n max-width: 560px;\n `,\n});\n","import { css } from '@emotion/css';\nimport React, { FC } from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useStyles2 } from '@grafana/ui';\nimport { PromAlertingRuleState } from 'app/types/unified-alerting-dto';\n\ntype Props = {\n status: PromAlertingRuleState | 'neutral';\n};\n\nexport const StateColoredText: FC<Props> = ({ children, status }) => {\n const styles = useStyles2(getStyles);\n\n return <span className={styles[status]}>{children || status}</span>;\n};\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n [PromAlertingRuleState.Inactive]: css`\n color: ${theme.colors.success.text};\n `,\n [PromAlertingRuleState.Pending]: css`\n color: ${theme.colors.warning.text};\n `,\n [PromAlertingRuleState.Firing]: css`\n color: ${theme.colors.error.text};\n `,\n neutral: css`\n color: ${theme.colors.text.secondary};\n `,\n});\n","import pluralize from 'pluralize';\nimport React, { FC, Fragment, useMemo } from 'react';\n\nimport { CombinedRule, CombinedRuleGroup, CombinedRuleNamespace } from 'app/types/unified-alerting';\nimport { PromAlertingRuleState } from 'app/types/unified-alerting-dto';\n\nimport { isAlertingRule, isRecordingRule, isRecordingRulerRule } from '../../utils/rules';\nimport { StateColoredText } from '../StateColoredText';\n\ninterface Props {\n showInactive?: boolean;\n showRecording?: boolean;\n group?: CombinedRuleGroup;\n namespaces?: CombinedRuleNamespace[];\n}\n\nconst emptyStats = {\n total: 0,\n recording: 0,\n [PromAlertingRuleState.Firing]: 0,\n [PromAlertingRuleState.Pending]: 0,\n [PromAlertingRuleState.Inactive]: 0,\n error: 0,\n} as const;\n\nexport const RuleStats: FC<Props> = ({ showInactive, showRecording, group, namespaces }) => {\n const calculated = useMemo(() => {\n const stats = { ...emptyStats };\n const calcRule = (rule: CombinedRule) => {\n if (rule.promRule && isAlertingRule(rule.promRule)) {\n stats[rule.promRule.state] += 1;\n }\n if (rule.promRule?.health === 'err' || rule.promRule?.health === 'error') {\n stats.error += 1;\n }\n if (\n (rule.promRule && isRecordingRule(rule.promRule)) ||\n (rule.rulerRule && isRecordingRulerRule(rule.rulerRule))\n ) {\n stats.recording += 1;\n }\n stats.total += 1;\n };\n if (group) {\n group.rules.forEach(calcRule);\n }\n if (namespaces) {\n namespaces.forEach((namespace) => namespace.groups.forEach((group) => group.rules.forEach(calcRule)));\n }\n return stats;\n }, [group, namespaces]);\n\n const statsComponents: React.ReactNode[] = [];\n if (calculated[PromAlertingRuleState.Firing]) {\n statsComponents.push(\n <StateColoredText key=\"firing\" status={PromAlertingRuleState.Firing}>\n {calculated[PromAlertingRuleState.Firing]} firing\n </StateColoredText>\n );\n }\n if (calculated.error) {\n statsComponents.push(\n <StateColoredText key=\"errors\" status={PromAlertingRuleState.Firing}>\n {calculated.error} errors\n </StateColoredText>\n );\n }\n if (calculated[PromAlertingRuleState.Pending]) {\n statsComponents.push(\n <StateColoredText key=\"pending\" status={PromAlertingRuleState.Pending}>\n {calculated[PromAlertingRuleState.Pending]} pending\n </StateColoredText>\n );\n }\n if (showInactive && calculated[PromAlertingRuleState.Inactive]) {\n statsComponents.push(\n <StateColoredText key=\"inactive\" status=\"neutral\">\n {calculated[PromAlertingRuleState.Inactive]} normal\n </StateColoredText>\n );\n }\n if (showRecording && calculated.recording) {\n statsComponents.push(\n <StateColoredText key=\"recording\" status=\"neutral\">\n {calculated.recording} recording\n </StateColoredText>\n );\n }\n\n return (\n <div>\n <span>\n {calculated.total} {pluralize('rule', calculated.total)}\n </span>\n {!!statsComponents.length && (\n <>\n <span>: </span>\n {statsComponents.reduce<React.ReactNode[]>(\n (prev, curr, idx) =>\n prev.length\n ? [\n prev,\n <Fragment key={idx}>\n <span>, </span>\n </Fragment>,\n curr,\n ]\n : [curr],\n []\n )}\n </>\n )}\n </div>\n );\n};\n","import { css } from '@emotion/css';\nimport pluralize from 'pluralize';\nimport React, { FC, useEffect, useState } from 'react';\nimport { useDispatch } from 'react-redux';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { Badge, ConfirmModal, HorizontalGroup, Icon, Spinner, Tooltip, useStyles2 } from '@grafana/ui';\nimport kbn from 'app/core/utils/kbn';\nimport { CombinedRuleGroup, CombinedRuleNamespace } from 'app/types/unified-alerting';\n\nimport { useFolder } from '../../hooks/useFolder';\nimport { useHasRuler } from '../../hooks/useHasRuler';\nimport { deleteRulesGroupAction } from '../../state/actions';\nimport { useRulesAccess } from '../../utils/accessControlHooks';\nimport { GRAFANA_RULES_SOURCE_NAME, isCloudRulesSource } from '../../utils/datasource';\nimport { isFederatedRuleGroup, isGrafanaRulerRule } from '../../utils/rules';\nimport { CollapseToggle } from '../CollapseToggle';\nimport { RuleLocation } from '../RuleLocation';\n\nimport { ActionIcon } from './ActionIcon';\nimport { EditCloudGroupModal } from './EditCloudGroupModal';\nimport { RuleStats } from './RuleStats';\nimport { RulesTable } from './RulesTable';\n\ninterface Props {\n namespace: CombinedRuleNamespace;\n group: CombinedRuleGroup;\n expandAll: boolean;\n}\n\nexport const RulesGroup: FC<Props> = React.memo(({ group, namespace, expandAll }) => {\n const { rulesSource } = namespace;\n const dispatch = useDispatch();\n const styles = useStyles2(getStyles);\n\n const [isEditingGroup, setIsEditingGroup] = useState(false);\n const [isDeletingGroup, setIsDeletingGroup] = useState(false);\n const [isCollapsed, setIsCollapsed] = useState(!expandAll);\n\n const { canEditRules } = useRulesAccess();\n\n useEffect(() => {\n setIsCollapsed(!expandAll);\n }, [expandAll]);\n\n const { hasRuler, rulerRulesLoaded } = useHasRuler();\n const rulerRule = group.rules[0]?.rulerRule;\n const folderUID = (rulerRule && isGrafanaRulerRule(rulerRule) && rulerRule.grafana_alert.namespace_uid) || undefined;\n const { folder } = useFolder(folderUID);\n\n // group \"is deleting\" if rules source has ruler, but this group has no rules that are in ruler\n const isDeleting =\n hasRuler(rulesSource) && rulerRulesLoaded(rulesSource) && !group.rules.find((rule) => !!rule.rulerRule);\n const isFederated = isFederatedRuleGroup(group);\n\n const deleteGroup = () => {\n dispatch(deleteRulesGroupAction(namespace, group));\n setIsDeletingGroup(false);\n };\n\n const actionIcons: React.ReactNode[] = [];\n\n // for grafana, link to folder views\n if (isDeleting) {\n actionIcons.push(\n <HorizontalGroup key=\"is-deleting\">\n <Spinner />\n deleting\n </HorizontalGroup>\n );\n } else if (rulesSource === GRAFANA_RULES_SOURCE_NAME) {\n if (folderUID) {\n const baseUrl = `/dashboards/f/${folderUID}/${kbn.slugifyForUrl(namespace.name)}`;\n if (folder?.canSave) {\n actionIcons.push(\n <ActionIcon\n aria-label=\"edit folder\"\n key=\"edit\"\n icon=\"pen\"\n tooltip=\"edit folder\"\n to={baseUrl + '/settings'}\n target=\"__blank\"\n />\n );\n }\n if (folder?.canAdmin) {\n actionIcons.push(\n <ActionIcon\n aria-label=\"manage permissions\"\n key=\"manage-perms\"\n icon=\"lock\"\n tooltip=\"manage permissions\"\n to={baseUrl + '/permissions'}\n target=\"__blank\"\n />\n );\n }\n }\n } else if (canEditRules(rulesSource.name) && hasRuler(rulesSource)) {\n if (!isFederated) {\n actionIcons.push(\n <ActionIcon\n aria-label=\"edit rule group\"\n data-testid=\"edit-group\"\n key=\"edit\"\n icon=\"pen\"\n tooltip=\"edit rule group\"\n onClick={() => setIsEditingGroup(true)}\n />\n );\n }\n\n actionIcons.push(\n <ActionIcon\n aria-label=\"delete rule group\"\n data-testid=\"delete-group\"\n key=\"delete-group\"\n icon=\"trash-alt\"\n tooltip=\"delete rule group\"\n onClick={() => setIsDeletingGroup(true)}\n />\n );\n }\n\n // ungrouped rules are rules that are in the \"default\" group name\n const isUngrouped = group.name === 'default';\n const groupName = isUngrouped ? (\n <RuleLocation namespace={namespace.name} />\n ) : (\n <RuleLocation namespace={namespace.name} group={group.name} />\n );\n\n return (\n <div className={styles.wrapper} data-testid=\"rule-group\">\n <div className={styles.header} data-testid=\"rule-group-header\">\n <CollapseToggle\n className={styles.collapseToggle}\n isCollapsed={isCollapsed}\n onToggle={setIsCollapsed}\n data-testid=\"group-collapse-toggle\"\n />\n <Icon name={isCollapsed ? 'folder' : 'folder-open'} />\n {isCloudRulesSource(rulesSource) && (\n <Tooltip content={rulesSource.name} placement=\"top\">\n <img\n alt={rulesSource.meta.name}\n className={styles.dataSourceIcon}\n src={rulesSource.meta.info.logos.small}\n />\n </Tooltip>\n )}\n <h6 className={styles.heading}>\n {isFederated && <Badge color=\"purple\" text=\"Federated\" />} {groupName}\n </h6>\n <div className={styles.spacer} />\n <div className={styles.headerStats}>\n <RuleStats showInactive={false} group={group} />\n </div>\n {!!actionIcons.length && (\n <>\n <div className={styles.actionsSeparator}>|</div>\n <div className={styles.actionIcons}>{actionIcons}</div>\n </>\n )}\n </div>\n {!isCollapsed && (\n <RulesTable showSummaryColumn={true} className={styles.rulesTable} showGuidelines={true} rules={group.rules} />\n )}\n {isEditingGroup && (\n <EditCloudGroupModal group={group} namespace={namespace} onClose={() => setIsEditingGroup(false)} />\n )}\n <ConfirmModal\n isOpen={isDeletingGroup}\n title=\"Delete group\"\n body={\n <div>\n Deleting this group will permanently remove the group\n <br />\n and {group.rules.length} alert {pluralize('rule', group.rules.length)} belonging to it.\n <br />\n Are you sure you want to delete this group?\n </div>\n }\n onConfirm={deleteGroup}\n onDismiss={() => setIsDeletingGroup(false)}\n confirmText=\"Delete\"\n />\n </div>\n );\n});\n\nRulesGroup.displayName = 'RulesGroup';\n\nexport const getStyles = (theme: GrafanaTheme2) => ({\n wrapper: css`\n & + & {\n margin-top: ${theme.spacing(2)};\n }\n `,\n header: css`\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: ${theme.spacing(1)} ${theme.spacing(1)} ${theme.spacing(1)} 0;\n background-color: ${theme.colors.background.secondary};\n flex-wrap: wrap;\n `,\n headerStats: css`\n span {\n vertical-align: middle;\n }\n\n ${theme.breakpoints.down('sm')} {\n order: 2;\n width: 100%;\n padding-left: ${theme.spacing(1)};\n }\n `,\n heading: css`\n margin-left: ${theme.spacing(1)};\n margin-bottom: 0;\n `,\n spacer: css`\n flex: 1;\n `,\n collapseToggle: css`\n background: none;\n border: none;\n margin-top: -${theme.spacing(1)};\n margin-bottom: -${theme.spacing(1)};\n\n svg {\n margin-bottom: 0;\n }\n `,\n dataSourceIcon: css`\n width: ${theme.spacing(2)};\n height: ${theme.spacing(2)};\n margin-left: ${theme.spacing(2)};\n `,\n dataSourceOrigin: css`\n margin-right: 1em;\n color: ${theme.colors.text.disabled};\n `,\n actionsSeparator: css`\n margin: 0 ${theme.spacing(2)};\n `,\n actionIcons: css`\n & > * + * {\n margin-left: ${theme.spacing(0.5)};\n }\n `,\n rulesTable: css`\n margin-top: ${theme.spacing(3)};\n `,\n});\n","import { css } from '@emotion/css';\nimport pluralize from 'pluralize';\nimport React, { FC, useMemo } from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { LoadingPlaceholder, useStyles2 } from '@grafana/ui';\nimport { CombinedRuleNamespace } from 'app/types/unified-alerting';\n\nimport { useUnifiedAlertingSelector } from '../../hooks/useUnifiedAlertingSelector';\nimport { getRulesDataSources, getRulesSourceName } from '../../utils/datasource';\n\nimport { RulesGroup } from './RulesGroup';\n\ninterface Props {\n namespaces: CombinedRuleNamespace[];\n expandAll: boolean;\n}\n\nexport const CloudRules: FC<Props> = ({ namespaces, expandAll }) => {\n const styles = useStyles2(getStyles);\n\n const dsConfigs = useUnifiedAlertingSelector((state) => state.dataSources);\n const rules = useUnifiedAlertingSelector((state) => state.promRules);\n const rulesDataSources = useMemo(getRulesDataSources, []);\n\n const dataSourcesLoading = useMemo(\n () => rulesDataSources.filter((ds) => rules[ds.name]?.loading || dsConfigs[ds.name]?.loading),\n [rules, dsConfigs, rulesDataSources]\n );\n\n return (\n <section className={styles.wrapper}>\n <div className={styles.sectionHeader}>\n <h5>Mimir / Cortex / Loki</h5>\n {dataSourcesLoading.length ? (\n <LoadingPlaceholder\n className={styles.loader}\n text={`Loading rules from ${dataSourcesLoading.length} ${pluralize('source', dataSourcesLoading.length)}`}\n />\n ) : (\n <div />\n )}\n </div>\n\n {namespaces.map((namespace) => {\n const { groups, rulesSource } = namespace;\n return groups.map((group) => (\n <RulesGroup\n group={group}\n key={`${getRulesSourceName(rulesSource)}-${name}-${group.name}`}\n namespace={namespace}\n expandAll={expandAll}\n />\n ));\n })}\n {namespaces?.length === 0 && !!rulesDataSources.length && <p>No rules found.</p>}\n {!rulesDataSources.length && <p>There are no Prometheus or Loki datas sources configured.</p>}\n </section>\n );\n};\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n loader: css`\n margin-bottom: 0;\n `,\n sectionHeader: css`\n display: flex;\n justify-content: space-between;\n `,\n wrapper: css`\n margin-bottom: ${theme.v1.spacing.xl};\n `,\n});\n","import { css } from '@emotion/css';\nimport React, { FC } from 'react';\n\nimport { GrafanaTheme } from '@grafana/data';\nimport { LoadingPlaceholder, useStyles } from '@grafana/ui';\nimport { useQueryParams } from 'app/core/hooks/useQueryParams';\nimport { CombinedRuleNamespace } from 'app/types/unified-alerting';\n\nimport { flattenGrafanaManagedRules } from '../../hooks/useCombinedRuleNamespaces';\nimport { useUnifiedAlertingSelector } from '../../hooks/useUnifiedAlertingSelector';\nimport { GRAFANA_RULES_SOURCE_NAME } from '../../utils/datasource';\nimport { initialAsyncRequestState } from '../../utils/redux';\n\nimport { RulesGroup } from './RulesGroup';\n\ninterface Props {\n namespaces: CombinedRuleNamespace[];\n expandAll: boolean;\n}\n\nexport const GrafanaRules: FC<Props> = ({ namespaces, expandAll }) => {\n const styles = useStyles(getStyles);\n const [queryParams] = useQueryParams();\n\n const { loading } = useUnifiedAlertingSelector(\n (state) => state.promRules[GRAFANA_RULES_SOURCE_NAME] || initialAsyncRequestState\n );\n\n const wantsGroupedView = queryParams['view'] === 'grouped';\n const namespacesFormat = wantsGroupedView ? namespaces : flattenGrafanaManagedRules(namespaces);\n\n return (\n <section className={styles.wrapper}>\n <div className={styles.sectionHeader}>\n <h5>Grafana</h5>\n {loading ? <LoadingPlaceholder className={styles.loader} text=\"Loading...\" /> : <div />}\n </div>\n\n {namespacesFormat?.map((namespace) =>\n namespace.groups.map((group) => (\n <RulesGroup\n group={group}\n key={`${namespace.name}-${group.name}`}\n namespace={namespace}\n expandAll={expandAll}\n />\n ))\n )}\n {namespacesFormat?.length === 0 && <p>No rules found.</p>}\n </section>\n );\n};\n\nconst getStyles = (theme: GrafanaTheme) => ({\n loader: css`\n margin-bottom: 0;\n `,\n sectionHeader: css`\n display: flex;\n justify-content: space-between;\n `,\n wrapper: css`\n margin-bottom: ${theme.spacing.xl};\n `,\n});\n","import { css } from '@emotion/css';\nimport React, { FC, useState } from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useStyles2 } from '@grafana/ui';\nimport { CombinedRule } from 'app/types/unified-alerting';\nimport { PromAlertingRuleState } from 'app/types/unified-alerting-dto';\n\nimport { alertStateToReadable } from '../../utils/rules';\nimport { CollapseToggle } from '../CollapseToggle';\n\nimport { RulesTable } from './RulesTable';\n\ninterface Props {\n rules: CombinedRule[];\n state: PromAlertingRuleState;\n defaultCollapsed?: boolean;\n}\n\nexport const RuleListStateSection: FC<Props> = ({ rules, state, defaultCollapsed = false }) => {\n const [collapsed, setCollapsed] = useState(defaultCollapsed);\n const styles = useStyles2(getStyles);\n return (\n <>\n <h4 className={styles.header}>\n <CollapseToggle\n className={styles.collapseToggle}\n size=\"xxl\"\n isCollapsed={collapsed}\n onToggle={() => setCollapsed(!collapsed)}\n />\n {alertStateToReadable(state)} ({rules.length})\n </h4>\n {!collapsed && <RulesTable className={styles.rulesTable} rules={rules} showGroupColumn={true} />}\n </>\n );\n};\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n collapseToggle: css`\n vertical-align: middle;\n `,\n header: css`\n margin-top: ${theme.spacing(2)};\n `,\n rulesTable: css`\n margin-top: ${theme.spacing(3)};\n `,\n});\n","import { css, cx } from '@emotion/css';\nimport { debounce } from 'lodash';\nimport React, { FormEvent, useState } from 'react';\n\nimport { DataSourceInstanceSettings, GrafanaTheme, SelectableValue } from '@grafana/data';\nimport { Stack } from '@grafana/experimental';\nimport { DataSourcePicker } from '@grafana/runtime';\nimport { Button, Field, Icon, Input, Label, RadioButtonGroup, Tooltip, useStyles } from '@grafana/ui';\nimport { useQueryParams } from 'app/core/hooks/useQueryParams';\nimport { PromAlertingRuleState, PromRuleType } from 'app/types/unified-alerting-dto';\n\nimport { getFiltersFromUrlParams } from '../../utils/misc';\nimport { alertStateToReadable } from '../../utils/rules';\n\nconst ViewOptions: SelectableValue[] = [\n {\n icon: 'list-ul',\n label: 'List',\n value: 'list',\n },\n {\n icon: 'folder',\n label: 'Grouped',\n value: 'grouped',\n },\n {\n icon: 'heart-rate',\n label: 'State',\n value: 'state',\n },\n];\n\nconst RuleTypeOptions: SelectableValue[] = [\n {\n label: 'Alert ',\n value: PromRuleType.Alerting,\n },\n {\n label: 'Recording ',\n value: PromRuleType.Recording,\n },\n];\n\nconst RulesFilter = () => {\n const [queryParams, setQueryParams] = useQueryParams();\n // This key is used to force a rerender on the inputs when the filters are cleared\n const [filterKey, setFilterKey] = useState<number>(Math.floor(Math.random() * 100));\n const dataSourceKey = `dataSource-${filterKey}`;\n const queryStringKey = `queryString-${filterKey}`;\n\n const { dataSource, alertState, queryString, ruleType } = getFiltersFromUrlParams(queryParams);\n\n const styles = useStyles(getStyles);\n const stateOptions = Object.entries(PromAlertingRuleState).map(([key, value]) => ({\n label: alertStateToReadable(value),\n value,\n }));\n\n const handleDataSourceChange = (dataSourceValue: DataSourceInstanceSettings) => {\n setQueryParams({ dataSource: dataSourceValue.name });\n };\n\n const clearDataSource = () => {\n setQueryParams({ dataSource: null });\n };\n\n const handleQueryStringChange = debounce((e: FormEvent<HTMLInputElement>) => {\n const target = e.target as HTMLInputElement;\n setQueryParams({ queryString: target.value || null });\n }, 600);\n\n const handleAlertStateChange = (value: string) => {\n setQueryParams({ alertState: value });\n };\n\n const handleViewChange = (view: string) => {\n setQueryParams({ view });\n };\n\n const handleRuleTypeChange = (ruleType: PromRuleType) => {\n setQueryParams({ ruleType });\n };\n\n const handleClearFiltersClick = () => {\n setQueryParams({\n alertState: null,\n queryString: null,\n dataSource: null,\n ruleType: null,\n });\n setTimeout(() => setFilterKey(filterKey + 1), 100);\n };\n\n const searchIcon = <Icon name={'search'} />;\n return (\n <div className={styles.container}>\n <Field className={styles.inputWidth} label=\"Search by data source\">\n <DataSourcePicker\n key={dataSourceKey}\n alerting\n noDefault\n placeholder=\"All data sources\"\n current={dataSource}\n onChange={handleDataSourceChange}\n onClear={clearDataSource}\n />\n </Field>\n <div className={cx(styles.flexRow, styles.spaceBetween)}>\n <div className={styles.flexRow}>\n <Field\n className={styles.rowChild}\n label={\n <Label>\n <Stack gap={0.5}>\n <span>Search by label</span>\n <Tooltip\n content={\n <div>\n Filter rules and alerts using label querying, ex:\n <code>{`{severity=\"critical\", instance=~\"cluster-us-.+\"}`}</code>\n </div>\n }\n >\n <Icon name=\"info-circle\" size=\"sm\" />\n </Tooltip>\n </Stack>\n </Label>\n }\n >\n <Input\n key={queryStringKey}\n className={styles.inputWidth}\n prefix={searchIcon}\n onChange={handleQueryStringChange}\n defaultValue={queryString}\n placeholder=\"Search\"\n data-testid=\"search-query-input\"\n />\n </Field>\n <div className={styles.rowChild}>\n <Label>State</Label>\n <RadioButtonGroup options={stateOptions} value={alertState} onChange={handleAlertStateChange} />\n </div>\n <div className={styles.rowChild}>\n <Label>Rule type</Label>\n <RadioButtonGroup\n options={RuleTypeOptions}\n value={ruleType as PromRuleType}\n onChange={handleRuleTypeChange}\n />\n </div>\n <div className={styles.rowChild}>\n <Label>View as</Label>\n <RadioButtonGroup\n options={ViewOptions}\n value={String(queryParams['view'] ?? ViewOptions[0].value)}\n onChange={handleViewChange}\n />\n </div>\n </div>\n {(dataSource || alertState || queryString || ruleType) && (\n <div className={styles.flexRow}>\n <Button\n className={styles.clearButton}\n fullWidth={false}\n icon=\"times\"\n variant=\"secondary\"\n onClick={handleClearFiltersClick}\n >\n Clear filters\n </Button>\n </div>\n )}\n </div>\n </div>\n );\n};\n\nconst getStyles = (theme: GrafanaTheme) => {\n return {\n container: css`\n display: flex;\n flex-direction: column;\n padding-bottom: ${theme.spacing.sm};\n margin-bottom: ${theme.spacing.sm};\n `,\n inputWidth: css`\n width: 340px;\n flex-grow: 0;\n `,\n flexRow: css`\n display: flex;\n flex-direction: row;\n align-items: flex-end;\n width: 100%;\n flex-wrap: wrap;\n `,\n spaceBetween: css`\n justify-content: space-between;\n `,\n rowChild: css`\n margin: 0 ${theme.spacing.sm} 0 0;\n `,\n clearButton: css`\n margin-top: ${theme.spacing.sm};\n `,\n };\n};\n\nexport default RulesFilter;\n","import { useMemo } from 'react';\n\nimport { getDataSourceSrv } from '@grafana/runtime';\nimport { useQueryParams } from 'app/core/hooks/useQueryParams';\nimport { CombinedRuleGroup, CombinedRuleNamespace, FilterState } from 'app/types/unified-alerting';\nimport { PromRuleType, RulerGrafanaRuleDTO } from 'app/types/unified-alerting-dto';\n\nimport { labelsMatchMatchers, parseMatchers } from '../utils/alertmanager';\nimport { isCloudRulesSource } from '../utils/datasource';\nimport { getFiltersFromUrlParams } from '../utils/misc';\nimport { isAlertingRule, isGrafanaRulerRule } from '../utils/rules';\n\nexport const useFilteredRules = (namespaces: CombinedRuleNamespace[]) => {\n const [queryParams] = useQueryParams();\n const filters = getFiltersFromUrlParams(queryParams);\n\n return useMemo(() => {\n const filteredNamespaces = namespaces\n // Filter by data source\n // TODO: filter by multiple data sources for grafana-managed alerts\n .filter(({ rulesSource }) =>\n filters.dataSource && isCloudRulesSource(rulesSource) ? rulesSource.name === filters.dataSource : true\n )\n // If a namespace and group have rules that match the rules filters then keep them.\n .reduce(reduceNamespaces(filters), [] as CombinedRuleNamespace[]);\n return filteredNamespaces;\n }, [namespaces, filters]);\n};\n\nconst reduceNamespaces = (filters: FilterState) => {\n return (namespaceAcc: CombinedRuleNamespace[], namespace: CombinedRuleNamespace) => {\n const groups = namespace.groups.reduce(reduceGroups(filters), [] as CombinedRuleGroup[]);\n\n if (groups.length) {\n namespaceAcc.push({\n ...namespace,\n groups,\n });\n }\n\n return namespaceAcc;\n };\n};\n\n// Reduces groups to only groups that have rules matching the filters\nconst reduceGroups = (filters: FilterState) => {\n return (groupAcc: CombinedRuleGroup[], group: CombinedRuleGroup) => {\n const rules = group.rules.filter((rule) => {\n if (filters.ruleType && filters.ruleType !== rule.promRule?.type) {\n return false;\n }\n if (filters.dataSource && isGrafanaRulerRule(rule.rulerRule) && !isQueryingDataSource(rule.rulerRule, filters)) {\n return false;\n }\n // Query strings can match alert name, label keys, and label values\n if (filters.queryString) {\n const normalizedQueryString = filters.queryString.toLocaleLowerCase();\n const doesNameContainsQueryString = rule.name?.toLocaleLowerCase().includes(normalizedQueryString);\n const matchers = parseMatchers(filters.queryString);\n\n const doRuleLabelsMatchQuery = labelsMatchMatchers(rule.labels, matchers);\n const doAlertsContainMatchingLabels =\n rule.promRule &&\n rule.promRule.type === PromRuleType.Alerting &&\n rule.promRule.alerts &&\n rule.promRule.alerts.some((alert) => labelsMatchMatchers(alert.labels, matchers));\n\n if (!(doesNameContainsQueryString || doRuleLabelsMatchQuery || doAlertsContainMatchingLabels)) {\n return false;\n }\n }\n if (\n filters.alertState &&\n !(rule.promRule && isAlertingRule(rule.promRule) && rule.promRule.state === filters.alertState)\n ) {\n return false;\n }\n return true;\n });\n // Add rules to the group that match the rule list filters\n if (rules.length) {\n groupAcc.push({\n ...group,\n rules,\n });\n }\n return groupAcc;\n };\n};\n\nconst isQueryingDataSource = (rulerRule: RulerGrafanaRuleDTO, filter: FilterState): boolean => {\n if (!filter.dataSource) {\n return true;\n }\n\n return !!rulerRule.grafana_alert.data.find((query) => {\n if (!query.datasourceUid) {\n return false;\n }\n const ds = getDataSourceSrv().getInstanceSettings(query.datasourceUid);\n return ds?.name === filter.dataSource;\n });\n};\n","import { css } from '@emotion/css';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { useLocation } from 'react-router-dom';\n\nimport { GrafanaTheme2, urlUtil } from '@grafana/data';\nimport { Button, LinkButton, useStyles2, withErrorBoundary } from '@grafana/ui';\nimport { useQueryParams } from 'app/core/hooks/useQueryParams';\n\nimport { AlertingPageWrapper } from './components/AlertingPageWrapper';\nimport { NoRulesSplash } from './components/rules/NoRulesCTA';\nimport { RuleListErrors } from './components/rules/RuleListErrors';\nimport { RuleListGroupView } from './components/rules/RuleListGroupView';\nimport { RuleListStateView } from './components/rules/RuleListStateView';\nimport { RuleStats } from './components/rules/RuleStats';\nimport RulesFilter from './components/rules/RulesFilter';\nimport { useCombinedRuleNamespaces } from './hooks/useCombinedRuleNamespaces';\nimport { useFilteredRules } from './hooks/useFilteredRules';\nimport { useUnifiedAlertingSelector } from './hooks/useUnifiedAlertingSelector';\nimport { fetchAllPromAndRulerRulesAction } from './state/actions';\nimport { useRulesAccess } from './utils/accessControlHooks';\nimport { RULE_LIST_POLL_INTERVAL_MS } from './utils/constants';\nimport { getAllRulesSourceNames } from './utils/datasource';\nimport { getFiltersFromUrlParams } from './utils/misc';\n\nconst VIEWS = {\n groups: RuleListGroupView,\n state: RuleListStateView,\n};\n\nconst RuleList = withErrorBoundary(\n () => {\n const dispatch = useDispatch();\n const styles = useStyles2(getStyles);\n const rulesDataSourceNames = useMemo(getAllRulesSourceNames, []);\n const location = useLocation();\n const [expandAll, setExpandAll] = useState(false);\n\n const [queryParams] = useQueryParams();\n const filters = getFiltersFromUrlParams(queryParams);\n const filtersActive = Object.values(filters).some((filter) => filter !== undefined);\n\n const { canCreateGrafanaRules, canCreateCloudRules } = useRulesAccess();\n\n const view = VIEWS[queryParams['view'] as keyof typeof VIEWS]\n ? (queryParams['view'] as keyof typeof VIEWS)\n : 'groups';\n\n const ViewComponent = VIEWS[view];\n\n // fetch rules, then poll every RULE_LIST_POLL_INTERVAL_MS\n useEffect(() => {\n dispatch(fetchAllPromAndRulerRulesAction());\n const interval = setInterval(() => dispatch(fetchAllPromAndRulerRulesAction()), RULE_LIST_POLL_INTERVAL_MS);\n return () => {\n clearInterval(interval);\n };\n }, [dispatch]);\n\n const promRuleRequests = useUnifiedAlertingSelector((state) => state.promRules);\n const rulerRuleRequests = useUnifiedAlertingSelector((state) => state.rulerRules);\n\n const dispatched = rulesDataSourceNames.some(\n (name) => promRuleRequests[name]?.dispatched || rulerRuleRequests[name]?.dispatched\n );\n const loading = rulesDataSourceNames.some(\n (name) => promRuleRequests[name]?.loading || rulerRuleRequests[name]?.loading\n );\n const haveResults = rulesDataSourceNames.some(\n (name) =>\n (promRuleRequests[name]?.result?.length && !promRuleRequests[name]?.error) ||\n (Object.keys(rulerRuleRequests[name]?.result || {}).length && !rulerRuleRequests[name]?.error)\n );\n\n const showNewAlertSplash = dispatched && !loading && !haveResults;\n\n const combinedNamespaces = useCombinedRuleNamespaces();\n const filteredNamespaces = useFilteredRules(combinedNamespaces);\n return (\n <AlertingPageWrapper pageId=\"alert-list\" isLoading={loading && !haveResults}>\n <RuleListErrors />\n {!showNewAlertSplash && (\n <>\n <RulesFilter />\n <div className={styles.break} />\n <div className={styles.buttonsContainer}>\n <div className={styles.statsContainer}>\n {view === 'groups' && filtersActive && (\n <Button\n className={styles.expandAllButton}\n icon={expandAll ? 'angle-double-up' : 'angle-double-down'}\n variant=\"secondary\"\n onClick={() => setExpandAll(!expandAll)}\n >\n {expandAll ? 'Collapse all' : 'Expand all'}\n </Button>\n )}\n <RuleStats showInactive={true} showRecording={true} namespaces={filteredNamespaces} />\n </div>\n {(canCreateGrafanaRules || canCreateCloudRules) && (\n <LinkButton\n href={urlUtil.renderUrl('alerting/new', { returnTo: location.pathname + location.search })}\n icon=\"plus\"\n >\n New alert rule\n </LinkButton>\n )}\n </div>\n </>\n )}\n {showNewAlertSplash && <NoRulesSplash />}\n {haveResults && <ViewComponent expandAll={expandAll} namespaces={filteredNamespaces} />}\n </AlertingPageWrapper>\n );\n },\n { style: 'page' }\n);\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n break: css`\n width: 100%;\n height: 0;\n margin-bottom: ${theme.spacing(2)};\n border-bottom: solid 1px ${theme.colors.border.medium};\n `,\n buttonsContainer: css`\n margin-bottom: ${theme.spacing(2)};\n display: flex;\n justify-content: space-between;\n `,\n statsContainer: css`\n display: flex;\n flex-direction: row;\n align-items: center;\n `,\n expandAllButton: css`\n margin-right: ${theme.spacing(1)};\n `,\n});\n\nexport default RuleList;\n","import React, { FC, useMemo } from 'react';\n\nimport { AccessControlAction } from 'app/types';\nimport { CombinedRuleNamespace } from 'app/types/unified-alerting';\n\nimport { isCloudRulesSource, isGrafanaRulesSource } from '../../utils/datasource';\nimport { Authorize } from '../Authorize';\n\nimport { CloudRules } from './CloudRules';\nimport { GrafanaRules } from './GrafanaRules';\n\ninterface Props {\n namespaces: CombinedRuleNamespace[];\n expandAll: boolean;\n}\n\nexport const RuleListGroupView: FC<Props> = ({ namespaces, expandAll }) => {\n const [grafanaNamespaces, cloudNamespaces] = useMemo(() => {\n const sorted = namespaces\n .map((namespace) => ({\n ...namespace,\n groups: namespace.groups.sort((a, b) => a.name.localeCompare(b.name)),\n }))\n .sort((a, b) => a.name.localeCompare(b.name));\n return [\n sorted.filter((ns) => isGrafanaRulesSource(ns.rulesSource)),\n sorted.filter((ns) => isCloudRulesSource(ns.rulesSource)),\n ];\n }, [namespaces]);\n\n return (\n <>\n <Authorize actions={[AccessControlAction.AlertingRuleRead]}>\n <GrafanaRules namespaces={grafanaNamespaces} expandAll={expandAll} />\n </Authorize>\n <Authorize actions={[AccessControlAction.AlertingRuleExternalRead]}>\n <CloudRules namespaces={cloudNamespaces} expandAll={expandAll} />\n </Authorize>\n </>\n );\n};\n","import React, { FC, useMemo } from 'react';\n\nimport { useQueryParams } from 'app/core/hooks/useQueryParams';\nimport { CombinedRule, CombinedRuleNamespace } from 'app/types/unified-alerting';\nimport { PromAlertingRuleState } from 'app/types/unified-alerting-dto';\n\nimport { getFiltersFromUrlParams } from '../../utils/misc';\nimport { isAlertingRule } from '../../utils/rules';\n\nimport { RuleListStateSection } from './RuleListStateSection';\n\ninterface Props {\n namespaces: CombinedRuleNamespace[];\n expandAll?: boolean;\n}\n\ntype GroupedRules = Record<PromAlertingRuleState, CombinedRule[]>;\n\nexport const RuleListStateView: FC<Props> = ({ namespaces }) => {\n const filters = getFiltersFromUrlParams(useQueryParams()[0]);\n\n const groupedRules = useMemo(() => {\n const result: GroupedRules = {\n [PromAlertingRuleState.Firing]: [],\n [PromAlertingRuleState.Inactive]: [],\n [PromAlertingRuleState.Pending]: [],\n };\n\n namespaces.forEach((namespace) =>\n namespace.groups.forEach((group) =>\n group.rules.forEach((rule) => {\n if (rule.promRule && isAlertingRule(rule.promRule)) {\n result[rule.promRule.state].push(rule);\n }\n })\n )\n );\n\n Object.values(result).forEach((rules) => rules.sort((a, b) => a.name.localeCompare(b.name)));\n\n return result;\n }, [namespaces]);\n return (\n <>\n {(!filters.alertState || filters.alertState === PromAlertingRuleState.Firing) && (\n <RuleListStateSection state={PromAlertingRuleState.Firing} rules={groupedRules[PromAlertingRuleState.Firing]} />\n )}\n {(!filters.alertState || filters.alertState === PromAlertingRuleState.Pending) && (\n <RuleListStateSection\n state={PromAlertingRuleState.Pending}\n rules={groupedRules[PromAlertingRuleState.Pending]}\n />\n )}\n {(!filters.alertState || filters.alertState === PromAlertingRuleState.Inactive) && (\n <RuleListStateSection\n defaultCollapsed={filters.alertState !== PromAlertingRuleState.Inactive}\n state={PromAlertingRuleState.Inactive}\n rules={groupedRules[PromAlertingRuleState.Inactive]}\n />\n )}\n </>\n );\n};\n","import React, { FC } from 'react';\nimport { useSelector } from 'react-redux';\n\nimport Page from 'app/core/components/Page/Page';\nimport { getNavModel } from 'app/core/selectors/navModel';\nimport { StoreState } from 'app/types/store';\n\ninterface Props {\n pageId: string;\n isLoading?: boolean;\n}\n\nexport const AlertingPageWrapper: FC<Props> = ({ children, pageId, isLoading }) => {\n const navModel = getNavModel(\n useSelector((state: StoreState) => state.navIndex),\n pageId\n );\n\n return (\n <Page navModel={navModel}>\n <Page.Contents isLoading={isLoading}>{children}</Page.Contents>\n </Page>\n );\n};\n","import React, { FC } from 'react';\n\nimport { contextSrv } from 'app/core/services/context_srv';\nimport { AccessControlAction } from 'app/types';\n\ntype Props = {\n actions: AccessControlAction[];\n fallback?: boolean;\n};\n\nexport const Authorize: FC<Props> = ({ actions, children, fallback = true }) => {\n if (actions.some((action) => contextSrv.hasAccess(action, fallback))) {\n return <>{children}</>;\n } else {\n return null;\n }\n};\n","import { css, cx } from '@emotion/css';\nimport React from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useStyles2 } from '@grafana/ui';\n\nimport { DynamicTable, DynamicTableProps } from './DynamicTable';\n\nexport type DynamicTableWithGuidelinesProps<T> = Omit<DynamicTableProps<T>, 'renderPrefixHeader, renderPrefixCell'>;\n\n// DynamicTable, but renders visual guidelines on the left, for larger screen widths\nexport const DynamicTableWithGuidelines = <T extends object>({\n renderExpandedContent,\n ...props\n}: DynamicTableWithGuidelinesProps<T>) => {\n const styles = useStyles2(getStyles);\n return (\n <DynamicTable\n renderExpandedContent={\n renderExpandedContent\n ? (item, index, items) => (\n <>\n {!(index === items.length - 1) && <div className={cx(styles.contentGuideline, styles.guideline)} />}\n {renderExpandedContent(item, index, items)}\n </>\n )\n : undefined\n }\n renderPrefixHeader={() => (\n <div className={styles.relative}>\n <div className={cx(styles.headerGuideline, styles.guideline)} />\n </div>\n )}\n renderPrefixCell={(_, index, items) => (\n <div className={styles.relative}>\n <div className={cx(styles.topGuideline, styles.guideline)} />\n {!(index === items.length - 1) && <div className={cx(styles.bottomGuideline, styles.guideline)} />}\n </div>\n )}\n {...props}\n />\n );\n};\n\nexport const getStyles = (theme: GrafanaTheme2) => ({\n relative: css`\n position: relative;\n height: 100%;\n `,\n guideline: css`\n left: -19px;\n border-left: 1px solid ${theme.colors.border.medium};\n position: absolute;\n\n ${theme.breakpoints.down('md')} {\n display: none;\n }\n `,\n topGuideline: css`\n width: 18px;\n border-bottom: 1px solid ${theme.colors.border.medium};\n top: 0;\n bottom: 50%;\n `,\n bottomGuideline: css`\n top: 50%;\n bottom: 0;\n `,\n contentGuideline: css`\n top: 0;\n bottom: 0;\n left: -49px !important;\n `,\n headerGuideline: css`\n top: -25px;\n bottom: 0;\n `,\n});\n","import React, { FC } from 'react';\n\nimport { Icon } from '@grafana/ui';\n\ninterface RuleLocationProps {\n namespace: string;\n group?: string;\n}\n\nconst RuleLocation: FC<RuleLocationProps> = ({ namespace, group }) => {\n if (!group) {\n return <>{namespace}</>;\n }\n\n return (\n <>\n {namespace} <Icon name=\"angle-right\" /> {group}\n </>\n );\n};\n\nexport { RuleLocation };\n","import React, { FC } from 'react';\n\nimport { IconName, Tooltip, LinkButton, Button } from '@grafana/ui';\nimport { PopoverContent, TooltipPlacement } from '@grafana/ui/src/components/Tooltip';\n\ninterface Props {\n tooltip: PopoverContent;\n icon: IconName;\n className?: string;\n tooltipPlacement?: TooltipPlacement;\n to?: string;\n target?: string;\n onClick?: () => void;\n 'data-testid'?: string;\n}\n\nexport const ActionIcon: FC<Props> = ({\n tooltip,\n icon,\n to,\n target,\n onClick,\n className,\n tooltipPlacement = 'top',\n ...rest\n}) => {\n const ariaLabel = typeof tooltip === 'string' ? tooltip : undefined;\n\n return (\n <Tooltip content={tooltip} placement={tooltipPlacement}>\n {to ? (\n <LinkButton\n variant=\"secondary\"\n fill=\"text\"\n icon={icon}\n href={to}\n size=\"sm\"\n target={target}\n {...rest}\n aria-label={ariaLabel}\n />\n ) : (\n <Button\n className={className}\n variant=\"secondary\"\n fill=\"text\"\n size=\"sm\"\n icon={icon}\n type=\"button\"\n onClick={onClick}\n {...rest}\n aria-label={ariaLabel}\n />\n )}\n </Tooltip>\n );\n};\n","import { css } from '@emotion/css';\nimport React, { FC } from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useStyles2 } from '@grafana/ui';\nimport { CombinedRule } from 'app/types/unified-alerting';\n\nimport { AlertLabels } from '../AlertLabels';\nimport { DetailsField } from '../DetailsField';\n\nimport { RuleDetailsActionButtons } from './RuleDetailsActionButtons';\nimport { RuleDetailsAnnotations } from './RuleDetailsAnnotations';\nimport { RuleDetailsDataSources } from './RuleDetailsDataSources';\nimport { RuleDetailsExpression } from './RuleDetailsExpression';\nimport { RuleDetailsMatchingInstances } from './RuleDetailsMatchingInstances';\n\ninterface Props {\n rule: CombinedRule;\n}\n\nexport const RuleDetails: FC<Props> = ({ rule }) => {\n const styles = useStyles2(getStyles);\n const {\n namespace: { rulesSource },\n } = rule;\n\n const annotations = Object.entries(rule.annotations).filter(([_, value]) => !!value.trim());\n\n return (\n <div>\n <RuleDetailsActionButtons rule={rule} rulesSource={rulesSource} />\n <div className={styles.wrapper}>\n <div className={styles.leftSide}>\n {!!rule.labels && !!Object.keys(rule.labels).length && (\n <DetailsField label=\"Labels\" horizontal={true}>\n <AlertLabels labels={rule.labels} />\n </DetailsField>\n )}\n <RuleDetailsExpression rulesSource={rulesSource} rule={rule} annotations={annotations} />\n <RuleDetailsAnnotations annotations={annotations} />\n </div>\n <div className={styles.rightSide}>\n <RuleDetailsDataSources rulesSource={rulesSource} rule={rule} />\n </div>\n </div>\n <RuleDetailsMatchingInstances rule={rule} />\n </div>\n );\n};\n\nexport const getStyles = (theme: GrafanaTheme2) => ({\n wrapper: css`\n display: flex;\n flex-direction: row;\n\n ${theme.breakpoints.down('md')} {\n flex-direction: column;\n }\n `,\n leftSide: css`\n flex: 1;\n `,\n rightSide: css`\n ${theme.breakpoints.up('md')} {\n padding-left: 90px;\n width: 300px;\n }\n `,\n});\n","import { css, cx } from '@emotion/css';\nimport React, { FC, useMemo } from 'react';\n\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useStyles2 } from '@grafana/ui';\nimport { CombinedRule } from 'app/types/unified-alerting';\n\nimport { useHasRuler } from '../../hooks/useHasRuler';\nimport { Annotation } from '../../utils/constants';\nimport { DynamicTable, DynamicTableColumnProps, DynamicTableItemProps } from '../DynamicTable';\nimport { DynamicTableWithGuidelines } from '../DynamicTableWithGuidelines';\nimport { RuleLocation } from '../RuleLocation';\n\nimport { RuleDetails } from './RuleDetails';\nimport { RuleHealth } from './RuleHealth';\nimport { RuleState } from './RuleState';\n\ntype RuleTableColumnProps = DynamicTableColumnProps<CombinedRule>;\ntype RuleTableItemProps = DynamicTableItemProps<CombinedRule>;\n\ninterface Props {\n rules: CombinedRule[];\n showGuidelines?: boolean;\n showGroupColumn?: boolean;\n showSummaryColumn?: boolean;\n emptyMessage?: string;\n className?: string;\n}\n\nexport const RulesTable: FC<Props> = ({\n rules,\n className,\n showGuidelines = false,\n emptyMessage = 'No rules found.',\n showGroupColumn = false,\n showSummaryColumn = false,\n}) => {\n const styles = useStyles2(getStyles);\n\n const wrapperClass = cx(styles.wrapper, className, { [styles.wrapperMargin]: showGuidelines });\n\n const items = useMemo((): RuleTableItemProps[] => {\n const seenKeys: string[] = [];\n return rules.map((rule, ruleIdx) => {\n let key = JSON.stringify([rule.promRule?.type, rule.labels, rule.query, rule.name, rule.annotations]);\n if (seenKeys.includes(key)) {\n key += `-${ruleIdx}`;\n }\n seenKeys.push(key);\n return {\n id: key,\n data: rule,\n };\n });\n }, [rules]);\n\n const columns = useColumns(showSummaryColumn, showGroupColumn);\n\n if (!rules.length) {\n return <div className={cx(wrapperClass, styles.emptyMessage)}>{emptyMessage}</div>;\n }\n\n const TableComponent = showGuidelines ? DynamicTableWithGuidelines : DynamicTable;\n\n return (\n <div className={wrapperClass} data-testid=\"rules-table\">\n <TableComponent\n cols={columns}\n isExpandable={true}\n items={items}\n renderExpandedContent={({ data: rule }) => <RuleDetails rule={rule} />}\n />\n </div>\n );\n};\n\nexport const getStyles = (theme: GrafanaTheme2) => ({\n wrapperMargin: css`\n ${theme.breakpoints.up('md')} {\n margin-left: 36px;\n }\n `,\n emptyMessage: css`\n padding: ${theme.spacing(1)};\n `,\n wrapper: css`\n width: auto;\n background-color: ${theme.colors.background.secondary};\n border-radius: ${theme.shape.borderRadius()};\n `,\n});\n\nfunction useColumns(showSummaryColumn: boolean, showGroupColumn: boolean) {\n const { hasRuler, rulerRulesLoaded } = useHasRuler();\n\n return useMemo((): RuleTableColumnProps[] => {\n const columns: RuleTableColumnProps[] = [\n {\n id: 'state',\n label: 'State',\n // eslint-disable-next-line react/display-name\n renderCell: ({ data: rule }) => {\n const { namespace } = rule;\n const { rulesSource } = namespace;\n const { promRule, rulerRule } = rule;\n const isDeleting = !!(hasRuler(rulesSource) && rulerRulesLoaded(rulesSource) && promRule && !rulerRule);\n const isCreating = !!(hasRuler(rulesSource) && rulerRulesLoaded(rulesSource) && rulerRule && !promRule);\n return <RuleState rule={rule} isDeleting={isDeleting} isCreating={isCreating} />;\n },\n size: '165px',\n },\n {\n id: 'name',\n label: 'Name',\n // eslint-disable-next-line react/display-name\n renderCell: ({ data: rule }) => rule.name,\n size: 5,\n },\n {\n id: 'health',\n label: 'Health',\n // eslint-disable-next-line react/display-name\n renderCell: ({ data: { promRule } }) => (promRule ? <RuleHealth rule={promRule} /> : null),\n size: '75px',\n },\n ];\n if (showSummaryColumn) {\n columns.push({\n id: 'summary',\n label: 'Summary',\n // eslint-disable-next-line react/display-name\n renderCell: ({ data: rule }) => rule.annotations[Annotation.summary] ?? '',\n size: 5,\n });\n }\n if (showGroupColumn) {\n columns.push({\n id: 'group',\n label: 'Group',\n // eslint-disable-next-line react/display-name\n renderCell: ({ data: rule }) => {\n const { namespace, group } = rule;\n // ungrouped rules are rules that are in the \"default\" group name\n const isUngrouped = group.name === 'default';\n const groupName = isUngrouped ? (\n <RuleLocation namespace={namespace.name} />\n ) : (\n <RuleLocation namespace={namespace.name} group={group.name} />\n );\n\n return groupName;\n },\n size: 5,\n });\n }\n return columns;\n }, [hasRuler, rulerRulesLoaded, showSummaryColumn, showGroupColumn]);\n}\n","import { useCallback } from 'react';\n\nimport { RulesSource } from 'app/types/unified-alerting';\n\nimport { getRulesSourceName, GRAFANA_RULES_SOURCE_NAME } from '../utils/datasource';\n\nimport { useUnifiedAlertingSelector } from './useUnifiedAlertingSelector';\n\n// datasource has ruler if it's grafana managed or if we're able to load rules from it\nexport function useHasRuler() {\n const rulerRules = useUnifiedAlertingSelector((state) => state.rulerRules);\n\n const hasRuler = useCallback(\n (rulesSource: string | RulesSource) => {\n const rulesSourceName = typeof rulesSource === 'string' ? rulesSource : rulesSource.name;\n return rulesSourceName === GRAFANA_RULES_SOURCE_NAME || !!rulerRules[rulesSourceName]?.result;\n },\n [rulerRules]\n );\n\n const rulerRulesLoaded = useCallback(\n (rulesSource: RulesSource) => {\n const rulesSourceName = getRulesSourceName(rulesSource);\n const result = rulerRules[rulesSourceName]?.result;\n\n return Boolean(result);\n },\n [rulerRules]\n );\n\n return { hasRuler, rulerRulesLoaded };\n}\n","import { useMemo } from 'react';\n\nimport { getRulesAccess } from './access-control';\n\nexport function useRulesAccess() {\n return useMemo(() => getRulesAccess(), []);\n}\n"],"names":["useCleanup","stateSelector","dispatch","useDispatch","selectorRef","useRef","current","useEffect","cleanUpAction","AlertHowToModal","onDismiss","Modal","title","isOpen","onClickBackdrop","VerticalGroup","spacing","src","alt","rule","search","onTogglePause","ruleUrl","url","panelId","renderText","useCallback","text","highlightClassName","textToHighlight","searchWords","Card","name","Icon","size","stateIcon","className","stateClass","stateText","stateAge","info","Button","variant","icon","state","onClick","LinkButton","href","DeprecationNotice","Alert","severity","getSearchQuery","searchQuery","getAlertRuleItems","regex","RegExp","alertRules","items","filter","item","test","mapDispatchToProps","getAlertRulesAsync","setSearchQuery","togglePauseAlertRule","connector","connect","navModel","getNavModel","navIndex","isLoading","AlertRuleListUnconnected","PureComponent","label","value","option","locationService","appEvents","ShowModalReactEvent","component","this","props","id","paused","componentDidMount","fetchRules","componentDidUpdate","prevProps","queryParams","getStateFilter","render","Page","FilterInput","placeholder","onChange","onSearchQueryChange","htmlFor","Select","inputId","options","stateFilters","onStateFilterChanged","config","onOpenHowTo","map","async","loadAlertRules","rules","getBackendSrv","get","loadedAlertRules","post","toString","createNotificationChannel","data","notifyApp","createSuccessNotification","error","createErrorNotification","updateNotificationChannel","put","testNotificationChannel","getState","channel","notificationChannel","loadNotificationTypes","notificationTypes","sort","o1","o2","setNotificationChannels","loadNotificationChannel","notificationChannelLoaded","NoRulesSplash","canCreateGrafanaRules","canCreateCloudRules","useRulesAccess","EmptyListCTA","buttonIcon","buttonLink","buttonTitle","proTip","proTipLink","proTipLinkTitle","proTipTarget","CallToActionCard","message","callToActionElement","RuleListErrors","expanded","setExpanded","useState","closed","setClosed","useLocalStorage","dataSourceConfigRequests","useUnifiedAlertingSelector","dataSources","promRuleRequests","promRules","rulerRuleRequests","rulerRules","styles","useStyles2","getStyles","errors","useMemo","dataSourceConfigErrors","promRequestErrors","rulerRequestErrors","requests","getRulesDataSources","reduce","result","dataSource","isRulerNotSupportedResponse","grafanaPromError","GRAFANA_RULES_SOURCE_NAME","grafanaRulerError","push","forEach","uid","length","ErrorSummaryButton","count","onRemove","idx","moreButton","fill","pluralize","floatRight","Tooltip","content","placement","theme","css","EditCloudGroupModal","namespace","group","onClose","loading","dispatched","updateLotexNamespaceAndGroup","initialAsyncRequestState","defaultValues","namespaceName","groupName","groupInterval","interval","unifiedAlerting","modal","Form","onSubmit","values","updateLotexNamespaceAndGroupAction","rulesSourceName","getRulesSourceName","rulesSource","newGroupName","newNamespaceName","undefined","register","formState","isDirty","Field","invalid","Input","required","pattern","durationValidationPattern","type","disabled","JSON","stringify","StateColoredText","children","status","PromAlertingRuleState","colors","success","warning","neutral","secondary","emptyStats","total","recording","RuleStats","showInactive","showRecording","namespaces","calculated","stats","calcRule","promRule","isAlertingRule","health","isRecordingRule","rulerRule","isRecordingRulerRule","groups","statsComponents","prev","curr","Fragment","RulesGroup","React","expandAll","isEditingGroup","setIsEditingGroup","isDeletingGroup","setIsDeletingGroup","isCollapsed","setIsCollapsed","canEditRules","hasRuler","rulerRulesLoaded","useHasRuler","folderUID","isGrafanaRulerRule","grafana_alert","namespace_uid","folder","useFolder","isDeleting","find","isFederated","isFederatedRuleGroup","actionIcons","HorizontalGroup","Spinner","baseUrl","kbn","canSave","ActionIcon","A","tooltip","to","target","canAdmin","RuleLocation","wrapper","header","CollapseToggle","collapseToggle","onToggle","isCloudRulesSource","meta","dataSourceIcon","logos","small","heading","Badge","color","spacer","headerStats","actionsSeparator","RulesTable","showSummaryColumn","rulesTable","showGuidelines","ConfirmModal","body","onConfirm","deleteRulesGroupAction","confirmText","displayName","background","breakpoints","down","dataSourceOrigin","CloudRules","dsConfigs","rulesDataSources","dataSourcesLoading","ds","sectionHeader","LoadingPlaceholder","loader","v1","xl","GrafanaRules","useStyles","useQueryParams","namespacesFormat","flattenGrafanaManagedRules","RuleListStateSection","defaultCollapsed","collapsed","setCollapsed","alertStateToReadable","showGroupColumn","ViewOptions","RuleTypeOptions","PromRuleType","container","sm","inputWidth","flexRow","spaceBetween","rowChild","clearButton","setQueryParams","filterKey","setFilterKey","Math","floor","random","dataSourceKey","queryStringKey","alertState","queryString","ruleType","getFiltersFromUrlParams","stateOptions","Object","entries","key","handleQueryStringChange","debounce","e","searchIcon","DataSourcePicker","alerting","noDefault","dataSourceValue","onClear","cx","Label","Stack","gap","prefix","defaultValue","RadioButtonGroup","String","view","fullWidth","setTimeout","reduceNamespaces","filters","namespaceAcc","reduceGroups","groupAcc","isQueryingDataSource","normalizedQueryString","toLocaleLowerCase","doesNameContainsQueryString","includes","matchers","parseMatchers","doRuleLabelsMatchQuery","labelsMatchMatchers","labels","doAlertsContainMatchingLabels","alerts","some","alert","query","datasourceUid","getDataSourceSrv","getInstanceSettings","VIEWS","grafanaNamespaces","cloudNamespaces","sorted","a","b","localeCompare","ns","isGrafanaRulesSource","Authorize","actions","AccessControlAction","groupedRules","RuleList","withErrorBoundary","rulesDataSourceNames","getAllRulesSourceNames","location","useLocation","setExpandAll","filtersActive","ViewComponent","fetchAllPromAndRulerRulesAction","setInterval","RULE_LIST_POLL_INTERVAL_MS","clearInterval","haveResults","keys","showNewAlertSplash","filteredNamespaces","useFilteredRules","useCombinedRuleNamespaces","AlertingPageWrapper","pageId","break","buttonsContainer","statsContainer","expandAllButton","urlUtil","returnTo","pathname","style","border","medium","useSelector","fallback","action","contextSrv","DynamicTableWithGuidelines","renderExpandedContent","index","contentGuideline","guideline","renderPrefixHeader","relative","headerGuideline","renderPrefixCell","_","topGuideline","bottomGuideline","tooltipPlacement","rest","ariaLabel","RuleDetails","annotations","trim","RuleDetailsActionButtons","leftSide","DetailsField","horizontal","AlertLabels","RuleDetailsExpression","RuleDetailsAnnotations","rightSide","RuleDetailsDataSources","RuleDetailsMatchingInstances","up","emptyMessage","wrapperClass","wrapperMargin","seenKeys","ruleIdx","columns","renderCell","isCreating","RuleState","RuleHealth","Annotation","useColumns","TableComponent","DynamicTable","cols","isExpandable","shape","borderRadius","Boolean","getRulesAccess"],"sourceRoot":""}