forked from baron/baron-sso
조직도 표현 개선
This commit is contained in:
@@ -105,7 +105,10 @@ function createEmptyAppointment(): AppointmentDraft {
|
||||
tenantId: "",
|
||||
tenantName: "",
|
||||
tenantSlug: "",
|
||||
isPrimary: false,
|
||||
isOwner: false,
|
||||
isAdmin: false,
|
||||
isManager: false,
|
||||
grade: "",
|
||||
jobTitle: "",
|
||||
position: "",
|
||||
@@ -314,8 +317,8 @@ function UserCreatePage() {
|
||||
if (currentIndex === index) {
|
||||
return { ...appointment, ...patch };
|
||||
}
|
||||
if (patch.isOwner === true) {
|
||||
return { ...appointment, isOwner: false };
|
||||
if (patch.isPrimary === true) {
|
||||
return { ...appointment, isPrimary: false };
|
||||
}
|
||||
return appointment;
|
||||
}),
|
||||
@@ -425,8 +428,10 @@ function UserCreatePage() {
|
||||
tenantId: appointment.tenantId,
|
||||
tenantSlug: appointment.tenantSlug,
|
||||
tenantName: appointment.tenantName,
|
||||
isPrimary: appointment.isOwner,
|
||||
isOwner: appointment.isOwner,
|
||||
isPrimary: appointment.isPrimary === true,
|
||||
...(appointment.isOwner === true ? { isOwner: true } : {}),
|
||||
...(appointment.isAdmin === true ? { isAdmin: true } : {}),
|
||||
...(appointment.isManager === true ? { isManager: true } : {}),
|
||||
grade: appointment.grade,
|
||||
jobTitle: appointment.jobTitle,
|
||||
position: appointment.position,
|
||||
@@ -442,12 +447,11 @@ function UserCreatePage() {
|
||||
return;
|
||||
}
|
||||
|
||||
const primary = appointments.find((a) => a.isOwner);
|
||||
const primary = appointments.find((a) => a.isPrimary);
|
||||
if (primary) {
|
||||
metadata.primaryTenantId = primary.tenantId;
|
||||
metadata.primaryTenantSlug = primary.tenantSlug;
|
||||
metadata.primaryTenantName = primary.tenantName;
|
||||
metadata.primaryTenantIsOwner = true;
|
||||
}
|
||||
|
||||
payload.additionalAppointments = appointments;
|
||||
@@ -811,10 +815,10 @@ function UserCreatePage() {
|
||||
)}
|
||||
<label className="flex items-center gap-3 text-sm">
|
||||
<Switch
|
||||
checked={appointment.isOwner}
|
||||
checked={appointment.isPrimary === true}
|
||||
onCheckedChange={(checked) =>
|
||||
updateAppointment(index, {
|
||||
isOwner: checked === true,
|
||||
isPrimary: checked === true,
|
||||
})
|
||||
}
|
||||
aria-label={t(
|
||||
@@ -827,6 +831,24 @@ function UserCreatePage() {
|
||||
"대표 조직",
|
||||
)}
|
||||
</label>
|
||||
<label className="flex items-center gap-3 text-sm">
|
||||
<Switch
|
||||
checked={appointment.isManager === true}
|
||||
onCheckedChange={(checked) =>
|
||||
updateAppointment(index, {
|
||||
isManager: checked === true,
|
||||
})
|
||||
}
|
||||
aria-label={t(
|
||||
"ui.admin.users.detail.form.appointment_manager",
|
||||
"조직장",
|
||||
)}
|
||||
/>
|
||||
{t(
|
||||
"ui.admin.users.detail.form.appointment_manager",
|
||||
"조직장",
|
||||
)}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user