feat(프로젝트): 매일 하는 업무 — 날짜 팝업 [매일]·반복 아이콘·시각별 알림
- 마이그레이션 033 tasks.repeat_daily — [매일]이면 마감일·시각 비움, 마감일을 고르면 꺼짐(미적용이면 버튼 숨김·PUT 503) - 마감 칸(카드·목록·내 업무·세부 업무·업무 창)에 반복 아이콘 + "매일" - reminders.run_daily_alerts: 영업일, Project 옵션 daily_alert_times 중 지난 가장 늦은 시각마다 담당자(없으면 협업자)에게 type=daily 알림(task_reminders 로 중복 방지, 데몬 1분 주기) - 큰 알림 팝업·PC 알림 프로그램에서 매일 업무 줄은 노란 배경 - Project 옵션 "알림" 분류: 알림 시각 여러 개 추가·삭제(최대 12) - 도움말·모듈 CLAUDE.md·DEPLOYMENT(033) 갱신, 테스트 추가 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+58
-31
@@ -448,7 +448,9 @@
|
||||
const a = new Date(String(iso).slice(0, 10) + "T00:00:00"), b = new Date(baseIso + "T00:00:00");
|
||||
return Math.round((a - b) / 86400000);
|
||||
}
|
||||
function dueInfo(iso, done) {
|
||||
// daily = 매일 하는 업무(033 repeat_daily) — 마감일 대신 반복 아이콘(CSS .is-daily::before) + "매일".
|
||||
function dueInfo(iso, done, daily) {
|
||||
if (daily) return { text: "매일", cls: "is-daily" };
|
||||
if (!iso) return null;
|
||||
const diff = dayDiff(iso, isoToday());
|
||||
let text, cls = "";
|
||||
@@ -460,10 +462,11 @@
|
||||
return { text: text, cls: cls };
|
||||
}
|
||||
// 마감일 칸 말풍선 — 지난 날짜(빨강)면 "마감일 지남", 아니면 "마감일 변경".
|
||||
function dueTip(di) { return di && di.cls === "is-overdue" ? "마감일 지남" : "마감일 변경"; }
|
||||
function dueTip(di) { return di && di.cls === "is-overdue" ? "마감일 지남" : di && di.cls === "is-daily" ? "매일 하는 업무(눌러서 변경)" : "마감일 변경"; }
|
||||
|
||||
// ── 아사나식 날짜 팝업 — 마감일(과 선택적으로 시작일)을 월 달력에서 고른다.
|
||||
// opts: { start, due, allowStart, onChange(patch) }. 날짜를 누를 때마다
|
||||
// opts: { start, due, allowStart, daily, allowDaily, onChange(patch) }. allowDaily = 아래 [매일] 버튼(매일 하는 업무,
|
||||
// 033) — 누르면 onChange({due_date: null, repeat_daily: true}) 하고 닫힘, 날짜를 고르면 repeat_daily: false. 날짜를 누를 때마다
|
||||
// onChange({due_date[, start_date]}) 로 바로 저장하고, 마감일을 고르면 팝업을
|
||||
// 닫는다(시작일을 고른 땐 마감일을 이어서 고르게 열어 둠). 바깥 클릭·Esc 로 닫힘. "지우기" = 둘 다 비우고 닫기. 앵커 아래(자리가
|
||||
// 없으면 위)에 뜨고 꼬리가 앵커를 가리킨다. 한 번에 하나만.
|
||||
@@ -504,6 +507,7 @@
|
||||
let start = opts.start ? String(opts.start).slice(0, 10) : "";
|
||||
let due = opts.due ? String(opts.due).slice(0, 10) : "";
|
||||
let showStart = !!(opts.allowStart && start);
|
||||
let daily = !!(opts.allowDaily && opts.daily);
|
||||
let active = "due";
|
||||
const base = new Date((due || start || today) + "T00:00:00");
|
||||
let viewY = base.getFullYear(), viewM = base.getMonth();
|
||||
@@ -518,6 +522,7 @@
|
||||
function emit() {
|
||||
const patch = { due_date: due || null };
|
||||
if (opts.allowStart) patch.start_date = start || null;
|
||||
if (opts.allowDaily) patch.repeat_daily = daily;
|
||||
if (opts.onChange) opts.onChange(patch);
|
||||
}
|
||||
function field(kind, val, ph) {
|
||||
@@ -554,7 +559,7 @@
|
||||
(opts.allowStart
|
||||
? (showStart ? field("start", start, "시작일") : '<button type="button" class="pj-dp-addstart">+ 시작일</button>')
|
||||
: "") +
|
||||
field("due", due, "마감일") +
|
||||
field("due", due, daily ? "매일 하는 업무" : "마감일") +
|
||||
"</div>" +
|
||||
'<div class="pj-dp-nav">' +
|
||||
'<button type="button" class="pj-dp-navbtn" data-nav="-1" title="이전 달"><span class="material-symbols-outlined">chevron_left</span></button>' +
|
||||
@@ -569,6 +574,10 @@
|
||||
"</div>" +
|
||||
'<div class="pj-dp-foot">' +
|
||||
'<button type="button" class="pj-dp-link pj-dp-today">오늘</button>' +
|
||||
(opts.allowDaily
|
||||
? '<button type="button" class="pj-dp-link pj-dp-daily' + (daily ? " is-on" : "") + '" title="마감일 없이 매일 하는 업무' +
|
||||
(daily ? "(다시 누르면 해제)" : "") + '"><span class="material-symbols-outlined">repeat</span>매일</button>'
|
||||
: "") +
|
||||
'<button type="button" class="pj-dp-link pj-dp-clear">지우기</button>' +
|
||||
"</div>";
|
||||
wire();
|
||||
@@ -587,6 +596,7 @@
|
||||
return;
|
||||
}
|
||||
due = iso;
|
||||
daily = false;
|
||||
if (start && start > iso) start = iso;
|
||||
emit();
|
||||
closeDatePopover();
|
||||
@@ -636,7 +646,13 @@
|
||||
pick(today);
|
||||
});
|
||||
pop.querySelector(".pj-dp-clear").addEventListener("click", function () {
|
||||
start = ""; due = ""; emit(); closeDatePopover();
|
||||
start = ""; due = ""; daily = false; emit(); closeDatePopover();
|
||||
});
|
||||
const dailyBtn = pop.querySelector(".pj-dp-daily");
|
||||
if (dailyBtn) dailyBtn.addEventListener("click", function () {
|
||||
daily = !daily;
|
||||
if (daily) due = "";
|
||||
emit(); closeDatePopover();
|
||||
});
|
||||
}
|
||||
function focusActive() {
|
||||
@@ -3230,8 +3246,8 @@
|
||||
{
|
||||
key: "due", label: "마감", cls: "pj-mtk-date",
|
||||
html: function (t) {
|
||||
if (!t.due_date) return "-";
|
||||
const di = dueInfo(t.due_date, !!t.completed_at);
|
||||
if (!t.due_date && !t.repeat_daily) return "-";
|
||||
const di = dueInfo(t.due_date, !!t.completed_at, t.repeat_daily);
|
||||
return '<span class="pj-due-label ' + di.cls + (di.cls === "is-overdue" ? " pj-mtk-overdue" : "") + '">' +
|
||||
escapeHtml(di.text) + "</span>";
|
||||
},
|
||||
@@ -5716,7 +5732,8 @@
|
||||
// 없으면 applyTaskPatch 로 업무에 저장.
|
||||
function openDuePicker(t, anchorEl, onPick) {
|
||||
const save = onPick || function (patch) { applyTaskPatch(t, patch, "마감일 변경 실패"); };
|
||||
openDatePopover(anchorEl, { start: t.start_date, due: t.due_date, allowStart: true, onChange: save });
|
||||
openDatePopover(anchorEl, { start: t.start_date, due: t.due_date, allowStart: true,
|
||||
daily: !!t.repeat_daily, allowDaily: "repeat_daily" in t, onChange: save }); // repeat_daily 키 = 033 적용됨
|
||||
}
|
||||
|
||||
// ── 카드 세부 업무 펼치기(아사나처럼) — 카드의 "N ⤷ ▾" 버튼을 누르면 카드
|
||||
@@ -5736,7 +5753,7 @@
|
||||
});
|
||||
}
|
||||
function cardSubRowHtml(sub) {
|
||||
const di = dueInfo(sub.due_date, !!sub.completed_at);
|
||||
const di = dueInfo(sub.due_date, !!sub.completed_at, sub.repeat_daily);
|
||||
return '<div class="pj-card-sub' + (sub.completed_at ? " is-done" : "") + '" data-sub-id="' + sub.id + '">' +
|
||||
'<button type="button" class="pj-card-sub-check" title="' + (sub.completed_at ? "완료 취소" : "완료로 표시") + '">' +
|
||||
'<span class="material-symbols-outlined">check_circle</span></button>' +
|
||||
@@ -5744,7 +5761,7 @@
|
||||
subMetaHtml(sub, "pj-card-sub-nsubs") +
|
||||
// 마감일 — 있으면 날짜, 없으면 아사나처럼 점선 원 달력 아이콘(줄에 마우스를
|
||||
// 올리면 보임). 둘 다 누르면 날짜 선택.
|
||||
(sub.due_date
|
||||
(di
|
||||
? '<span class="pj-card-sub-due ' + di.cls + '" data-tip="' + dueTip(di) + '">' + escapeHtml(di.text) + "</span>"
|
||||
: '<span class="pj-card-sub-due is-empty" data-tip="마감일 추가">' + DUE_EMPTY_ICON_SVG + "</span>") +
|
||||
// 담당자 — 있으면 아바타, 없으면 아사나처럼 점선 원 사람 아이콘(줄에
|
||||
@@ -6270,9 +6287,9 @@
|
||||
// 누르면 서버에서 받아 멤버 메뉴. 한 번 받은(고른) 협업자는 이 화면에 머무는 동안 카드에 보인다(cardFollowers).
|
||||
(canManage ? cardFolHtml(cardFollowers[t.id]) : "") +
|
||||
(function () {
|
||||
const di = dueInfo(t.due_date, !!t.completed_at);
|
||||
const di = dueInfo(t.due_date, !!t.completed_at, t.repeat_daily);
|
||||
return '<span class="pj-card-due pj-card-edit-hit' + (di ? " " + di.cls : " is-empty") +
|
||||
'" title="' + (t.due_date ? dueTip(di) : "마감일 추가") + '">' +
|
||||
'" title="' + (di ? dueTip(di) : "마감일 추가") + '">' +
|
||||
// 마감일 없음 — 세부 업무 줄과 같은 점선 원 달력 아이콘만(카드에 마우스를 올리면 보임).
|
||||
(di ? escapeHtml(di.text) : DUE_EMPTY_ICON_SVG) + "</span>";
|
||||
})() +
|
||||
@@ -6456,7 +6473,7 @@
|
||||
{ key: "stage", label: "섹션", text: function (t) { return t.stage_name || "-"; }, sort: function (t) { return t.stage_name || ""; } },
|
||||
{ key: "priority", label: "우선순위", text: function (t) { return priorityLabels[t.priority] || t.priority || "-"; }, sort: function (t) { return ({ low: 0, normal: 1, high: 2 })[t.priority]; } },
|
||||
{ key: "start", label: "시작", text: function (t) { return t.start_date || "-"; }, sort: function (t) { return t.start_date || ""; } },
|
||||
{ key: "due", label: "마감", text: function (t) { const di = dueInfo(t.due_date, !!t.completed_at); return di ? di.text : "-"; }, sort: function (t) { return t.due_date || ""; } },
|
||||
{ key: "due", label: "마감", text: function (t) { const di = dueInfo(t.due_date, !!t.completed_at, t.repeat_daily); return di ? di.text : "-"; }, sort: function (t) { return t.due_date || ""; } },
|
||||
];
|
||||
// "이 프로젝트" 스코프 — 아사나 리스트 뷰처럼 세션이 컬럼이 아니라 그룹
|
||||
// 구분선이 된다(renderListGrouped). 그래서 세션 컬럼은 뺀다.
|
||||
@@ -6529,9 +6546,9 @@
|
||||
tr.innerHTML = cols.map(function (c) {
|
||||
let inner = escapeHtml(String(c.text(t)));
|
||||
if (c.key === "title") inner += cmtBadge(t);
|
||||
if (c.key === "due" && t.due_date) {
|
||||
const di = dueInfo(t.due_date, !!t.completed_at);
|
||||
inner = '<span class="pj-due-label ' + di.cls + '" title="' + t.due_date + '">' + escapeHtml(di.text) + "</span>";
|
||||
if (c.key === "due" && (t.due_date || t.repeat_daily)) {
|
||||
const di = dueInfo(t.due_date, !!t.completed_at, t.repeat_daily);
|
||||
inner = '<span class="pj-due-label ' + di.cls + '" title="' + (t.due_date || "매일 하는 업무") + '">' + escapeHtml(di.text) + "</span>";
|
||||
}
|
||||
if (c.key === "assignee" && t.assignee_email) {
|
||||
inner = '<span class="pj-assignee">' + avatarHtml(t.assignee_email, "pj-gicon-sm") + escapeHtml(idOf(t.assignee_email)) + "</span>";
|
||||
@@ -7352,6 +7369,7 @@
|
||||
body = { priority: el("pj-t-priority").value };
|
||||
} else if (key === "due") {
|
||||
body = { due_date: el("pj-t-due").value || null };
|
||||
if (el("pj-t-due").dataset.daily) body.repeat_daily = el("pj-t-due").dataset.daily === "1";
|
||||
}
|
||||
if (!body) return Promise.resolve(true);
|
||||
setAutoState("saving");
|
||||
@@ -7757,6 +7775,8 @@
|
||||
: (presetStageId != null ? presetStageId : (stages[0] ? stages[0].id : ""));
|
||||
el("pj-t-priority").value = task ? (task.priority || "normal") : "normal";
|
||||
el("pj-t-due").value = task ? (task.due_date || "") : "";
|
||||
// 매일 하는 업무(033) — "" = 열 없음(미적용, [매일] 숨김), "0"/"1" = 꺼짐/켜짐
|
||||
el("pj-t-due").dataset.daily = task && "repeat_daily" in task ? (task.repeat_daily ? "1" : "0") : "";
|
||||
currentTaskData = task || null;
|
||||
syncDueBtn(); // 완료 여부(지남 표시)를 보려면 currentTaskData 다음에
|
||||
el("pj-delete-task").hidden = !task;
|
||||
@@ -7873,12 +7893,16 @@
|
||||
const v = el("pj-t-due").value;
|
||||
const btn = el("pj-t-due-btn");
|
||||
if (!btn) return;
|
||||
const di = dueInfo(v, !!(currentTaskData && currentTaskData.completed_at));
|
||||
const daily = el("pj-t-due").dataset.daily === "1";
|
||||
const di = dueInfo(v, !!(currentTaskData && currentTaskData.completed_at), daily);
|
||||
el("pj-t-due-text").textContent = di ? di.text : "";
|
||||
btn.classList.toggle("has-date", !!v);
|
||||
btn.classList.toggle("has-date", !!di);
|
||||
btn.classList.toggle("is-daily", daily);
|
||||
const ic = btn.querySelector(".material-symbols-outlined");
|
||||
if (ic) ic.textContent = daily ? "repeat" : "calendar_month";
|
||||
btn.classList.toggle("is-overdue", !!di && di.cls === "is-overdue");
|
||||
btn.classList.toggle("is-soon", !!di && di.cls === "is-soon");
|
||||
btn.title = v ? "마감일 " + v + " (눌러서 변경)" : "마감일 지정";
|
||||
btn.title = daily ? "매일 하는 업무 (눌러서 변경)" : v ? "마감일 " + v + " (눌러서 변경)" : "마감일 지정";
|
||||
}
|
||||
if (el("pj-t-due-btn")) {
|
||||
// 아사나식 날짜 팝업 — 숨긴 #pj-t-due 값을 바꾸고 change 를 보내면
|
||||
@@ -7886,9 +7910,10 @@
|
||||
el("pj-t-due-btn").addEventListener("click", function () {
|
||||
const inp = el("pj-t-due");
|
||||
openDatePopover(el("pj-t-due-btn"), {
|
||||
due: inp.value, allowStart: false,
|
||||
due: inp.value, allowStart: false, daily: inp.dataset.daily === "1", allowDaily: !!inp.dataset.daily,
|
||||
onChange: function (patch) {
|
||||
inp.value = patch.due_date || "";
|
||||
if ("repeat_daily" in patch) inp.dataset.daily = patch.repeat_daily ? "1" : "0";
|
||||
inp.dispatchEvent(new Event("change", { bubbles: true }));
|
||||
},
|
||||
});
|
||||
@@ -9547,10 +9572,10 @@
|
||||
checkBtn.title = sub.completed_at ? "완료 취소" : "완료로 표시";
|
||||
}
|
||||
function renderDue() {
|
||||
const di = dueInfo(sub.due_date, !!sub.completed_at);
|
||||
const di = dueInfo(sub.due_date, !!sub.completed_at, sub.repeat_daily);
|
||||
dueEl.className = "pj-subtask-due" + (di ? " " + di.cls : " is-empty");
|
||||
dueEl.innerHTML = di ? escapeHtml(di.text) : DUE_EMPTY_ICON_SVG;
|
||||
dueEl.title = sub.due_date ? dueTip(di) : "마감일 추가";
|
||||
dueEl.title = di ? dueTip(di) : "마감일 추가";
|
||||
}
|
||||
function renderAv() {
|
||||
const e = sub.assignee_email || "";
|
||||
@@ -9599,12 +9624,14 @@
|
||||
dueEl.addEventListener("click", function (e) {
|
||||
e.stopPropagation();
|
||||
openDatePopover(dueEl, {
|
||||
due: sub.due_date, allowStart: false,
|
||||
due: sub.due_date, allowStart: false, daily: !!sub.repeat_daily, allowDaily: "repeat_daily" in sub,
|
||||
onChange: async function (p) {
|
||||
const prev = sub.due_date;
|
||||
sub.due_date = p.due_date || null;
|
||||
const prev = { due_date: sub.due_date, repeat_daily: sub.repeat_daily };
|
||||
const body = { due_date: p.due_date || null };
|
||||
if ("repeat_daily" in p) body.repeat_daily = p.repeat_daily;
|
||||
Object.assign(sub, body);
|
||||
renderDue();
|
||||
if (!(await patch({ due_date: sub.due_date }))) { sub.due_date = prev; renderDue(); }
|
||||
if (!(await patch(body))) { Object.assign(sub, prev); renderDue(); }
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -13548,14 +13575,14 @@
|
||||
"<b>새 알림 " + items.length + "건</b>" +
|
||||
'<button type="button" class="pj-btn pj-btn-sm" data-alert-close>닫기</button></div>' +
|
||||
'<div class="pj-alert-list">' + items.map(function (n) {
|
||||
const isMention = n.type === "mention";
|
||||
const isMention = n.type === "mention", isDaily = n.type === "daily"; // daily = 매일 하는 업무(033) — 줄 배경 따로
|
||||
// 서버가 준 주소(작업 = /project/t/{id} — 연결된 프로젝트에서만 읽을 수 있는 작업도 열린다)
|
||||
const href = n.href || (n.task_id ? "/project/t/" + n.task_id
|
||||
: n.project_id ? "/project/p/" + n.project_id : "/project/inbox");
|
||||
return '<a class="pj-alert-item" href="' + escapeHtml(href) + '" data-alert-open="' + escapeHtml(n.id) + '">' +
|
||||
'<span class="pj-alert-kind ' + (isMention ? "is-mention" : "is-assigned") + '">' +
|
||||
(isMention ? "나를 태그" : "업무 배정") + "</span>" +
|
||||
'<span class="pj-alert-text"><b>' + escapeHtml(String(n.title || "").replace(/^(나를 태그함|업무 배정|작업 배정):\s*/, "")) + "</b>" +
|
||||
return '<a class="pj-alert-item' + (isDaily ? " is-daily" : "") + '" href="' + escapeHtml(href) + '" data-alert-open="' + escapeHtml(n.id) + '">' +
|
||||
'<span class="pj-alert-kind ' + (isDaily ? "is-daily" : isMention ? "is-mention" : "is-assigned") + '">' +
|
||||
(isDaily ? '<span class="material-symbols-outlined">repeat</span>매일 업무' : isMention ? "나를 태그" : "업무 배정") + "</span>" +
|
||||
'<span class="pj-alert-text"><b>' + escapeHtml(String(n.title || "").replace(/^(나를 태그함|업무 배정|작업 배정|매일 업무):\s*/, "")) + "</b>" +
|
||||
"<small>" + escapeHtml((n.body || "") + (n.actor_email ? " · " + capName(idOf(n.actor_email)) : "")) + "</small></span>" +
|
||||
'<span class="pj-alert-go">열기 ›</span></a>';
|
||||
}).join("") + "</div>";
|
||||
|
||||
Reference in New Issue
Block a user