diff --git a/src/components/AddItemModal/SetAttributesStep/index.tsx b/src/components/AddItemModal/SetAttributesStep/index.tsx index 1cb4e4150..ea4a63020 100644 --- a/src/components/AddItemModal/SetAttributesStep/index.tsx +++ b/src/components/AddItemModal/SetAttributesStep/index.tsx @@ -35,7 +35,8 @@ export const SetAttributesStep: FC = ({ handleSelectType, skipToStep, nod const data = await getNodeType(nodeType) - const parsedData = parseJson(data) + const parsedData = + data.attributes && typeof data.attributes === 'object' ? parseJson(data.attributes) : parseJson(data) const filteredAttributes = parsedData.filter((attr) => attr.key !== 'node_key') diff --git a/src/components/ModalsContainer/BlueprintModal/Body/Editor/CustomAttributesStep/FormInput/index.tsx b/src/components/ModalsContainer/BlueprintModal/Body/Editor/CustomAttributesStep/FormInput/index.tsx index 1c31e9967..d0fd98ceb 100644 --- a/src/components/ModalsContainer/BlueprintModal/Body/Editor/CustomAttributesStep/FormInput/index.tsx +++ b/src/components/ModalsContainer/BlueprintModal/Body/Editor/CustomAttributesStep/FormInput/index.tsx @@ -48,7 +48,11 @@ export const FormInput = ({ const data = await getNodeType(parentParam as string) - parsedDataDefault = parseJson(data) + if (data.attributes && typeof data.attributes === 'object') { + parsedDataDefault = parseJson(data.attributes) + } else { + parsedDataDefault = parseJson(data) + } } parsedDataDefault = parsedDataDefault.filter((x) => x.key !== 'node_key') diff --git a/src/components/ModalsContainer/BlueprintModal/Body/index.tsx b/src/components/ModalsContainer/BlueprintModal/Body/index.tsx index e61393df1..dd53065dd 100644 --- a/src/components/ModalsContainer/BlueprintModal/Body/index.tsx +++ b/src/components/ModalsContainer/BlueprintModal/Body/index.tsx @@ -1,6 +1,7 @@ import { useEffect, useState } from 'react' import { ClipLoader } from 'react-spinners' import styled from 'styled-components' +import { AddEdgeNode } from '~/components/ModalsContainer/BlueprintModal/Body/AddEdgeNode' import { Flex } from '~/components/common/Flex' import { Schema, getSchemaAll } from '~/network/fetchSourcesData' import { useSchemaStore } from '~/stores/useSchemaStore' @@ -9,7 +10,6 @@ import { SchemaWithChildren } from '../types' import { Editor } from './Editor' import { Graph } from './Graph' import { Toolbar } from './Toolbar' -import { AddEdgeNode } from '~/components/ModalsContainer/BlueprintModal/Body/AddEdgeNode' export type FormData = { type: string