feat(membership): dates on tracker steps + fallback history from DB dates
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

This commit is contained in:
Maciej Pienczyn 2026-03-30 15:15:52 +02:00
parent 8441dc47db
commit 7c3daaa4f2

View File

@ -592,6 +592,15 @@
.tracker-step.done .tracker-label,
.tracker-step.current .tracker-label { color: #1e293b; }
.tracker-step.rejected .tracker-label { color: #dc2626; }
.tracker-date {
font-size: 10px;
color: #94a3b8;
margin-top: 2px;
text-align: center;
line-height: 1.2;
}
.tracker-step.done .tracker-date,
.tracker-step.current .tracker-date { color: #64748b; }
.tracker-line {
flex: 1;
height: 3px;
@ -1079,9 +1088,9 @@
<h2>Status deklaracji</h2>
<div class="tracker">
{% set steps = [
{'key': 'submitted', 'icon': '📝', 'label': 'Złożona'},
{'key': 'under_review', 'icon': '🔍', 'label': 'Rozpatrywana'},
{'key': 'approved', 'icon': '✅', 'label': 'Zatwierdzona'},
{'key': 'submitted', 'icon': '📝', 'label': 'Złożona', 'date': application.submitted_at},
{'key': 'under_review', 'icon': '🔍', 'label': 'Rozpatrywana', 'date': application.reviewed_at},
{'key': 'approved', 'icon': '✅', 'label': 'Zatwierdzona', 'date': application.updated_at if application.status == 'approved' else None},
] %}
{% set status_order = {'draft': 0, 'submitted': 1, 'under_review': 2, 'changes_requested': 2, 'pending_user_approval': 2, 'approved': 3, 'rejected': 3} %}
{% set current_step = status_order.get(application.status, 0) %}
@ -1104,6 +1113,9 @@
{% endif %}
</div>
<div class="tracker-label">{{ step.label }}</div>
{% if step.date %}
<div class="tracker-date">{{ step.date.strftime('%d.%m.%Y') }}<br>{{ step.date.strftime('%H:%M') }}</div>
{% endif %}
</div>
{% if not loop.last %}
@ -1133,10 +1145,41 @@
</div>
<!-- Historia zdarzeń (szczegóły) -->
{% if application.workflow_history %}
{% set has_history = application.workflow_history and application.workflow_history|length > 0 %}
{% if has_history or application.submitted_at %}
<div class="section">
<h2>Historia zdarzeń</h2>
<div class="history-list">
{% if not has_history %}
{# Fallback: generate history from available dates #}
{% if application.status in ['approved'] and application.updated_at %}
<div class="history-item">
<div class="history-dot dot-green"></div>
<div class="history-content">
<div class="history-title">Deklaracja zatwierdzona</div>
<div class="history-meta">{{ application.updated_at.strftime('%d.%m.%Y %H:%M') }}</div>
</div>
</div>
{% endif %}
{% if application.reviewed_at %}
<div class="history-item">
<div class="history-dot dot-yellow"></div>
<div class="history-content">
<div class="history-title">Rozpoczęto rozpatrywanie</div>
<div class="history-meta">{{ application.reviewed_at.strftime('%d.%m.%Y %H:%M') }}</div>
</div>
</div>
{% endif %}
{% if application.submitted_at %}
<div class="history-item">
<div class="history-dot dot-blue"></div>
<div class="history-content">
<div class="history-title">Deklaracja złożona</div>
<div class="history-meta">{{ application.submitted_at.strftime('%d.%m.%Y %H:%M') }}{% if application.user %} · {{ application.user.name }}{% endif %}</div>
</div>
</div>
{% endif %}
{% else %}
{% for event in application.workflow_history|reverse %}
<div class="history-item">
<div class="history-dot
@ -1159,6 +1202,7 @@
</div>
</div>
{% endfor %}
{% endif %}
</div>
</div>
{% endif %}