1
0
forked from baron/baron-sso

recent changes 관계 상세 파싱 수정

This commit is contained in:
2026-06-16 15:55:14 +09:00
parent 4b2d9c89b3
commit d30a324293
2 changed files with 17 additions and 1 deletions

View File

@@ -89,6 +89,16 @@ describe("recent client changes", () => {
{ label: "Relation", value: "admins" },
{ label: "Subject", value: "User:1" },
]);
expect(
buildRecentClientChangeDetails("ADD_RELATION", {
relation: "config_editor",
subject: "User:2",
}),
).toEqual([
{ label: "Relation", value: "config_editor" },
{ label: "Subject", value: "User:2" },
]);
});
it("ignores audit object key order changes in update details", () => {

View File

@@ -257,6 +257,12 @@ export function buildRecentClientChangeDetails(
) {
const before = isRecord(details.before) ? details.before : {};
const after = isRecord(details.after) ? details.after : {};
const sourceDetails =
action === "ADD_RELATION"
? { ...after, ...details }
: action === "REMOVE_RELATION"
? { ...before, ...details }
: {};
if (action === "ROTATE_SECRET") {
return [
@@ -268,7 +274,7 @@ export function buildRecentClientChangeDetails(
}
if (action === "ADD_RELATION" || action === "REMOVE_RELATION") {
const source = action === "ADD_RELATION" ? after : before;
const source = sourceDetails;
return [
...(source.relation
? [