feat(vacation): 휴가 신청 날짜 칸 — 프로젝트와 같은 아사나식 날짜 팝업
- 공용 erp-datepop.js/css(project.js openDatePopover·enhanceDateInput·.pj-datepop CSS 를 떼어 낸 같은 모양·동작) - 시작일·종료일 = 숨긴 input + 날짜 버튼 둘(enhanceRange), 어느 쪽을 눌러도 같은 기간 팝업(누른 칸 먼저, 시작 → 종료 → 닫힘), 반차는 하루짜리, 직접 입력(Enter), Esc·바깥 클릭 닫힘 - 공휴일 = 휴가 설정 공휴일(빨강, 작년~내년) — 팝업 빨강·이름, 예상 일수에서도 제외(서버 compute_days 와 같게) - 테스트: vacation_datepop.browser.test.js(render_vacation.py), 휴가 신청 화면 공휴일·스크립트 렌더 확인 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -197,6 +197,9 @@ class Store:
|
||||
self.req.update(status="반려", reject_reason=reason); return dict(self.req)
|
||||
def list_mail_log(self, request_id):
|
||||
return []
|
||||
def list_holidays(self, year=None):
|
||||
return [{"holiday_date": f"{year}-10-09", "name": "한글날", "is_red": True},
|
||||
{"holiday_date": f"{year}-05-01", "name": "근로자의날(회사)", "is_red": False}]
|
||||
|
||||
st = Store()
|
||||
|
||||
@@ -264,6 +267,15 @@ def body(c):
|
||||
# 관리자는 승인자 목록에 없어도 승인
|
||||
who["u"] = admin
|
||||
assert c.post("/vacation/r1/approve").status_code == 303 and sent[-1][:2] == ("approved", "admin@test.local")
|
||||
# 휴가 신청 화면 — 날짜 칸 = 공용 날짜 팝업(erp-datepop), 공휴일(빨강만) 작년~내년을 화면에
|
||||
import json, re
|
||||
from app.timezone import today_kst
|
||||
r = c.get("/vacation/new")
|
||||
assert r.status_code == 200, r.status_code
|
||||
assert "/static/erp-datepop.js" in r.text and "/static/erp-datepop.css" in r.text and "material-symbols.css" in r.text
|
||||
hol = json.loads(re.search(r'<script type="application/json" id="vac-holidays">(.*?)</script>', r.text, re.S).group(1))
|
||||
y = today_kst().year
|
||||
assert hol == {f"{yy}-10-09": "한글날" for yy in (y - 1, y, y + 1)}, hol
|
||||
# Gmail 연결 — 저장소(입출고 DB)가 없으면 옵션으로 돌아와 안내
|
||||
who["u"] = kim
|
||||
r = c.get("/vacation/gmail/connect")
|
||||
|
||||
Reference in New Issue
Block a user