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,
|
||||
);
|
||||
|
||||
const isSaveDisabled = useMemo(
|
||||
const isNewTraceLogsAvailable = useMemo(
|
||||
() =>
|
||||
isQueryBuilderActive &&
|
||||
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 (
|
||||
<Container>
|
||||
<ButtonContainer>
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { notification } from 'antd';
|
||||
import updateDashboardApi from 'api/dashboard/update';
|
||||
import { AxiosError } from 'axios';
|
||||
import { COMPOSITE_QUERY } from 'constants/queryBuilderQueryNames';
|
||||
@ -129,10 +130,16 @@ export const SaveDashboard = ({
|
||||
});
|
||||
history.push(generatePath(ROUTES.DASHBOARD, { dashboardId }));
|
||||
} else {
|
||||
const error = 'Something went wrong';
|
||||
|
||||
notification.error({
|
||||
message: response.error || error,
|
||||
});
|
||||
|
||||
dispatch({
|
||||
type: 'SAVE_SETTING_TO_PANEL_ERROR',
|
||||
payload: {
|
||||
errorMessage: response.error || 'Something went wrong',
|
||||
errorMessage: response.error || error,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user