Skip to content

Commit

Permalink
webui: add support for jsonl/ndjson file diffing as text files (#8136)
Browse files Browse the repository at this point in the history
This change follows the approach taken for other similar formats, allowing
newline-delimited JSON files to be viewed and diffed in the LakeFS UI.

Closes #8094
  • Loading branch information
kujenga authored Oct 2, 2024
1 parent dcf175c commit aecc37a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion webui/src/lib/components/repository/ObjectsDiff.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {useStorageConfig} from "../../hooks/storageConfig";
import {AppContext} from "../../hooks/appContext";

const maxDiffSizeBytes = 120 << 10;
const supportedReadableFormats = ["txt", "text", "csv", "tsv", "yaml", "yml", "json"];
const supportedReadableFormats = ["txt", "text", "csv", "tsv", "yaml", "yml", "json", "jsonl", "ndjson"];

export const ObjectsDiff = ({diffType, repoId, leftRef, rightRef, path}) => {
const config = useStorageConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ export function guessType(contentType: string | null, fileExtension: string | nu
case 'yaml':
case 'yml':
case 'json':
case 'jsonl':
case 'ndjson':
return FileType.TEXT
}
if (guessLanguage(fileExtension, contentType))
Expand Down

0 comments on commit aecc37a

Please sign in to comment.