forked from MapComplete/MapComplete
UX(inspector): fix search, show graphs, see #2353
This commit is contained in:
parent
0ae58a740c
commit
4e5f32139e
6 changed files with 95 additions and 31 deletions
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue