fix: descriptive messages for Instagram/Twitter/YouTube data sources
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

Replace generic "OAuth API niedostępne" with platform-specific
instructions explaining what's needed to fetch data:
- Instagram: 3-step guide (Business account, FB link, OAuth)
- Twitter/YouTube: note that data is fetched automatically
- Facebook: prompt to connect OAuth

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-03-12 14:40:16 +01:00
parent bc18999f28
commit 0394f9f17d
2 changed files with 22 additions and 2 deletions

View File

@ -1033,7 +1033,15 @@ def _run_enrichment_background(company_ids, platforms_filter=None):
else:
profile_result['reason'] = 'Facebook blokuje dostęp publiczny. Podłącz Graph API (OAuth), aby pobierać dane.'
elif platform_name == 'instagram':
profile_result['reason'] = 'Instagram wymaga logowania. Podłącz Meta API (OAuth), aby pobierać dane.'
profile_result['reason'] = (
'Instagram blokuje publiczny dostęp do danych. '
'Aby pobierać statystyki (obserwujący, posty, zaangażowanie), wymagane są 3 kroki: '
'(1) konto Instagram musi być typu Business lub Creator (nie prywatne), '
'(2) konto Instagram musi być powiązane ze stroną Facebook firmy '
'(Ustawienia strony FB → Instagram), '
'(3) firma musi mieć podłączony Facebook OAuth na nordabiznes.pl '
'z uprawnieniem instagram_basic.'
)
elif platform_name == 'linkedin':
profile_result['reason'] = 'LinkedIn blokuje boty (3 próby z opóźnieniem). Wyniki mogą się różnić między skanami.'
else:

View File

@ -1036,7 +1036,19 @@
{% else %}
<div class="oauth-prompt" style="background: #f9fafb; border-color: #e5e7eb;">
<svg width="14" height="14" fill="none" stroke="#9ca3af" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
<span style="color: var(--text-secondary);">OAuth API niedostępne dla {{ p.platform|capitalize }}. Dane pochodzą ze scrapingu publicznych profili.</span>
<span style="color: var(--text-secondary);">
{% if p.platform == 'instagram' %}
Dane Instagram wymagają połączenia z Meta API. Aby pobierać statystyki: (1) konto IG musi być typu Business/Creator, (2) musi być powiązane ze stroną Facebook firmy, (3) firma musi mieć podłączony Facebook OAuth na portalu.
{% elif p.platform == 'twitter' %}
Dane pobierane automatycznie przez Twitter API (bez OAuth). Uruchom skan, aby pobrać aktualne statystyki.
{% elif p.platform == 'youtube' %}
Dane pobierane automatycznie przez YouTube Data API v3 (bez OAuth). Uruchom skan, aby pobrać aktualne statystyki.
{% elif p.platform == 'facebook' %}
Facebook blokuje publiczny dostęp. Podłącz Graph API (OAuth) w ustawieniach firmy, aby pobierać dane.
{% else %}
OAuth API niedostępne dla {{ p.platform|capitalize }}. Dane pochodzą ze scrapingu publicznych profili.
{% endif %}
</span>
</div>
{% endif %}
</div>