mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-10 15:58:59 +08:00
feat(UI): Eslint fixes (#418)
* chore(UI): port finder is removed * chore(UI): webpack config is updated * fix(UI): eslint error and fixes are updated
This commit is contained in:
parent
fbf047a477
commit
03bf9afe03
@ -173,7 +173,6 @@
|
|||||||
"less-plugin-npm-import": "^2.1.0",
|
"less-plugin-npm-import": "^2.1.0",
|
||||||
"lint-staged": "10.5.3",
|
"lint-staged": "10.5.3",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"portfinder-sync": "^0.0.2",
|
|
||||||
"prettier": "2.2.1",
|
"prettier": "2.2.1",
|
||||||
"react-hot-loader": "^4.13.0",
|
"react-hot-loader": "^4.13.0",
|
||||||
"react-is": "^17.0.1",
|
"react-is": "^17.0.1",
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { apiV1, AxiosAlertManagerInstance } from 'api';
|
import { AxiosAlertManagerInstance } from 'api';
|
||||||
import { apiV2 } from 'api/apiV1';
|
|
||||||
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
|
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import { ErrorResponse, SuccessResponse } from 'types/api';
|
import { ErrorResponse, SuccessResponse } from 'types/api';
|
||||||
|
@ -3,7 +3,7 @@ import React, { useEffect, useRef } from 'react';
|
|||||||
|
|
||||||
import { Container } from './styles';
|
import { Container } from './styles';
|
||||||
|
|
||||||
const Editor = ({ value }: EditorProps) => {
|
const Editor = ({ value }: EditorProps): JSX.Element => {
|
||||||
const divEl = useRef<HTMLDivElement>(null);
|
const divEl = useRef<HTMLDivElement>(null);
|
||||||
const editorRef = useRef<monaco.editor.IStandaloneCodeEditor>();
|
const editorRef = useRef<monaco.editor.IStandaloneCodeEditor>();
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ const Editor = ({ value }: EditorProps) => {
|
|||||||
value.current = editor?.getValue() || '';
|
value.current = editor?.getValue() || '';
|
||||||
});
|
});
|
||||||
|
|
||||||
return () => {
|
return (): void => {
|
||||||
if (editor) {
|
if (editor) {
|
||||||
editor.dispose();
|
editor.dispose();
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ const FormAlertChannels = ({
|
|||||||
type,
|
type,
|
||||||
setSelectedConfig,
|
setSelectedConfig,
|
||||||
onTypeChangeHandler,
|
onTypeChangeHandler,
|
||||||
onTestHandler,
|
// onTestHandler,
|
||||||
onSaveHandler,
|
onSaveHandler,
|
||||||
savingState,
|
savingState,
|
||||||
NotificationElement,
|
NotificationElement,
|
||||||
@ -92,8 +92,8 @@ interface FormAlertChannelsProps {
|
|||||||
onSaveHandler: (props: ChannelType) => void;
|
onSaveHandler: (props: ChannelType) => void;
|
||||||
savingState: boolean;
|
savingState: boolean;
|
||||||
NotificationElement: React.ReactElement<
|
NotificationElement: React.ReactElement<
|
||||||
any,
|
unknown,
|
||||||
string | React.JSXElementConstructor<any>
|
string | React.JSXElementConstructor<unknown>
|
||||||
>;
|
>;
|
||||||
title: string;
|
title: string;
|
||||||
initialValue: Store;
|
initialValue: Store;
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
|
|
||||||
const MapAlertChannels = () => {
|
|
||||||
return <div>MapAlertChannels</div>;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default MapAlertChannels;
|
|
@ -4,6 +4,7 @@ import React from 'react';
|
|||||||
import { connect, useSelector } from 'react-redux';
|
import { connect, useSelector } from 'react-redux';
|
||||||
import { AppState } from 'store/reducers';
|
import { AppState } from 'store/reducers';
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
|
import { Store } from 'rc-field-form/lib/interface';
|
||||||
import { bindActionCreators } from 'redux';
|
import { bindActionCreators } from 'redux';
|
||||||
import { ThunkDispatch } from 'redux-thunk';
|
import { ThunkDispatch } from 'redux-thunk';
|
||||||
import {
|
import {
|
||||||
@ -33,7 +34,7 @@ const TraceCustomVisualisation = ({
|
|||||||
return <Spinner tip="Loading..." height="40vh" />;
|
return <Spinner tip="Loading..." height="40vh" />;
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleFormValuesChange = (changedValues: any): void => {
|
const handleFormValuesChange = (changedValues: Store): void => {
|
||||||
const formFieldName = Object.keys(changedValues)[0];
|
const formFieldName = Object.keys(changedValues)[0];
|
||||||
if (formFieldName === 'entity') {
|
if (formFieldName === 'entity') {
|
||||||
const temp_entity = aggregation_options.filter(
|
const temp_entity = aggregation_options.filter(
|
||||||
|
@ -75,7 +75,7 @@ const SelectedSpanDetails = (props: SelectedSpanDetailsProps): JSX.Element => {
|
|||||||
<Tabs defaultActiveKey="1">
|
<Tabs defaultActiveKey="1">
|
||||||
<TabPane tab="Tags" key="1">
|
<TabPane tab="Tags" key="1">
|
||||||
{spanTags &&
|
{spanTags &&
|
||||||
spanTags.map((tags, index) => {
|
spanTags.map((tags) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{tags.value && (
|
{tags.value && (
|
||||||
|
@ -18,7 +18,7 @@ interface UsageExplorerProps {
|
|||||||
getUsageData: (
|
getUsageData: (
|
||||||
minTime: number,
|
minTime: number,
|
||||||
maxTime: number,
|
maxTime: number,
|
||||||
selectedInterval: any,
|
selectedInterval: number,
|
||||||
selectedService: string,
|
selectedService: string,
|
||||||
) => void;
|
) => void;
|
||||||
getServicesList: ({
|
getServicesList: ({
|
||||||
|
@ -12,7 +12,7 @@ import { ButtonContainer, Title } from './styles';
|
|||||||
|
|
||||||
const CreateAlert = (): JSX.Element => {
|
const CreateAlert = (): JSX.Element => {
|
||||||
const value = useRef<string>(
|
const value = useRef<string>(
|
||||||
`\n alert: <alert name>\n expr: system_cpu_load_average_1m > 0.01\n for: 0m\n labels:\n severity: warning\n annotations:\n summary: High CPU load\n description: \"CPU load is > 0.01\n VALUE = {{ $value }}\n LABELS = {{ $labels }}\"\n `,
|
`\n alert: <alert name>\n expr: system_cpu_load_average_1m > 0.01\n for: 0m\n labels:\n severity: warning\n annotations:\n summary: High CPU load\n description: "CPU load is > 0.01\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"\n `,
|
||||||
);
|
);
|
||||||
|
|
||||||
const [newAlertState, setNewAlertState] = useState<
|
const [newAlertState, setNewAlertState] = useState<
|
||||||
@ -85,7 +85,7 @@ const CreateAlert = (): JSX.Element => {
|
|||||||
'Oops! Some issue occured in saving the alert please try again or contact support@signoz.io',
|
'Oops! Some issue occured in saving the alert please try again or contact support@signoz.io',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, []);
|
}, [notifications]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import api from 'api';
|
import api from 'api';
|
||||||
import ROUTES from 'constants/routes';
|
|
||||||
import { Dispatch } from 'redux';
|
import { Dispatch } from 'redux';
|
||||||
import { GlobalTime } from 'types/actions/globalTime';
|
import { GlobalTime } from 'types/actions/globalTime';
|
||||||
import { toUTCEpoch } from 'utils/timeUtils';
|
import { toUTCEpoch } from 'utils/timeUtils';
|
||||||
@ -120,7 +119,7 @@ export interface FetchTraceItemAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const fetchTraces = (globalTime: GlobalTime, filter_params: string) => {
|
export const fetchTraces = (globalTime: GlobalTime, filter_params: string) => {
|
||||||
return async (dispatch: Dispatch): void => {
|
return async (dispatch: Dispatch): Promise<void> => {
|
||||||
if (globalTime) {
|
if (globalTime) {
|
||||||
const request_string =
|
const request_string =
|
||||||
'/spans?limit=100&lookback=2d&start=' +
|
'/spans?limit=100&lookback=2d&start=' +
|
||||||
|
@ -4,7 +4,7 @@ import thunk, { ThunkMiddleware } from 'redux-thunk';
|
|||||||
import reducers, { AppState } from './reducers';
|
import reducers, { AppState } from './reducers';
|
||||||
|
|
||||||
const composeEnhancers =
|
const composeEnhancers =
|
||||||
(window && (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) || compose;
|
(window && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) || compose;
|
||||||
|
|
||||||
const store = createStore(
|
const store = createStore(
|
||||||
reducers,
|
reducers,
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/no-namespace */
|
||||||
declare global {
|
declare global {
|
||||||
namespace NodeJS {
|
namespace NodeJS {
|
||||||
interface ProcessEnv {
|
interface ProcessEnv {
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import Cypress from 'cypress';
|
import Cypress from 'cypress';
|
||||||
import { Store } from 'redux';
|
import { compose, Store } from 'redux';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
store: Store;
|
store: Store;
|
||||||
Cypress: typeof Cypress;
|
Cypress: typeof Cypress;
|
||||||
|
__REDUX_DEVTOOLS_EXTENSION_COMPOSE__: typeof compose;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ const config = {
|
|||||||
open: true,
|
open: true,
|
||||||
hot: true,
|
hot: true,
|
||||||
liveReload: true,
|
liveReload: true,
|
||||||
port: portFinderSync.getPort(3000),
|
port: 3000,
|
||||||
static: {
|
static: {
|
||||||
directory: resolve(__dirname, 'public'),
|
directory: resolve(__dirname, 'public'),
|
||||||
publicPath: '/',
|
publicPath: '/',
|
||||||
|
@ -11251,15 +11251,7 @@ polished@4:
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@babel/runtime" "^7.14.0"
|
"@babel/runtime" "^7.14.0"
|
||||||
|
|
||||||
portfinder-sync@^0.0.2:
|
portfinder@^1.0.28:
|
||||||
version "0.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/portfinder-sync/-/portfinder-sync-0.0.2.tgz#6e3409a73a718436de053ac949385350caabd8a2"
|
|
||||||
integrity sha1-bjQJpzpxhDbeBTrJSThTUMqr2KI=
|
|
||||||
dependencies:
|
|
||||||
minimist "^1.2.0"
|
|
||||||
portfinder "^1.0.10"
|
|
||||||
|
|
||||||
portfinder@^1.0.10, portfinder@^1.0.28:
|
|
||||||
version "1.0.28"
|
version "1.0.28"
|
||||||
resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.28.tgz#67c4622852bd5374dd1dd900f779f53462fac778"
|
resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.28.tgz#67c4622852bd5374dd1dd900f779f53462fac778"
|
||||||
integrity sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==
|
integrity sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==
|
||||||
|
Loading…
x
Reference in New Issue
Block a user