mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-29 18:02:06 +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: [],
|
||||
})),
|
||||
error: false,
|
||||
errorMessage: '',
|
||||
loading: false,
|
||||
},
|
||||
})),
|
||||
};
|
||||
|
@ -12,9 +12,23 @@ function ShareModal({
|
||||
onToggleHandler,
|
||||
selectedData,
|
||||
}: ShareModalProps): JSX.Element {
|
||||
const [jsonValue, setJSONValue] = useState<string>(
|
||||
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<string>(getParsedValue());
|
||||
const [isViewJSON, setIsViewJSON] = useState<boolean>(false);
|
||||
const { t } = useTranslation(['dashboard', 'common']);
|
||||
const [state, setCopy] = useCopyToClipboard();
|
||||
|
Loading…
x
Reference in New Issue
Block a user