diff --git a/frontend/src/container/ListOfDashboard/ImportJSON/index.tsx b/frontend/src/container/ListOfDashboard/ImportJSON/index.tsx index 24b2d8b753..99f5fb0eeb 100644 --- a/frontend/src/container/ListOfDashboard/ImportJSON/index.tsx +++ b/frontend/src/container/ListOfDashboard/ImportJSON/index.tsx @@ -77,6 +77,9 @@ function ImportJSON({ ...queryData, queryData: [], })), + error: false, + errorMessage: '', + loading: false, }, })), }; diff --git a/frontend/src/container/NewDashboard/DescriptionOfDashboard/ShareModal.tsx b/frontend/src/container/NewDashboard/DescriptionOfDashboard/ShareModal.tsx index d746d42218..134c2502c3 100644 --- a/frontend/src/container/NewDashboard/DescriptionOfDashboard/ShareModal.tsx +++ b/frontend/src/container/NewDashboard/DescriptionOfDashboard/ShareModal.tsx @@ -12,9 +12,23 @@ function ShareModal({ onToggleHandler, selectedData, }: ShareModalProps): JSX.Element { - const [jsonValue, setJSONValue] = useState( - JSON.stringify(selectedData, null, 2), - ); + const getParsedValue = (): string => { + const updatedData: DashboardData = { + ...selectedData, + widgets: selectedData.widgets?.map((widget) => ({ + ...widget, + queryData: { + ...widget.queryData, + loading: false, + error: false, + errorMessage: '', + }, + })), + }; + return JSON.stringify(updatedData, null, 2); + }; + + const [jsonValue, setJSONValue] = useState(getParsedValue()); const [isViewJSON, setIsViewJSON] = useState(false); const { t } = useTranslation(['dashboard', 'common']); const [state, setCopy] = useCopyToClipboard();