balibabu
commited on
Commit
·
d1efcef
1
Parent(s):
4359d15
feat: generate uuid with human-id #918 (#1111)
Browse files### What problem does this PR solve?
feat: generate uuid with human-id #918
### Type of change
- [x] New Feature (non-breaking change which adds functionality)
- web/package-lock.json +9 -0
- web/package.json +1 -0
- web/src/pages/flow/chat/drawer.tsx +1 -1
- web/src/pages/flow/hooks.ts +2 -2
web/package-lock.json
CHANGED
|
@@ -19,6 +19,7 @@
|
|
| 19 |
"dayjs": "^1.11.10",
|
| 20 |
"elkjs": "^0.9.3",
|
| 21 |
"eventsource-parser": "^1.1.2",
|
|
|
|
| 22 |
"i18next": "^23.7.16",
|
| 23 |
"i18next-browser-languagedetector": "^8.0.0",
|
| 24 |
"js-base64": "^3.7.5",
|
|
@@ -13379,6 +13380,14 @@
|
|
| 13379 |
"node": ">= 6"
|
| 13380 |
}
|
| 13381 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13382 |
"node_modules/human-signals": {
|
| 13383 |
"version": "2.1.0",
|
| 13384 |
"resolved": "https://registry.npmmirror.com/human-signals/-/human-signals-2.1.0.tgz",
|
|
|
|
| 19 |
"dayjs": "^1.11.10",
|
| 20 |
"elkjs": "^0.9.3",
|
| 21 |
"eventsource-parser": "^1.1.2",
|
| 22 |
+
"human-id": "^4.1.1",
|
| 23 |
"i18next": "^23.7.16",
|
| 24 |
"i18next-browser-languagedetector": "^8.0.0",
|
| 25 |
"js-base64": "^3.7.5",
|
|
|
|
| 13380 |
"node": ">= 6"
|
| 13381 |
}
|
| 13382 |
},
|
| 13383 |
+
"node_modules/human-id": {
|
| 13384 |
+
"version": "4.1.1",
|
| 13385 |
+
"resolved": "https://registry.npmmirror.com/human-id/-/human-id-4.1.1.tgz",
|
| 13386 |
+
"integrity": "sha512-3gKm/gCSUipeLsRYZbbdA1BD83lBoWUkZ7G9VFrhWPAU76KwYo5KR8V28bpoPm/ygy0x5/GCbpRQdY7VLYCoIg==",
|
| 13387 |
+
"bin": {
|
| 13388 |
+
"human-id": "dist/cli.js"
|
| 13389 |
+
}
|
| 13390 |
+
},
|
| 13391 |
"node_modules/human-signals": {
|
| 13392 |
"version": "2.1.0",
|
| 13393 |
"resolved": "https://registry.npmmirror.com/human-signals/-/human-signals-2.1.0.tgz",
|
web/package.json
CHANGED
|
@@ -24,6 +24,7 @@
|
|
| 24 |
"dayjs": "^1.11.10",
|
| 25 |
"elkjs": "^0.9.3",
|
| 26 |
"eventsource-parser": "^1.1.2",
|
|
|
|
| 27 |
"i18next": "^23.7.16",
|
| 28 |
"i18next-browser-languagedetector": "^8.0.0",
|
| 29 |
"js-base64": "^3.7.5",
|
|
|
|
| 24 |
"dayjs": "^1.11.10",
|
| 25 |
"elkjs": "^0.9.3",
|
| 26 |
"eventsource-parser": "^1.1.2",
|
| 27 |
+
"human-id": "^4.1.1",
|
| 28 |
"i18next": "^23.7.16",
|
| 29 |
"i18next-browser-languagedetector": "^8.0.0",
|
| 30 |
"js-base64": "^3.7.5",
|
web/src/pages/flow/chat/drawer.tsx
CHANGED
|
@@ -11,7 +11,7 @@ const ChatDrawer = ({ visible, hideModal }: IModalProps<any>) => {
|
|
| 11 |
open={visible}
|
| 12 |
getContainer={false}
|
| 13 |
width={470}
|
| 14 |
-
zIndex={10000}
|
| 15 |
>
|
| 16 |
<FlowChatBox></FlowChatBox>
|
| 17 |
</Drawer>
|
|
|
|
| 11 |
open={visible}
|
| 12 |
getContainer={false}
|
| 13 |
width={470}
|
| 14 |
+
// zIndex={10000}
|
| 15 |
>
|
| 16 |
<FlowChatBox></FlowChatBox>
|
| 17 |
</Drawer>
|
web/src/pages/flow/hooks.ts
CHANGED
|
@@ -15,9 +15,9 @@ import React, {
|
|
| 15 |
useState,
|
| 16 |
} from 'react';
|
| 17 |
import { Node, Position, ReactFlowInstance } from 'reactflow';
|
| 18 |
-
import { v4 as uuidv4 } from 'uuid';
|
| 19 |
// import { shallow } from 'zustand/shallow';
|
| 20 |
import { useDebounceEffect } from 'ahooks';
|
|
|
|
| 21 |
import { useParams } from 'umi';
|
| 22 |
import useGraphStore, { RFState } from './store';
|
| 23 |
import { buildDslComponentsByGraph } from './utils';
|
|
@@ -79,7 +79,7 @@ export const useHandleDrop = () => {
|
|
| 79 |
y: event.clientY,
|
| 80 |
});
|
| 81 |
const newNode = {
|
| 82 |
-
id:
|
| 83 |
type: 'textUpdater',
|
| 84 |
position: position || {
|
| 85 |
x: 0,
|
|
|
|
| 15 |
useState,
|
| 16 |
} from 'react';
|
| 17 |
import { Node, Position, ReactFlowInstance } from 'reactflow';
|
|
|
|
| 18 |
// import { shallow } from 'zustand/shallow';
|
| 19 |
import { useDebounceEffect } from 'ahooks';
|
| 20 |
+
import { humanId } from 'human-id';
|
| 21 |
import { useParams } from 'umi';
|
| 22 |
import useGraphStore, { RFState } from './store';
|
| 23 |
import { buildDslComponentsByGraph } from './utils';
|
|
|
|
| 79 |
y: event.clientY,
|
| 80 |
});
|
| 81 |
const newNode = {
|
| 82 |
+
id: `${type}:${humanId()}`,
|
| 83 |
type: 'textUpdater',
|
| 84 |
position: position || {
|
| 85 |
x: 0,
|