fix: refs #6630 getLogTree grouping fixed
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
This commit is contained in:
parent
5438ce5c33
commit
57eca9b267
|
@ -168,17 +168,17 @@ function getLogTree(data) {
|
|||
let originLog = null;
|
||||
let userLog = null;
|
||||
let modelLog = null;
|
||||
let prevLog;
|
||||
let nLogs;
|
||||
|
||||
data.forEach((log) => {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let log = data[i];
|
||||
let prevLog = i > 0 ? data[i - 1] : null;
|
||||
const locale = validations[log.changedModel]?.locale || {};
|
||||
|
||||
// Origin
|
||||
const originChanged = !prevLog || log.originFk != prevLog.originFk;
|
||||
if (originChanged) {
|
||||
logs.push((originLog = { originFk: log.originFk, logs: [] }));
|
||||
prevLog = log;
|
||||
}
|
||||
// User
|
||||
const userChanged = originChanged || log.userFk != prevLog.userFk;
|
||||
|
@ -197,6 +197,7 @@ function getLogTree(data) {
|
|||
log.changedModel != prevLog.changedModel ||
|
||||
log.changedModelId != prevLog.changedModelId ||
|
||||
nLogs >= 6;
|
||||
|
||||
if (modelChanged) {
|
||||
userLog.logs.push(
|
||||
(modelLog = {
|
||||
|
@ -221,7 +222,7 @@ function getLogTree(data) {
|
|||
propNames = [...new Set(propNames)];
|
||||
|
||||
log.props = parseProps(propNames, locale, vals, olds);
|
||||
});
|
||||
}
|
||||
return logs;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue