feat: show rejected domains per company in discovery dashboard
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
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
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
601bd99559
commit
19c31876b2
@ -273,6 +273,20 @@ def admin_data_quality():
|
||||
).distinct().all()
|
||||
)
|
||||
only_rejected_ids = rejected_company_ids - active_candidate_ids
|
||||
|
||||
# Fetch rejected domains per company
|
||||
rejected_candidates = db.query(
|
||||
WebsiteDiscoveryCandidate.company_id,
|
||||
WebsiteDiscoveryCandidate.candidate_domain,
|
||||
).filter(
|
||||
WebsiteDiscoveryCandidate.status == 'rejected',
|
||||
WebsiteDiscoveryCandidate.company_id.in_(only_rejected_ids) if only_rejected_ids else False,
|
||||
).all()
|
||||
rejected_domains_map = {}
|
||||
for cid, domain in rejected_candidates:
|
||||
if domain:
|
||||
rejected_domains_map.setdefault(cid, set()).add(domain)
|
||||
|
||||
rejected_companies = []
|
||||
for cid in only_rejected_ids:
|
||||
comp = company_map.get(cid)
|
||||
@ -280,6 +294,7 @@ def admin_data_quality():
|
||||
rejected_companies.append({
|
||||
'company_name': comp.name,
|
||||
'company_id': cid,
|
||||
'domains': sorted(rejected_domains_map.get(cid, set())),
|
||||
})
|
||||
rejected_companies.sort(key=lambda x: x['company_name'])
|
||||
|
||||
|
||||
@ -753,15 +753,23 @@
|
||||
|
||||
{% if rejected_companies %}
|
||||
<div style="margin-top: var(--spacing-lg); padding: var(--spacing-md); background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius);">
|
||||
<span style="font-size: var(--font-size-sm); color: #991b1b; font-weight: 500;">
|
||||
Odrzucone przez admina ({{ rejected_companies|length }}):
|
||||
</span>
|
||||
<span style="font-size: var(--font-size-xs); color: #b91c1c;">
|
||||
{% for rc in rejected_companies %}{{ rc.company_name }}{% if not loop.last %}, {% endif %}{% endfor %}
|
||||
</span>
|
||||
<span style="font-size: var(--font-size-xs); color: #991b1b; display: block; margin-top: 4px;">
|
||||
Te firmy nie będą ponownie wyszukiwane w trybie zbiorczym.
|
||||
</span>
|
||||
<div style="font-size: var(--font-size-sm); color: #991b1b; font-weight: 500; margin-bottom: 8px;">
|
||||
Odrzucone przez admina ({{ rejected_companies|length }} firm):
|
||||
</div>
|
||||
<div style="font-size: var(--font-size-xs); color: #b91c1c;">
|
||||
{% for rc in rejected_companies %}
|
||||
<div style="margin-bottom: 4px;">
|
||||
<strong>{{ rc.company_name }}</strong>
|
||||
{% if rc.domains %}
|
||||
<span style="color: #9ca3af;"> → </span>
|
||||
<span style="color: #6b7280;">{{ rc.domains|join(', ') }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div style="font-size: var(--font-size-xs); color: #991b1b; margin-top: 8px;">
|
||||
Odrzucone domeny nie pojawią się ponownie w propozycjach.
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user