Skip to content

Commit

Permalink
Fix node update (#603)
Browse files Browse the repository at this point in the history
* update js tree

* updates

* update type
  • Loading branch information
AnnaLysiuk committed May 8, 2024
1 parent 39383bf commit 36fff9c
Show file tree
Hide file tree
Showing 9 changed files with 7,267 additions and 4,345 deletions.
11,575 changes: 7,248 additions & 4,327 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -32,7 +32,7 @@
"@types/classnames": "^2.3.0",
"@types/faker": "^5.5.8",
"@types/file-saver": "^2.0.5",
"@types/graphql": "^14.2.3",
"@types/graphql": "^14.5.0",
"@types/history": "4.7.9",
"@types/jest": "^27.0.1",
"@types/node": "^16.9.2",
Expand Down Expand Up @@ -80,4 +80,4 @@
"./packages/socket-live-test"
]
}
}
}
6 changes: 3 additions & 3 deletions packages/editor-worker/package.json
Expand Up @@ -30,8 +30,8 @@
"@qix/elkjs-patched": "^0.8.0-patch3",
"d3": "^7.8.4",
"elkjs": "^0.8.2",
"graphql-js-tree": "^1.0.9",
"graphql-language-service": "3.1.4"
"graphql-js-tree": "^2.0.1",
"graphql-language-service": "3.2.5"
},
"config": {
"commitizen": {
Expand All @@ -41,4 +41,4 @@
"devDependencies": {
"@types/d3": "^7.4.0"
}
}
}
2 changes: 1 addition & 1 deletion packages/editor-worker/src/validation.ts
Expand Up @@ -47,7 +47,7 @@ const moveErrorsByLibraryPadding = () => {
column: l.column - 1,
})),
positions: error.error.positions,
},
} as GraphQLError,
};
};
};
Expand Down
6 changes: 3 additions & 3 deletions packages/editor/package.json
Expand Up @@ -46,8 +46,8 @@
"framer-motion": "^10.12.16",
"fuzzyjs": "^5.0.1",
"graphql-editor-worker": "^7.2.8",
"graphql-js-tree": "^1.0.9",
"graphql-language-service": "3.1.4",
"graphql-js-tree": "^2.0.1",
"graphql-language-service": "3.2.5",
"html-to-image": "^1.10.8",
"re-resizable": "^6.9.1",
"react-laag": "^2.0.4",
Expand All @@ -65,4 +65,4 @@
"@types/d3": "^7.4.0",
"@types/diff": "^5.0.2"
}
}
}
7 changes: 4 additions & 3 deletions packages/editor/src/Graf/Node/ActiveNode/index.tsx
Expand Up @@ -163,7 +163,7 @@ export const ActiveNode: React.FC<NodeProps> = ({
parentNode,
...sharedProps
}) => {
const { setEditMode } = useRelationsState();
const { setEditMode, editMode } = useRelationsState();
const { setSelectedNodeId } = useTreesState();
const [openedNode, setOpenedNode] = useState<{
type:
Expand Down Expand Up @@ -359,7 +359,8 @@ export const ActiveNode: React.FC<NodeProps> = ({
{
...node,
name: newName,
}
},
editMode
);
return;
}
Expand Down Expand Up @@ -499,7 +500,7 @@ export const ActiveNode: React.FC<NodeProps> = ({
}
onDelete={() => removeFieldFromNode(node, a)}
onUpdate={(updatedNode) => {
updateFieldOnNode(node, i, updatedNode);
updateFieldOnNode(node, i, updatedNode, editMode);
}}
/>
</div>
Expand Down
Expand Up @@ -144,7 +144,7 @@ export const useGqlServices = (options: SchemaServicesOptions = {}) => {
});
if (bridge) {
const suggestions = getAutocompleteSuggestions(
bridge.schema,
bridge.schema as GraphQLSchema,
bridge.document,
bridge.position,
bridge.token as ContextTokenForCodeMirror
Expand Down
5 changes: 3 additions & 2 deletions packages/editor/src/state/containers/trees/index.ts
Expand Up @@ -312,10 +312,11 @@ const useTreesStateContainer = createContainer(() => {
const updateFieldOnNode = (
node: ParserField,
i: number,
updatedField: ParserField
updatedField: ParserField,
parentNode: string
) => {
updateNode(node, () =>
mutationRoot.updateFieldOnNode(node, i, updatedField)
mutationRoot.updateFieldOnNode(node, i, updatedField, parentNode)
);
};

Expand Down
5 changes: 2 additions & 3 deletions packages/sandbox/package.json
Expand Up @@ -34,7 +34,6 @@
"fork-ts-checker-webpack-plugin": "^6.3.3",
"html-loader": "^2.1.2",
"html-webpack-plugin": "^5.3.2",
"react-hot-loader": "^4.13.0",
"react-refresh": "^0.14.0",
"style-loader": "^3.2.1",
"ts-loader": "^9.2.5",
Expand All @@ -50,7 +49,7 @@
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"graphql-editor": "^7.2.8",
"graphql-js-tree": "^0.1.6",
"graphql-js-tree": "^2.0.1",
"socket.io-client": "^4.7.2",
"y-monaco": "^0.1.5",
"y-websocket": "^1.5.3",
Expand All @@ -61,4 +60,4 @@
"path": "./node_modules/cz-conventional-changelog"
}
}
}
}

0 comments on commit 36fff9c

Please sign in to comment.