feat(project): 프로젝트 색상·아이콘을 아사나식으로(16색 + 아이콘 42종)
- 색상표: 아사나 프로젝트 16색(8칸×2줄, 고른 색에 체크), 새 프로젝트 기본 파랑. 예전 팔레트 색 프로젝트는 그대로 유지(수정 팝업이 첫 칸으로 바꾸지 않음) - 아이콘: 아사나 프로젝트 아이콘과 같은 종류 42개(Material Symbols, self-host 글꼴에 전부 있는 것 확인). 새 프로젝트·수정 팝업에 아이콘 격자(첫 칸 Aa=없음), 사이드바 배지·프로젝트 제목에 흰 아이콘 - DB: projects.icon (scripts/sql/project_db_011_project_icon.sql). 아이콘은 고르거나 바꿨을 때만 보내서 011 적용 전에도 다른 생성·수정은 그대로 동작, 아이콘을 고르면 "마이그레이션 011 필요" 안내(503) - 색상·아이콘 칸을 label 대신 div 로(글자를 누르면 첫 버튼이 눌리던 문제) - 정적 파일 버전 20260926h Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -36,7 +36,7 @@ Claude Code는 이 저장소에서 작업을 시작하기 전에 **반드시 아
|
||||
- 말레이시아 창고 재고관리 (`app/modules/malaysia/`, `malaysia_stock_db`) — 낱개(MT/MX/MZ) 입출고·조정, 세트(MY) BOM, 일일 재고조사(세트→낱개 자동 분해), 현재고 현황. 뚜껑(MD-)은 재고 집계 제외 — 단, 창고 랙에는 위치 확인용으로 배치 가능(`store.LID_ITEMS`). 상품은 `itemcode_db` 읽기 전용. 권한키 `malaysia`
|
||||
- 말레이시아 배송 (`app/modules/dispatch/`, `dispatch_db`) — TikTok·Shopee 출고관리. 플랫폼별 데이터 엑셀 업로드(TikTok=03_TikTok_Order_Export.xlsx, Shopee=Packing List.Doorstep Delivery.xlsx) → 1상자=1카드 출고 작업 리스트·SKU 피킹 요약·Kagayaku 전달표 자동 생성. 1상자 묶음 기준 Package ID > Tracking ID > Order ID, 같은 상자 같은 SKU 합산. 작업 상태 토글(`dispatch_logs` 기록). 받는 사람 이름/전화/주소는 상자 단위로 저장(작업 카드 표시 + 출고 엑셀 생성용 — 개인정보). 배치 다운로드 zip 에 업로드 원본 + 취합 출고 엑셀(`YYYY.MM.DD(Ddd)_tictoc|shopee.xlsx`) 포함. 엑셀은 openpyxl 파싱/생성. 권한키 `dispatch`. 상세는 `docs/DISPATCH_MODULE.md`
|
||||
- 카페24 상품관리 (`app/modules/cafe24/`, `cafe24_db`) — 카페24 관리자에 들어가지 않고 상품 상세페이지(description HTML) 조회·편집·즉시적용·예약적용·버전 이력. 3분할 화면(목록 | HTML 편집기 | 상품 정보 패널). 정보 패널(`routes_product_info.py`, `_side.html`)에서 상품명·판매가·공급가·소비자가, 대표이미지(업로드 → `POST /admin/products/images` → PUT `detail_image`+`image_upload_type=A`), 옵션(생성/이름·썸네일·표시방식 수정/삭제)·품목(자체코드·추가금액·진열·판매)을 수정. 카페24 OAuth/API 클라이언트는 향후 주문관리와 공유하기 위해 **공통 계층 `app/integrations/cafe24/`** 에 둔다 — 라우터에서 `httpx`/`requests` 직접 호출 금지. 토큰은 Fernet 암호화 저장(`CAFE24_TOKEN_SECRET`), 로그/화면에 토큰·시크릿 절대 미출력. 쓰기 직전 항상 카페24 현재 HTML 을 다시 읽어 `BACKUP` revision 생성(로컬 값을 현재값으로 가정 금지). **카페24 관리자 API 는 PUT 뒤 한동안 GET 에서 예전 값을 돌려준다(읽기 지연)** — 우리 캐시 문제가 아니다. 그래서 "마지막 쓰기가 권위": 상세설명은 카페24 값이 최근 revision 중 하나와 같으면 지연으로 보고 마지막 MANUAL/SCHEDULED 를 표시·지문 기준으로 쓰고(`store.resolve_description`), 스칼라(상품명·가격·이미지·진열/판매)는 PUT 응답 스냅샷(`cafe24_products.last_write_snapshot`, 마이그레이션 004)과 GET 의 `updated_date` 를 비교해 덮어씌운다(`store.overlay_recent_write`). 유예시간 `CAFE24_READ_LAG_GRACE_MIN`(기본 360분). 쓰기 후 화면은 PUT 응답으로 그리고 다시 GET 하지 않는다. 예약은 DB 저장 + 별도 worker(`app/modules/cafe24/worker.py`, compose 서비스 `dbx-cafe24-worker`)가 처리 — 웹 프로세스에서 대기하지 않는다. 권한키 `cafe24`(연결/해제는 admin 전용). 상세는 `docs/CAFE24_MODULE.md`
|
||||
- 프로젝트 관리 (`app/modules/project/`, `project_db`) — 아사나식. 프로젝트/서브프로젝트(self-FK `parent_id`, CASCADE)·작업(`tasks`: 담당자·우선순위·시작/마감)·진행단계(`project_stages` 칸반, 생성시 기본 4단계 seed, 섹션 기본 담당자 `default_assignee_email` — 담당자 빈 작업을 그 섹션에 만들거나 옮기면 자동 배정, 마이그레이션 009)·멤버 배정(`project_members`)·활동이력(`project_activity`). 첫 화면(`/project/`)은 **내 작업 목록**(프로젝트 홈 카드 화면은 폐지). 프로젝트 화면은 캘린더(FullCalendar)/타임라인(vis-timeline)/보드/목록/대시보드 뷰 토글. 좌측 사이드바는 수신함·내 작업·휴지통·프로젝트 화면 공용(`templates/project/_side.html` + 프로젝트 목록 동작 `initSideTree`, 새 프로젝트/수정 모달 `_side_modals.html`) — 프로젝트 목록(순서 변경·✎·×)은 어느 화면에서나 같다. 보드는 아사나처럼 섹션이 가로로 계속 늘어나고(넘치면 가로 스크롤) 카드의 담당자·마감일을 클릭해 그 자리에서 바꾼다. 좌측 사이드바에 수신함·내 작업(접이식) 메뉴. 설명란은 주소 붙여넣기 시 자동 링크, 설명란·댓글에서 @로 멤버를 태그하면 (`task_mentions`, 마이그레이션 006) 수신함에 그 작업이 쌓인다. 진입 권한키 `project`(관리자 페이지 토글로 직원별 부여, admin 자동). 프로젝트 생성은 `project` 권한자 누구나(만든 사람이 owner), 삭제는 만든 사람만(슈퍼관리자 예외), 사용자 배정은 `is_admin` 만. 배정 멤버(또는 owner/admin)만 그 프로젝트를 조회(화면·API 모두, 비멤버 403)하고 서브프로젝트/작업/단계 CRUD — URL 의 섹션·부모 작업이 그 프로젝트 것인지 서버가 검증. 실시간 반영은 `project_live_version` 카운터(마이그레이션 007, 미적용 시 MAX 폴백). 사이드바 전체 검색(`/api/search`, 제목·설명·댓글, pg_trgm) + 프로젝트/내 작업 필터 바(찾기·상태·담당자·마감·우선순위·정렬, 클라이언트 필터). 협업자(`task_followers`, 자동 팔로우: 만든 사람·담당자·댓글·@태그) — 완료·댓글 알림은 담당자+협업자에게만. 작업 삭제는 휴지통(`project_trash`, 마이그레이션 010) — 삭제 직전 스냅샷 3개월 보관, 관리자만 보기·복구(`/project/trash`). 마감 알림(`reminders.py` 데몬 스레드, 영업일 09시, D-1/당일/지연, `task_reminders` 로 중복 방지, `PROJECT_REMINDER_*` env) — 마이그레이션 008. 라우터 핸들러는 동기 DB 라 `def` 로 둔다(`async def` 금지). 말풍선은 전부 아사나식 공용 말풍선(`.pj-hovertip`) — 새 기능도 `title=`/`data-tip=` 만 달고 별도 툴팁 구현 금지. 멤버 배정 후보는 `project` 권한 보유 등록 사용자에서 자동 목록(`GET /project/api/assignable-users`). 작업 배정·완료 시 관리자에게 메일(`app/mail.py` stdlib smtplib, `SMTP_*`+`PROJECT_NOTIFY_EMAIL` env, 미설정 시 조용히 skip, `BackgroundTasks` 비동기). 상세는 `docs/PROJECT_MODULE.md`
|
||||
- 프로젝트 관리 (`app/modules/project/`, `project_db`) — 아사나식. 프로젝트/서브프로젝트(self-FK `parent_id`, CASCADE)·프로젝트 색상(아사나 16색)·아이콘(`projects.icon`, Material Symbols 42종, 마이그레이션 011)·작업(`tasks`: 담당자·우선순위·시작/마감)·진행단계(`project_stages` 칸반, 생성시 기본 4단계 seed, 섹션 기본 담당자 `default_assignee_email` — 담당자 빈 작업을 그 섹션에 만들거나 옮기면 자동 배정, 마이그레이션 009)·멤버 배정(`project_members`)·활동이력(`project_activity`). 첫 화면(`/project/`)은 **내 작업 목록**(프로젝트 홈 카드 화면은 폐지). 프로젝트 화면은 캘린더(FullCalendar)/타임라인(vis-timeline)/보드/목록/대시보드 뷰 토글. 좌측 사이드바는 수신함·내 작업·휴지통·프로젝트 화면 공용(`templates/project/_side.html` + 프로젝트 목록 동작 `initSideTree`, 새 프로젝트/수정 모달 `_side_modals.html`) — 프로젝트 목록(순서 변경·✎·×)은 어느 화면에서나 같다. 보드는 아사나처럼 섹션이 가로로 계속 늘어나고(넘치면 가로 스크롤) 카드의 담당자·마감일을 클릭해 그 자리에서 바꾼다. 좌측 사이드바에 수신함·내 작업(접이식) 메뉴. 설명란은 주소 붙여넣기 시 자동 링크, 설명란·댓글에서 @로 멤버를 태그하면 (`task_mentions`, 마이그레이션 006) 수신함에 그 작업이 쌓인다. 진입 권한키 `project`(관리자 페이지 토글로 직원별 부여, admin 자동). 프로젝트 생성은 `project` 권한자 누구나(만든 사람이 owner), 삭제는 만든 사람만(슈퍼관리자 예외), 사용자 배정은 `is_admin` 만. 배정 멤버(또는 owner/admin)만 그 프로젝트를 조회(화면·API 모두, 비멤버 403)하고 서브프로젝트/작업/단계 CRUD — URL 의 섹션·부모 작업이 그 프로젝트 것인지 서버가 검증. 실시간 반영은 `project_live_version` 카운터(마이그레이션 007, 미적용 시 MAX 폴백). 사이드바 전체 검색(`/api/search`, 제목·설명·댓글, pg_trgm) + 프로젝트/내 작업 필터 바(찾기·상태·담당자·마감·우선순위·정렬, 클라이언트 필터). 협업자(`task_followers`, 자동 팔로우: 만든 사람·담당자·댓글·@태그) — 완료·댓글 알림은 담당자+협업자에게만. 작업 삭제는 휴지통(`project_trash`, 마이그레이션 010) — 삭제 직전 스냅샷 3개월 보관, 관리자만 보기·복구(`/project/trash`). 마감 알림(`reminders.py` 데몬 스레드, 영업일 09시, D-1/당일/지연, `task_reminders` 로 중복 방지, `PROJECT_REMINDER_*` env) — 마이그레이션 008. 라우터 핸들러는 동기 DB 라 `def` 로 둔다(`async def` 금지). 말풍선은 전부 아사나식 공용 말풍선(`.pj-hovertip`) — 새 기능도 `title=`/`data-tip=` 만 달고 별도 툴팁 구현 금지. 멤버 배정 후보는 `project` 권한 보유 등록 사용자에서 자동 목록(`GET /project/api/assignable-users`). 작업 배정·완료 시 관리자에게 메일(`app/mail.py` stdlib smtplib, `SMTP_*`+`PROJECT_NOTIFY_EMAIL` env, 미설정 시 조용히 skip, `BackgroundTasks` 비동기). 상세는 `docs/PROJECT_MODULE.md`
|
||||
|
||||
상세는 `docs/PROJECT_OVERVIEW.md`.
|
||||
|
||||
|
||||
+23
-17
@@ -93,9 +93,11 @@ class ProjectStore:
|
||||
due_date: str | None = None,
|
||||
created_by: str = "",
|
||||
seed_stages: bool = False,
|
||||
icon: str | None = None,
|
||||
) -> dict[str, Any]:
|
||||
nm = store.validate_project_name(name)
|
||||
col = store.validate_color(color)
|
||||
ic = store.validate_project_icon(icon)
|
||||
sd = store.validate_date(start_date)
|
||||
dd = store.validate_date(due_date)
|
||||
with self._pool.connection() as conn:
|
||||
@@ -106,24 +108,27 @@ class ProjectStore:
|
||||
).fetchone()
|
||||
if not parent:
|
||||
raise KeyError(f"상위 프로젝트를 찾을 수 없습니다: {parent_id}")
|
||||
# 아이콘을 고른 경우에만 icon 컬럼을 쓴다 — 마이그레이션 011 전에도
|
||||
# 아이콘 없이 만드는 건 예전처럼 된다.
|
||||
cols = ["parent_id", "name", "description", "color", "owner_email",
|
||||
"start_date", "due_date", "created_by"]
|
||||
vals: list[Any] = [
|
||||
parent_id,
|
||||
nm,
|
||||
store.norm_str(description),
|
||||
col,
|
||||
store.norm_str(owner_email, lower=True),
|
||||
sd,
|
||||
dd,
|
||||
store.norm_str(created_by, lower=True),
|
||||
]
|
||||
if ic:
|
||||
cols.append("icon")
|
||||
vals.append(ic)
|
||||
row = conn.execute(
|
||||
"""
|
||||
INSERT INTO projects
|
||||
(parent_id, name, description, color, owner_email,
|
||||
start_date, due_date, created_by)
|
||||
VALUES (%s,%s,%s,%s,%s,%s,%s,%s)
|
||||
RETURNING *
|
||||
""",
|
||||
(
|
||||
parent_id,
|
||||
nm,
|
||||
store.norm_str(description),
|
||||
col,
|
||||
store.norm_str(owner_email, lower=True),
|
||||
sd,
|
||||
dd,
|
||||
store.norm_str(created_by, lower=True),
|
||||
),
|
||||
f"INSERT INTO projects ({', '.join(cols)}) "
|
||||
f"VALUES ({', '.join(['%s'] * len(cols))}) RETURNING *",
|
||||
vals,
|
||||
).fetchone()
|
||||
pid = row["id"]
|
||||
if seed_stages:
|
||||
@@ -143,6 +148,7 @@ class ProjectStore:
|
||||
"name": lambda v: store.validate_project_name(v),
|
||||
"description": lambda v: store.norm_str(v),
|
||||
"color": lambda v: store.validate_color(v),
|
||||
"icon": lambda v: store.validate_project_icon(v), # 마이그레이션 011
|
||||
"owner_email": lambda v: store.norm_str(v, lower=True),
|
||||
"start_date": lambda v: store.validate_date(v),
|
||||
"due_date": lambda v: store.validate_date(v),
|
||||
|
||||
@@ -381,6 +381,7 @@ def _nav_projects(st: Any, user: dict[str, Any], admin: bool) -> list[dict[str,
|
||||
"id": p["id"],
|
||||
"name": p["name"],
|
||||
"color": p.get("color") or "#4573d2",
|
||||
"icon": p.get("icon") or "",
|
||||
"created_by": p.get("created_by") or "",
|
||||
"description": p.get("description") or "",
|
||||
"start_date": p.get("start_date"),
|
||||
@@ -587,6 +588,7 @@ def my_tasks_page(request: Request) -> HTMLResponse:
|
||||
"avatars": avatars,
|
||||
"priority_labels": store.PRIORITY_LABELS,
|
||||
"color_palette": list(store.COLOR_PALETTE),
|
||||
"project_icons": list(store.PROJECT_ICONS),
|
||||
"today": today_iso,
|
||||
},
|
||||
)
|
||||
@@ -714,6 +716,7 @@ def project_page(request: Request, project_id: int) -> HTMLResponse:
|
||||
"id": p["id"],
|
||||
"name": p["name"],
|
||||
"color": p.get("color") or "#4573d2",
|
||||
"icon": p.get("icon") or "",
|
||||
"start_date": p.get("start_date"),
|
||||
"due_date": p.get("due_date"),
|
||||
"created_by": p.get("created_by") or "",
|
||||
@@ -724,6 +727,7 @@ def project_page(request: Request, project_id: int) -> HTMLResponse:
|
||||
"id": p["id"],
|
||||
"name": p["name"],
|
||||
"color": p.get("color") or "#4573d2",
|
||||
"icon": p.get("icon") or "",
|
||||
"created_by": p.get("created_by") or "",
|
||||
"description": p.get("description") or "",
|
||||
"start_date": p.get("start_date"),
|
||||
@@ -796,6 +800,7 @@ def project_page(request: Request, project_id: int) -> HTMLResponse:
|
||||
"avatars": avatars,
|
||||
"priority_labels": store.PRIORITY_LABELS,
|
||||
"color_palette": list(store.COLOR_PALETTE),
|
||||
"project_icons": list(store.PROJECT_ICONS),
|
||||
"stage_color_palette": list(store.STAGE_COLOR_PALETTE),
|
||||
"today": today.isoformat(),
|
||||
"year": year,
|
||||
@@ -832,6 +837,9 @@ def api_list_projects(request: Request) -> JSONResponse:
|
||||
return JSONResponse({"projects": projects, "tree": _build_tree(projects)})
|
||||
|
||||
|
||||
_PROJECT_ICON_MIGRATION_MSG = "프로젝트 아이콘 기능이 아직 준비되지 않았습니다(DB 마이그레이션 011 필요)."
|
||||
|
||||
|
||||
@router.post("/api/projects")
|
||||
def api_create_project(
|
||||
request: Request, payload: dict[str, Any] = Body(...)
|
||||
@@ -849,9 +857,12 @@ def api_create_project(
|
||||
start_date=payload.get("start_date"),
|
||||
due_date=payload.get("due_date"),
|
||||
created_by=user["email"],
|
||||
icon=payload.get("icon"),
|
||||
)
|
||||
except ValueError as exc:
|
||||
raise HTTPException(status_code=400, detail=str(exc))
|
||||
except UndefinedColumn:
|
||||
raise HTTPException(status_code=503, detail=_PROJECT_ICON_MIGRATION_MSG)
|
||||
return JSONResponse({"project": project}, status_code=201)
|
||||
|
||||
|
||||
@@ -913,6 +924,8 @@ def api_update_project(
|
||||
project = st.update_project(project_id=project_id, fields=payload)
|
||||
except ValueError as exc:
|
||||
raise HTTPException(status_code=400, detail=str(exc))
|
||||
except UndefinedColumn:
|
||||
raise HTTPException(status_code=503, detail=_PROJECT_ICON_MIGRATION_MSG)
|
||||
except KeyError:
|
||||
raise HTTPException(status_code=404, detail="프로젝트를 찾을 수 없습니다.")
|
||||
return JSONResponse({"project": project})
|
||||
@@ -2001,6 +2014,7 @@ def trash_page(request: Request) -> HTMLResponse:
|
||||
"page_subtitle": "삭제한 작업 — 3개월 보관, 관리자만 복구",
|
||||
"force_sidebar_collapsed": True,
|
||||
"color_palette": list(store.COLOR_PALETTE),
|
||||
"project_icons": list(store.PROJECT_ICONS),
|
||||
"trash_enabled": enabled,
|
||||
"items": _trash_view_items(st.list_trash()) if enabled else [],
|
||||
},
|
||||
@@ -2073,6 +2087,7 @@ def inbox_page(request: Request) -> HTMLResponse:
|
||||
"page_subtitle": "나를 태그한 작업과 프로젝트 알림",
|
||||
"force_sidebar_collapsed": True,
|
||||
"color_palette": list(store.COLOR_PALETTE),
|
||||
"project_icons": list(store.PROJECT_ICONS),
|
||||
"notifications": items,
|
||||
"mentioned_tasks": mentioned,
|
||||
"mention_unread": _safe_mention_unread(st, user["email"]),
|
||||
|
||||
@@ -39,16 +39,74 @@ ACTION_STAGE_CHANGED = "stage_changed"
|
||||
ACTION_REOPENED = "reopened"
|
||||
ACTION_SUBTASK_MOVED = "subtask_moved" # 하위 업무를 다른 상위 업무로 옮김(보드 드래그)
|
||||
|
||||
# 프로젝트 색상 팔레트(아사나 느낌) — UI 선택지
|
||||
# 프로젝트 색상 팔레트 — 아사나 프로젝트 색 16가지(아사나 색상표 순서 그대로).
|
||||
# 새 프로젝트 기본색은 DEFAULT_PROJECT_COLOR(파랑). 예전 팔레트 색으로 만든 프로젝트는
|
||||
# 그 색 그대로 둔다(검증은 hex 형식만 본다).
|
||||
COLOR_PALETTE: tuple[str, ...] = (
|
||||
"#c7c4c4", # none(연회색)
|
||||
"#f06a6a", # red
|
||||
"#ec8d71", # orange
|
||||
"#f1bd6c", # yellow-orange
|
||||
"#f8df72", # yellow
|
||||
"#aecf55", # yellow-green
|
||||
"#5da283", # green
|
||||
"#4ecbc4", # blue-green
|
||||
"#9ee7e3", # aqua
|
||||
"#4573d2", # blue
|
||||
"#37a3a3", # teal
|
||||
"#62a420", # green
|
||||
"#e8a33d", # amber
|
||||
"#e8384f", # red
|
||||
"#aa62e3", # purple
|
||||
"#f06a6a", # coral
|
||||
"#5a6772", # slate
|
||||
"#8d84e8", # indigo
|
||||
"#b36bd4", # purple
|
||||
"#f9aaef", # magenta
|
||||
"#f26fb2", # hot-pink
|
||||
"#fc979a", # pink
|
||||
"#6d6e6f", # cool-gray
|
||||
)
|
||||
DEFAULT_PROJECT_COLOR = "#4573d2"
|
||||
|
||||
# 프로젝트 아이콘 — 아사나 프로젝트 아이콘 목록과 같은 종류를 Material Symbols
|
||||
# (앱이 self-host 하는 아이콘 글꼴)의 이름으로. 빈 값/목록 밖 = 아이콘 없음(첫 글자).
|
||||
PROJECT_ICONS: tuple[str, ...] = (
|
||||
"format_list_bulleted", # 목록
|
||||
"view_kanban", # 보드
|
||||
"view_timeline", # 타임라인
|
||||
"calendar_month", # 캘린더
|
||||
"rocket_launch", # 로켓
|
||||
"groups", # 사람들
|
||||
"trending_up", # 그래프
|
||||
"stars", # 별
|
||||
"bug_report", # 버그
|
||||
"lightbulb", # 전구
|
||||
"language", # 지구
|
||||
"settings", # 톱니
|
||||
"menu_book", # 노트
|
||||
"desktop_windows", # 모니터
|
||||
"check_circle", # 체크
|
||||
"adjust", # 과녁
|
||||
"code", # 코드
|
||||
"campaign", # 확성기
|
||||
"forum", # 말풍선
|
||||
"work", # 서류가방
|
||||
"dashboard", # 페이지 레이아웃
|
||||
"flag", # 깃발
|
||||
"extension", # 퍼즐
|
||||
"slideshow", # 발표
|
||||
"confirmation_number", # 티켓
|
||||
"shopping_basket", # 장바구니
|
||||
"cloud", # 구름
|
||||
"payments", # 돈
|
||||
"favorite", # 하트
|
||||
"redeem", # 선물
|
||||
"trophy", # 트로피
|
||||
"photo_camera", # 카메라
|
||||
"palette", # 디자인
|
||||
"school", # 교육
|
||||
"local_shipping", # 배송
|
||||
"inventory_2", # 재고
|
||||
"storefront", # 상점
|
||||
"science", # 실험
|
||||
"videocam", # 영상
|
||||
"description", # 문서
|
||||
"handshake", # 협업
|
||||
"build", # 도구
|
||||
)
|
||||
|
||||
# 세션(칸반 컬럼) 색상 팔레트 — 아사나 태그/커스텀필드에서 쓰는 10색.
|
||||
@@ -187,7 +245,7 @@ def validate_task_title(title: Any) -> str:
|
||||
def validate_color(color: Any) -> str:
|
||||
v = norm_str(color)
|
||||
if not v:
|
||||
return COLOR_PALETTE[0]
|
||||
return DEFAULT_PROJECT_COLOR
|
||||
# 매우 단순한 hex 검증 — #RGB / #RRGGBB
|
||||
if v.startswith("#") and len(v) in (4, 7):
|
||||
try:
|
||||
@@ -195,7 +253,13 @@ def validate_color(color: Any) -> str:
|
||||
return v.lower()
|
||||
except ValueError:
|
||||
pass
|
||||
return COLOR_PALETTE[0]
|
||||
return DEFAULT_PROJECT_COLOR
|
||||
|
||||
|
||||
def validate_project_icon(icon: Any) -> str | None:
|
||||
"""프로젝트 아이콘 — PROJECT_ICONS 안의 이름만, 빈값/목록 밖은 None(첫 글자 표시)."""
|
||||
v = norm_str(icon)
|
||||
return v if v in PROJECT_ICONS else None
|
||||
|
||||
|
||||
def validate_stage_color(color: Any) -> str | None:
|
||||
|
||||
@@ -57,11 +57,11 @@
|
||||
data-name="{{ p.name }}" data-desc="{{ p.description or '' }}"
|
||||
data-start="{{ p.start_date or '' }}" data-due="{{ p.due_date or '' }}"
|
||||
data-color="{{ p.color }}" data-status="{{ p.status or 'active' }}"
|
||||
data-creator="{{ p.created_by or '' }}">
|
||||
data-creator="{{ p.created_by or '' }}" data-icon="{{ p.icon or '' }}">
|
||||
<div class="pj-tree-row {% if p.id == current_pid %}is-active{% endif %}">
|
||||
{% if is_admin %}<span class="pj-tree-handle" title="드래그로 순서 변경">⣿</span>{% endif %}
|
||||
<a class="pj-tree-link" href="/project/p/{{ p.id }}"{% if is_admin %} draggable="false"{% endif %}>
|
||||
<span class="pj-tree-avatar" style="background: {{ p.color }}">{{ p.name[0] | upper }}</span>
|
||||
<span class="pj-tree-avatar{% if p.icon %} has-icon{% endif %}" style="background: {{ p.color }}">{% if p.icon %}<span class="material-symbols-outlined pj-proj-ic">{{ p.icon }}</span>{% else %}{{ p.name[0] | upper }}{% endif %}</span>
|
||||
<span class="pj-tree-name">{{ p.name }}</span>
|
||||
</a>
|
||||
{% if is_admin %}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
{# ── 좌측 프로젝트 목록(project/_side.html)용 모달 (공용) ──────────────
|
||||
"+" 새 프로젝트 / ✎ 프로젝트 수정 — 수신함·내 업무·휴지통·프로젝트 화면이
|
||||
모두 include 한다(동작은 project.js 의 initSideTree). 관리자만 쓰므로
|
||||
관리자에게만 그린다. 색상 원은 window.PJ_COLORS(color_palette). #}
|
||||
관리자에게만 그린다. 색상 원은 window.PJ_COLORS(color_palette, 아사나 16색),
|
||||
아이콘은 window.PJ_ICONS(project_icons — Material Symbols 이름). #}
|
||||
<script>
|
||||
window.PJ_COLORS = {{ color_palette | tojson }};
|
||||
window.PJ_ICONS = {{ (project_icons or []) | tojson }};
|
||||
</script>
|
||||
{% if is_admin %}
|
||||
<!-- 새 프로젝트 모달 — 좌측 프로젝트 목록의 + 버튼 -->
|
||||
@@ -15,9 +17,13 @@
|
||||
{# 날짜 칸은 project.js enhanceDateInput 이 아사나식 날짜 버튼으로 바꾼다(input 은 숨긴 값 저장소).
|
||||
label 로 감싸지 않는다 — label 안의 버튼을 누르면 숨긴 input 이 다시 눌리는 문제가 생긴다. #}
|
||||
<div class="pj-field-label">마감일<input type="date" id="pj-f-due" /></div>
|
||||
<label>색상
|
||||
{# 색상·아이콘은 label 로 감싸지 않는다 — label 글자를 누르면 첫 버튼이 눌린다. #}
|
||||
<div class="pj-field-label">색상
|
||||
<span class="pj-color-palette" id="pj-f-colors"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="pj-field-label">아이콘
|
||||
<div class="pj-icon-palette" id="pj-f-icons"></div>
|
||||
</div>
|
||||
<div class="pj-field-label">멤버
|
||||
<div class="pj-member-picker" id="pj-f-members">불러오는 중…</div>
|
||||
</div>
|
||||
@@ -40,9 +46,12 @@
|
||||
<input type="date" id="pj-e-start" />
|
||||
<input type="date" id="pj-e-due" />
|
||||
</div>
|
||||
<label>색상
|
||||
<div class="pj-field-label">색상
|
||||
<span class="pj-color-palette" id="pj-e-colors"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="pj-field-label">아이콘
|
||||
<div class="pj-icon-palette" id="pj-e-icons"></div>
|
||||
</div>
|
||||
<label class="pj-time-toggle">
|
||||
<input type="checkbox" id="pj-e-done" /> 프로젝트 완료 (목록 끝으로 이동·비활성)
|
||||
</label>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926g" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926h" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -99,5 +99,5 @@
|
||||
{% include "project/_side_modals.html" %}
|
||||
{% include "project/_member_tasks_modal.html" %}
|
||||
|
||||
<script src="/static/project.js?v=20260926g" defer></script>
|
||||
<script src="/static/project.js?v=20260926h" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926g" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926h" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -98,5 +98,5 @@
|
||||
"today": {{ today | tojson }}
|
||||
}
|
||||
</script>
|
||||
<script src="/static/project.js?v=20260926g" defer></script>
|
||||
<script src="/static/project.js?v=20260926h" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926g" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926h" />
|
||||
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
<!-- 타임라인 vis-timeline — self-host -->
|
||||
@@ -48,7 +48,7 @@
|
||||
같은 마크업으로 다시 그린다. -->
|
||||
<div class="pj-title-wrap">
|
||||
<h1 class="pj-project-title">
|
||||
<span class="pj-project-title-pill" style="--pj-color: {{ project.color or '#4573d2' }}">{{ project.name }}</span>
|
||||
<span class="pj-project-title-pill" style="--pj-color: {{ project.color or '#4573d2' }}">{% if project.icon %}<span class="material-symbols-outlined pj-pill-ic">{{ project.icon }}</span>{% endif %}{{ project.name }}</span>
|
||||
</h1>
|
||||
<div class="pj-title-members" id="pj-member-list">
|
||||
{% for m in members %}
|
||||
@@ -466,5 +466,5 @@
|
||||
</script>
|
||||
|
||||
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
|
||||
<script src="/static/project.js?v=20260926g" defer></script>
|
||||
<script src="/static/project.js?v=20260926h" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926g" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260926h" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -68,5 +68,5 @@
|
||||
{% include "project/_side_modals.html" %}
|
||||
{% include "project/_member_tasks_modal.html" %}
|
||||
|
||||
<script src="/static/project.js?v=20260926g" defer></script>
|
||||
<script src="/static/project.js?v=20260926h" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
+28
-3
@@ -128,6 +128,7 @@
|
||||
display: inline-flex; align-items: center; justify-content: center;
|
||||
color: #fff; font-size: 11px; font-weight: 700;
|
||||
}
|
||||
.pj-tree-avatar .pj-proj-ic { font-size: 16px; color: #fff; }
|
||||
.pj-tree-name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.pj-tree-acts { display: none; gap: 0; flex: 0 0 auto; }
|
||||
.pj-tree-row:hover .pj-tree-acts { display: inline-flex; }
|
||||
@@ -169,6 +170,8 @@
|
||||
color: #6b7280; font-size: 15px; line-height: 1; cursor: pointer;
|
||||
}
|
||||
.pj-title-addmember:hover { border-style: solid; border-color: var(--pj-accent); color: var(--pj-accent); }
|
||||
/* 제목 알약 안 프로젝트 아이콘 */
|
||||
.pj-pill-ic { font-size: 26px; vertical-align: -5px; margin-right: 8px; }
|
||||
.pj-project-title-pill {
|
||||
display: inline-block; max-width: 100%; vertical-align: middle;
|
||||
font-size: 22px; font-weight: 800; color: #fff;
|
||||
@@ -631,9 +634,31 @@
|
||||
.pj-btn-complete:hover { background: #d9f2e4; }
|
||||
.pj-btn-complete.is-done { background: #f2f2f4; color: #6b6f76; border-color: var(--pj-border); }
|
||||
|
||||
.pj-color-palette, #pj-f-colors { display: flex; gap: 8px; margin-top: 6px; }
|
||||
.pj-color-swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
|
||||
.pj-color-swatch.is-active { border-color: #1e1f21; box-shadow: 0 0 0 2px #fff inset; }
|
||||
/* 색상표(아사나) — 8칸씩 둥근 네모, 고른 색엔 체크 */
|
||||
.pj-color-palette, #pj-f-colors { display: grid; grid-template-columns: repeat(8, 26px); gap: 8px; margin-top: 6px; }
|
||||
.pj-color-swatch {
|
||||
position: relative; width: 26px; height: 26px; padding: 0; border: none; border-radius: 6px; cursor: pointer;
|
||||
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
|
||||
}
|
||||
.pj-color-swatch:hover { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
|
||||
.pj-color-swatch.is-active::after {
|
||||
content: "check"; font-family: "Material Symbols Outlined"; font-size: 18px; line-height: 26px;
|
||||
position: absolute; inset: 0; text-align: center; color: #1e1f21;
|
||||
-webkit-font-feature-settings: "liga"; font-feature-settings: "liga";
|
||||
}
|
||||
/* 프로젝트 아이콘 고르기(아사나) — 회색 아이콘 격자, 고른 것은 보라 강조. 길면 칸 안에서 스크롤 */
|
||||
.pj-icon-palette {
|
||||
display: grid; grid-template-columns: repeat(auto-fill, 38px); gap: 6px; margin-top: 6px;
|
||||
max-height: 186px; overflow-y: auto; padding: 2px;
|
||||
}
|
||||
.pj-icon-pick {
|
||||
width: 38px; height: 38px; padding: 0; border: none; border-radius: 8px; background: transparent;
|
||||
color: #6d6e6f; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
|
||||
}
|
||||
.pj-icon-pick .material-symbols-outlined { font-size: 24px; }
|
||||
.pj-icon-pick:hover { background: #f1f2f4; color: var(--pj-ink); }
|
||||
.pj-icon-pick.is-active { background: var(--pj-accent-tint); color: var(--pj-accent); box-shadow: inset 0 0 0 1.5px var(--pj-accent); }
|
||||
.pj-icon-pick-aa { font-size: 14px; font-weight: 800; }
|
||||
|
||||
/* ── 알림 벨 ── */
|
||||
.pj-toolbar-right { display: flex; align-items: center; gap: 12px; }
|
||||
|
||||
+46
-6
@@ -805,7 +805,9 @@
|
||||
// window.PJ_STAGE_COLORS(아사나 10색)를 넘겨 같은 UI를 재사용한다.
|
||||
function renderColorPalette(container, onPick, initial, palette) {
|
||||
const colors = palette || window.PJ_COLORS || ["#4573d2"];
|
||||
let selected = (initial && colors.indexOf(initial) >= 0) ? initial : colors[0];
|
||||
// 목록에 없는 현재 색(예전 팔레트로 만든 프로젝트)은 고르기 전까지 그대로 둔다 —
|
||||
// 첫 칸으로 바꿔 버리면 수정 팝업에서 저장만 해도 색이 바뀐다.
|
||||
let selected = initial || colors[0];
|
||||
container.innerHTML = "";
|
||||
colors.forEach(function (c) {
|
||||
const b = document.createElement("button");
|
||||
@@ -826,6 +828,32 @@
|
||||
return function () { return selected; };
|
||||
}
|
||||
|
||||
// ── 프로젝트 아이콘(아사나식) — window.PJ_ICONS(Material Symbols 이름) 격자.
|
||||
// 첫 칸 "Aa" = 아이콘 없음(프로젝트 색 + 이름 첫 글자). 반환 = 지금 고른 이름("" = 없음).
|
||||
function renderIconPalette(container, initial) {
|
||||
if (!container) return function () { return ""; };
|
||||
const icons = window.PJ_ICONS || [];
|
||||
let selected = initial && icons.indexOf(initial) >= 0 ? initial : "";
|
||||
container.innerHTML = [""].concat(icons).map(function (ic) {
|
||||
return '<button type="button" class="pj-icon-pick' + (ic === selected ? " is-active" : "") +
|
||||
'" data-icon="' + ic + '" title="' + (ic ? "아이콘" : "아이콘 없음(첫 글자)") + '">' +
|
||||
(ic ? '<span class="material-symbols-outlined">' + ic + "</span>" : '<span class="pj-icon-pick-aa">Aa</span>') +
|
||||
"</button>";
|
||||
}).join("");
|
||||
container.querySelectorAll(".pj-icon-pick").forEach(function (b) {
|
||||
b.addEventListener("click", function () {
|
||||
selected = b.dataset.icon;
|
||||
container.querySelectorAll(".pj-icon-pick").forEach(function (x) { x.classList.toggle("is-active", x === b); });
|
||||
});
|
||||
});
|
||||
return function () { return selected; };
|
||||
}
|
||||
// 프로젝트 배지 안쪽 — 아이콘이 있으면 흰 아이콘, 없으면 이름 첫 글자(사이드바 목록·제목 공용).
|
||||
function projBadgeInner(p) {
|
||||
if (p && p.icon) return '<span class="material-symbols-outlined pj-proj-ic">' + escapeHtml(p.icon) + "</span>";
|
||||
return escapeHtml(((p && p.name) || "?").trim().charAt(0).toUpperCase() || "?");
|
||||
}
|
||||
|
||||
// ════════════════════════════════════════════════════════════
|
||||
// 댓글만 보는 채팅형 팝업(#pj-modal-comments) — 홈 카드/내 업무, 프로젝트
|
||||
// 화면 우측 "내 업무" 패널 전부 공용(마크업 id 는 두 페이지가 같은 걸 씀).
|
||||
@@ -842,7 +870,8 @@
|
||||
const modal = el("pj-modal-project");
|
||||
if (!btn || !modal) return;
|
||||
wireModalClose(modal);
|
||||
const getColor = renderColorPalette(el("pj-f-colors"));
|
||||
let getColor = renderColorPalette(el("pj-f-colors"), null, "#4573d2");
|
||||
let getIcon = renderIconPalette(el("pj-f-icons"), "");
|
||||
const membersBox = el("pj-f-members");
|
||||
btn.addEventListener("click", async function () {
|
||||
openModal(modal);
|
||||
@@ -875,6 +904,7 @@
|
||||
description: el("pj-f-desc").value.trim(),
|
||||
due_date: el("pj-f-due").value || null,
|
||||
color: getColor(),
|
||||
icon: getIcon() || undefined,
|
||||
});
|
||||
const pid = res.project.id;
|
||||
for (const email of memberEmails) {
|
||||
@@ -884,6 +914,8 @@
|
||||
closeModal(modal);
|
||||
el("pj-f-name").value = ""; el("pj-f-desc").value = "";
|
||||
el("pj-f-due").value = "";
|
||||
getColor = renderColorPalette(el("pj-f-colors"), null, "#4573d2");
|
||||
getIcon = renderIconPalette(el("pj-f-icons"), "");
|
||||
if (onCreated) onCreated(res.project);
|
||||
} catch (e) { showToast("생성 실패: " + e.message, "error"); }
|
||||
});
|
||||
@@ -921,6 +953,7 @@
|
||||
id: parseInt(d.id, 10), name: d.name || "", description: d.desc || "",
|
||||
start_date: d.start || null, due_date: d.due || null,
|
||||
color: d.color || "#4573d2", status: d.status || "active", created_by: d.creator || "",
|
||||
icon: d.icon || "",
|
||||
};
|
||||
}
|
||||
);
|
||||
@@ -938,14 +971,14 @@
|
||||
'" data-name="' + escapeHtml(p.name) + '" data-creator="' + escapeHtml(p.created_by || "") + '" title="프로젝트 삭제">×</button>' +
|
||||
"</span>";
|
||||
}
|
||||
const initial = escapeHtml((p.name || "?").trim().charAt(0).toUpperCase() || "?");
|
||||
// 드래그로 순서 변경 가능함을 알려주는 손잡이(⣿) — 관리자에게만 보인다.
|
||||
const handle = isAdmin ? '<span class="pj-tree-handle" title="드래그로 순서 변경">⣿</span>' : "";
|
||||
return '<li class="pj-tree-li"' + (isAdmin ? ' draggable="true"' : "") + ' data-id="' + p.id + '"><div class="pj-tree-row ' +
|
||||
(p.id === currentId ? "is-active" : "") + '">' +
|
||||
handle +
|
||||
'<a class="pj-tree-link" href="/project/p/' + p.id + '">' +
|
||||
'<span class="pj-tree-avatar" style="background:' + (p.color || "#4573d2") + '">' + initial + "</span>" +
|
||||
'<span class="pj-tree-avatar' + (p.icon ? " has-icon" : "") + '" style="background:' + (p.color || "#4573d2") + '">' +
|
||||
projBadgeInner(p) + "</span>" +
|
||||
'<span class="pj-tree-name">' + escapeHtml(p.name) + "</span></a>" + acts + "</div></li>";
|
||||
}
|
||||
async function deleteTreeProject(id, name, createdBy) {
|
||||
@@ -1096,7 +1129,7 @@
|
||||
// ── ✎ 버튼 — 프로젝트 수정 모달. 트리는 render() 로 매번 다시 그려지므로
|
||||
// 열기 로직을 함수로 두고 wireTreeHandlers 에서 매번 다시 건다.
|
||||
const editModal = el("pj-modal-edit");
|
||||
let getEditColor = null;
|
||||
let getEditColor = null, getEditIcon = null, editOrigIcon = "";
|
||||
function openProjectEditModal(data) {
|
||||
if (!editModal) return;
|
||||
el("pj-e-id").value = data.id;
|
||||
@@ -1106,6 +1139,9 @@
|
||||
el("pj-e-due").value = data.due || "";
|
||||
el("pj-e-done").checked = data.status === "completed";
|
||||
getEditColor = renderColorPalette(el("pj-e-colors"), null, data.color);
|
||||
const cur = projects.find(function (x) { return String(x.id) === String(data.id); });
|
||||
editOrigIcon = (cur && cur.icon) || "";
|
||||
getEditIcon = renderIconPalette(el("pj-e-icons"), editOrigIcon);
|
||||
openModal(editModal);
|
||||
}
|
||||
if (editModal) {
|
||||
@@ -1121,6 +1157,8 @@
|
||||
start_date: el("pj-e-start").value || null,
|
||||
due_date: el("pj-e-due").value || null,
|
||||
color: getEditColor ? getEditColor() : undefined,
|
||||
// 아이콘은 바뀐 경우에만 — 안 바꾼 저장이 마이그레이션 011 전에도 되게.
|
||||
icon: getEditIcon && getEditIcon() !== editOrigIcon ? (getEditIcon() || null) : undefined,
|
||||
status: el("pj-e-done").checked ? "completed" : "active",
|
||||
});
|
||||
merge(res.project);
|
||||
@@ -2079,7 +2117,9 @@
|
||||
Object.assign(currentProject, p);
|
||||
const pillEl = document.querySelector(".pj-project-title-pill");
|
||||
if (pillEl) {
|
||||
pillEl.textContent = currentProject.name || "";
|
||||
pillEl.innerHTML = (currentProject.icon
|
||||
? '<span class="material-symbols-outlined pj-pill-ic">' + escapeHtml(currentProject.icon) + "</span>" : "") +
|
||||
escapeHtml(currentProject.name || "");
|
||||
pillEl.style.setProperty("--pj-color", currentProject.color || "#4573d2");
|
||||
}
|
||||
},
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
"@태그"는 그대로 쓴다. 코드 식별자·DB 컬럼(`tasks`, `stage_id`, `task_followers` 등)과 코드 주석은 예전 이름 그대로다.
|
||||
**멤버 이름 표기** — 이메일 아이디의 첫 글자만 대문자(king → King). JS 는 `idOf(email)`/`capName(s)`,
|
||||
템플릿은 `{{ nm[:1]|upper }}{{ nm[1:] }}` 로 화면에 그릴 때만 바꾼다(API `id`·DB 값은 그대로 — 멘션·검색은 이메일 기준).
|
||||
**프로젝트 색상·아이콘(아사나식)** — 색상표는 아사나 프로젝트 16색(`store.COLOR_PALETTE`, 8칸×2줄, 새 프로젝트
|
||||
기본은 파랑 `DEFAULT_PROJECT_COLOR`). 예전 팔레트 색으로 만든 프로젝트는 그 색 그대로(수정 팝업이 첫 칸으로
|
||||
바꾸지 않는다). 아이콘은 아사나 프로젝트 아이콘과 같은 종류 42개를 Material Symbols 이름으로(`store.PROJECT_ICONS`
|
||||
— 아사나의 실제 아이콘 이미지는 쓰지 않는다), `projects.icon`(마이그레이션 011, NULL = 색 + 첫 글자).
|
||||
새 프로젝트·프로젝트 수정 팝업의 "아이콘" 격자(`renderIconPalette`, 첫 칸 "Aa" = 아이콘 없음), 사이드바 배지·
|
||||
제목 알약에 흰 아이콘(`projBadgeInner`). 아이콘은 고르거나 바꿨을 때만 서버로 보내므로 011 전에도 다른 수정은 된다.
|
||||
|
||||
## 1. 개요
|
||||
|
||||
@@ -220,6 +226,8 @@ docker exec -i postgres-db psql -U postgres -d project_db \
|
||||
< scripts/sql/project_db_009_stage_default_assignee.sql
|
||||
docker exec -i postgres-db psql -U postgres -d project_db \
|
||||
< scripts/sql/project_db_010_trash.sql
|
||||
docker exec -i postgres-db psql -U postgres -d project_db \
|
||||
< scripts/sql/project_db_011_project_icon.sql
|
||||
|
||||
# 4) 재배포 (git pull 후 반드시 --build)
|
||||
cd /opt/www/main && docker compose up -d --build web
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
-- =====================================================================
|
||||
-- project_db 마이그레이션 011 — 프로젝트 아이콘(아사나식 색상·아이콘)
|
||||
-- =====================================================================
|
||||
-- 프로젝트마다 아이콘 하나(Material Symbols 이름, store.PROJECT_ICONS 중 하나)를
|
||||
-- 저장한다. NULL = 아이콘 없음 → 예전처럼 프로젝트 색 + 이름 첫 글자.
|
||||
--
|
||||
-- 미적용이어도 앱은 동작한다 — 아이콘 없이 만들고 고치는 건 예전처럼 되고,
|
||||
-- 아이콘을 고를 때만 "마이그레이션 011 필요" 안내가 뜬다.
|
||||
--
|
||||
-- 적용 (1회, 여러 번 돌려도 안전):
|
||||
-- docker exec -i postgres-db psql -U postgres -d project_db \
|
||||
-- < scripts/sql/project_db_011_project_icon.sql
|
||||
-- =====================================================================
|
||||
|
||||
\set ON_ERROR_STOP on
|
||||
\connect project_db
|
||||
|
||||
ALTER TABLE projects ADD COLUMN IF NOT EXISTS icon TEXT;
|
||||
|
||||
COMMENT ON COLUMN projects.icon IS
|
||||
'프로젝트 아이콘(Material Symbols 이름, store.PROJECT_ICONS). NULL = 색 + 첫 글자';
|
||||
Reference in New Issue
Block a user