Skip to content

Commit

Permalink
fixed the requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
THEBOSS0369 committed Oct 29, 2024
1 parent d11f920 commit 7daba5e
Showing 1 changed file with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions frontend/taipy/src/DataNodeViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import React, {
SyntheticEvent,
MouseEvent,
useRef,
lazy,
Suspense,
} from "react";
import Accordion from "@mui/material/Accordion";
import AccordionDetails from "@mui/material/AccordionDetails";
Expand Down Expand Up @@ -56,7 +58,6 @@ import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
import { AdapterDateFns } from "@mui/x-date-pickers/AdapterDateFnsV3";
import { format } from "date-fns";
import deepEqual from "fast-deep-equal/es6";
import ReactJson from 'react-json-view';

import {
ColumnDesc,
Expand Down Expand Up @@ -96,6 +97,8 @@ import { useUniqueId } from "./utils/hooks";
import DataNodeChart from "./DataNodeChart";
import DataNodeTable from "./DataNodeTable";

const LazyReactJson = lazy(() => import("react-json-view"));

const editTimestampFormat = "YYY/MM/dd HH:mm";

const tabBoxSx = { borderBottom: 1, borderColor: "divider" };
Expand Down Expand Up @@ -757,29 +760,6 @@ const DataNodeViewer = (props: DataNodeViewerProps) => {
) : null}
</Stack>
</Box>
<div>
{ dtType === "json" ? (
<>
<Grid container spacing={2}>
<Grid xs={12}>
<Typography variant="subtitle2">JSON Data</Typography>
</Grid>
<Grid xs={12}>
<ReactJson
// json data as prop
src={dtValue}
// it will be collapsed intitially
collapsed={true}
// disabling copy to clipboard
enableClipboard={true}
// hide data type
displayDataTypes={false}
/>
</Grid>
</Grid>
</>
)}
</div>
<div
role="tabpanel"
hidden={tabValue !== TabValues.Properties}
Expand Down Expand Up @@ -1041,6 +1021,28 @@ const DataNodeViewer = (props: DataNodeViewerProps) => {
</Tooltip>
</Grid>
</>
) : dtType === "json" ? (
<>
<Suspense>
<Grid container spacing={2}>
<Grid xs={12}>
<Typography variant="subtitle2">JSON Data</Typography>
</Grid>
<Grid xs={12}>
<LazyReactJson
// json data as prop
src={dtValue}
// collapsed intitially

Check failure on line 1035 in frontend/taipy/src/DataNodeViewer.tsx

View workflow job for this annotation

GitHub Actions / Check for spelling errors

intitially ==> initially
collapsed={true}
// disabling copy to clipboard
enableClipboard={true}
// hide data type
displayDataTypes={false}
/>
</Grid>
</Grid>
</Suspense>
</>
) : dtType == "date" &&
(dataValue === null || dataValue instanceof Date) ? (
<LocalizationProvider dateAdapter={AdapterDateFns}>
Expand Down

0 comments on commit 7daba5e

Please sign in to comment.