mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-13 00:58:59 +08:00
feat: address comments
This commit is contained in:
parent
8d1c4491b7
commit
715f8a2363
@ -27,7 +27,6 @@ import { AxiosError } from 'axios';
|
|||||||
import cx from 'classnames';
|
import cx from 'classnames';
|
||||||
import { ENTITY_VERSION_V4 } from 'constants/app';
|
import { ENTITY_VERSION_V4 } from 'constants/app';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
import { sanitizeDashboardData } from 'container/NewDashboard/DashboardDescription';
|
|
||||||
import { downloadObjectAsJson } from 'container/NewDashboard/DashboardDescription/utils';
|
import { downloadObjectAsJson } from 'container/NewDashboard/DashboardDescription/utils';
|
||||||
import { Base64Icons } from 'container/NewDashboard/DashboardSettings/General/utils';
|
import { Base64Icons } from 'container/NewDashboard/DashboardSettings/General/utils';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
@ -456,18 +455,7 @@ function DashboardsList(): JSX.Element {
|
|||||||
const handleJsonExport = (event: React.MouseEvent<HTMLElement>): void => {
|
const handleJsonExport = (event: React.MouseEvent<HTMLElement>): void => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const selectedDashboardData = dashboards?.find(
|
downloadObjectAsJson(dashboard, dashboard.name);
|
||||||
(d) => d.uuid === dashboard.id,
|
|
||||||
);
|
|
||||||
if (selectedDashboardData) {
|
|
||||||
downloadObjectAsJson(
|
|
||||||
sanitizeDashboardData({
|
|
||||||
...selectedDashboardData.data,
|
|
||||||
uuid: selectedDashboardData.uuid,
|
|
||||||
}),
|
|
||||||
dashboard.name,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -65,7 +65,7 @@ interface DashboardDescriptionProps {
|
|||||||
handle: FullScreenHandle;
|
handle: FullScreenHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function sanitizeDashboardData(
|
function sanitizeDashboardData(
|
||||||
selectedData: DashboardData,
|
selectedData: DashboardData,
|
||||||
): Omit<DashboardData, 'uuid'> {
|
): Omit<DashboardData, 'uuid'> {
|
||||||
if (!selectedData?.variables) {
|
if (!selectedData?.variables) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user