Skip to content

Commit 77decf7

Browse files
committed
changelog authorname - cables-gl/cables/issues/7462
1 parent 6e9f595 commit 77decf7

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

shared/api/utils/shared_ops_util.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ export default class SharedOpsUtil extends SharedUtil
361361
catch (e) {}
362362
}
363363

364-
addOpChangelog(user, opName, newEntry, referenceDate = null, update = false)
364+
addOpChangelog(authorName, opName, newEntry, referenceDate = null, update = false)
365365
{
366366
let changes = [];
367367
if (update && referenceDate !== null)
@@ -374,6 +374,7 @@ export default class SharedOpsUtil extends SharedUtil
374374
const oldEntry = changelog.find((change) => { return change.hasOwnProperty("date") && change.date === timestamp; });
375375
if (oldEntry)
376376
{
377+
oldEntry.author = authorName;
377378
if (newEntry.message) oldEntry.message = newEntry.message;
378379
if (newEntry.hasOwnProperty("type"))
379380
{
@@ -413,7 +414,7 @@ export default class SharedOpsUtil extends SharedUtil
413414
const change = {
414415
"message": newEntry.message,
415416
"type": newEntry.type,
416-
"author": user.username,
417+
"author": authorName,
417418
"date": Date.now()
418419
};
419420
changes.push(change);
@@ -3395,7 +3396,7 @@ export default class SharedOpsUtil extends SharedUtil
33953396
result.attachments = this.getAttachments(opName);
33963397
}
33973398

3398-
this.addOpChangelog(author, opName, { "message": "op created", "type": "new op" });
3399+
this.addOpChangelog(author.username, opName, { "message": "op created", "type": "new op" });
33993400
this._docsUtil.updateOpDocs(opName);
34003401
this._docsUtil.addOpToLookup(opId, opName);
34013402

@@ -3933,11 +3934,11 @@ export default class SharedOpsUtil extends SharedUtil
39333934
if (jsonChange) jsonfile.writeFileSync(newJson, newJsonData, this.OPJSON_FORMAT);
39343935
if (newName.includes(this.INFIX_DEPRECATED))
39353936
{
3936-
this.addOpChangelog(currentUser, newName, { "type": "deprecation", "message": "op " + oldNameChangelog + " was deprecated" });
3937+
this.addOpChangelog(currentUser.username, newName, { "type": "deprecation", "message": "op " + oldNameChangelog + " was deprecated" });
39373938
}
39383939
else
39393940
{
3940-
this.addOpChangelog(currentUser, newName, { "type": "rename", "message": oldNameChangelog + " renamed to " + newName });
3941+
this.addOpChangelog(currentUser.username, newName, { "type": "rename", "message": oldNameChangelog + " renamed to " + newName });
39413942
}
39423943

39433944
let updateOld = false;

0 commit comments

Comments
 (0)