Skip to content

Commit 039b4e7

Browse files
committed
SdggSoft:
- Runned pnpm run lint:fix - And fixed some warning lint fixes on code i touched
1 parent 38b5d53 commit 039b4e7

19 files changed

Lines changed: 40 additions & 47 deletions

File tree

apps/chaingraph-frontend/src/components/flow/nodes/ChaingraphNode/ChaingraphNode.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ import { removeNodeFromFlow, updateNodeUI } from '@/store/nodes'
2626
import { useNode } from '@/store/nodes/hooks/useNode'
2727
import {
2828
addFieldObjectPort,
29-
updateItemConfigArrayPort,
3029
appendElementArrayPort,
3130
removeElementArrayPort,
3231
removeFieldObjectPort,
3332
requestUpdatePortUI,
3433
requestUpdatePortValue,
34+
updateItemConfigArrayPort,
3535
} from '@/store/ports'
3636
import { NodeResizeControl, ResizeControlVariant } from '@xyflow/react'
3737
import { useUnit } from 'effector-react'
@@ -195,7 +195,7 @@ function ChaingraphNodeComponent({
195195
updateItemConfigArrayPort: params => dispatch.updateItemConfigArrayPort({
196196
nodeId: params.nodeId,
197197
portId: params.portId,
198-
itemConfig: params.itemConfig
198+
itemConfig: params.itemConfig,
199199
}),
200200
appendElementArrayPort: params => dispatch.appendElementArrayPort({
201201
nodeId: params.nodeId,

apps/chaingraph-frontend/src/components/flow/nodes/ChaingraphNode/SchemaEditor/ArrayItemSchemaEditor.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,11 @@ export function ArrayItemSchemaEditor({
105105
</TabsList>
106106
</div>
107107

108-
{tab === "visual" && <TabsContent value="visual" className="flex-1 flex flex-col">
109-
<ArrayItemEditorContent onSave={onSave} />
110-
</TabsContent>}
108+
{tab === 'visual' && (
109+
<TabsContent value="visual" className="flex-1 flex flex-col">
110+
<ArrayItemEditorContent onSave={onSave} />
111+
</TabsContent>
112+
)}
111113

112114
<TabsContent value="json" className="flex-1 p-6">
113115
<JsonEditor onSave={onSave} />

apps/chaingraph-frontend/src/components/flow/nodes/ChaingraphNode/ports/ArrayPort/AddElementPopover.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* As of the Change Date specified in that file, in accordance with the Business Source License, use of this software will be governed by the Apache License, version 2.0.
77
*/
88

9-
import type { IPort, ArrayPortConfig, IPortConfig, PortType } from '@badaitech/chaingraph-types'
9+
import type { ArrayPortConfig, IPort, IPortConfig, PortType } from '@badaitech/chaingraph-types'
1010
import { Button } from '@/components/ui/button'
1111
import {
1212
DropdownMenu,
@@ -115,7 +115,7 @@ export function AddElementPopover(props: Props) {
115115
const dropDownValues = (itemType !== 'any' ? [itemType] : (port.getConfig().ui?.allowedTypes || PORT_TYPES)).filter(portType => portType !== 'any') // && portType !== 'secret')))
116116

117117
const [type, setType] = useState<PortType | undefined>(
118-
dropDownValues.at(0) || itemType
118+
dropDownValues.at(0) || itemType,
119119
)
120120
const [isDropdownOpen, setIsDropdownOpen] = useState(false)
121121

apps/chaingraph-frontend/src/components/flow/nodes/ChaingraphNode/ports/ArrayPort/ArrayPort.tsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import type {
1515
IPort,
1616
IPortConfig,
1717
} from '@badaitech/chaingraph-types'
18-
import { Button } from '@/components/ui/button'
1918
import { PortTitle } from '@/components/flow/nodes/ChaingraphNode/ports/ui/PortTitle'
2019
import { Popover, PopoverTrigger } from '@/components/ui/popover'
2120
import { cn } from '@/lib/utils'
@@ -27,10 +26,8 @@ import { ArrayItemSchemaEditor } from '../../SchemaEditor/ArrayItemSchemaEditor'
2726
import { PortHandle } from '../ui/PortHandle'
2827
import { isHideEditor } from '../utils/hide-editor'
2928
import { AddElementPopover } from './AddElementPopover'
30-
import { Edit } from 'lucide-react'
3129
import { PortField } from './PortField'
3230
import { PortHeader } from './PortHeader'
33-
import { EditItemConfigPopover } from './EditItemConfigPopover'
3431

3532
export interface ArrayPortProps {
3633
node: INode
@@ -104,8 +101,8 @@ export function ArrayPort({ node, port, context }: ArrayPortProps) {
104101
.filter(p => p.getConfig().parentId === config.id)
105102
}, [node.ports, config.id])
106103

107-
//Use firstport config as itemconfig otherwise, arrayports itemConfig
108-
const newItemConfig = useMemo(() => childPorts.length > 0 ? childPorts[0].getConfig() : config.itemConfig, [childPorts.length])
104+
// Use firstport config as itemconfig otherwise, arrayports itemConfig
105+
const newItemConfig = useMemo(() => childPorts.length > 0 ? childPorts[0].getConfig() : config.itemConfig, [childPorts, config.itemConfig])
109106

110107
// Memoize edges
111108
const connectedEdges = useMemo(() => {
@@ -120,18 +117,18 @@ export function ArrayPort({ node, port, context }: ArrayPortProps) {
120117

121118
// Memoize callback functions
122119
const handleAddElement = useCallback(() => {
123-
// if type is not any you want immediately add element instead of choose type
120+
// if type is not any you want immediately add element instead of choose type
124121
if (newItemConfig.type === 'any') {
125122
setIsAddPropOpen(true)
126123
} else {
127-
// if type is not any you want immediately add element instead of choose type
124+
// if type is not any you want immediately add element instead of choose type
128125
appendElementArrayPort({
129126
nodeId: node.id,
130127
portId: port.id,
131-
value: newItemConfig.defaultValue
128+
value: newItemConfig.defaultValue,
132129
})
133130
}
134-
}, [newItemConfig])
131+
}, [newItemConfig, appendElementArrayPort, node.id, port.id])
135132

136133
const handleClosePopover = useCallback(() => {
137134
setIsAddPropOpen(false)
@@ -148,10 +145,10 @@ export function ArrayPort({ node, port, context }: ArrayPortProps) {
148145
appendElementArrayPort({
149146
nodeId: node.id,
150147
portId: port.id,
151-
value: newItemConfig.defaultValue
148+
value: newItemConfig.defaultValue,
152149
})
153150
setIsAddPropOpen(false)
154-
}, [node.id, port.id, appendElementArrayPort])
151+
}, [node.id, port.id, appendElementArrayPort, updateItemConfigArrayPort])
155152

156153
const handleToggleCollapsible = useCallback(() => {
157154
updatePortUI({

apps/chaingraph-frontend/src/components/flow/nodes/ChaingraphNode/ports/ObjectPort/components/AddPropPopover.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* As of the Change Date specified in that file, in accordance with the Business Source License, use of this software will be governed by the Apache License, version 2.0.
77
*/
88

9-
import type { IPort, ObjectPortConfig, IPortConfig, PortType } from '@badaitech/chaingraph-types'
9+
import type { IPort, IPortConfig, ObjectPortConfig, PortType } from '@badaitech/chaingraph-types'
1010
import { Button } from '@/components/ui/button'
1111
import {
1212
DropdownMenu,

apps/chaingraph-frontend/src/components/flow/nodes/ChaingraphNode/ports/ObjectPort/components/PortField.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ export function PortField({
4444
...portConfig,
4545
ui: {
4646
...portConfig.ui || {},
47-
hideEditor: parentPort.getConfig()?.ui?.hidePropertyEditor || false
48-
}
47+
hideEditor: parentPort.getConfig()?.ui?.hidePropertyEditor || false,
48+
},
4949
})
5050

5151
return (

apps/chaingraph-frontend/src/store/ports/stores.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ sample({
290290
nodeId,
291291
flowId: activeFlowId,
292292
portId,
293-
itemConfig
293+
itemConfig,
294294
}
295295
return result
296296
},
@@ -308,7 +308,7 @@ sample({
308308
nodeId,
309309
flowId: activeFlowId,
310310
portId,
311-
value
311+
value,
312312
}
313313
return result
314314
},

packages/chaingraph-nodes/src/nodes/api/coin-market-cap.node.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ class CoinMarketCapNode extends BaseNode {
171171
const crypto = (data.data as any)[symbol]
172172
const contractAddresses: ContractAddress[] = crypto.platform
173173
? Object.entries(crypto.platform).map(([blockchain, address]) => ({
174-
blockchain,
175-
address: address as string,
176-
}))
174+
blockchain,
175+
address: address as string,
176+
}))
177177
: []
178178

179179
const cryptoData: CryptoData = {

packages/chaingraph-nodes/src/nodes/basic-values/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ export * from './boolean'
1111
export * from './number'
1212
export * from './object'
1313
export * from './text'
14-

packages/chaingraph-nodes/src/nodes/flow/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
*/
88

99
export * from './branch.node'
10-
export * from './switch.node'
1110
export * from './gate.node'
11+
export * from './switch.node'

0 commit comments

Comments
 (0)