Skip to content

Commit 5126bd2

Browse files
committed
forgot to lint
1 parent 115b0b1 commit 5126bd2

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

frontend/src/components/files/File.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ import { useParams, useSearchParams } from "react-router-dom";
1515
import { useDispatch, useSelector } from "react-redux";
1616

1717
import { a11yProps, TabPanel } from "../tabs/TabComponent";
18-
import { fetchFileSummary, fetchFileVersions, changeSelectedVersion } from "../../actions/file";
18+
import {
19+
fetchFileSummary,
20+
fetchFileVersions,
21+
changeSelectedVersion,
22+
} from "../../actions/file";
1923
import { MainBreadcrumbs } from "../navigation/BreadCrumb";
2024
import { FileVersionHistory } from "../versions/FileVersionHistory";
2125
import { DisplayMetadata } from "../metadata/DisplayMetadata";

frontend/src/components/visualizations/JSONVisualizer/JSONVisualizer.tsx

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import {
99
import CodeMirror from "@uiw/react-codemirror"; // CodeMirror editor
1010
import { json } from "@codemirror/lang-json"; // JSON language support for CodeMirror
1111
import { downloadVisData, fileDownloaded } from "../../../utils/visualization";
12-
import {fetchFileVersions, updateFile as updateFileAction} from "../../../actions/file";
12+
import {
13+
fetchFileVersions,
14+
updateFile as updateFileAction,
15+
} from "../../../actions/file";
1316
import { readTextFromFile } from "../../../utils/common";
1417
import { downloadPublicVisData } from "../../../actions/public_visualization";
1518
import { filePublicDownloaded } from "../../../actions/public_file";
@@ -23,10 +26,12 @@ type jsonProps = {
2326
};
2427

2528
export default function JSONVisualizer(props: jsonProps) {
26-
const { visualizationId, publicView } = props;
29+
const { visualizationId, publicView } = props;
2730
// TODO: Use fileData to get the fileid to reflect version change
2831
const fileId = useSelector((state: RootState) => state.file.fileSummary?.id);
29-
const versionNum = useSelector((state: RootState) => state.file.selected_version_num);
32+
const versionNum = useSelector(
33+
(state: RootState) => state.file.selected_version_num
34+
);
3035
const fileSummary = useSelector((state: RootState) => state.file.fileSummary);
3136
const fileData = useSelector((state: RootState) => state.file);
3237

@@ -89,20 +94,16 @@ export default function JSONVisualizer(props: jsonProps) {
8994
} catch (error) {
9095
return false;
9196
}
92-
}
97+
};
9398

9499
const handleChange = (value: string) => {
95100
setJsonContent(value);
96101
setValidJson(validateJson(value));
97-
}
102+
};
98103

99104
const handleSave = async () => {
100105
try {
101-
if (
102-
jsonContent !== undefined &&
103-
fileName &&
104-
fileSummary?.content_type
105-
) {
106+
if (jsonContent !== undefined && fileName && fileSummary?.content_type) {
106107
const textBlob = new Blob([jsonContent], { type: "text/plain" });
107108
const file = new File([textBlob], fileName, {
108109
type: fileSummary.content_type.content_type,
@@ -122,7 +123,7 @@ export default function JSONVisualizer(props: jsonProps) {
122123

123124
const disableSaveButton = () => {
124125
return originalContent === jsonContent || !validJson;
125-
}
126+
};
126127

127128
return (
128129
<Card>
@@ -139,7 +140,12 @@ export default function JSONVisualizer(props: jsonProps) {
139140
)}
140141
</CardContent>
141142
<CardActions>
142-
<Button variant="contained" color="primary" onClick={handleSave} disabled={disableSaveButton()}>
143+
<Button
144+
variant="contained"
145+
color="primary"
146+
onClick={handleSave}
147+
disabled={disableSaveButton()}
148+
>
143149
Save Changes
144150
</Button>
145151
</CardActions>

0 commit comments

Comments
 (0)