mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-30 06:32:04 +08:00
Merge pull request #1146 from palash-signoz/379-json-data
feat: dashboard error and loading state is removed from dashboard object
This commit is contained in:
commit
03ef3d3bcd
@ -77,6 +77,9 @@ function ImportJSON({
|
|||||||
...queryData,
|
...queryData,
|
||||||
queryData: [],
|
queryData: [],
|
||||||
})),
|
})),
|
||||||
|
error: false,
|
||||||
|
errorMessage: '',
|
||||||
|
loading: false,
|
||||||
},
|
},
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
|
@ -12,9 +12,23 @@ function ShareModal({
|
|||||||
onToggleHandler,
|
onToggleHandler,
|
||||||
selectedData,
|
selectedData,
|
||||||
}: ShareModalProps): JSX.Element {
|
}: ShareModalProps): JSX.Element {
|
||||||
const [jsonValue, setJSONValue] = useState<string>(
|
const getParsedValue = (): string => {
|
||||||
JSON.stringify(selectedData, null, 2),
|
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<string>(getParsedValue());
|
||||||
const [isViewJSON, setIsViewJSON] = useState<boolean>(false);
|
const [isViewJSON, setIsViewJSON] = useState<boolean>(false);
|
||||||
const { t } = useTranslation(['dashboard', 'common']);
|
const { t } = useTranslation(['dashboard', 'common']);
|
||||||
const [state, setCopy] = useCopyToClipboard();
|
const [state, setCopy] = useCopyToClipboard();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user