mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 14:18:58 +08:00
Merge branch 'develop' of https://github.com/SigNoz/signoz into develop
This commit is contained in:
commit
d787298600
@ -144,6 +144,8 @@ Moreover, SigNoz has few more advanced features wrt Jaeger:
|
|||||||
- SigNoz Logs management are based on ClickHouse, a columnar OLAP datastore which makes aggregate log analytics queries much more efficient
|
- SigNoz Logs management are based on ClickHouse, a columnar OLAP datastore which makes aggregate log analytics queries much more efficient
|
||||||
- 50% lower resource requirement compared to Elastic during ingestion
|
- 50% lower resource requirement compared to Elastic during ingestion
|
||||||
|
|
||||||
|
We have published benchmarks comparing Elastic with SigNoz. Check it out [here](https://signoz.io/blog/logs-performance-benchmark/?utm_source=github-readme&utm_medium=logs-benchmark)
|
||||||
|
|
||||||
<p>  </p>
|
<p>  </p>
|
||||||
|
|
||||||
### SigNoz vs Loki
|
### SigNoz vs Loki
|
||||||
@ -152,6 +154,8 @@ Moreover, SigNoz has few more advanced features wrt Jaeger:
|
|||||||
- SigNoz supports indexes over high cardinality data and has no limitations on the number of indexes, while Loki reaches max streams with a few indexes added to it.
|
- SigNoz supports indexes over high cardinality data and has no limitations on the number of indexes, while Loki reaches max streams with a few indexes added to it.
|
||||||
- Searching over a huge volume of data is difficult and slow in Loki compared to SigNoz
|
- Searching over a huge volume of data is difficult and slow in Loki compared to SigNoz
|
||||||
|
|
||||||
|
We have published benchmarks comparing Loki with SigNoz. Check it out [here](https://signoz.io/blog/logs-performance-benchmark/?utm_source=github-readme&utm_medium=logs-benchmark)
|
||||||
|
|
||||||
<br /><br />
|
<br /><br />
|
||||||
|
|
||||||
<img align="left" src="https://signoz-public.s3.us-east-2.amazonaws.com/Contributors.svg" width="50px" />
|
<img align="left" src="https://signoz-public.s3.us-east-2.amazonaws.com/Contributors.svg" width="50px" />
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import { notification } from 'antd';
|
|
||||||
import getLocalStorageApi from 'api/browser/localstorage/get';
|
import getLocalStorageApi from 'api/browser/localstorage/get';
|
||||||
import loginApi from 'api/user/login';
|
import loginApi from 'api/user/login';
|
||||||
import { Logout } from 'api/utils';
|
import { Logout } from 'api/utils';
|
||||||
import Spinner from 'components/Spinner';
|
import Spinner from 'components/Spinner';
|
||||||
import { LOCALSTORAGE } from 'constants/localStorage';
|
import { LOCALSTORAGE } from 'constants/localStorage';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import React, { useEffect, useMemo } from 'react';
|
import React, { useEffect, useMemo } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@ -47,7 +47,7 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
|
|||||||
|
|
||||||
const dispatch = useDispatch<Dispatch<AppActions>>();
|
const dispatch = useDispatch<Dispatch<AppActions>>();
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const currentRoute = mapRoutes.get('current');
|
const currentRoute = mapRoutes.get('current');
|
||||||
|
|
||||||
@ -157,12 +157,7 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
|
|||||||
|
|
||||||
// NOTE: disabling this rule as there is no need to have div
|
// NOTE: disabling this rule as there is no need to have div
|
||||||
// eslint-disable-next-line react/jsx-no-useless-fragment
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
||||||
return (
|
return <>{children}</>;
|
||||||
<>
|
|
||||||
{NotificationElement}
|
|
||||||
{children}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PrivateRouteProps {
|
interface PrivateRouteProps {
|
||||||
|
@ -3,6 +3,7 @@ import NotFound from 'components/NotFound';
|
|||||||
import Spinner from 'components/Spinner';
|
import Spinner from 'components/Spinner';
|
||||||
import AppLayout from 'container/AppLayout';
|
import AppLayout from 'container/AppLayout';
|
||||||
import { useThemeConfig } from 'hooks/useDarkMode';
|
import { useThemeConfig } from 'hooks/useDarkMode';
|
||||||
|
import { NotificationProvider } from 'hooks/useNotifications';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import React, { Suspense } from 'react';
|
import React, { Suspense } from 'react';
|
||||||
import { Route, Router, Switch } from 'react-router-dom';
|
import { Route, Router, Switch } from 'react-router-dom';
|
||||||
@ -15,6 +16,7 @@ function App(): JSX.Element {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ConfigProvider theme={themeConfig}>
|
<ConfigProvider theme={themeConfig}>
|
||||||
|
<NotificationProvider>
|
||||||
<Router history={history}>
|
<Router history={history}>
|
||||||
<PrivateRoute>
|
<PrivateRoute>
|
||||||
<AppLayout>
|
<AppLayout>
|
||||||
@ -35,6 +37,7 @@ function App(): JSX.Element {
|
|||||||
</AppLayout>
|
</AppLayout>
|
||||||
</PrivateRoute>
|
</PrivateRoute>
|
||||||
</Router>
|
</Router>
|
||||||
|
</NotificationProvider>
|
||||||
</ConfigProvider>
|
</ConfigProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { notification, Popover } from 'antd';
|
import { Popover } from 'antd';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useCallback, useEffect } from 'react';
|
import React, { useCallback, useEffect } from 'react';
|
||||||
import { useCopyToClipboard } from 'react-use';
|
import { useCopyToClipboard } from 'react-use';
|
||||||
|
|
||||||
@ -7,7 +8,7 @@ function CopyClipboardHOC({
|
|||||||
children,
|
children,
|
||||||
}: CopyClipboardHOCProps): JSX.Element {
|
}: CopyClipboardHOCProps): JSX.Element {
|
||||||
const [value, setCopy] = useCopyToClipboard();
|
const [value, setCopy] = useCopyToClipboard();
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (value.value) {
|
if (value.value) {
|
||||||
notifications.success({
|
notifications.success({
|
||||||
@ -22,7 +23,6 @@ function CopyClipboardHOC({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<span onClick={onClick} onKeyDown={onClick} role="button" tabIndex={0}>
|
<span onClick={onClick} onKeyDown={onClick} role="button" tabIndex={0}>
|
||||||
{NotificationElement}
|
|
||||||
<Popover
|
<Popover
|
||||||
placement="top"
|
placement="top"
|
||||||
content={<span style={{ fontSize: '0.9rem' }}>Copy to clipboard</span>}
|
content={<span style={{ fontSize: '0.9rem' }}>Copy to clipboard</span>}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { blue, grey, orange } from '@ant-design/colors';
|
import { blue, grey, orange } from '@ant-design/colors';
|
||||||
import { CopyFilled, ExpandAltOutlined } from '@ant-design/icons';
|
import { CopyFilled, ExpandAltOutlined } from '@ant-design/icons';
|
||||||
import { Button, Divider, notification, Row, Typography } from 'antd';
|
import { Button, Divider, Row, Typography } from 'antd';
|
||||||
import { map } from 'd3';
|
import { map } from 'd3';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import { FlatLogData } from 'lib/logs/flatLogData';
|
import { FlatLogData } from 'lib/logs/flatLogData';
|
||||||
import React, { useCallback, useMemo } from 'react';
|
import React, { useCallback, useMemo } from 'react';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
@ -79,7 +80,7 @@ function LogItem({ logData }: LogItemProps): JSX.Element {
|
|||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const flattenLogData = useMemo(() => FlatLogData(logData), [logData]);
|
const flattenLogData = useMemo(() => FlatLogData(logData), [logData]);
|
||||||
const [, setCopy] = useCopyToClipboard();
|
const [, setCopy] = useCopyToClipboard();
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const handleDetailedView = useCallback(() => {
|
const handleDetailedView = useCallback(() => {
|
||||||
dispatch({
|
dispatch({
|
||||||
@ -97,7 +98,6 @@ function LogItem({ logData }: LogItemProps): JSX.Element {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
{NotificationElement}
|
|
||||||
<div>
|
<div>
|
||||||
<div>
|
<div>
|
||||||
{'{'}
|
{'{'}
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
/* eslint-disable react/display-name */
|
/* eslint-disable react/display-name */
|
||||||
import { Button, notification } from 'antd';
|
import { Button } from 'antd';
|
||||||
import { ColumnsType } from 'antd/lib/table';
|
import { ColumnsType } from 'antd/lib/table';
|
||||||
import { ResizeTable } from 'components/ResizeTable';
|
import { ResizeTable } from 'components/ResizeTable';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
import useComponentPermission from 'hooks/useComponentPermission';
|
import useComponentPermission from 'hooks/useComponentPermission';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@ -17,7 +18,7 @@ import Delete from './Delete';
|
|||||||
|
|
||||||
function AlertChannels({ allChannels }: AlertChannelsProps): JSX.Element {
|
function AlertChannels({ allChannels }: AlertChannelsProps): JSX.Element {
|
||||||
const { t } = useTranslation(['channels']);
|
const { t } = useTranslation(['channels']);
|
||||||
const [notifications, Element] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
const [channels, setChannels] = useState<Channels[]>(allChannels);
|
const [channels, setChannels] = useState<Channels[]>(allChannels);
|
||||||
const { role } = useSelector<AppState, AppReducer>((state) => state.app);
|
const { role } = useSelector<AppState, AppReducer>((state) => state.app);
|
||||||
const [action] = useComponentPermission(['new_alert_action'], role);
|
const [action] = useComponentPermission(['new_alert_action'], role);
|
||||||
@ -63,12 +64,7 @@ function AlertChannels({ allChannels }: AlertChannelsProps): JSX.Element {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return <ResizeTable columns={columns} dataSource={channels} rowKey="id" />;
|
||||||
<>
|
|
||||||
{Element}
|
|
||||||
<ResizeTable columns={columns} dataSource={channels} rowKey="id" />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AlertChannelsProps {
|
interface AlertChannelsProps {
|
||||||
|
@ -3,7 +3,6 @@ import {
|
|||||||
Button,
|
Button,
|
||||||
Card,
|
Card,
|
||||||
Input,
|
Input,
|
||||||
notification,
|
|
||||||
Space,
|
Space,
|
||||||
TableProps,
|
TableProps,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
@ -18,6 +17,7 @@ import getErrorCounts from 'api/errors/getErrorCounts';
|
|||||||
import { ResizeTable } from 'components/ResizeTable';
|
import { ResizeTable } from 'components/ResizeTable';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import useUrlQuery from 'hooks/useUrlQuery';
|
import useUrlQuery from 'hooks/useUrlQuery';
|
||||||
import createQueryParams from 'lib/createQueryParams';
|
import createQueryParams from 'lib/createQueryParams';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
@ -127,7 +127,7 @@ function AllErrors(): JSX.Element {
|
|||||||
enabled: !loading,
|
enabled: !loading,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (data?.error) {
|
if (data?.error) {
|
||||||
@ -386,8 +386,6 @@ function AllErrors(): JSX.Element {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
{NotificationElement}
|
|
||||||
<ResizeTable
|
<ResizeTable
|
||||||
columns={columns}
|
columns={columns}
|
||||||
tableLayout="fixed"
|
tableLayout="fixed"
|
||||||
@ -403,7 +401,6 @@ function AllErrors(): JSX.Element {
|
|||||||
}}
|
}}
|
||||||
onChange={onChangeHandler}
|
onChange={onChangeHandler}
|
||||||
/>
|
/>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { notification } from 'antd';
|
|
||||||
import getDynamicConfigs from 'api/dynamicConfigs/getDynamicConfigs';
|
import getDynamicConfigs from 'api/dynamicConfigs/getDynamicConfigs';
|
||||||
import getFeaturesFlags from 'api/features/getFeatureFlags';
|
import getFeaturesFlags from 'api/features/getFeatureFlags';
|
||||||
import getUserLatestVersion from 'api/user/getLatestVersion';
|
import getUserLatestVersion from 'api/user/getLatestVersion';
|
||||||
@ -6,6 +5,7 @@ import getUserVersion from 'api/user/getVersion';
|
|||||||
import Header from 'container/Header';
|
import Header from 'container/Header';
|
||||||
import SideNav from 'container/SideNav';
|
import SideNav from 'container/SideNav';
|
||||||
import TopNav from 'container/TopNav';
|
import TopNav from 'container/TopNav';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { ReactNode, useEffect, useRef } from 'react';
|
import React, { ReactNode, useEffect, useRef } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useQueries } from 'react-query';
|
import { useQueries } from 'react-query';
|
||||||
@ -91,7 +91,7 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
|
|||||||
const latestVersionCounter = useRef(0);
|
const latestVersionCounter = useRef(0);
|
||||||
const latestConfigCounter = useRef(0);
|
const latestConfigCounter = useRef(0);
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
@ -228,7 +228,6 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
{NotificationElement}
|
|
||||||
{isToDisplayLayout && <Header />}
|
{isToDisplayLayout && <Header />}
|
||||||
<Layout>
|
<Layout>
|
||||||
{isToDisplayLayout && <SideNav />}
|
{isToDisplayLayout && <SideNav />}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Form, notification } from 'antd';
|
import { Form } from 'antd';
|
||||||
import createPagerApi from 'api/channels/createPager';
|
import createPagerApi from 'api/channels/createPager';
|
||||||
import createSlackApi from 'api/channels/createSlack';
|
import createSlackApi from 'api/channels/createSlack';
|
||||||
import createWebhookApi from 'api/channels/createWebhook';
|
import createWebhookApi from 'api/channels/createWebhook';
|
||||||
@ -7,6 +7,7 @@ import testSlackApi from 'api/channels/testSlack';
|
|||||||
import testWebhookApi from 'api/channels/testWebhook';
|
import testWebhookApi from 'api/channels/testWebhook';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
import FormAlertChannels from 'container/FormAlertChannels';
|
import FormAlertChannels from 'container/FormAlertChannels';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@ -58,7 +59,7 @@ function CreateAlertChannels({
|
|||||||
});
|
});
|
||||||
const [savingState, setSavingState] = useState<boolean>(false);
|
const [savingState, setSavingState] = useState<boolean>(false);
|
||||||
const [testingState, setTestingState] = useState<boolean>(false);
|
const [testingState, setTestingState] = useState<boolean>(false);
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const [type, setType] = useState<ChannelType>(preType);
|
const [type, setType] = useState<ChannelType>(preType);
|
||||||
const onTypeChangeHandler = useCallback(
|
const onTypeChangeHandler = useCallback(
|
||||||
@ -336,7 +337,6 @@ function CreateAlertChannels({
|
|||||||
onSaveHandler,
|
onSaveHandler,
|
||||||
savingState,
|
savingState,
|
||||||
testingState,
|
testingState,
|
||||||
NotificationElement,
|
|
||||||
title: t('page_title_create'),
|
title: t('page_title_create'),
|
||||||
initialValue: {
|
initialValue: {
|
||||||
type,
|
type,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Form, notification } from 'antd';
|
import { Form } from 'antd';
|
||||||
import editPagerApi from 'api/channels/editPager';
|
import editPagerApi from 'api/channels/editPager';
|
||||||
import editSlackApi from 'api/channels/editSlack';
|
import editSlackApi from 'api/channels/editSlack';
|
||||||
import editWebhookApi from 'api/channels/editWebhook';
|
import editWebhookApi from 'api/channels/editWebhook';
|
||||||
@ -17,6 +17,7 @@ import {
|
|||||||
WebhookType,
|
WebhookType,
|
||||||
} from 'container/CreateAlertChannels/config';
|
} from 'container/CreateAlertChannels/config';
|
||||||
import FormAlertChannels from 'container/FormAlertChannels';
|
import FormAlertChannels from 'container/FormAlertChannels';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@ -36,7 +37,7 @@ function EditAlertChannels({
|
|||||||
});
|
});
|
||||||
const [savingState, setSavingState] = useState<boolean>(false);
|
const [savingState, setSavingState] = useState<boolean>(false);
|
||||||
const [testingState, setTestingState] = useState<boolean>(false);
|
const [testingState, setTestingState] = useState<boolean>(false);
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
const { id } = useParams<{ id: string }>();
|
const { id } = useParams<{ id: string }>();
|
||||||
|
|
||||||
const [type, setType] = useState<ChannelType>(
|
const [type, setType] = useState<ChannelType>(
|
||||||
@ -281,7 +282,6 @@ function EditAlertChannels({
|
|||||||
onSaveHandler,
|
onSaveHandler,
|
||||||
testingState,
|
testingState,
|
||||||
savingState,
|
savingState,
|
||||||
NotificationElement,
|
|
||||||
title: t('page_title_edit'),
|
title: t('page_title_edit'),
|
||||||
initialValue,
|
initialValue,
|
||||||
editing: true,
|
editing: true,
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import { Button, Divider, notification, Space, Typography } from 'antd';
|
import { Button, Divider, Space, Typography } from 'antd';
|
||||||
import getNextPrevId from 'api/errors/getNextPrevId';
|
import getNextPrevId from 'api/errors/getNextPrevId';
|
||||||
import Editor from 'components/Editor';
|
import Editor from 'components/Editor';
|
||||||
import { ResizeTable } from 'components/ResizeTable';
|
import { ResizeTable } from 'components/ResizeTable';
|
||||||
import { getNanoSeconds } from 'container/AllError/utils';
|
import { getNanoSeconds } from 'container/AllError/utils';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import { urlKey } from 'pages/ErrorDetails/utils';
|
import { urlKey } from 'pages/ErrorDetails/utils';
|
||||||
import React, { useMemo, useState } from 'react';
|
import React, { useMemo, useState } from 'react';
|
||||||
@ -80,7 +81,7 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
|
|||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const onClickErrorIdHandler = async (
|
const onClickErrorIdHandler = async (
|
||||||
id: string,
|
id: string,
|
||||||
@ -121,7 +122,6 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{NotificationElement}
|
|
||||||
<Typography>{errorDetail.exceptionType}</Typography>
|
<Typography>{errorDetail.exceptionType}</Typography>
|
||||||
<Typography>{errorDetail.exceptionMessage}</Typography>
|
<Typography>{errorDetail.exceptionMessage}</Typography>
|
||||||
<Divider />
|
<Divider />
|
||||||
|
@ -31,7 +31,6 @@ function FormAlertChannels({
|
|||||||
onSaveHandler,
|
onSaveHandler,
|
||||||
savingState,
|
savingState,
|
||||||
testingState,
|
testingState,
|
||||||
NotificationElement,
|
|
||||||
title,
|
title,
|
||||||
initialValue,
|
initialValue,
|
||||||
editing = false,
|
editing = false,
|
||||||
@ -53,8 +52,6 @@ function FormAlertChannels({
|
|||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{NotificationElement}
|
|
||||||
|
|
||||||
<Title level={3}>{title}</Title>
|
<Title level={3}>{title}</Title>
|
||||||
|
|
||||||
<Form initialValues={initialValue} layout="vertical" form={formInstance}>
|
<Form initialValues={initialValue} layout="vertical" form={formInstance}>
|
||||||
@ -126,10 +123,6 @@ interface FormAlertChannelsProps {
|
|||||||
onTestHandler: (props: ChannelType) => void;
|
onTestHandler: (props: ChannelType) => void;
|
||||||
testingState: boolean;
|
testingState: boolean;
|
||||||
savingState: boolean;
|
savingState: boolean;
|
||||||
NotificationElement: React.ReactElement<
|
|
||||||
unknown,
|
|
||||||
string | React.JSXElementConstructor<unknown>
|
|
||||||
>;
|
|
||||||
title: string;
|
title: string;
|
||||||
initialValue: Store;
|
initialValue: Store;
|
||||||
// editing indicates if the form is opened in edit mode
|
// editing indicates if the form is opened in edit mode
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { notification, Select } from 'antd';
|
import { Select } from 'antd';
|
||||||
import getChannels from 'api/channels/getAll';
|
import getChannels from 'api/channels/getAll';
|
||||||
import useFetch from 'hooks/useFetch';
|
import useFetch from 'hooks/useFetch';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
@ -20,7 +21,7 @@ function ChannelSelect({
|
|||||||
|
|
||||||
const { loading, payload, error, errorMessage } = useFetch(getChannels);
|
const { loading, payload, error, errorMessage } = useFetch(getChannels);
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const handleChange = (value: string[]): void => {
|
const handleChange = (value: string[]): void => {
|
||||||
onSelectChannels(value);
|
onSelectChannels(value);
|
||||||
@ -50,8 +51,6 @@ function ChannelSelect({
|
|||||||
return children;
|
return children;
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
{NotificationElement}
|
|
||||||
<StyledSelect
|
<StyledSelect
|
||||||
status={error ? 'error' : ''}
|
status={error ? 'error' : ''}
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
@ -65,7 +64,6 @@ function ChannelSelect({
|
|||||||
>
|
>
|
||||||
{renderOptions()}
|
{renderOptions()}
|
||||||
</StyledSelect>
|
</StyledSelect>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import { PlusOutlined } from '@ant-design/icons';
|
import { PlusOutlined } from '@ant-design/icons';
|
||||||
import { Button, notification, Tabs } from 'antd';
|
import { Button, Tabs } from 'antd';
|
||||||
import MetricsBuilderFormula from 'container/NewWidget/LeftContainer/QuerySection/QueryBuilder/queryBuilder/formula';
|
import MetricsBuilderFormula from 'container/NewWidget/LeftContainer/QuerySection/QueryBuilder/queryBuilder/formula';
|
||||||
import MetricsBuilder from 'container/NewWidget/LeftContainer/QuerySection/QueryBuilder/queryBuilder/query';
|
import MetricsBuilder from 'container/NewWidget/LeftContainer/QuerySection/QueryBuilder/queryBuilder/query';
|
||||||
import {
|
import {
|
||||||
IQueryBuilderFormulaHandleChange,
|
IQueryBuilderFormulaHandleChange,
|
||||||
IQueryBuilderQueryHandleChange,
|
IQueryBuilderQueryHandleChange,
|
||||||
} from 'container/NewWidget/LeftContainer/QuerySection/QueryBuilder/queryBuilder/types';
|
} from 'container/NewWidget/LeftContainer/QuerySection/QueryBuilder/queryBuilder/types';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { AlertTypes } from 'types/api/alerts/alertTypes';
|
import { AlertTypes } from 'types/api/alerts/alertTypes';
|
||||||
@ -163,7 +164,7 @@ function QuerySection({
|
|||||||
...allQueries,
|
...allQueries,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const addMetricQuery = useCallback(() => {
|
const addMetricQuery = useCallback(() => {
|
||||||
if (Object.keys(metricQueries).length > 5) {
|
if (Object.keys(metricQueries).length > 5) {
|
||||||
@ -351,7 +352,6 @@ function QuerySection({
|
|||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{NotificationElement}
|
|
||||||
<StepHeading> {t('alert_form_step1')}</StepHeading>
|
<StepHeading> {t('alert_form_step1')}</StepHeading>
|
||||||
<FormContainer>
|
<FormContainer>
|
||||||
<div style={{ display: 'flex' }}>{renderTabs(alertType)}</div>
|
<div style={{ display: 'flex' }}>{renderTabs(alertType)}</div>
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import { ExclamationCircleOutlined, SaveOutlined } from '@ant-design/icons';
|
import { ExclamationCircleOutlined, SaveOutlined } from '@ant-design/icons';
|
||||||
import { Col, FormInstance, Modal, notification, Typography } from 'antd';
|
import { Col, FormInstance, Modal, Typography } from 'antd';
|
||||||
import saveAlertApi from 'api/alerts/save';
|
import saveAlertApi from 'api/alerts/save';
|
||||||
import testAlertApi from 'api/alerts/testAlert';
|
import testAlertApi from 'api/alerts/testAlert';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
import QueryTypeTag from 'container/NewWidget/LeftContainer/QueryTypeTag';
|
import QueryTypeTag from 'container/NewWidget/LeftContainer/QueryTypeTag';
|
||||||
import PlotTag from 'container/NewWidget/LeftContainer/WidgetGraph/PlotTag';
|
import PlotTag from 'container/NewWidget/LeftContainer/WidgetGraph/PlotTag';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@ -190,7 +191,7 @@ function FormAlertRules({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const validatePromParams = useCallback((): boolean => {
|
const validatePromParams = useCallback((): boolean => {
|
||||||
let retval = true;
|
let retval = true;
|
||||||
@ -483,7 +484,6 @@ function FormAlertRules({
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{NotificationElement}
|
|
||||||
{Element}
|
{Element}
|
||||||
<PanelContainer>
|
<PanelContainer>
|
||||||
<StyledLeftContainer flex="5 1 600px">
|
<StyledLeftContainer flex="5 1 600px">
|
||||||
|
@ -1,19 +1,10 @@
|
|||||||
/* eslint-disable sonarjs/no-duplicate-string */
|
/* eslint-disable sonarjs/no-duplicate-string */
|
||||||
import { LoadingOutlined } from '@ant-design/icons';
|
import { LoadingOutlined } from '@ant-design/icons';
|
||||||
import {
|
import { Button, Card, Col, Divider, Modal, Row, Spin, Typography } from 'antd';
|
||||||
Button,
|
|
||||||
Card,
|
|
||||||
Col,
|
|
||||||
Divider,
|
|
||||||
Modal,
|
|
||||||
notification,
|
|
||||||
Row,
|
|
||||||
Spin,
|
|
||||||
Typography,
|
|
||||||
} from 'antd';
|
|
||||||
import setRetentionApi from 'api/settings/setRetention';
|
import setRetentionApi from 'api/settings/setRetention';
|
||||||
import TextToolTip from 'components/TextToolTip';
|
import TextToolTip from 'components/TextToolTip';
|
||||||
import useComponentPermission from 'hooks/useComponentPermission';
|
import useComponentPermission from 'hooks/useComponentPermission';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import find from 'lodash-es/find';
|
import find from 'lodash-es/find';
|
||||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@ -172,7 +163,7 @@ function GeneralSettings({
|
|||||||
logsTtlValuesPayload.status === 'pending' ? 1000 : null,
|
logsTtlValuesPayload.status === 'pending' ? 1000 : null,
|
||||||
);
|
);
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const onModalToggleHandler = (type: TTTLType): void => {
|
const onModalToggleHandler = (type: TTTLType): void => {
|
||||||
if (type === 'metrics') setModalMetrics((modal) => !modal);
|
if (type === 'metrics') setModalMetrics((modal) => !modal);
|
||||||
@ -593,7 +584,6 @@ function GeneralSettings({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{NotificationElement}
|
|
||||||
{Element}
|
{Element}
|
||||||
<Col xs={24} md={22} xl={20} xxl={18} style={{ margin: 'auto' }}>
|
<Col xs={24} md={22} xl={20} xxl={18} style={{ margin: 'auto' }}>
|
||||||
<ErrorTextContainer>
|
<ErrorTextContainer>
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
/* eslint-disable react/no-unstable-nested-components */
|
/* eslint-disable react/no-unstable-nested-components */
|
||||||
import { notification } from 'antd';
|
|
||||||
import updateDashboardApi from 'api/dashboard/update';
|
import updateDashboardApi from 'api/dashboard/update';
|
||||||
import useComponentPermission from 'hooks/useComponentPermission';
|
import useComponentPermission from 'hooks/useComponentPermission';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
import { Layout } from 'react-grid-layout';
|
import { Layout } from 'react-grid-layout';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@ -204,7 +205,7 @@ function GridGraph(props: Props): JSX.Element {
|
|||||||
[widgets, onDragSelect],
|
[widgets, onDragSelect],
|
||||||
);
|
);
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const onEmptyWidgetHandler = useCallback(async () => {
|
const onEmptyWidgetHandler = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
@ -276,8 +277,6 @@ function GridGraph(props: Props): JSX.Element {
|
|||||||
}, [layouts, onEmptyWidgetHandler, t, toggleAddWidget, notifications]);
|
}, [layouts, onEmptyWidgetHandler, t, toggleAddWidget, notifications]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
{NotificationElement}
|
|
||||||
<GraphLayoutContainer
|
<GraphLayoutContainer
|
||||||
{...{
|
{...{
|
||||||
addPanelLoading,
|
addPanelLoading,
|
||||||
@ -290,7 +289,6 @@ function GridGraph(props: Props): JSX.Element {
|
|||||||
setLayout,
|
setLayout,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { Button, Form, Input, notification } from 'antd';
|
import { Button, Form, Input } from 'antd';
|
||||||
import getFeaturesFlags from 'api/features/getFeatureFlags';
|
import getFeaturesFlags from 'api/features/getFeatureFlags';
|
||||||
import apply from 'api/licenses/apply';
|
import apply from 'api/licenses/apply';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { QueryObserverResult, RefetchOptions, useQuery } from 'react-query';
|
import { QueryObserverResult, RefetchOptions, useQuery } from 'react-query';
|
||||||
@ -27,7 +28,7 @@ function ApplyLicenseForm({
|
|||||||
enabled: false,
|
enabled: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const onFinish = async (values: unknown | { key: string }): Promise<void> => {
|
const onFinish = async (values: unknown | { key: string }): Promise<void> => {
|
||||||
const params = values as { key: string };
|
const params = values as { key: string };
|
||||||
@ -77,7 +78,6 @@ function ApplyLicenseForm({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<ApplyFormContainer>
|
<ApplyFormContainer>
|
||||||
{NotificationElement}
|
|
||||||
<ApplyForm layout="inline" onFinish={onFinish}>
|
<ApplyForm layout="inline" onFinish={onFinish}>
|
||||||
<LicenseInput labelAlign="left" name="key">
|
<LicenseInput labelAlign="left" name="key">
|
||||||
<Input
|
<Input
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
/* eslint-disable react/display-name */
|
/* eslint-disable react/display-name */
|
||||||
import { PlusOutlined } from '@ant-design/icons';
|
import { PlusOutlined } from '@ant-design/icons';
|
||||||
import { notification, Typography } from 'antd';
|
import { Typography } from 'antd';
|
||||||
import { ColumnsType } from 'antd/lib/table';
|
import { ColumnsType } from 'antd/lib/table';
|
||||||
import { ResizeTable } from 'components/ResizeTable';
|
import { ResizeTable } from 'components/ResizeTable';
|
||||||
import TextToolTip from 'components/TextToolTip';
|
import TextToolTip from 'components/TextToolTip';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
import useComponentPermission from 'hooks/useComponentPermission';
|
import useComponentPermission from 'hooks/useComponentPermission';
|
||||||
import useInterval from 'hooks/useInterval';
|
import useInterval from 'hooks/useInterval';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@ -31,7 +32,7 @@ function ListAlert({ allAlertRules, refetch }: ListAlertProps): JSX.Element {
|
|||||||
role,
|
role,
|
||||||
);
|
);
|
||||||
|
|
||||||
const [notificationsApi, NotificationElement] = notification.useNotification();
|
const { notifications: notificationsApi } = useNotifications();
|
||||||
|
|
||||||
useInterval(() => {
|
useInterval(() => {
|
||||||
(async (): Promise<void> => {
|
(async (): Promise<void> => {
|
||||||
@ -51,8 +52,6 @@ function ListAlert({ allAlertRules, refetch }: ListAlertProps): JSX.Element {
|
|||||||
history.push(ROUTES.ALERTS_NEW);
|
history.push(ROUTES.ALERTS_NEW);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const [notifications, Element] = notification.useNotification();
|
|
||||||
|
|
||||||
const onEditHandler = (id: string): void => {
|
const onEditHandler = (id: string): void => {
|
||||||
history.push(`${ROUTES.EDIT_ALERTS}?ruleId=${id}`);
|
history.push(`${ROUTES.EDIT_ALERTS}?ruleId=${id}`);
|
||||||
};
|
};
|
||||||
@ -144,7 +143,7 @@ function ListAlert({ allAlertRules, refetch }: ListAlertProps): JSX.Element {
|
|||||||
Edit
|
Edit
|
||||||
</ColumnButton>
|
</ColumnButton>
|
||||||
|
|
||||||
<DeleteAlert notifications={notifications} setData={setData} id={id} />
|
<DeleteAlert notifications={notificationsApi} setData={setData} id={id} />
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
@ -152,9 +151,6 @@ function ListAlert({ allAlertRules, refetch }: ListAlertProps): JSX.Element {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{NotificationElement}
|
|
||||||
{Element}
|
|
||||||
|
|
||||||
<ButtonContainer>
|
<ButtonContainer>
|
||||||
<TextToolTip
|
<TextToolTip
|
||||||
{...{
|
{...{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { notification } from 'antd';
|
|
||||||
import patchAlert from 'api/alerts/patch';
|
import patchAlert from 'api/alerts/patch';
|
||||||
import { State } from 'hooks/useFetch';
|
import { State } from 'hooks/useFetch';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { GettableAlert } from 'types/api/alerts/get';
|
import { GettableAlert } from 'types/api/alerts/get';
|
||||||
import { PayloadProps as PatchPayloadProps } from 'types/api/alerts/patch';
|
import { PayloadProps as PatchPayloadProps } from 'types/api/alerts/patch';
|
||||||
@ -20,7 +20,7 @@ function ToggleAlertState({
|
|||||||
payload: undefined,
|
payload: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const defaultErrorMessage = 'Something went wrong';
|
const defaultErrorMessage = 'Something went wrong';
|
||||||
|
|
||||||
@ -90,8 +90,6 @@ function ToggleAlertState({
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
{NotificationElement}
|
|
||||||
<ColumnButton
|
<ColumnButton
|
||||||
disabled={apiStatus.loading || false}
|
disabled={apiStatus.loading || false}
|
||||||
loading={apiStatus.loading || false}
|
loading={apiStatus.loading || false}
|
||||||
@ -100,7 +98,6 @@ function ToggleAlertState({
|
|||||||
>
|
>
|
||||||
{disabled ? 'Enable' : 'Disable'}
|
{disabled ? 'Enable' : 'Disable'}
|
||||||
</ColumnButton>
|
</ColumnButton>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { notification, Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import getAll from 'api/alerts/getAll';
|
import getAll from 'api/alerts/getAll';
|
||||||
import ReleaseNote from 'components/ReleaseNote';
|
import ReleaseNote from 'components/ReleaseNote';
|
||||||
import Spinner from 'components/Spinner';
|
import Spinner from 'components/Spinner';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useQuery } from 'react-query';
|
import { useQuery } from 'react-query';
|
||||||
@ -17,7 +18,7 @@ function ListAlertRules(): JSX.Element {
|
|||||||
cacheTime: 0,
|
cacheTime: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (status === 'error' || (status === 'success' && data.statusCode >= 400)) {
|
if (status === 'error' || (status === 'success' && data.statusCode >= 400)) {
|
||||||
@ -29,26 +30,18 @@ function ListAlertRules(): JSX.Element {
|
|||||||
|
|
||||||
// api failed to load the data
|
// api failed to load the data
|
||||||
if (isError) {
|
if (isError) {
|
||||||
return (
|
return <div>{data?.error || t('something_went_wrong')}</div>;
|
||||||
<div>
|
|
||||||
{NotificationElement}
|
|
||||||
{data?.error || t('something_went_wrong')}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// api is successful but error is present
|
// api is successful but error is present
|
||||||
if (status === 'success' && data.statusCode >= 400) {
|
if (status === 'success' && data.statusCode >= 400) {
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
{NotificationElement}
|
|
||||||
<ListAlert
|
<ListAlert
|
||||||
{...{
|
{...{
|
||||||
allAlertRules: [],
|
allAlertRules: [],
|
||||||
refetch,
|
refetch,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +52,6 @@ function ListAlertRules(): JSX.Element {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Space direction="vertical" size="large" style={{ width: '100%' }}>
|
<Space direction="vertical" size="large" style={{ width: '100%' }}>
|
||||||
{NotificationElement}
|
|
||||||
<ReleaseNote path={location.pathname} />
|
<ReleaseNote path={location.pathname} />
|
||||||
<ListAlert
|
<ListAlert
|
||||||
{...{
|
{...{
|
||||||
|
@ -1,17 +1,10 @@
|
|||||||
import { red } from '@ant-design/colors';
|
import { red } from '@ant-design/colors';
|
||||||
import { ExclamationCircleTwoTone } from '@ant-design/icons';
|
import { ExclamationCircleTwoTone } from '@ant-design/icons';
|
||||||
import {
|
import { Button, Modal, Space, Typography, Upload, UploadProps } from 'antd';
|
||||||
Button,
|
|
||||||
Modal,
|
|
||||||
notification,
|
|
||||||
Space,
|
|
||||||
Typography,
|
|
||||||
Upload,
|
|
||||||
UploadProps,
|
|
||||||
} from 'antd';
|
|
||||||
import createDashboard from 'api/dashboard/create';
|
import createDashboard from 'api/dashboard/create';
|
||||||
import Editor from 'components/Editor';
|
import Editor from 'components/Editor';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@ -41,7 +34,7 @@ function ImportJSON({
|
|||||||
|
|
||||||
const [editorValue, setEditorValue] = useState<string>('');
|
const [editorValue, setEditorValue] = useState<string>('');
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const onChangeHandler: UploadProps['onChange'] = (info) => {
|
const onChangeHandler: UploadProps['onChange'] = (info) => {
|
||||||
const { fileList } = info;
|
const { fileList } = info;
|
||||||
@ -132,8 +125,6 @@ function ImportJSON({
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
{NotificationElement}
|
|
||||||
<Modal
|
<Modal
|
||||||
open={isImportJSONModalVisible}
|
open={isImportJSONModalVisible}
|
||||||
centered
|
centered
|
||||||
@ -186,7 +177,6 @@ function ImportJSON({
|
|||||||
</EditorContainer>
|
</EditorContainer>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { Button, Input, notification, Space, Tooltip, Typography } from 'antd';
|
import { Button, Input, Space, Tooltip, Typography } from 'antd';
|
||||||
import loginApi from 'api/user/login';
|
import loginApi from 'api/user/login';
|
||||||
import loginPrecheckApi from 'api/user/loginPrecheck';
|
import loginPrecheckApi from 'api/user/loginPrecheck';
|
||||||
import afterLogin from 'AppRoutes/utils';
|
import afterLogin from 'AppRoutes/utils';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@ -42,7 +43,7 @@ function Login({
|
|||||||
const [precheckInProcess, setPrecheckInProcess] = useState(false);
|
const [precheckInProcess, setPrecheckInProcess] = useState(false);
|
||||||
const [precheckComplete, setPrecheckComplete] = useState(false);
|
const [precheckComplete, setPrecheckComplete] = useState(false);
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (withPassword === 'Y') {
|
if (withPassword === 'Y') {
|
||||||
@ -185,7 +186,6 @@ function Login({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<FormWrapper>
|
<FormWrapper>
|
||||||
{NotificationElement}
|
|
||||||
<FormContainer onSubmit={onSubmitHandler}>
|
<FormContainer onSubmit={onSubmitHandler}>
|
||||||
<Title level={4}>{t('login_page_title')}</Title>
|
<Title level={4}>{t('login_page_title')}</Title>
|
||||||
<ParentContainer>
|
<ParentContainer>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { notification } from 'antd';
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import { flatten } from 'lodash-es';
|
import { flatten } from 'lodash-es';
|
||||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
@ -36,7 +36,7 @@ function SearchFields({
|
|||||||
|
|
||||||
const keyPrefixRef = useRef(hashCode(JSON.stringify(fieldsQuery)));
|
const keyPrefixRef = useRef(hashCode(JSON.stringify(fieldsQuery)));
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const updatedFieldsQuery = createParsedQueryStructure([
|
const updatedFieldsQuery = createParsedQueryStructure([
|
||||||
@ -102,7 +102,6 @@ function SearchFields({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{NotificationElement}
|
|
||||||
<QueryBuilder
|
<QueryBuilder
|
||||||
key={keyPrefixRef.current}
|
key={keyPrefixRef.current}
|
||||||
keyPrefix={keyPrefixRef.current}
|
keyPrefix={keyPrefixRef.current}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { Button, notification, Space, Typography } from 'antd';
|
import { Button, Space, Typography } from 'antd';
|
||||||
import changeMyPassword from 'api/user/changeMyPassword';
|
import changeMyPassword from 'api/user/changeMyPassword';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import { isPasswordNotValidMessage, isPasswordValid } from 'pages/SignUp/utils';
|
import { isPasswordNotValidMessage, isPasswordValid } from 'pages/SignUp/utils';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@ -23,7 +24,7 @@ function PasswordContainer(): JSX.Element {
|
|||||||
ns: 'settings',
|
ns: 'settings',
|
||||||
});
|
});
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (currentPassword && !isPasswordValid(currentPassword)) {
|
if (currentPassword && !isPasswordValid(currentPassword)) {
|
||||||
@ -82,7 +83,6 @@ function PasswordContainer(): JSX.Element {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Space direction="vertical" size="large">
|
<Space direction="vertical" size="large">
|
||||||
{NotificationElement}
|
|
||||||
<Typography.Title level={3}>
|
<Typography.Title level={3}>
|
||||||
{t('change_password', {
|
{t('change_password', {
|
||||||
ns: 'settings',
|
ns: 'settings',
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { Button, notification, Space, Typography } from 'antd';
|
import { Button, Space, Typography } from 'antd';
|
||||||
import editUser from 'api/user/editUser';
|
import editUser from 'api/user/editUser';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
@ -21,7 +22,7 @@ function UpdateName(): JSX.Element {
|
|||||||
const [changedName, setChangedName] = useState<string>(user?.name || '');
|
const [changedName, setChangedName] = useState<string>(user?.name || '');
|
||||||
const [loading, setLoading] = useState<boolean>(false);
|
const [loading, setLoading] = useState<boolean>(false);
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
if (!user || !org) {
|
if (!user || !org) {
|
||||||
return <div />;
|
return <div />;
|
||||||
@ -72,7 +73,6 @@ function UpdateName(): JSX.Element {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{NotificationElement}
|
|
||||||
<Space direction="vertical" size="middle">
|
<Space direction="vertical" size="middle">
|
||||||
<Typography>Name</Typography>
|
<Typography>Name</Typography>
|
||||||
<NameInput
|
<NameInput
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import { notification } from 'antd';
|
|
||||||
import { useIsDarkMode } from 'hooks/useDarkMode';
|
import { useIsDarkMode } from 'hooks/useDarkMode';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import { connect, useSelector } from 'react-redux';
|
import { connect, useSelector } from 'react-redux';
|
||||||
@ -22,7 +23,7 @@ function DashboardGraphSlider({ toggleAddWidget }: Props): JSX.Element {
|
|||||||
(state) => state.dashboards,
|
(state) => state.dashboards,
|
||||||
);
|
);
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const [selectedDashboard] = dashboards;
|
const [selectedDashboard] = dashboards;
|
||||||
const { data } = selectedDashboard;
|
const { data } = selectedDashboard;
|
||||||
@ -57,7 +58,6 @@ function DashboardGraphSlider({ toggleAddWidget }: Props): JSX.Element {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
{NotificationElement}
|
|
||||||
{menuItems.map(({ name, Icon, display }) => (
|
{menuItems.map(({ name, Icon, display }) => (
|
||||||
<Card
|
<Card
|
||||||
onClick={(event): void => {
|
onClick={(event): void => {
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { blue, red } from '@ant-design/colors';
|
import { blue, red } from '@ant-design/colors';
|
||||||
import { PlusOutlined } from '@ant-design/icons';
|
import { PlusOutlined } from '@ant-design/icons';
|
||||||
import { Button, Modal, notification, Row, Space, Tag } from 'antd';
|
import { Button, Modal, Row, Space, Tag } from 'antd';
|
||||||
import { NotificationInstance } from 'antd/es/notification/interface';
|
import { NotificationInstance } from 'antd/es/notification/interface';
|
||||||
import { ResizeTable } from 'components/ResizeTable';
|
import { ResizeTable } from 'components/ResizeTable';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useRef, useState } from 'react';
|
import React, { useRef, useState } from 'react';
|
||||||
import { connect, useSelector } from 'react-redux';
|
import { connect, useSelector } from 'react-redux';
|
||||||
import { bindActionCreators, Dispatch } from 'redux';
|
import { bindActionCreators, Dispatch } from 'redux';
|
||||||
@ -26,7 +27,7 @@ function VariablesSetting({
|
|||||||
(state) => state.dashboards,
|
(state) => state.dashboards,
|
||||||
);
|
);
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const [selectedDashboard] = dashboards;
|
const [selectedDashboard] = dashboards;
|
||||||
|
|
||||||
@ -143,7 +144,6 @@ function VariablesSetting({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{NotificationElement}
|
|
||||||
{variableViewMode ? (
|
{variableViewMode ? (
|
||||||
<VariableItem
|
<VariableItem
|
||||||
variableData={{ ...variableEditData } as IDashboardVariable}
|
variableData={{ ...variableEditData } as IDashboardVariable}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { notification, Row } from 'antd';
|
import { Row } from 'antd';
|
||||||
import { NotificationInstance } from 'antd/es/notification/interface';
|
import { NotificationInstance } from 'antd/es/notification/interface';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import { map, sortBy } from 'lodash-es';
|
import { map, sortBy } from 'lodash-es';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { connect, useSelector } from 'react-redux';
|
import { connect, useSelector } from 'react-redux';
|
||||||
@ -26,7 +27,7 @@ function DashboardVariableSelection({
|
|||||||
|
|
||||||
const [update, setUpdate] = useState<boolean>(false);
|
const [update, setUpdate] = useState<boolean>(false);
|
||||||
const [lastUpdatedVar, setLastUpdatedVar] = useState<string>('');
|
const [lastUpdatedVar, setLastUpdatedVar] = useState<string>('');
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const onVarChanged = (name: string): void => {
|
const onVarChanged = (name: string): void => {
|
||||||
setLastUpdatedVar(name);
|
setLastUpdatedVar(name);
|
||||||
@ -62,7 +63,6 @@ function DashboardVariableSelection({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Row style={{ gap: '1rem' }}>
|
<Row style={{ gap: '1rem' }}>
|
||||||
{NotificationElement}
|
|
||||||
{map(sortBy(Object.keys(variables)), (variableName) => (
|
{map(sortBy(Object.keys(variables)), (variableName) => (
|
||||||
<VariableItem
|
<VariableItem
|
||||||
key={`${variableName}${variables[variableName].modificationUUID}`}
|
key={`${variableName}${variables[variableName].modificationUUID}`}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { Button, Modal, notification, Typography } from 'antd';
|
import { Button, Modal, Typography } from 'antd';
|
||||||
import Editor from 'components/Editor';
|
import Editor from 'components/Editor';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useEffect, useMemo, useState } from 'react';
|
import React, { useEffect, useMemo, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useCopyToClipboard } from 'react-use';
|
import { useCopyToClipboard } from 'react-use';
|
||||||
@ -32,7 +33,7 @@ function ShareModal({
|
|||||||
const [isViewJSON, setIsViewJSON] = useState<boolean>(false);
|
const [isViewJSON, setIsViewJSON] = useState<boolean>(false);
|
||||||
const { t } = useTranslation(['dashboard', 'common']);
|
const { t } = useTranslation(['dashboard', 'common']);
|
||||||
const [state, setCopy] = useCopyToClipboard();
|
const [state, setCopy] = useCopyToClipboard();
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (state.error) {
|
if (state.error) {
|
||||||
@ -84,8 +85,6 @@ function ShareModal({
|
|||||||
}, [isViewJSON, jsonValue, selectedData, selectedDataCleaned, setCopy, t]);
|
}, [isViewJSON, jsonValue, selectedData, selectedDataCleaned, setCopy, t]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
{NotificationElement}
|
|
||||||
<Modal
|
<Modal
|
||||||
open={isJSONModalVisible}
|
open={isJSONModalVisible}
|
||||||
onCancel={(): void => {
|
onCancel={(): void => {
|
||||||
@ -105,13 +104,9 @@ function ShareModal({
|
|||||||
{!isViewJSON ? (
|
{!isViewJSON ? (
|
||||||
<Typography>{t('export_dashboard')}</Typography>
|
<Typography>{t('export_dashboard')}</Typography>
|
||||||
) : (
|
) : (
|
||||||
<Editor
|
<Editor onChange={(value): void => setJSONValue(value)} value={jsonValue} />
|
||||||
onChange={(value): void => setJSONValue(value)}
|
|
||||||
value={jsonValue}
|
|
||||||
/>
|
|
||||||
)}
|
)}
|
||||||
</Modal>
|
</Modal>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { PlusOutlined } from '@ant-design/icons';
|
import { PlusOutlined } from '@ant-design/icons';
|
||||||
import { notification } from 'antd';
|
|
||||||
import {
|
import {
|
||||||
QueryBuilderFormulaTemplate,
|
QueryBuilderFormulaTemplate,
|
||||||
QueryBuilderQueryTemplate,
|
QueryBuilderQueryTemplate,
|
||||||
} from 'constants/dashboard';
|
} from 'constants/dashboard';
|
||||||
import { GRAPH_TYPES } from 'container/NewDashboard/ComponentsSlider';
|
import { GRAPH_TYPES } from 'container/NewDashboard/ComponentsSlider';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import GetFormulaName from 'lib/query/GetFormulaName';
|
import GetFormulaName from 'lib/query/GetFormulaName';
|
||||||
import GetQueryName from 'lib/query/GetQueryName';
|
import GetQueryName from 'lib/query/GetQueryName';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
@ -37,7 +37,7 @@ function QueryBuilderQueryContainer({
|
|||||||
metricsBuilderQueries,
|
metricsBuilderQueries,
|
||||||
selectedGraph,
|
selectedGraph,
|
||||||
}: IQueryBuilderQueryContainerProps): JSX.Element | null {
|
}: IQueryBuilderQueryContainerProps): JSX.Element | null {
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
const handleQueryBuilderQueryChange = ({
|
const handleQueryBuilderQueryChange = ({
|
||||||
queryIndex,
|
queryIndex,
|
||||||
aggregateFunction,
|
aggregateFunction,
|
||||||
@ -156,7 +156,6 @@ function QueryBuilderQueryContainer({
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{NotificationElement}
|
|
||||||
{metricsBuilderQueries.queryBuilder.map((q, idx) => (
|
{metricsBuilderQueries.queryBuilder.map((q, idx) => (
|
||||||
<MetricsBuilder
|
<MetricsBuilder
|
||||||
key={q.name}
|
key={q.name}
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
/* eslint-disable prefer-regex-literals */
|
/* eslint-disable prefer-regex-literals */
|
||||||
import { PlusOutlined } from '@ant-design/icons';
|
import { PlusOutlined } from '@ant-design/icons';
|
||||||
import { Button, Form, Input, Modal, notification, Typography } from 'antd';
|
import { Button, Form, Input, Modal, Typography } from 'antd';
|
||||||
import { useForm } from 'antd/es/form/Form';
|
import { useForm } from 'antd/es/form/Form';
|
||||||
import createDomainApi from 'api/SAML/postDomain';
|
import createDomainApi from 'api/SAML/postDomain';
|
||||||
import { FeatureKeys } from 'constants/featureKeys';
|
import { FeatureKeys } from 'constants/featureKeys';
|
||||||
import useFeatureFlag from 'hooks/useFeatureFlag';
|
import useFeatureFlag from 'hooks/useFeatureFlag';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
@ -21,7 +22,7 @@ function AddDomain({ refetch }: Props): JSX.Element {
|
|||||||
|
|
||||||
const { org } = useSelector<AppState, AppReducer>((state) => state.app);
|
const { org } = useSelector<AppState, AppReducer>((state) => state.app);
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const onCreateHandler = async (): Promise<void> => {
|
const onCreateHandler = async (): Promise<void> => {
|
||||||
try {
|
try {
|
||||||
@ -51,7 +52,6 @@ function AddDomain({ refetch }: Props): JSX.Element {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{NotificationElement}
|
|
||||||
<Container>
|
<Container>
|
||||||
<Typography.Title level={3}>
|
<Typography.Title level={3}>
|
||||||
{t('authenticated_domains', {
|
{t('authenticated_domains', {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { Button, Form, notification, Space } from 'antd';
|
import { Button, Form, Space } from 'antd';
|
||||||
import { useForm } from 'antd/lib/form/Form';
|
import { useForm } from 'antd/lib/form/Form';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { AuthDomain, GOOGLE_AUTH, SAML } from 'types/api/SAML/listDomain';
|
import { AuthDomain, GOOGLE_AUTH, SAML } from 'types/api/SAML/listDomain';
|
||||||
@ -31,7 +32,7 @@ function EditSSO({
|
|||||||
|
|
||||||
const { t } = useTranslation(['common']);
|
const { t } = useTranslation(['common']);
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const onFinishHandler = useCallback(() => {
|
const onFinishHandler = useCallback(() => {
|
||||||
form
|
form
|
||||||
@ -75,7 +76,6 @@ function EditSSO({
|
|||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
form={form}
|
form={form}
|
||||||
>
|
>
|
||||||
{NotificationElement}
|
|
||||||
{renderFormInputs(record)}
|
{renderFormInputs(record)}
|
||||||
<Space
|
<Space
|
||||||
style={{ width: '100%', justifyContent: 'flex-end' }}
|
style={{ width: '100%', justifyContent: 'flex-end' }}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { LockTwoTone } from '@ant-design/icons';
|
import { LockTwoTone } from '@ant-design/icons';
|
||||||
import { Button, Modal, notification, Space, Typography } from 'antd';
|
import { Button, Modal, Space, Typography } from 'antd';
|
||||||
import { ColumnsType } from 'antd/lib/table';
|
import { ColumnsType } from 'antd/lib/table';
|
||||||
import deleteDomain from 'api/SAML/deleteDomain';
|
import deleteDomain from 'api/SAML/deleteDomain';
|
||||||
import listAllDomain from 'api/SAML/listAllDomain';
|
import listAllDomain from 'api/SAML/listAllDomain';
|
||||||
@ -9,6 +9,7 @@ import TextToolTip from 'components/TextToolTip';
|
|||||||
import { SIGNOZ_UPGRADE_PLAN_URL } from 'constants/app';
|
import { SIGNOZ_UPGRADE_PLAN_URL } from 'constants/app';
|
||||||
import { FeatureKeys } from 'constants/featureKeys';
|
import { FeatureKeys } from 'constants/featureKeys';
|
||||||
import useFeatureFlag from 'hooks/useFeatureFlag';
|
import useFeatureFlag from 'hooks/useFeatureFlag';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useCallback, useState } from 'react';
|
import React, { useCallback, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useQuery } from 'react-query';
|
import { useQuery } from 'react-query';
|
||||||
@ -57,7 +58,7 @@ function AuthDomains(): JSX.Element {
|
|||||||
enabled: org !== null,
|
enabled: org !== null,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const assignSsoMethod = useCallback(
|
const assignSsoMethod = useCallback(
|
||||||
(typ: AuthDomain['ssoType']): void => {
|
(typ: AuthDomain['ssoType']): void => {
|
||||||
@ -254,7 +255,6 @@ function AuthDomains(): JSX.Element {
|
|||||||
if (!isLoading && data?.payload?.length === 0) {
|
if (!isLoading && data?.payload?.length === 0) {
|
||||||
return (
|
return (
|
||||||
<Space direction="vertical" size="middle">
|
<Space direction="vertical" size="middle">
|
||||||
{NotificationElement}
|
|
||||||
<AddDomain refetch={refetch} />
|
<AddDomain refetch={refetch} />
|
||||||
|
|
||||||
<Modal
|
<Modal
|
||||||
@ -286,7 +286,6 @@ function AuthDomains(): JSX.Element {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{NotificationElement}
|
|
||||||
<Modal
|
<Modal
|
||||||
centered
|
centered
|
||||||
title="Configure Authentication Method"
|
title="Configure Authentication Method"
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { Button, Form, Input, notification } from 'antd';
|
import { Button, Form, Input } from 'antd';
|
||||||
import editOrg from 'api/user/editOrg';
|
import editOrg from 'api/user/editOrg';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
@ -21,7 +22,7 @@ function DisplayName({
|
|||||||
const { name } = (org || [])[index];
|
const { name } = (org || [])[index];
|
||||||
const [isLoading, setIsLoading] = useState<boolean>(false);
|
const [isLoading, setIsLoading] = useState<boolean>(false);
|
||||||
const dispatch = useDispatch<Dispatch<AppActions>>();
|
const dispatch = useDispatch<Dispatch<AppActions>>();
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const onSubmit = async ({ name: orgName }: OnSubmitProps): Promise<void> => {
|
const onSubmit = async ({ name: orgName }: OnSubmitProps): Promise<void> => {
|
||||||
try {
|
try {
|
||||||
@ -76,7 +77,6 @@ function DisplayName({
|
|||||||
onFinish={onSubmit}
|
onFinish={onSubmit}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
>
|
>
|
||||||
{NotificationElement}
|
|
||||||
<Form.Item name="name" label="Display name" rules={[{ required: true }]}>
|
<Form.Item name="name" label="Display name" rules={[{ required: true }]}>
|
||||||
<Input size="large" placeholder={t('signoz')} disabled={isLoading} />
|
<Input size="large" placeholder={t('signoz')} disabled={isLoading} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { CopyOutlined } from '@ant-design/icons';
|
import { CopyOutlined } from '@ant-design/icons';
|
||||||
import { Button, Input, notification, Select, Space, Tooltip } from 'antd';
|
import { Button, Input, Select, Space, Tooltip } from 'antd';
|
||||||
import getResetPasswordToken from 'api/user/getResetPasswordToken';
|
import getResetPasswordToken from 'api/user/getResetPasswordToken';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useCopyToClipboard } from 'react-use';
|
import { useCopyToClipboard } from 'react-use';
|
||||||
@ -36,7 +37,7 @@ function EditMembersDetails({
|
|||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (state.error) {
|
if (state.error) {
|
||||||
@ -91,7 +92,6 @@ function EditMembersDetails({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Space direction="vertical" size="large">
|
<Space direction="vertical" size="large">
|
||||||
{NotificationElement}
|
|
||||||
<Space direction="horizontal">
|
<Space direction="horizontal">
|
||||||
<Title>Email address</Title>
|
<Title>Email address</Title>
|
||||||
<Input
|
<Input
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Button, Modal, notification, Space, Typography } from 'antd';
|
import { Button, Modal, Space, Typography } from 'antd';
|
||||||
import { ColumnsType } from 'antd/lib/table';
|
import { ColumnsType } from 'antd/lib/table';
|
||||||
import deleteUser from 'api/user/deleteUser';
|
import deleteUser from 'api/user/deleteUser';
|
||||||
import editUserApi from 'api/user/editUser';
|
import editUserApi from 'api/user/editUser';
|
||||||
@ -6,6 +6,7 @@ import getOrgUser from 'api/user/getOrgUser';
|
|||||||
import updateRole from 'api/user/updateRole';
|
import updateRole from 'api/user/updateRole';
|
||||||
import { ResizeTable } from 'components/ResizeTable';
|
import { ResizeTable } from 'components/ResizeTable';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useQuery } from 'react-query';
|
import { useQuery } from 'react-query';
|
||||||
@ -40,7 +41,7 @@ function UserFunction({
|
|||||||
const { t } = useTranslation(['common']);
|
const { t } = useTranslation(['common']);
|
||||||
const [isDeleteLoading, setIsDeleteLoading] = useState<boolean>(false);
|
const [isDeleteLoading, setIsDeleteLoading] = useState<boolean>(false);
|
||||||
const [isUpdateLoading, setIsUpdateLoading] = useState<boolean>(false);
|
const [isUpdateLoading, setIsUpdateLoading] = useState<boolean>(false);
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const onUpdateDetailsHandler = (): void => {
|
const onUpdateDetailsHandler = (): void => {
|
||||||
setDataSource((data) => {
|
setDataSource((data) => {
|
||||||
@ -164,7 +165,6 @@ function UserFunction({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{NotificationElement}
|
|
||||||
<Space direction="horizontal">
|
<Space direction="horizontal">
|
||||||
<Typography.Link
|
<Typography.Link
|
||||||
onClick={(): void => onModalToggleHandler(setIsModalVisible, true)}
|
onClick={(): void => onModalToggleHandler(setIsModalVisible, true)}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { PlusOutlined } from '@ant-design/icons';
|
import { PlusOutlined } from '@ant-design/icons';
|
||||||
import { Button, Modal, notification, Space, Typography } from 'antd';
|
import { Button, Modal, Space, Typography } from 'antd';
|
||||||
import { ColumnsType } from 'antd/lib/table';
|
import { ColumnsType } from 'antd/lib/table';
|
||||||
import deleteInvite from 'api/user/deleteInvite';
|
import deleteInvite from 'api/user/deleteInvite';
|
||||||
import getPendingInvites from 'api/user/getPendingInvites';
|
import getPendingInvites from 'api/user/getPendingInvites';
|
||||||
@ -7,6 +7,7 @@ import sendInvite from 'api/user/sendInvite';
|
|||||||
import { ResizeTable } from 'components/ResizeTable';
|
import { ResizeTable } from 'components/ResizeTable';
|
||||||
import { INVITE_MEMBERS_HASH } from 'constants/app';
|
import { INVITE_MEMBERS_HASH } from 'constants/app';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useQuery } from 'react-query';
|
import { useQuery } from 'react-query';
|
||||||
@ -26,7 +27,7 @@ function PendingInvitesContainer(): JSX.Element {
|
|||||||
const [isInvitingMembers, setIsInvitingMembers] = useState<boolean>(false);
|
const [isInvitingMembers, setIsInvitingMembers] = useState<boolean>(false);
|
||||||
const { t } = useTranslation(['organizationsettings', 'common']);
|
const { t } = useTranslation(['organizationsettings', 'common']);
|
||||||
const [state, setText] = useCopyToClipboard();
|
const [state, setText] = useCopyToClipboard();
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (state.error) {
|
if (state.error) {
|
||||||
@ -229,7 +230,6 @@ function PendingInvitesContainer(): JSX.Element {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{NotificationElement}
|
|
||||||
<Modal
|
<Modal
|
||||||
title={t('invite_team_members')}
|
title={t('invite_team_members')}
|
||||||
open={isInviteTeamMemberModalOpen}
|
open={isInviteTeamMemberModalOpen}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { Button, Input, notification, Typography } from 'antd';
|
import { Button, Input, Typography } from 'antd';
|
||||||
import resetPasswordApi from 'api/user/resetPassword';
|
import resetPasswordApi from 'api/user/resetPassword';
|
||||||
import { Logout } from 'api/utils';
|
import { Logout } from 'api/utils';
|
||||||
import WelcomeLeftContainer from 'components/WelcomeLeftContainer';
|
import WelcomeLeftContainer from 'components/WelcomeLeftContainer';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import { Label } from 'pages/SignUp/styles';
|
import { Label } from 'pages/SignUp/styles';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
@ -24,7 +25,7 @@ function ResetPassword({ version }: ResetPasswordProps): JSX.Element {
|
|||||||
const { search } = useLocation();
|
const { search } = useLocation();
|
||||||
const params = new URLSearchParams(search);
|
const params = new URLSearchParams(search);
|
||||||
const token = params.get('token');
|
const token = params.get('token');
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!token) {
|
if (!token) {
|
||||||
@ -83,8 +84,6 @@ function ResetPassword({ version }: ResetPasswordProps): JSX.Element {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<WelcomeLeftContainer version={version}>
|
<WelcomeLeftContainer version={version}>
|
||||||
<>
|
|
||||||
{NotificationElement}
|
|
||||||
<FormWrapper>
|
<FormWrapper>
|
||||||
<form onSubmit={handleSubmit}>
|
<form onSubmit={handleSubmit}>
|
||||||
<Title level={4}>Reset Your Password</Title>
|
<Title level={4}>Reset Your Password</Title>
|
||||||
@ -149,7 +148,6 @@ function ResetPassword({ version }: ResetPasswordProps): JSX.Element {
|
|||||||
</ButtonContainer>
|
</ButtonContainer>
|
||||||
</form>
|
</form>
|
||||||
</FormWrapper>
|
</FormWrapper>
|
||||||
</>
|
|
||||||
</WelcomeLeftContainer>
|
</WelcomeLeftContainer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { Checkbox, notification, Tooltip, Typography } from 'antd';
|
import { Checkbox, Tooltip, Typography } from 'antd';
|
||||||
import getFilters from 'api/trace/getFilters';
|
import getFilters from 'api/trace/getFilters';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useMemo, useState } from 'react';
|
import React, { useMemo, useState } from 'react';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { Dispatch } from 'redux';
|
import { Dispatch } from 'redux';
|
||||||
@ -38,7 +39,7 @@ function CheckBoxComponent(props: CheckBoxProps): JSX.Element {
|
|||||||
(userSelectedFilter.get(name) || []).find((e) => e === keyValue) !==
|
(userSelectedFilter.get(name) || []).find((e) => e === keyValue) !==
|
||||||
undefined;
|
undefined;
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
// eslint-disable-next-line sonarjs/cognitive-complexity
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
||||||
const onCheckHandler = async (): Promise<void> => {
|
const onCheckHandler = async (): Promise<void> => {
|
||||||
@ -163,7 +164,6 @@ function CheckBoxComponent(props: CheckBoxProps): JSX.Element {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<CheckBoxContainer>
|
<CheckBoxContainer>
|
||||||
{NotificationElement}
|
|
||||||
<Checkbox
|
<Checkbox
|
||||||
disabled={isLoading || filterLoading}
|
disabled={isLoading || filterLoading}
|
||||||
onClick={onCheckHandler}
|
onClick={onCheckHandler}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { Input, notification } from 'antd';
|
import { Input } from 'antd';
|
||||||
import getFilters from 'api/trace/getFilters';
|
import getFilters from 'api/trace/getFilters';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { Dispatch } from 'redux';
|
import { Dispatch } from 'redux';
|
||||||
@ -28,7 +29,7 @@ function TraceID(): JSX.Element {
|
|||||||
);
|
);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [userEnteredValue, setUserEnteredValue] = useState<string>('');
|
const [userEnteredValue, setUserEnteredValue] = useState<string>('');
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setUserEnteredValue(selectedFilter.get('traceID')?.[0] || '');
|
setUserEnteredValue(selectedFilter.get('traceID')?.[0] || '');
|
||||||
}, [selectedFilter]);
|
}, [selectedFilter]);
|
||||||
@ -109,7 +110,6 @@ function TraceID(): JSX.Element {
|
|||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{NotificationElement}
|
|
||||||
<Search
|
<Search
|
||||||
placeholder="Filter by Trace ID"
|
placeholder="Filter by Trace ID"
|
||||||
onSearch={onSearch}
|
onSearch={onSearch}
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { DownOutlined, RightOutlined } from '@ant-design/icons';
|
import { DownOutlined, RightOutlined } from '@ant-design/icons';
|
||||||
import { Card, Divider, notification, Typography } from 'antd';
|
import { Card, Divider, Typography } from 'antd';
|
||||||
import getFilters from 'api/trace/getFilters';
|
import getFilters from 'api/trace/getFilters';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { Dispatch } from 'redux';
|
import { Dispatch } from 'redux';
|
||||||
@ -53,7 +54,7 @@ function PanelHeading(props: PanelHeadingProps): JSX.Element {
|
|||||||
|
|
||||||
const defaultErrorMessage = 'Something went wrong';
|
const defaultErrorMessage = 'Something went wrong';
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
// eslint-disable-next-line sonarjs/cognitive-complexity
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
||||||
const onExpandHandler: React.MouseEventHandler<HTMLDivElement> = async (e) => {
|
const onExpandHandler: React.MouseEventHandler<HTMLDivElement> = async (e) => {
|
||||||
@ -297,7 +298,6 @@ function PanelHeading(props: PanelHeadingProps): JSX.Element {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{NotificationElement}
|
|
||||||
{PanelName !== 'duration' && <Divider plain style={{ margin: 0 }} />}
|
{PanelName !== 'duration' && <Divider plain style={{ margin: 0 }} />}
|
||||||
|
|
||||||
<Card bordered={false}>
|
<Card bordered={false}>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { notification } from 'antd';
|
|
||||||
import getTriggeredApi from 'api/alerts/getTriggered';
|
import getTriggeredApi from 'api/alerts/getTriggered';
|
||||||
import Spinner from 'components/Spinner';
|
import Spinner from 'components/Spinner';
|
||||||
import { State } from 'hooks/useFetch';
|
import { State } from 'hooks/useFetch';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { PayloadProps } from 'types/api/alerts/getTriggered';
|
import { PayloadProps } from 'types/api/alerts/getTriggered';
|
||||||
@ -17,7 +17,7 @@ function TriggeredAlerts(): JSX.Element {
|
|||||||
payload: [],
|
payload: [],
|
||||||
});
|
});
|
||||||
const { t } = useTranslation(['common']);
|
const { t } = useTranslation(['common']);
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
const fetchData = useCallback(async () => {
|
const fetchData = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
@ -69,21 +69,11 @@ function TriggeredAlerts(): JSX.Element {
|
|||||||
}, [groupState.error, groupState.errorMessage, t, notifications]);
|
}, [groupState.error, groupState.errorMessage, t, notifications]);
|
||||||
|
|
||||||
if (groupState.error) {
|
if (groupState.error) {
|
||||||
return (
|
return <TriggerComponent allAlerts={[]} />;
|
||||||
<>
|
|
||||||
{NotificationElement}
|
|
||||||
<TriggerComponent allAlerts={[]} />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (groupState.loading || groupState.payload === undefined) {
|
if (groupState.loading || groupState.payload === undefined) {
|
||||||
return (
|
return <Spinner height="75vh" tip="Loading Alerts..." />;
|
||||||
<>
|
|
||||||
{NotificationElement}
|
|
||||||
<Spinner height="75vh" tip="Loading Alerts..." />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// commented the reduce() call as we no longer use /alerts/groups
|
// commented the reduce() call as we no longer use /alerts/groups
|
||||||
@ -95,12 +85,7 @@ function TriggeredAlerts(): JSX.Element {
|
|||||||
// return [...acc, ...curr.alerts];
|
// return [...acc, ...curr.alerts];
|
||||||
// }, initialAlerts);
|
// }, initialAlerts);
|
||||||
|
|
||||||
return (
|
return <TriggerComponent allAlerts={groupState.payload} />;
|
||||||
<>
|
|
||||||
{NotificationElement}
|
|
||||||
<TriggerComponent allAlerts={groupState.payload} />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default TriggeredAlerts;
|
export default TriggeredAlerts;
|
||||||
|
43
frontend/src/hooks/useNotifications.tsx
Normal file
43
frontend/src/hooks/useNotifications.tsx
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import { notification } from 'antd';
|
||||||
|
import { NotificationInstance } from 'antd/es/notification/interface';
|
||||||
|
import React, { createContext, useContext, useMemo } from 'react';
|
||||||
|
|
||||||
|
type Notification = {
|
||||||
|
notifications: NotificationInstance;
|
||||||
|
};
|
||||||
|
|
||||||
|
const defaultNotification: Notification = {
|
||||||
|
notifications: {
|
||||||
|
success: (): void => {},
|
||||||
|
error: (): void => {},
|
||||||
|
info: (): void => {},
|
||||||
|
warning: (): void => {},
|
||||||
|
open: (): void => {},
|
||||||
|
destroy: (): void => {},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const NotificationContext = createContext<Notification>(
|
||||||
|
defaultNotification,
|
||||||
|
);
|
||||||
|
|
||||||
|
export function NotificationProvider({
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
children: JSX.Element;
|
||||||
|
}): JSX.Element {
|
||||||
|
const [notificationApi, NotificationElement] = notification.useNotification();
|
||||||
|
const notifications = useMemo(() => ({ notifications: notificationApi }), [
|
||||||
|
notificationApi,
|
||||||
|
]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<NotificationContext.Provider value={notifications}>
|
||||||
|
{NotificationElement}
|
||||||
|
{children}
|
||||||
|
</NotificationContext.Provider>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useNotifications = (): Notification =>
|
||||||
|
useContext(NotificationContext);
|
@ -1,8 +1,8 @@
|
|||||||
import { notification } from 'antd';
|
|
||||||
import get from 'api/alerts/get';
|
import get from 'api/alerts/get';
|
||||||
import Spinner from 'components/Spinner';
|
import Spinner from 'components/Spinner';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
import EditRulesContainer from 'container/EditRules';
|
import EditRulesContainer from 'container/EditRules';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@ -26,7 +26,7 @@ function EditRules(): JSX.Element {
|
|||||||
enabled: isValidRuleId,
|
enabled: isValidRuleId,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isValidRuleId) {
|
if (!isValidRuleId) {
|
||||||
@ -42,12 +42,7 @@ function EditRules(): JSX.Element {
|
|||||||
ruleId == null ||
|
ruleId == null ||
|
||||||
(data?.payload?.data === undefined && !isLoading)
|
(data?.payload?.data === undefined && !isLoading)
|
||||||
) {
|
) {
|
||||||
return (
|
return <div>{data?.error || t('something_went_wrong')}</div>;
|
||||||
<div>
|
|
||||||
{NotificationElement}
|
|
||||||
{data?.error || t('something_went_wrong')}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLoading || !data?.payload) {
|
if (isLoading || !data?.payload) {
|
||||||
@ -55,13 +50,10 @@ function EditRules(): JSX.Element {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
{NotificationElement}
|
|
||||||
<EditRulesContainer
|
<EditRulesContainer
|
||||||
ruleId={parseInt(ruleId, 10)}
|
ruleId={parseInt(ruleId, 10)}
|
||||||
initialValue={data.payload.data}
|
initialValue={data.payload.data}
|
||||||
/>
|
/>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import { notification, Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import getLocalStorageKey from 'api/browser/localstorage/get';
|
import getLocalStorageKey from 'api/browser/localstorage/get';
|
||||||
import ReleaseNote from 'components/ReleaseNote';
|
import ReleaseNote from 'components/ReleaseNote';
|
||||||
import Spinner from 'components/Spinner';
|
import Spinner from 'components/Spinner';
|
||||||
import { SKIP_ONBOARDING } from 'constants/onboarding';
|
import { SKIP_ONBOARDING } from 'constants/onboarding';
|
||||||
import ResourceAttributesFilter from 'container/MetricsApplication/ResourceAttributesFilter';
|
import ResourceAttributesFilter from 'container/MetricsApplication/ResourceAttributesFilter';
|
||||||
import MetricTable from 'container/MetricsTable';
|
import MetricTable from 'container/MetricsTable';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import { convertRawQueriesToTraceSelectedTags } from 'lib/resourceAttributes';
|
import { convertRawQueriesToTraceSelectedTags } from 'lib/resourceAttributes';
|
||||||
import React, { useEffect, useMemo } from 'react';
|
import React, { useEffect, useMemo } from 'react';
|
||||||
import { connect, useSelector } from 'react-redux';
|
import { connect, useSelector } from 'react-redux';
|
||||||
@ -30,7 +31,7 @@ function Metrics({ getService }: MetricsProps): JSX.Element {
|
|||||||
error,
|
error,
|
||||||
errorMessage,
|
errorMessage,
|
||||||
} = useSelector<AppState, MetricReducer>((state) => state.metrics);
|
} = useSelector<AppState, MetricReducer>((state) => state.metrics);
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (error) {
|
if (error) {
|
||||||
@ -91,7 +92,6 @@ function Metrics({ getService }: MetricsProps): JSX.Element {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Space direction="vertical" style={{ width: '100%' }}>
|
<Space direction="vertical" style={{ width: '100%' }}>
|
||||||
{NotificationElement}
|
|
||||||
<ReleaseNote path={location.pathname} />
|
<ReleaseNote path={location.pathname} />
|
||||||
|
|
||||||
<ResourceAttributesFilter />
|
<ResourceAttributesFilter />
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Button, Input, notification, Space, Switch, Typography } from 'antd';
|
import { Button, Input, Space, Switch, Typography } from 'antd';
|
||||||
import editOrg from 'api/user/editOrg';
|
import editOrg from 'api/user/editOrg';
|
||||||
import getInviteDetails from 'api/user/getInviteDetails';
|
import getInviteDetails from 'api/user/getInviteDetails';
|
||||||
import loginApi from 'api/user/login';
|
import loginApi from 'api/user/login';
|
||||||
@ -6,6 +6,7 @@ import signUpApi from 'api/user/signup';
|
|||||||
import afterLogin from 'AppRoutes/utils';
|
import afterLogin from 'AppRoutes/utils';
|
||||||
import WelcomeLeftContainer from 'components/WelcomeLeftContainer';
|
import WelcomeLeftContainer from 'components/WelcomeLeftContainer';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@ -56,7 +57,7 @@ function SignUp({ version }: SignUpProps): JSX.Element {
|
|||||||
enabled: token !== null,
|
enabled: token !== null,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
@ -266,8 +267,6 @@ function SignUp({ version }: SignUpProps): JSX.Element {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<WelcomeLeftContainer version={version}>
|
<WelcomeLeftContainer version={version}>
|
||||||
<>
|
|
||||||
{NotificationElement}
|
|
||||||
<FormWrapper>
|
<FormWrapper>
|
||||||
<form onSubmit={!precheck.sso ? handleSubmit : handleSubmitSSO}>
|
<form onSubmit={!precheck.sso ? handleSubmit : handleSubmitSSO}>
|
||||||
<Title level={4}>Create your account</Title>
|
<Title level={4}>Create your account</Title>
|
||||||
@ -373,9 +372,7 @@ function SignUp({ version }: SignUpProps): JSX.Element {
|
|||||||
<MarginTop marginTop="2.4375rem">
|
<MarginTop marginTop="2.4375rem">
|
||||||
<Space>
|
<Space>
|
||||||
<Switch
|
<Switch
|
||||||
onChange={(value): void =>
|
onChange={(value): void => onSwitchHandler(value, setHasOptedUpdates)}
|
||||||
onSwitchHandler(value, setHasOptedUpdates)
|
|
||||||
}
|
|
||||||
checked={hasOptedUpdates}
|
checked={hasOptedUpdates}
|
||||||
/>
|
/>
|
||||||
<Typography>{t('prompt_keepme_posted')} </Typography>
|
<Typography>{t('prompt_keepme_posted')} </Typography>
|
||||||
@ -428,7 +425,6 @@ function SignUp({ version }: SignUpProps): JSX.Element {
|
|||||||
</ButtonContainer>
|
</ButtonContainer>
|
||||||
</form>
|
</form>
|
||||||
</FormWrapper>
|
</FormWrapper>
|
||||||
</>
|
|
||||||
</WelcomeLeftContainer>
|
</WelcomeLeftContainer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Card, notification } from 'antd';
|
import { Card } from 'antd';
|
||||||
import { NotificationInstance } from 'antd/es/notification/interface';
|
import { NotificationInstance } from 'antd/es/notification/interface';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
import Filters from 'container/Trace/Filters';
|
import Filters from 'container/Trace/Filters';
|
||||||
@ -6,6 +6,7 @@ import TraceGraph from 'container/Trace/Graph';
|
|||||||
import Search from 'container/Trace/Search';
|
import Search from 'container/Trace/Search';
|
||||||
import TraceGraphFilter from 'container/Trace/TraceGraphFilter';
|
import TraceGraphFilter from 'container/Trace/TraceGraphFilter';
|
||||||
import TraceTable from 'container/Trace/TraceTable';
|
import TraceTable from 'container/Trace/TraceTable';
|
||||||
|
import { useNotifications } from 'hooks/useNotifications';
|
||||||
import getStep from 'lib/getStep';
|
import getStep from 'lib/getStep';
|
||||||
import history from 'lib/history';
|
import history from 'lib/history';
|
||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
@ -53,7 +54,7 @@ function Trace({
|
|||||||
isFilterExclude,
|
isFilterExclude,
|
||||||
} = useSelector<AppState, TraceReducer>((state) => state.traces);
|
} = useSelector<AppState, TraceReducer>((state) => state.traces);
|
||||||
|
|
||||||
const [notifications, NotificationElement] = notification.useNotification();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getInitialFilter(minTime, maxTime, notifications);
|
getInitialFilter(minTime, maxTime, notifications);
|
||||||
@ -139,7 +140,6 @@ function Trace({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{NotificationElement}
|
|
||||||
<Search />
|
<Search />
|
||||||
<Container>
|
<Container>
|
||||||
<div>
|
<div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user