B01 - 팀원 등록을 계정 대리 생성에서 「소속 없는 기존 가입자 검색·선택」으로 교체, 미가입자는 안내 메일만 발송 - 사용자 계정 삭제 API 신설, 삭제 모달에서 회사 제외/계정 삭제 선택, 관리자 수정 모달에 활성·비활성 상태 지정 - 기본정보 폼과 사용자 수정 폼을 공용 입력칸 한 벌로 통일 (이름 > 직급 > 이메일 > 부서 > 전화) - 프로젝트 담당자 선택의 신규 등록 항목 제거 B02 - 프로젝트명 자동 조합 (사업연도 + 사업지역 + 임도종류 + 직접 입력값) 및 미리보기 표시 - 예상 연장 입력칸 제거, 노선 종료 누가거리 제목에 구간 연장 표기, 표지 값은 프로젝트명·연장에서 파생 - 취소 버튼 추가 (대시보드 복귀), 담당자 기본값을 생성자로 지정 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
83 lines
2.5 KiB
TypeScript
83 lines
2.5 KiB
TypeScript
import { createButton } from "@ui/ui_template_elements";
|
|
import type { AuditLog, DashboardUser } from "./B01_Dashboard_Api_Fetch";
|
|
import { canChangeRole, canDeleteUser } from "./B01_Dashboard_UI_Helper";
|
|
import {
|
|
openChangeRoleModal,
|
|
openDeleteUserModal,
|
|
openEditUserModal,
|
|
} from "./B01_Dashboard_UI_Modals";
|
|
import { table, text } from "@ui/ui_template_general_blocks";
|
|
import { DASHBOARD_VISIBLE_ROWS, formatDate, L } from "./B01_Dashboard_UI_Common";
|
|
|
|
export function userTable(users: DashboardUser[], currentUser: DashboardUser): HTMLElement {
|
|
return table(
|
|
[
|
|
L("B01_Dashboard_Table_Email"),
|
|
L("B01_Dashboard_Table_Name"),
|
|
L("B01_Dashboard_Table_Position"),
|
|
L("B01_Dashboard_Table_Department"),
|
|
L("B01_Account_Field_Phone"),
|
|
L("B01_Dashboard_Table_Role"),
|
|
L("B01_Dashboard_Table_Status"),
|
|
L("B01_Dashboard_Table_Action"),
|
|
],
|
|
users.map((user) => {
|
|
const actionsEl = document.createElement("div");
|
|
actionsEl.className = "b01-dashboard__actions";
|
|
|
|
actionsEl.append(
|
|
createButton({
|
|
label: L("Common_Btn_Edit"),
|
|
variant: "ghost",
|
|
onClick: () => openEditUserModal(currentUser, user),
|
|
}),
|
|
);
|
|
|
|
if (canChangeRole(currentUser, user)) {
|
|
actionsEl.append(
|
|
createButton({
|
|
label: L("B01_Dashboard_ChangeRole"),
|
|
variant: "ghost",
|
|
onClick: () => openChangeRoleModal(user),
|
|
}),
|
|
);
|
|
}
|
|
|
|
// 회사에서 빼기·계정 삭제 (2026-09-06 사용자 지시) — 범위는 백엔드가 다시 본다.
|
|
if (canDeleteUser(currentUser, user) && user.id !== currentUser.id) {
|
|
actionsEl.append(
|
|
createButton({
|
|
label: L("B01_Dashboard_DeleteUser"),
|
|
variant: "ghost",
|
|
onClick: () => openDeleteUserModal(user),
|
|
}),
|
|
);
|
|
}
|
|
|
|
return [
|
|
text(user.email),
|
|
text(user.name),
|
|
text(user.position),
|
|
text(user.department),
|
|
text(user.phone),
|
|
text(user.role),
|
|
text(user.status),
|
|
actionsEl,
|
|
];
|
|
}),
|
|
DASHBOARD_VISIBLE_ROWS,
|
|
);
|
|
}
|
|
|
|
export function auditLogTable(logs: AuditLog[]): HTMLElement {
|
|
return table(
|
|
[
|
|
L("B01_Dashboard_Table_Email"),
|
|
L("B01_Dashboard_Table_Action"),
|
|
L("B01_Dashboard_Table_Updated"),
|
|
],
|
|
logs.map((log) => [text(log.email), text(log.action), text(formatDate(log.timestamp))]),
|
|
DASHBOARD_VISIBLE_ROWS,
|
|
);
|
|
}
|