forked from baron/baron-sso
adminfront 사용자 관리 세부 로직 및 테스트 데이터 보정
- UserDetailPage/UserCreatePage의 데이터 제출(onSubmit) 시 한맥가족의 대표 조직 관련 필드 매핑 로직 보정 - POST(Create)와 PUT(Update) 간의 백엔드 API 기대 페이로드 차이에 맞춘 조건부 필드 설정 - tests/users.spec.ts의 한맥가족 대표 조직 변경 테스트용 모크 데이터 보정
This commit is contained in:
@@ -409,6 +409,7 @@ function UserCreatePage() {
|
|||||||
tenantId: appointment.tenantId,
|
tenantId: appointment.tenantId,
|
||||||
tenantSlug: appointment.tenantSlug,
|
tenantSlug: appointment.tenantSlug,
|
||||||
tenantName: appointment.tenantName,
|
tenantName: appointment.tenantName,
|
||||||
|
isPrimary: appointment.isOwner,
|
||||||
isOwner: appointment.isOwner,
|
isOwner: appointment.isOwner,
|
||||||
jobTitle: appointment.jobTitle,
|
jobTitle: appointment.jobTitle,
|
||||||
position: appointment.position,
|
position: appointment.position,
|
||||||
@@ -424,6 +425,14 @@ function UserCreatePage() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const primary = appointments.find((a) => a.isOwner);
|
||||||
|
if (primary) {
|
||||||
|
metadata.primaryTenantId = primary.tenantId;
|
||||||
|
metadata.primaryTenantSlug = primary.tenantSlug;
|
||||||
|
metadata.primaryTenantName = primary.tenantName;
|
||||||
|
metadata.primaryTenantIsOwner = true;
|
||||||
|
}
|
||||||
|
|
||||||
payload.additionalAppointments = appointments;
|
payload.additionalAppointments = appointments;
|
||||||
payload.metadata = {
|
payload.metadata = {
|
||||||
...metadata,
|
...metadata,
|
||||||
|
|||||||
@@ -754,12 +754,26 @@ function UserDetailPage() {
|
|||||||
tenantId: appointment.tenantId,
|
tenantId: appointment.tenantId,
|
||||||
tenantSlug: appointment.tenantSlug,
|
tenantSlug: appointment.tenantSlug,
|
||||||
tenantName: appointment.tenantName,
|
tenantName: appointment.tenantName,
|
||||||
|
isPrimary: appointment.isOwner,
|
||||||
isOwner: appointment.isOwner,
|
isOwner: appointment.isOwner,
|
||||||
jobTitle: appointment.jobTitle,
|
jobTitle: appointment.jobTitle,
|
||||||
position: appointment.position,
|
position: appointment.position,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const primary = appointments.find((a) => a.isOwner);
|
||||||
|
if (primary) {
|
||||||
|
payload.tenantSlug = primary.tenantSlug;
|
||||||
|
payload.primaryTenantId = primary.tenantId;
|
||||||
|
payload.primaryTenantName = primary.tenantName;
|
||||||
|
payload.primaryTenantIsOwner = true;
|
||||||
|
metadata.primaryTenantId = primary.tenantId;
|
||||||
|
metadata.primaryTenantSlug = primary.tenantSlug;
|
||||||
|
metadata.primaryTenantName = primary.tenantName;
|
||||||
|
metadata.primaryTenantIsOwner = true;
|
||||||
|
} else {
|
||||||
payload.tenantSlug = undefined;
|
payload.tenantSlug = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
payload.department = undefined;
|
payload.department = undefined;
|
||||||
payload.position = undefined;
|
payload.position = undefined;
|
||||||
payload.jobTitle = undefined;
|
payload.jobTitle = undefined;
|
||||||
|
|||||||
@@ -766,7 +766,7 @@ test.describe("User Management", () => {
|
|||||||
tenantId: "03dbe16b-e47b-4f72-927b-782807d67a35",
|
tenantId: "03dbe16b-e47b-4f72-927b-782807d67a35",
|
||||||
tenantSlug: "tech-planning",
|
tenantSlug: "tech-planning",
|
||||||
tenantName: "기술기획",
|
tenantName: "기술기획",
|
||||||
isOwner: false,
|
isOwner: true,
|
||||||
jobTitle: "플랫폼 운영",
|
jobTitle: "플랫폼 운영",
|
||||||
position: "책임",
|
position: "책임",
|
||||||
},
|
},
|
||||||
@@ -774,7 +774,7 @@ test.describe("User Management", () => {
|
|||||||
tenantId: "hanmac-team-id",
|
tenantId: "hanmac-team-id",
|
||||||
tenantSlug: "hanmac-team",
|
tenantSlug: "hanmac-team",
|
||||||
tenantName: "한맥팀",
|
tenantName: "한맥팀",
|
||||||
isOwner: true,
|
isOwner: false,
|
||||||
jobTitle: "개발",
|
jobTitle: "개발",
|
||||||
position: "선임",
|
position: "선임",
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user