mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-29 01:02:01 +08:00
Merge branch 'develop' into release/v0.21.0
This commit is contained in:
commit
803cfd1aa3
@ -163,7 +163,7 @@ function NewWidget({ selectedGraph, saveSettingOfPanel }: Props): JSX.Element {
|
|||||||
FeatureKeys.QUERY_BUILDER_PANELS,
|
FeatureKeys.QUERY_BUILDER_PANELS,
|
||||||
);
|
);
|
||||||
|
|
||||||
const isSaveDisabled = useMemo(
|
const isNewTraceLogsAvailable = useMemo(
|
||||||
() =>
|
() =>
|
||||||
isQueryBuilderActive &&
|
isQueryBuilderActive &&
|
||||||
currentQuery.queryType === EQueryType.QUERY_BUILDER &&
|
currentQuery.queryType === EQueryType.QUERY_BUILDER &&
|
||||||
@ -177,6 +177,30 @@ function NewWidget({ selectedGraph, saveSettingOfPanel }: Props): JSX.Element {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const isSaveDisabled = useMemo(() => {
|
||||||
|
// new created dashboard
|
||||||
|
if (selectedWidget?.id === 'empty') {
|
||||||
|
return isNewTraceLogsAvailable;
|
||||||
|
}
|
||||||
|
|
||||||
|
const isTraceOrLogsQueryBuilder =
|
||||||
|
currentQuery.builder.queryData.find(
|
||||||
|
(query) =>
|
||||||
|
query.dataSource === DataSource.TRACES ||
|
||||||
|
query.dataSource === DataSource.LOGS,
|
||||||
|
) !== undefined;
|
||||||
|
|
||||||
|
if (isTraceOrLogsQueryBuilder) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return isNewTraceLogsAvailable;
|
||||||
|
}, [
|
||||||
|
currentQuery.builder.queryData,
|
||||||
|
selectedWidget?.id,
|
||||||
|
isNewTraceLogsAvailable,
|
||||||
|
]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
<ButtonContainer>
|
<ButtonContainer>
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { notification } from 'antd';
|
||||||
import updateDashboardApi from 'api/dashboard/update';
|
import updateDashboardApi from 'api/dashboard/update';
|
||||||
import { AxiosError } from 'axios';
|
import { AxiosError } from 'axios';
|
||||||
import { COMPOSITE_QUERY } from 'constants/queryBuilderQueryNames';
|
import { COMPOSITE_QUERY } from 'constants/queryBuilderQueryNames';
|
||||||
@ -129,10 +130,16 @@ export const SaveDashboard = ({
|
|||||||
});
|
});
|
||||||
history.push(generatePath(ROUTES.DASHBOARD, { dashboardId }));
|
history.push(generatePath(ROUTES.DASHBOARD, { dashboardId }));
|
||||||
} else {
|
} else {
|
||||||
|
const error = 'Something went wrong';
|
||||||
|
|
||||||
|
notification.error({
|
||||||
|
message: response.error || error,
|
||||||
|
});
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'SAVE_SETTING_TO_PANEL_ERROR',
|
type: 'SAVE_SETTING_TO_PANEL_ERROR',
|
||||||
payload: {
|
payload: {
|
||||||
errorMessage: response.error || 'Something went wrong',
|
errorMessage: response.error || error,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user