feat: promote seatmap and organization updates
This commit is contained in:
@@ -325,9 +325,7 @@ function buildAuthHeaders(headers) {
|
||||
function shouldShowGlobalDateControls() {
|
||||
return currentView === "ledger"
|
||||
|| currentView === "project"
|
||||
|| currentView === "team"
|
||||
|| currentView === "seatmap-admin"
|
||||
|| currentView === "seatmap-readonly";
|
||||
|| currentView === "team";
|
||||
}
|
||||
|
||||
function syncGlobalDateControlVisibility() {
|
||||
@@ -361,6 +359,10 @@ function buildAsOfQuery() {
|
||||
return `?as_of=${encodeURIComponent(asOf)}`;
|
||||
}
|
||||
|
||||
function buildSeatMapAsOfQuery() {
|
||||
return "";
|
||||
}
|
||||
|
||||
function notifyEmbeddedTabActivated() {
|
||||
if (currentView === "project" && projectFrame?.contentWindow) {
|
||||
projectFrame.contentWindow.postMessage({ source: "total-control", type: "tab-activated", tab: "project" }, window.location.origin);
|
||||
@@ -787,6 +789,22 @@ function getPlacementForMember(memberId) {
|
||||
return getPlacementSource().find((item) => Number(item.member_id) === Number(memberId)) || null;
|
||||
}
|
||||
|
||||
function isMemberAssignedAnywhere(member) {
|
||||
const seatLabel = String(
|
||||
member?.member_seat_label
|
||||
|| member?.seat_label
|
||||
|| ""
|
||||
).trim();
|
||||
return Boolean(seatLabel);
|
||||
}
|
||||
|
||||
function shouldHideMemberFromSeatMap(member) {
|
||||
if (Boolean(member?.is_retired)) return true;
|
||||
const workStatus = String(member?.work_status || "").trim();
|
||||
if (/(퇴사|퇴직)/u.test(workStatus)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
function memberMatchesSeatMapSearch(member) {
|
||||
const keyword = seatMapState.search.trim().toLowerCase();
|
||||
if (!keyword) return true;
|
||||
@@ -839,7 +857,9 @@ function renderSeatMapOfficeTabs() {
|
||||
function getUnassignedMembers() {
|
||||
const placedIds = new Set(getPlacementSource().map((item) => Number(item.member_id)));
|
||||
return seatMapState.members.filter((member) => {
|
||||
if (shouldHideMemberFromSeatMap(member)) return false;
|
||||
if (placedIds.has(Number(member.id))) return false;
|
||||
if (isMemberAssignedAnywhere(member)) return false;
|
||||
return memberMatchesSeatMapSearch(member);
|
||||
});
|
||||
}
|
||||
@@ -847,6 +867,7 @@ function getUnassignedMembers() {
|
||||
function getPlacedMembers() {
|
||||
const placedIds = new Set(getPlacementSource().map((item) => Number(item.member_id)));
|
||||
return seatMapState.members.filter((member) => {
|
||||
if (shouldHideMemberFromSeatMap(member)) return false;
|
||||
if (!placedIds.has(Number(member.id))) return false;
|
||||
return memberMatchesSeatMapSearch(member);
|
||||
});
|
||||
@@ -1011,7 +1032,7 @@ function renderDxfSeatMapBoard() {
|
||||
seatMapBoard.innerHTML = `<div class="seatmap-empty-card"><strong>DXF 뷰어 데이터를 준비하지 못했습니다.</strong></div>`;
|
||||
return;
|
||||
}
|
||||
const viewerUrl = resolveAppUrl(`/api/seat-maps/${seatMapState.seatMap.id}/viewer${buildAsOfQuery()}`);
|
||||
const viewerUrl = resolveAppUrl(`/api/seat-maps/${seatMapState.seatMap.id}/viewer${buildSeatMapAsOfQuery()}`);
|
||||
seatMapBoard.innerHTML = `
|
||||
<div class="seatmap-dxf-frame-shell">
|
||||
<div class="seatmap-dxf-drop-overlay" data-seatmap-drop-overlay></div>
|
||||
@@ -1354,7 +1375,7 @@ async function loadSeatMapData(force = false) {
|
||||
const office = getCurrentSeatMapOffice();
|
||||
const activePayload = await fetchJson(`/api/seat-maps/active?office_key=${encodeURIComponent(office.key)}`);
|
||||
const activeSeatMap = activePayload.item;
|
||||
const layoutPayload = await fetchJson(`/api/seat-maps/${activeSeatMap.id}/layout${buildAsOfQuery()}`);
|
||||
const layoutPayload = await fetchJson(`/api/seat-maps/${activeSeatMap.id}/layout${buildSeatMapAsOfQuery()}`);
|
||||
seatMapState.seatMap = {
|
||||
...(layoutPayload.seat_map || {}),
|
||||
viewer_data: layoutPayload.viewer_data || null,
|
||||
|
||||
Reference in New Issue
Block a user