Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds new JSON viewer #5407

Draft
wants to merge 48 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
4dfd3bd
feat: Add JsonEditor component for JSON editing
anovazzi1 Dec 20, 2024
c7ceb47
feat: Add JsonEditor component for JSON editing and replace JsonView
anovazzi1 Dec 20, 2024
d994363
[autofix.ci] apply automated fixes
autofix-ci[bot] Dec 23, 2024
91580aa
Added json editor to package
lucaseduoli Jan 15, 2025
3d3ab4e
Change jsonEditor to use new vanilla jsonEditor
lucaseduoli Jan 15, 2025
fe9fef4
Added color variables
lucaseduoli Jan 15, 2025
c85fa84
Removed unused buttons on json editor
lucaseduoli Jan 15, 2025
5bcb1f7
Removed unused dark store
lucaseduoli Jan 20, 2025
7fcf275
Fixed state management on dictAreaModal
lucaseduoli Jan 20, 2025
0a7cc78
Change default DictComponent value to dict
lucaseduoli Jan 20, 2025
c754331
removed unused checks
lucaseduoli Jan 20, 2025
f0ba23e
Changed to forward ref of json editor
lucaseduoli Jan 20, 2025
37389c8
removed nav bar
lucaseduoli Jan 20, 2025
8a97ebd
Fixed value not being received
lucaseduoli Jan 20, 2025
14b3b15
Added check if value is null and handleOnNewValue on this case
lucaseduoli Jan 20, 2025
a27d866
Removed unused button on json editor
lucaseduoli Jan 20, 2025
2282d53
Adds auto focus and change mode to text
lucaseduoli Jan 20, 2025
5e9965d
♻️ (jsonEditor/index.tsx): remove unnecessary comments and improve co…
Cristhianzl Jan 20, 2025
bcaf5c8
Fixed dict component test
lucaseduoli Jan 20, 2025
fbf19e7
Refactor json-input component to use VanillaJsonEditor and JsonEditor…
anovazzi1 Jan 21, 2025
2e94c3c
Remove react-json-view-lite and react18-json-view dependencies
anovazzi1 Jan 21, 2025
3169d9b
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 21, 2025
461d138
Refactor jsonEditor component to add readOnly prop
anovazzi1 Jan 21, 2025
437cb22
Refactor json-output-view component to add read-only prop
anovazzi1 Jan 21, 2025
7b3440e
Refactor switchOutputView component to add JSON output view
anovazzi1 Jan 21, 2025
eb3b1d6
Refactor CSS styles for JSON editor buttons
anovazzi1 Jan 21, 2025
0462a49
Update package-lock.json to add new dependencies for @mapbox/node-pre…
ogabrielluiz Jan 21, 2025
1f7f7bb
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 21, 2025
ef6edcd
Refactor textModal component to remove unused imports and dependencies
anovazzi1 Jan 21, 2025
832a089
add filter property to jsonEditor
anovazzi1 Jan 27, 2025
43a7baa
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 27, 2025
a76dd52
Refactor jsonEditor component to handle transform queries and display…
anovazzi1 Jan 27, 2025
f275ca6
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 27, 2025
1ef7f94
Refactor jsonEditor component to add filter property and handle trans…
anovazzi1 Jan 27, 2025
993e55c
Refactor jsonEditor component to add filter property and handle trans…
anovazzi1 Jan 27, 2025
2b49c68
Refactor Output class to add options property
anovazzi1 Jan 27, 2025
e4ef9c4
Refactor json-output-view.tsx to update default height value
anovazzi1 Jan 27, 2025
68270ea
Refactor jsonEditor component to normalize transform query path
anovazzi1 Jan 27, 2025
faea5f1
Refactor jsonEditor component to add JSONQuery support for transform …
anovazzi1 Jan 27, 2025
767dc82
Add jsonquerylang library as a dependency
anovazzi1 Jan 27, 2025
fe0242c
Refactor utils.py to add support for applying JSON filters
anovazzi1 Jan 27, 2025
f06d060
Refactor base.py to add apply_options method for JSON filtering
anovazzi1 Jan 27, 2025
c493949
Fix jsonOutputView to set filter option to undefined when empty
anovazzi1 Jan 29, 2025
bc8c55b
Enhance apply_json_filter to support Data objects and improve query h…
anovazzi1 Jan 29, 2025
9995697
Improve json filtering in Output class to return original result if f…
anovazzi1 Jan 29, 2025
637b09c
Refactor Component class to simplify map_outputs method and enhance o…
anovazzi1 Jan 29, 2025
032c522
move jsonquerylang to langflow-base
ogabrielluiz Jan 30, 2025
90a95ef
Refactor Component and Output classes for improved output handling an…
anovazzi1 Jan 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[autofix.ci] apply automated fixes
  • Loading branch information
autofix-ci[bot] authored Jan 27, 2025

Verified

This commit was signed with the committer’s verified signature.
DylanTinianov Dylan Tinianov
commit f275ca653d5c52c4ef5f5aba55ab8d7bec1cdc3c
38 changes: 21 additions & 17 deletions src/frontend/src/components/core/jsonEditor/index.tsx
Original file line number Diff line number Diff line change
@@ -4,9 +4,9 @@ import {
createJSONEditor,
JsonEditor as VanillaJsonEditor,
} from "vanilla-jsoneditor";
import useAlertStore from "../../../stores/alertStore";
import { Button } from "../../ui/button";
import { Input } from "../../ui/input";
import useAlertStore from "../../../stores/alertStore";

interface JsonEditorProps {
data?: Content;
@@ -57,7 +57,7 @@ const JsonEditor = ({
if (result === undefined || result === null) {
setErrorData({
title: "Invalid Path",
list: [`Path '${transformQuery}' led to undefined or null value`]
list: [`Path '${transformQuery}' led to undefined or null value`],
});
return;
}
@@ -69,29 +69,33 @@ const JsonEditor = ({
if (index >= result.length) {
setErrorData({
title: "Invalid Array Index",
list: [`Index ${index} is out of bounds for array of length ${result.length}`]
list: [
`Index ${index} is out of bounds for array of length ${result.length}`,
],
});
return;
}
result = result[index];
continue;
}
// Apply operation to all array items
result = result.map(item => {
if (!(key in item)) {
setErrorData({
title: "Invalid Property",
list: [`Property '${key}' does not exist in array items`]
});
return undefined;
}
return item[key];
}).filter(item => item !== undefined);
result = result
.map((item) => {
if (!(key in item)) {
setErrorData({
title: "Invalid Property",
list: [`Property '${key}' does not exist in array items`],
});
return undefined;
}
return item[key];
})
.filter((item) => item !== undefined);
} else {
if (!(key in result)) {
setErrorData({
title: "Invalid Property",
list: [`Property '${key}' does not exist in object`]
list: [`Property '${key}' does not exist in object`],
});
return;
}
@@ -105,14 +109,14 @@ const JsonEditor = ({
} else {
setErrorData({
title: "Invalid Result",
list: ["Transform resulted in undefined value"]
list: ["Transform resulted in undefined value"],
});
}
} catch (error) {
console.error('Error applying transform:', error);
console.error("Error applying transform:", error);
setErrorData({
title: "Transform Error",
list: [(error as Error).message]
list: [(error as Error).message],
});
}
};
Loading