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,GACA,aAAAE,GACA,cAAe,CAAE,QAASK,EAAkB,EAC5C,WAAYxB,EAAa,KACzB,iBAAAY,EACA,SAAUZ,EAAa,SACvB,WAAYsB,GACZ,iBAAkB,IAClB,gBAAAZ,EACA,kBAAAC,CAAA,CAAsC,CAE9E,CACF,CAEJ,E,sCCpHA,SA7B+B,IAC7B,gBAAC,KAAa,CAAC,MAAM,iBACnB,gBAACgB,GAAA,EAAoB,IAAC,EACtB,gBAAC,MAAW,MAAM,gBACN,QACE,gBAAC,KAAW,CAAC,YAAY,6BACvB,gBAAC,IAAa,CAAC,GAAIhF,EAAA,GAAO,OAAO,cAAc,QAC7C,gBAAC,SAAM,CAAC,QAAQ,WAAU,qBAAmB,CAC/C,CACF,EAEF,kBAAmB,CACjB,MAAO,uBACP,KAAMiF,GAAA,EAAW,MAAM,MACzB,GACV,gBAAC,YAAK,+OAGN,CACF,EAEA,gBAAC,MAAG,CAAC,UAAU,WACb,gBAAC,MAAG,CAAC,GAAI,IACP,gBAAC,GAA2B,IAAC,CAC/B,CACF,CACF,C","sources":["webpack://graylog-web-interface/./src/components/event-notifications/event-notifications/Constants.ts","webpack://graylog-web-interface/./src/components/event-notifications/event-notifications/NotificationConfigTypeCell.tsx","webpack://graylog-web-interface/./src/components/event-notifications/event-notifications/NotificationTitle.tsx","webpack://graylog-web-interface/./src/components/event-notifications/event-notifications/EventNotificationActions.tsx","webpack://graylog-web-interface/./src/components/event-notifications/event-notifications/BulkActions.tsx","webpack://graylog-web-interface/./src/components/event-notifications/hooks/useEventNotifications.ts","webpack://graylog-web-interface/./src/components/event-notifications/hooks/useNotificationTest.ts","webpack://graylog-web-interface/./src/components/event-notifications/event-notifications/EventNotificationsContainer.tsx","webpack://graylog-web-interface/./src/pages/EventNotificationsPage.tsx"],"sourcesContent":["/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport type { Sort } from 'stores/PaginationTypes';\n\nexport const ENTITY_TABLE_ID = 'event_notifications';\nexport const DEFAULT_LAYOUT = {\n pageSize: 20,\n sort: { attributeId: 'title', direction: 'asc' } as Sort,\n displayedColumns: ['title', 'description', 'type', 'created_at'],\n columnsOrder: ['title', 'description', 'type', 'created_at'],\n};\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\nimport { PluginStore } from 'graylog-web-plugin/plugin';\n\nimport type { EventNotification } from 'stores/event-notifications/EventNotificationsStore';\n\ntype Props = {\n notification: EventNotification\n}\n\nconst getNotificationPlugin = (type: string) => {\n if (type === undefined) {\n return {};\n }\n\n return PluginStore.exports('eventNotificationTypes').find((n) => n.type === type) || { displayName: null };\n};\n\nconst NotificationConfigTypeCell = ({ notification }: Props) => {\n const plugin = getNotificationPlugin(notification.config.type);\n\n return (\n {plugin?.displayName || notification.config.type}\n );\n};\n\nexport default NotificationConfigTypeCell;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport React from 'react';\n\nimport type { EventNotification, TestResults } from 'stores/event-notifications/EventNotificationsStore';\nimport { Spinner } from 'components/common';\nimport { Link } from 'components/common/router';\nimport Routes from 'routing/Routes';\n\ntype Props = {\n notification: EventNotification\n testResults: TestResults\n}\n\nconst NotificationTitle = ({ notification, testResults }: Props) => {\n const result = testResults?.[notification.id];\n\n return (\n <>\n {notification.title}\n {result?.id === notification.id ? (\n \n {result.isLoading ? (\n \n ) : (\n \n {result.error ? 'Error' : 'Success'}: {result.message}\n
\n )}\n \n ) : null}\n >\n );\n};\n\nexport default NotificationTitle;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\nimport { useState } from 'react';\n\nimport UserNotification from 'util/UserNotification';\nimport { ConfirmDialog, IfPermitted, ShareButton } from 'components/common';\nimport { LinkContainer } from 'components/common/router';\nimport Routes from 'routing/Routes';\nimport { MenuItem, ButtonToolbar } from 'components/bootstrap';\nimport type { EventNotification } from 'stores/event-notifications/EventNotificationsStore';\nimport { EventNotificationsActions } from 'stores/event-notifications/EventNotificationsStore';\nimport EntityShareModal from 'components/permissions/EntityShareModal';\nimport OverlayDropdownButton from 'components/common/OverlayDropdownButton';\nimport useSendTelemetry from 'logic/telemetry/useSendTelemetry';\nimport { MORE_ACTIONS_TITLE, MORE_ACTIONS_HOVER_TITLE } from 'components/common/EntityDataTable/Constants';\nimport { TELEMETRY_EVENT_TYPE } from 'logic/telemetry/Constants';\nimport { getPathnameWithoutId } from 'util/URLUtils';\nimport useLocation from 'routing/useLocation';\n\ntype Props = {\n isTestLoading: boolean,\n notification: EventNotification,\n onTest: (notification: EventNotification) => void,\n refetchEventNotification: () => void,\n};\n\nconst EventNotificationActions = ({ isTestLoading, notification, refetchEventNotification, onTest }: Props) => {\n const [showDialog, setShowDialog] = useState(false);\n const [showShareNotification, setShowShareNotification] = useState(undefined);\n const sendTelemetry = useSendTelemetry();\n const { pathname } = useLocation();\n\n const onDelete = () => {\n sendTelemetry(TELEMETRY_EVENT_TYPE.NOTIFICATIONS.ROW_ACTION_DELETE_CLICKED, {\n app_pathname: getPathnameWithoutId(pathname),\n app_section: 'event-notification',\n app_action_value: 'notification-delete',\n });\n\n setShowDialog(true);\n };\n\n const handleClearState = () => {\n setShowDialog(false);\n refetchEventNotification();\n };\n\n const handleDelete = () => {\n EventNotificationsActions.delete(notification).then(\n () => {\n UserNotification.success('Event Notification deleted successfully',\n `Event Notification \"${notification.title}\" was deleted successfully.`);\n },\n (error) => {\n UserNotification.error(`Deleting Event Notification \"${notification.title}\" failed with status: ${error}`,\n 'Could not delete Event Notification');\n },\n ).finally(() => {\n handleClearState();\n });\n };\n\n return (\n <>\n \n setShowShareNotification(notification)}\n bsSize=\"xsmall\" />\n\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n {showDialog && (\n \n {`Are you sure you want to delete \"${notification.title}\"`}\n \n )}\n {showShareNotification && (\n setShowShareNotification(undefined)} />\n )}\n >\n );\n};\n\nexport default EventNotificationActions;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\nimport uniq from 'lodash/uniq';\nimport { useCallback } from 'react';\nimport { useQueryClient } from '@tanstack/react-query';\n\nimport ApiRoutes from 'routing/ApiRoutes';\nimport type FetchError from 'logic/errors/FetchError';\nimport fetch from 'logic/rest/FetchProvider';\nimport { getPathnameWithoutId, qualifyUrl } from 'util/URLUtils';\nimport UserNotification from 'util/UserNotification';\nimport { MenuItem } from 'components/bootstrap';\nimport StringUtils from 'util/StringUtils';\nimport BulkActionsDropdown from 'components/common/EntityDataTable/BulkActionsDropdown';\nimport useSendTelemetry from 'logic/telemetry/useSendTelemetry';\nimport { TELEMETRY_EVENT_TYPE } from 'logic/telemetry/Constants';\nimport useLocation from 'routing/useLocation';\n\ntype Props = {\n selectedNotificationsIds: Array,\n setSelectedNotificationsIds: (definitionIds: Array) => void,\n refetchEventNotifications: () => void,\n};\n\nconst BulkActions = ({ selectedNotificationsIds, setSelectedNotificationsIds, refetchEventNotifications }: Props) => {\n const queryClient = useQueryClient();\n const sendTelemetry = useSendTelemetry();\n const { pathname } = useLocation();\n const selectedItemsAmount = selectedNotificationsIds?.length;\n const descriptor = StringUtils.pluralize(selectedItemsAmount, 'event notification', 'event notifications');\n\n const onDelete = useCallback(() => {\n sendTelemetry(TELEMETRY_EVENT_TYPE.NOTIFICATIONS.BULK_ACTION_DELETE_CLICKED, {\n app_pathname: getPathnameWithoutId(pathname),\n app_section: 'event-notification-bulk',\n app_action_value: 'bulk-delete-button',\n });\n\n // eslint-disable-next-line no-alert\n if (window.confirm(`Do you really want to remove ${selectedItemsAmount} ${descriptor}?`)) {\n const deleteCalls = selectedNotificationsIds.map((notificationId) => fetch('DELETE', qualifyUrl(ApiRoutes.EventNotificationsApiController.delete(notificationId).url)).then(() => notificationId));\n\n Promise.allSettled(deleteCalls).then((result) => {\n const fulfilledRequests = result.filter((response) => response.status === 'fulfilled') as Array<{\n status: 'fulfilled',\n value: string\n }>;\n const deletedNotificationIds = fulfilledRequests.map(({ value }) => value);\n const notDeletedNotificationIds = selectedNotificationsIds?.filter((streamId) => !deletedNotificationIds.includes(streamId));\n\n if (notDeletedNotificationIds.length) {\n const rejectedRequests = result.filter((response) => response.status === 'rejected') as Array<{\n status: 'rejected',\n reason: FetchError\n }>;\n const errorMessages = uniq(rejectedRequests.map((request) => request.reason.responseMessage));\n\n if (notDeletedNotificationIds.length !== selectedNotificationsIds.length) {\n queryClient.invalidateQueries(['eventNotifications', 'overview']);\n }\n\n UserNotification.error(`${notDeletedNotificationIds.length} out of ${selectedNotificationsIds} selected ${descriptor} could not be deleted. Status: ${errorMessages.join()}`);\n\n return;\n }\n\n queryClient.invalidateQueries(['eventNotifications', 'overview']);\n setSelectedNotificationsIds(notDeletedNotificationIds);\n refetchEventNotifications();\n UserNotification.success(`${selectedItemsAmount} ${descriptor} ${StringUtils.pluralize(selectedItemsAmount, 'was', 'were')} deleted successfully.`, 'Success');\n });\n }\n }, [sendTelemetry, pathname, selectedItemsAmount, descriptor, selectedNotificationsIds, queryClient, setSelectedNotificationsIds, refetchEventNotifications]);\n\n return (\n \n \n \n );\n};\n\nexport default BulkActions;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport { useQuery } from '@tanstack/react-query';\n\nimport UserNotification from 'util/UserNotification';\nimport type { SearchParams } from 'stores/PaginationTypes';\nimport type { EventNotification } from 'stores/event-notifications/EventNotificationsStore';\nimport { EventNotificationsStore } from 'stores/event-notifications/EventNotificationsStore';\n\ntype Options = {\n enabled: boolean,\n}\n\nconst useEventNotifications = (searchParams: SearchParams, { enabled }: Options = { enabled: true }): {\n data: {\n elements: Array,\n pagination: { total: number }\n attributes: Array<{ id: string, title: string, sortable: boolean }>\n } | undefined,\n refetch: () => void,\n isInitialLoading: boolean,\n} => {\n const { data, refetch, isInitialLoading } = useQuery(\n ['eventNotifications', 'overview', searchParams],\n () => EventNotificationsStore.searchPaginated(\n searchParams.page,\n searchParams.pageSize,\n searchParams.query,\n { sort: searchParams?.sort.attributeId, order: searchParams?.sort.direction },\n ),\n {\n onError: (errorThrown) => {\n UserNotification.error(`Loading event notifications failed with status: ${errorThrown}`,\n 'Could not load event notifications');\n },\n keepPreviousData: true,\n enabled,\n },\n );\n\n return ({\n data,\n refetch,\n isInitialLoading,\n });\n};\n\nexport default useEventNotifications;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport { useState } from 'react';\n\nimport type { EventNotification, TestResults } from 'stores/event-notifications/EventNotificationsStore';\nimport { EventNotificationsActions } from 'stores/event-notifications/EventNotificationsStore';\n\ntype UseNotificationTestType = {\n isLoadingTest: boolean,\n testResults: TestResults\n getNotificationTest: (notification: EventNotification) => void,\n}\n\nconst useNotificationTest = (): UseNotificationTestType => {\n const [testResults, setTestResults] = useState(undefined);\n\n const getNotificationTest = (notification: EventNotification) => {\n setTestResults({ [notification.id]: { isLoading: true, id: notification.id } });\n let result = { isLoading: false, id: null, error: null, message: null };\n\n EventNotificationsActions.testPersisted(notification)\n .then(\n (response) => {\n result = {\n ...result,\n id: notification.id,\n error: false,\n message: 'Notification was executed successfully.',\n };\n\n setTestResults({ [notification.id]: result });\n\n return response;\n },\n (errorResponse) => {\n result = { isLoading: false, id: notification.id, error: true, message: null };\n\n if (errorResponse.status !== 400 || !errorResponse.additional.body || !errorResponse.additional.body.failed) {\n result.message = errorResponse.responseMessage || 'Unknown errorResponse, please check your Graylog server logs.';\n }\n\n setTestResults({ [notification.id]: result });\n\n return errorResponse;\n },\n );\n };\n\n return {\n isLoadingTest: testResults?.isLoading,\n testResults,\n getNotificationTest,\n };\n};\n\nexport default useNotificationTest;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\nimport { useState, useMemo, useCallback } from 'react';\n\nimport type { ColumnRenderers } from 'components/common/EntityDataTable';\nimport { EntityDataTable, NoSearchResult, PaginatedList, QueryHelper, SearchForm, Spinner } from 'components/common';\nimport type { EventNotification, TestResults } from 'stores/event-notifications/EventNotificationsStore';\nimport type { Sort } from 'stores/PaginationTypes';\nimport usePaginationQueryParameter from 'hooks/usePaginationQueryParameter';\nimport useTableLayout from 'components/common/EntityDataTable/hooks/useTableLayout';\nimport useUpdateUserLayoutPreferences from 'components/common/EntityDataTable/hooks/useUpdateUserLayoutPreferences';\nimport { ENTITY_TABLE_ID, DEFAULT_LAYOUT } from 'components/event-notifications/event-notifications/Constants';\nimport useSendTelemetry from 'logic/telemetry/useSendTelemetry';\nimport { TELEMETRY_EVENT_TYPE } from 'logic/telemetry/Constants';\nimport { getPathnameWithoutId } from 'util/URLUtils';\nimport useLocation from 'routing/useLocation';\n\nimport NotificationConfigTypeCell from './NotificationConfigTypeCell';\nimport NotificationTitle from './NotificationTitle';\nimport EventNotificationActions from './EventNotificationActions';\nimport BulkActions from './BulkActions';\n\nimport useEventNotifications from '../hooks/useEventNotifications';\nimport useNotificationTest from '../hooks/useNotificationTest';\n\n// Import built-in Event Notification Types\nimport '../event-notification-types';\n\nconst customColumnRenderers = (testResults: TestResults): ColumnRenderers => ({\n attributes: {\n title: {\n renderCell: (_title: string, notification) => ,\n },\n type: {\n renderCell: (_type: string, notification) => (\n \n ),\n },\n },\n});\n\nconst EventNotificationsContainer = () => {\n const [query, setQuery] = useState('');\n const { layoutConfig, isInitialLoading: isLoadingLayoutPreferences } = useTableLayout({\n entityTableId: ENTITY_TABLE_ID,\n defaultPageSize: DEFAULT_LAYOUT.pageSize,\n defaultDisplayedAttributes: DEFAULT_LAYOUT.displayedColumns,\n defaultSort: DEFAULT_LAYOUT.sort,\n });\n const paginationQueryParameter = usePaginationQueryParameter(undefined, layoutConfig.pageSize, false);\n const { mutate: updateTableLayout } = useUpdateUserLayoutPreferences(ENTITY_TABLE_ID);\n const {\n data: paginatedEventNotifications,\n refetch: refetchEventNotifications,\n isInitialLoading: isLoadingEventNotifications,\n } = useEventNotifications({\n query,\n page: paginationQueryParameter.page,\n pageSize: layoutConfig.pageSize,\n sort: layoutConfig.sort,\n });\n const { isLoadingTest, testResults, getNotificationTest } = useNotificationTest();\n const sendTelemetry = useSendTelemetry();\n const { pathname } = useLocation();\n const columnRenderers = useMemo(() => customColumnRenderers(testResults), [testResults]);\n const columnDefinitions = useMemo(\n () => ([...(paginatedEventNotifications?.attributes ?? [])]),\n [paginatedEventNotifications?.attributes],\n );\n\n const onPageSizeChange = useCallback((newPageSize: number) => {\n paginationQueryParameter.setPagination({ page: 1, pageSize: newPageSize });\n updateTableLayout({ perPage: newPageSize });\n }, [paginationQueryParameter, updateTableLayout]);\n\n const onSearch = useCallback((newQuery: string) => {\n paginationQueryParameter.resetPage();\n setQuery(newQuery);\n }, [paginationQueryParameter]);\n\n const onReset = useCallback(() => {\n onSearch('');\n }, [onSearch]);\n\n const onColumnsChange = useCallback((displayedAttributes: Array) => {\n updateTableLayout({ displayedAttributes });\n }, [updateTableLayout]);\n\n const onSortChange = useCallback((newSort: Sort) => {\n paginationQueryParameter.resetPage();\n updateTableLayout({ sort: newSort });\n }, [paginationQueryParameter, updateTableLayout]);\n\n const handleTest = useCallback((notification: EventNotification) => {\n sendTelemetry(TELEMETRY_EVENT_TYPE.NOTIFICATIONS.ROW_ACTION_TEST_CLICKED, {\n app_pathname: getPathnameWithoutId(pathname),\n app_section: 'event-notification',\n app_action_value: 'notification-test',\n });\n\n getNotificationTest(notification);\n refetchEventNotifications();\n }, [getNotificationTest, pathname, refetchEventNotifications, sendTelemetry]);\n\n const renderEventDefinitionActions = useCallback((listItem: EventNotification) => (\n \n ), [handleTest, isLoadingTest, refetchEventNotifications]);\n\n const renderBulkActions = (\n selectedNotificationsIds: Array,\n setSelectedNotificationsIds: (eventDefinitionsId: Array) => void,\n ) => (\n \n );\n\n if (isLoadingLayoutPreferences || isLoadingEventNotifications) {\n return ;\n }\n\n const { elements, pagination: { total } } = paginatedEventNotifications;\n\n return (\n \n \n } />\n \n \n {elements?.length === 0 ? (\n No notification has been found \n ) : (\n data={elements}\n visibleColumns={layoutConfig.displayedAttributes}\n columnsOrder={DEFAULT_LAYOUT.columnsOrder}\n onColumnsChange={onColumnsChange}\n onSortChange={onSortChange}\n bulkSelection={{ actions: renderBulkActions }}\n activeSort={layoutConfig.sort}\n onPageSizeChange={onPageSizeChange}\n pageSize={layoutConfig.pageSize}\n rowActions={renderEventDefinitionActions}\n actionsCellWidth={160}\n columnRenderers={columnRenderers}\n columnDefinitions={columnDefinitions} />\n )}\n \n \n );\n};\n\nexport default EventNotificationsContainer;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport React from 'react';\n\nimport { LinkContainer } from 'components/common/router';\nimport { Button, Col, Row } from 'components/bootstrap';\nimport { DocumentTitle, IfPermitted, PageHeader } from 'components/common';\nimport EventNotificationsContainer from 'components/event-notifications/event-notifications/EventNotificationsContainer';\nimport Routes from 'routing/Routes';\nimport DocsHelper from 'util/DocsHelper';\nimport EventsPageNavigation from 'components/events/EventsPageNavigation';\n\nconst EventNotificationsPage = () => (\n \n \n \n \n \n \n \n )}\n documentationLink={{\n title: 'Alerts documentation',\n path: DocsHelper.PAGES.ALERTS,\n }}>\n \n Notifications alert you of any configured Event when they occur. Graylog can send Notifications directly\n to you or to other systems you use for that purpose. Remember to assign Notifications while creating or editing an Event Definition.\n \n \n\n \n \n \n \n
\n \n);\n\nexport default EventNotificationsPage;\n"],"names":["ENTITY_TABLE_ID","DEFAULT_LAYOUT","getNotificationPlugin","type","notification","plugin","testResults","result","Routes","isTestLoading","refetchEventNotification","onTest","showDialog","setShowDialog","showShareNotification","setShowShareNotification","sendTelemetry","useSendTelemetry","pathname","useLocation","onDelete","handleClearState","handleDelete","UserNotification","error","OverlayDropdownButton","EntityShareModal","selectedNotificationsIds","setSelectedNotificationsIds","refetchEventNotifications","queryClient","selectedItemsAmount","descriptor","StringUtils","deleteCalls","notificationId","ApiRoutes","deletedNotificationIds","response","value","notDeletedNotificationIds","streamId","rejectedRequests","errorMessages","request","BulkActionsDropdown","searchParams","enabled","data","refetch","isInitialLoading","EventNotificationsStore","errorThrown","setTestResults","getNotificationTest","errorResponse","customColumnRenderers","_title","_type","query","setQuery","layoutConfig","isLoadingLayoutPreferences","useTableLayout","paginationQueryParameter","usePaginationQueryParameter","updateTableLayout","useUpdateUserLayoutPreferences","paginatedEventNotifications","isLoadingEventNotifications","isLoadingTest","columnRenderers","columnDefinitions","onPageSizeChange","newPageSize","onSearch","newQuery","onReset","onColumnsChange","displayedAttributes","onSortChange","newSort","handleTest","renderEventDefinitionActions","listItem","renderBulkActions","elements","total","EventsPageNavigation","DocsHelper"],"sourceRoot":""}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy