From b72815ca2f780c41a1719f2bd885631e4866a12e Mon Sep 17 00:00:00 2001
From: Fellipe Montes <102544529+FellipeMTX@users.noreply.github.com>
Date: Mon, 30 Jan 2023 07:37:23 -0300
Subject: [PATCH] FIX: Exported dashboard include response of the queries #1981
(#2052)
* clear the queryData
* avoid creation of inline func and move logic to utils
* remove console.log
* fix
---
.../DescriptionOfDashboard/ShareModal.tsx | 7 ++++---
.../NewDashboard/DescriptionOfDashboard/util.ts | 17 +++++++++++++++++
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/frontend/src/container/NewDashboard/DescriptionOfDashboard/ShareModal.tsx b/frontend/src/container/NewDashboard/DescriptionOfDashboard/ShareModal.tsx
index e3be718e86..b177f056d2 100644
--- a/frontend/src/container/NewDashboard/DescriptionOfDashboard/ShareModal.tsx
+++ b/frontend/src/container/NewDashboard/DescriptionOfDashboard/ShareModal.tsx
@@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next';
import { useCopyToClipboard } from 'react-use';
import { DashboardData } from 'types/api/dashboard/getAll';
-import { downloadObjectAsJson } from './util';
+import { cleardQueryData, downloadObjectAsJson } from './util';
function ShareModal({
isJSONModalVisible,
@@ -51,6 +51,7 @@ function ShareModal({
}
}, [state.error, state.value, t]);
+ const selectedDataCleaned = cleardQueryData(selectedData);
const GetFooterComponent = useMemo(() => {
if (!isViewJSON) {
return (
@@ -66,7 +67,7 @@ function ShareModal({
);
- }, [isViewJSON, jsonValue, selectedData, setCopy, t]);
+ }, [isViewJSON, jsonValue, selectedData, selectedDataCleaned, setCopy, t]);
return (
({
+ ...widget,
+ queryData: {
+ ...widget.queryData,
+ data: {
+ queryData: [],
+ },
+ },
+ })),
+ };
+}