Skip to content

Commit 8d8dcf8

Browse files
twou12031travilyu
authored andcommitted
[bugfix] tracing panel, throw err when click flame bar
**Phenomenon and reproduction steps** none **Root cause and solution** none **Impactions** none **Test method** none **Affected branch(es)** - main - v6.4 - v6.3 **Checklist** - [ ] Dependencies update required - [ ] Common bug (similar problem in other repo)
1 parent bf1c76d commit 8d8dcf8

File tree

1 file changed

+13
-7
lines changed
  • deepflow-apptracing-panel/src/utils

1 file changed

+13
-7
lines changed

deepflow-apptracing-panel/src/utils/tools.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,20 +191,21 @@ export function getRelatedData(item: any, fullData: any) {
191191
})
192192
}
193193
})
194-
const result = [
195-
...relateData.map((e: any) => {
194+
const result = relateData
195+
.map((e: any) => {
196196
return {
197197
...fullDataKeyById[e.id],
198198
__related: e
199199
}
200200
})
201-
]
202201

203202
item.__hightLights = {}
204-
result.forEach(e => {
205-
const relatedFields = RELATED_TYPE_FIELDS_MAP[e.__related.type as keyof typeof RELATED_TYPE_FIELDS_MAP]
203+
result.forEach((e: any) => {
204+
const relatedFields = e.__related.type.split(',').map((k: keyof typeof RELATED_TYPE_FIELDS_MAP) => {
205+
return RELATED_TYPE_FIELDS_MAP[k]
206+
})
206207
e.__hightLights = {}
207-
const _relatedFields = [...relatedFields].sort(() => -1)
208+
const _relatedFields = relatedFields ? [...relatedFields].sort(() => -1) : []
208209
relatedFields.forEach((k: string, i: number) => {
209210
if (RELATED_EQUAL_INVALID_VALUES.includes(e[k])) {
210211
return
@@ -228,7 +229,12 @@ export function getRelatedData(item: any, fullData: any) {
228229
}
229230
})
230231
})
231-
return [item, ...result]
232+
return [
233+
item,
234+
..._.uniqBy(result, (e: any) => {
235+
return e.__related._id
236+
})
237+
]
232238
}
233239

234240
export function formatDetailList(detailList: any[], metaCustom: any) {

0 commit comments

Comments
 (0)