forked from baron/baron-sso
조직도 표현 개선
This commit is contained in:
@@ -156,7 +156,7 @@ type orgContextMember struct {
|
||||
Position string `json:"position,omitempty"`
|
||||
JobTitle string `json:"jobTitle,omitempty"`
|
||||
IsOwner bool `json:"isOwner"`
|
||||
IsLeader bool `json:"isLeader"`
|
||||
IsManager bool `json:"isManager"`
|
||||
IsPrimary bool `json:"isPrimary"`
|
||||
}
|
||||
|
||||
@@ -2412,12 +2412,12 @@ func mapOrgContextMember(user domain.User, appointment map[string]any, includeUs
|
||||
department = value
|
||||
}
|
||||
isOwner := false
|
||||
if value, ok := metadataBoolFromMap(appointment, "isOwner", "isManager"); ok {
|
||||
if value, ok := metadataBoolFromMap(appointment, "isOwner"); ok {
|
||||
isOwner = value
|
||||
}
|
||||
isLeader := isOwner
|
||||
if value, ok := metadataBoolFromMap(appointment, "lead", "isLead"); ok {
|
||||
isLeader = value
|
||||
isManager := false
|
||||
if value, ok := metadataBoolFromMap(appointment, "isManager", "lead", "isLead"); ok {
|
||||
isManager = value
|
||||
}
|
||||
isPrimary := false
|
||||
if value, ok := metadataBoolFromMap(appointment, "representative", "isPrimary", "primary"); ok {
|
||||
@@ -2439,7 +2439,7 @@ func mapOrgContextMember(user domain.User, appointment map[string]any, includeUs
|
||||
Position: position,
|
||||
JobTitle: jobTitle,
|
||||
IsOwner: isOwner,
|
||||
IsLeader: isLeader,
|
||||
IsManager: isManager,
|
||||
IsPrimary: isPrimary,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -690,7 +690,7 @@ func TestTenantHandler_GetOrgContextJSONDefaultsToHanmacFamilyForApiKey(t *testi
|
||||
"additionalAppointments": []any{
|
||||
map[string]any{
|
||||
"tenantSlug": "sso",
|
||||
"lead": true,
|
||||
"isManager": true,
|
||||
"position": "파트장",
|
||||
},
|
||||
},
|
||||
@@ -743,8 +743,9 @@ func TestTenantHandler_GetOrgContextJSONDefaultsToHanmacFamilyForApiKey(t *testi
|
||||
require.Equal(t, "lead@example.com", firstUser["email"])
|
||||
require.Equal(t, "플랫폼 리드", firstUser["name"])
|
||||
require.Equal(t, true, firstUser["isOwner"])
|
||||
require.Equal(t, true, firstUser["isLeader"])
|
||||
require.Equal(t, false, firstUser["isManager"])
|
||||
require.Equal(t, true, firstUser["isPrimary"])
|
||||
require.NotContains(t, firstUser, "isLeader")
|
||||
require.Equal(t, "수석", firstUser["grade"])
|
||||
require.Equal(t, "실장", firstUser["position"])
|
||||
require.Equal(t, "기술기획", firstUser["jobTitle"])
|
||||
@@ -754,7 +755,8 @@ func TestTenantHandler_GetOrgContextJSONDefaultsToHanmacFamilyForApiKey(t *testi
|
||||
appointmentOnly := ssoMembers[0].(map[string]any)
|
||||
require.Equal(t, "appointment@example.com", appointmentOnly["email"])
|
||||
require.Equal(t, false, appointmentOnly["isOwner"])
|
||||
require.Equal(t, true, appointmentOnly["isLeader"])
|
||||
require.Equal(t, true, appointmentOnly["isManager"])
|
||||
require.NotContains(t, appointmentOnly, "isLeader")
|
||||
|
||||
tree := got["tree"].(map[string]any)
|
||||
require.Equal(t, "group-hanmac-family", tree["id"])
|
||||
|
||||
Reference in New Issue
Block a user