UX(inspector): fix search, show graphs, see #2353

This commit is contained in:
Pieter Vander Vennet 2025-04-25 18:04:25 +02:00
parent 0ae58a740c
commit 4e5f32139e
6 changed files with 95 additions and 31 deletions

View file

@ -44,22 +44,37 @@ export class HistoryUtils {
.filter((ch) => ch.oldValue !== ch.value)
}
public static fullHistoryDiff(histories: OsmObject[][], onlyShowUsername?: Set<string>) {
const allDiffs: { key: string; oldValue?: string; value?: string }[] = [].concat(
...histories.map((history) => {
const filtered = history.filter(
(step) =>
!onlyShowUsername ||
onlyShowUsername?.has(step.tags["_last_edit:contributor"])
)
const diffs: {
key: string
value?: string
oldValue?: string
}[][] = filtered.map((step) => HistoryUtils.tagHistoryDiff(step, history))
return [].concat(...diffs)
})
)
public static fullHistoryDiff(histories: OsmObject[][], onlyShowUsername?: Set<string>): {
key: string;
value?: string;
oldValue?: string;
step: OsmObject
}[] {
const allDiffs: {
key: string;
value?: string;
oldValue?: string;
step: OsmObject
}[] = []
for (const history of histories) {
const filtered = history.filter(
(step) =>
!onlyShowUsername ||
onlyShowUsername?.has(step.tags["_last_edit:contributor"])
)
for (const step of filtered) {
const diff: {
key: string;
value?: string;
oldValue?: string;
step: OsmObject
}[] = HistoryUtils.tagHistoryDiff(step, history)
allDiffs.push(...diff)
}
}
return allDiffs
}
}