mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-04 11:20:41 +08:00
Merge branch 'develop' into release/v0.49.x
This commit is contained in:
commit
08431131a9
@ -6,7 +6,6 @@ import './AppLayout.styles.scss';
|
|||||||
import * as Sentry from '@sentry/react';
|
import * as Sentry from '@sentry/react';
|
||||||
import { Flex } from 'antd';
|
import { Flex } from 'antd';
|
||||||
import getLocalStorageKey from 'api/browser/localstorage/get';
|
import getLocalStorageKey from 'api/browser/localstorage/get';
|
||||||
import getDynamicConfigs from 'api/dynamicConfigs/getDynamicConfigs';
|
|
||||||
import getUserLatestVersion from 'api/user/getLatestVersion';
|
import getUserLatestVersion from 'api/user/getLatestVersion';
|
||||||
import getUserVersion from 'api/user/getVersion';
|
import getUserVersion from 'api/user/getVersion';
|
||||||
import cx from 'classnames';
|
import cx from 'classnames';
|
||||||
@ -38,7 +37,6 @@ import { sideBarCollapse } from 'store/actions';
|
|||||||
import { AppState } from 'store/reducers';
|
import { AppState } from 'store/reducers';
|
||||||
import AppActions from 'types/actions';
|
import AppActions from 'types/actions';
|
||||||
import {
|
import {
|
||||||
UPDATE_CONFIGS,
|
|
||||||
UPDATE_CURRENT_ERROR,
|
UPDATE_CURRENT_ERROR,
|
||||||
UPDATE_CURRENT_VERSION,
|
UPDATE_CURRENT_VERSION,
|
||||||
UPDATE_LATEST_VERSION,
|
UPDATE_LATEST_VERSION,
|
||||||
@ -66,11 +64,7 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
|
|||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
const { t } = useTranslation(['titles']);
|
const { t } = useTranslation(['titles']);
|
||||||
|
|
||||||
const [
|
const [getUserVersionResponse, getUserLatestVersionResponse] = useQueries([
|
||||||
getUserVersionResponse,
|
|
||||||
getUserLatestVersionResponse,
|
|
||||||
getDynamicConfigsResponse,
|
|
||||||
] = useQueries([
|
|
||||||
{
|
{
|
||||||
queryFn: getUserVersion,
|
queryFn: getUserVersion,
|
||||||
queryKey: ['getUserVersion', user?.accessJwt],
|
queryKey: ['getUserVersion', user?.accessJwt],
|
||||||
@ -81,10 +75,6 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
|
|||||||
queryKey: ['getUserLatestVersion', user?.accessJwt],
|
queryKey: ['getUserLatestVersion', user?.accessJwt],
|
||||||
enabled: isLoggedIn,
|
enabled: isLoggedIn,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
queryFn: getDynamicConfigs,
|
|
||||||
queryKey: ['getDynamicConfigs', user?.accessJwt],
|
|
||||||
},
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -95,15 +85,7 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
|
|||||||
if (getUserVersionResponse.status === 'idle' && isLoggedIn) {
|
if (getUserVersionResponse.status === 'idle' && isLoggedIn) {
|
||||||
getUserVersionResponse.refetch();
|
getUserVersionResponse.refetch();
|
||||||
}
|
}
|
||||||
if (getDynamicConfigsResponse.status === 'idle') {
|
}, [getUserLatestVersionResponse, getUserVersionResponse, isLoggedIn]);
|
||||||
getDynamicConfigsResponse.refetch();
|
|
||||||
}
|
|
||||||
}, [
|
|
||||||
getUserLatestVersionResponse,
|
|
||||||
getUserVersionResponse,
|
|
||||||
isLoggedIn,
|
|
||||||
getDynamicConfigsResponse,
|
|
||||||
]);
|
|
||||||
|
|
||||||
const { children } = props;
|
const { children } = props;
|
||||||
|
|
||||||
@ -111,7 +93,6 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
|
|||||||
|
|
||||||
const latestCurrentCounter = useRef(0);
|
const latestCurrentCounter = useRef(0);
|
||||||
const latestVersionCounter = useRef(0);
|
const latestVersionCounter = useRef(0);
|
||||||
const latestConfigCounter = useRef(0);
|
|
||||||
|
|
||||||
const { notifications } = useNotifications();
|
const { notifications } = useNotifications();
|
||||||
|
|
||||||
@ -189,23 +170,6 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
|
||||||
getDynamicConfigsResponse.isFetched &&
|
|
||||||
getDynamicConfigsResponse.isSuccess &&
|
|
||||||
getDynamicConfigsResponse.data &&
|
|
||||||
getDynamicConfigsResponse.data.payload &&
|
|
||||||
latestConfigCounter.current === 0
|
|
||||||
) {
|
|
||||||
latestConfigCounter.current = 1;
|
|
||||||
|
|
||||||
dispatch({
|
|
||||||
type: UPDATE_CONFIGS,
|
|
||||||
payload: {
|
|
||||||
configs: getDynamicConfigsResponse.data.payload,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, [
|
}, [
|
||||||
dispatch,
|
dispatch,
|
||||||
isLoggedIn,
|
isLoggedIn,
|
||||||
@ -220,9 +184,6 @@ function AppLayout(props: AppLayoutProps): JSX.Element {
|
|||||||
getUserLatestVersionResponse.isFetched,
|
getUserLatestVersionResponse.isFetched,
|
||||||
getUserVersionResponse.isFetched,
|
getUserVersionResponse.isFetched,
|
||||||
getUserLatestVersionResponse.isSuccess,
|
getUserLatestVersionResponse.isSuccess,
|
||||||
getDynamicConfigsResponse.data,
|
|
||||||
getDynamicConfigsResponse.isFetched,
|
|
||||||
getDynamicConfigsResponse.isSuccess,
|
|
||||||
notifications,
|
notifications,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -91,6 +91,10 @@ func ValidateAndCastValue(v interface{}, dataType v3.AttributeKeyDataType) (inte
|
|||||||
return x, nil
|
return x, nil
|
||||||
case int, int64:
|
case int, int64:
|
||||||
return x, nil
|
return x, nil
|
||||||
|
case float32:
|
||||||
|
return int64(x), nil
|
||||||
|
case float64:
|
||||||
|
return int64(x), nil
|
||||||
case string:
|
case string:
|
||||||
int64val, err := strconv.ParseInt(x, 10, 64)
|
int64val, err := strconv.ParseInt(x, 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -275,6 +275,24 @@ var testValidateAndCastValueData = []struct {
|
|||||||
want: nil,
|
want: nil,
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "v3.AttributeKeyDataTypeInt64: valid float32",
|
||||||
|
args: args{
|
||||||
|
v: float32(1000),
|
||||||
|
dataType: v3.AttributeKeyDataTypeInt64,
|
||||||
|
},
|
||||||
|
want: int64(1000),
|
||||||
|
wantErr: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "v3.AttributeKeyDataTypeInt64: valid float64",
|
||||||
|
args: args{
|
||||||
|
v: float64(1000),
|
||||||
|
dataType: v3.AttributeKeyDataTypeInt64,
|
||||||
|
},
|
||||||
|
want: int64(1000),
|
||||||
|
wantErr: false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test cases for ValidateAndCastValue function in pkg/query-service/utils/format.go
|
// Test cases for ValidateAndCastValue function in pkg/query-service/utils/format.go
|
||||||
|
Loading…
x
Reference in New Issue
Block a user