Skip to content

Commit

Permalink
feat: address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
amlannandy committed Dec 5, 2024
1 parent 2374997 commit b0a83ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
14 changes: 1 addition & 13 deletions frontend/src/container/ListOfDashboard/DashboardsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { AxiosError } from 'axios';
import cx from 'classnames';
import { ENTITY_VERSION_V4 } from 'constants/app';
import ROUTES from 'constants/routes';
import { sanitizeDashboardData } from 'container/NewDashboard/DashboardDescription';
import { downloadObjectAsJson } from 'container/NewDashboard/DashboardDescription/utils';
import { Base64Icons } from 'container/NewDashboard/DashboardSettings/General/utils';
import dayjs from 'dayjs';
Expand Down Expand Up @@ -456,18 +455,7 @@ function DashboardsList(): JSX.Element {
const handleJsonExport = (event: React.MouseEvent<HTMLElement>): void => {
event.stopPropagation();
event.preventDefault();
const selectedDashboardData = dashboards?.find(
(d) => d.uuid === dashboard.id,
);
if (selectedDashboardData) {
downloadObjectAsJson(
sanitizeDashboardData({
...selectedDashboardData.data,
uuid: selectedDashboardData.uuid,
}),
dashboard.name,
);
}
downloadObjectAsJson(dashboard, dashboard.name);
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ interface DashboardDescriptionProps {
handle: FullScreenHandle;
}

export function sanitizeDashboardData(
function sanitizeDashboardData(
selectedData: DashboardData,
): Omit<DashboardData, 'uuid'> {
if (!selectedData?.variables) {
Expand Down

0 comments on commit b0a83ed

Please sign in to comment.