fix(inout): 메일 창 — 연결 전 아래 줄 숨김, redirect_uri_mismatch 대비 등록할 주소 안내

- .io-dlg-footbar 의 display:flex 가 hidden 속성을 덮어써 연결 전에도 [메일 발송]·[연결 끊기]가 보이던 문제
  → .io/.io-dlg/.io-viewer 안의 [hidden] 은 늘 숨김.
- 구글이 redirect_uri_mismatch 로 막으면 ERP 로 돌아오지 않으므로, 연결 안내에 구글 클라우드
  "승인된 리디렉션 URI"에 넣을 정확한 주소(callback_url)를 미리 보여 준다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-16 16:59:14 +09:00
parent 9429485236
commit 12f1d455b9
8 changed files with 25 additions and 9 deletions
+7
View File
@@ -491,6 +491,12 @@ def photo_view(request: Request, photo_id: int) -> Response:
# ────────────────────────────────────────────────────────────
# 발주 메일 — 발주 담당 본인 Gmail(003). 연결은 사람마다 한 번, 보내기는 [메일 발송]을 눌렀을 때만.
# ────────────────────────────────────────────────────────────
def _callback_url(request: Request) -> str:
from app.main import public_url_for # noqa: WPS433
return public_url_for(request, "inout_gmail_callback")
def _safe_next(nxt: Any) -> str:
s = str(nxt or "")
return s if s.startswith("/inout/") and "//" not in s and "\\" not in s else "/inout/"
@@ -584,6 +590,7 @@ def mail_preview(request: Request, order_id: int) -> JSONResponse:
return JSONResponse({
"connected": tok is not None, "configured": gmail.configured(),
"connect_url": f"/inout/gmail/connect?{urlencode({'next': f'/inout/orders/{order_id}?mail=1'})}",
"callback_url": _callback_url(request), # 구글 클라우드 승인된 리디렉션 URI 에 등록해야 하는 주소(안내용)
"from": user.get("email", ""), "to": order.get("factory_email") or "", "factory": order["factory_name"],
"subject": mail["subject"], "html": mail["html"],
"sent": [{"at": m["sent_at"].strftime("%Y-%m-%d %H:%M"), "by": m["sent_by"], "to": m["to_addrs"]} for m in order["mails"]],
+2 -2
View File
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %}
{% from "inout/_macros.html" import status_badge, progress, due, n %}
{% block head_extra %}<link rel="stylesheet" href="/static/inout.css?v=20261016d" />{% endblock %}
{% block head_extra %}<link rel="stylesheet" href="/static/inout.css?v=20261016e" />{% endblock %}
{% block content %}
<section class="io">
@@ -58,4 +58,4 @@
</div>
</section>
{% endblock %}
{% block scripts %}<script src="/static/inout.js?v=20261016c" defer></script>{% endblock %}
{% block scripts %}<script src="/static/inout.js?v=20261016d" defer></script>{% endblock %}
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %}
{% from "inout/_macros.html" import status_badge, progress, due, n %}
{% block head_extra %}<link rel="stylesheet" href="/static/inout.css?v=20261016d" />{% endblock %}
{% block head_extra %}<link rel="stylesheet" href="/static/inout.css?v=20261016e" />{% endblock %}
{% block content %}
{% set active = order.status in ('open', 'partial') %}
@@ -200,4 +200,4 @@
{% endif %}
</section>
{% endblock %}
{% block scripts %}<script src="/static/inout.js?v=20261016c" defer></script>{% endblock %}
{% block scripts %}<script src="/static/inout.js?v=20261016d" defer></script>{% endblock %}
@@ -1,5 +1,5 @@
{% extends "erp_base.html" %}
{% block head_extra %}<link rel="stylesheet" href="/static/inout.css?v=20261016d" />{% endblock %}
{% block head_extra %}<link rel="stylesheet" href="/static/inout.css?v=20261016e" />{% endblock %}
{% block content %}
<section class="io">
@@ -76,4 +76,4 @@
</form>
</section>
{% endblock %}
{% block scripts %}<script src="/static/inout.js?v=20261016c" defer></script>{% endblock %}
{% block scripts %}<script src="/static/inout.js?v=20261016d" defer></script>{% endblock %}
@@ -1,6 +1,6 @@
{% extends "erp_base.html" %}
{% from "inout/_macros.html" import due, n %}
{% block head_extra %}<link rel="stylesheet" href="/static/inout.css?v=20261016d" />{% endblock %}
{% block head_extra %}<link rel="stylesheet" href="/static/inout.css?v=20261016e" />{% endblock %}
{% block content %}
<section class="io">
@@ -88,4 +88,4 @@
{% endif %}
</section>
{% endblock %}
{% block scripts %}<script src="/static/inout.js?v=20261016c" defer></script>{% endblock %}
{% block scripts %}<script src="/static/inout.js?v=20261016d" defer></script>{% endblock %}