Skip to content

Commit

Permalink
Fix: Fixed the issue that the page crashed when the node ID was the s…
Browse files Browse the repository at this point in the history
…ame as the combo ID infiniflow#4180
  • Loading branch information
cike8899 committed Dec 23, 2024
1 parent a4bccc1 commit 43490e7
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 408 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { isEmpty } from 'lodash';
import { v4 as uuid } from 'uuid';

class KeyGenerator {
idx = 0;
Expand Down Expand Up @@ -64,16 +65,22 @@ export const isDataExist = (data: any) => {

export const buildNodesAndCombos = (nodes: any[]) => {
const combos: any[] = [];
const nextNodes = nodes.map((x) => {
nodes.forEach((x) => {
const combo = Array.isArray(x?.communities) ? x.communities[0] : undefined;
if (combo && combos.every((y) => y.id !== combo)) {
if (combo && combos.every((y) => y.data.label !== combo)) {
combos.push({
id: combo,
id: uuid(),
data: {
label: combo,
},
});
}
});

const nextNodes = nodes.map((x) => {
return {
...x,
combo,
combo: combos.find((y) => y.data.label === x.id)?.id,
};
});

Expand Down
241 changes: 0 additions & 241 deletions web/src/pages/force-graph/constant.ts

This file was deleted.

4 changes: 0 additions & 4 deletions web/src/pages/force-graph/index.less

This file was deleted.

3 changes: 0 additions & 3 deletions web/src/pages/force-graph/index.tsx

This file was deleted.

59 changes: 0 additions & 59 deletions web/src/pages/force-graph/input-upload.tsx

This file was deleted.

37 changes: 0 additions & 37 deletions web/src/pages/force-graph/next.tsx

This file was deleted.

Loading

0 comments on commit 43490e7

Please sign in to comment.