Skip to content

Commit

Permalink
[bugfix] tracing panel, throw err when click flame bar
Browse files Browse the repository at this point in the history
**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)
  • Loading branch information
twou12031 authored and travilyu committed Mar 26, 2024
1 parent 986bf1c commit 22a8368
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions deepflow-apptracing-panel/src/utils/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,20 +191,21 @@ export function getRelatedData(item: any, fullData: any) {
})
}
})
const result = [
...relateData.map((e: any) => {
const result = relateData
.map((e: any) => {
return {
...fullDataKeyById[e.id],
__related: e
}
})
]

item.__hightLights = {}
result.forEach(e => {
const relatedFields = RELATED_TYPE_FIELDS_MAP[e.__related.type as keyof typeof RELATED_TYPE_FIELDS_MAP]
result.forEach((e: any) => {
const relatedFields = e.__related.type.split(',').map((k: keyof typeof RELATED_TYPE_FIELDS_MAP) => {
return RELATED_TYPE_FIELDS_MAP[k]
})
e.__hightLights = {}
const _relatedFields = [...relatedFields].sort(() => -1)
const _relatedFields = relatedFields ? [...relatedFields].sort(() => -1) : []
relatedFields.forEach((k: string, i: number) => {
if (RELATED_EQUAL_INVALID_VALUES.includes(e[k])) {
return
Expand All @@ -228,7 +229,12 @@ export function getRelatedData(item: any, fullData: any) {
}
})
})
return [item, ...result]
return [
item,
..._.uniqBy(result, (e: any) => {
return e.__related._id
})
]
}

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

0 comments on commit 22a8368

Please sign in to comment.