mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 06:43:06 +00:00
Board "Acompanhe de perto" (S1+S2) ganha o feed automático do perfil oficial: loader irmão src/utilities/socialFeed/instagramFeed.ts (Graph API /media com children p/ carrossel + username, unstable_cache tag social-feed + revalidate 300, snapshot cru pré-exclusão persistido via SQL direto, refresh de token automático com retry 1x — refresh endpoint só renova tokens de Instagram Login, page tokens caem no fail-closed), global SocialFeedSettings estendida (instagramEnabled/AccessToken/UserId/MaxItems + snapshot hidden; excludedItems já cobria a plataforma desde a S2). Requisito nº 1 — picker de exclusão no admin (primeiro componente custom do repo, campo ui + importmap): lista os posts do snapshot com thumbnail e toggle "Não exibir" que escreve em excludedItems. Card com coverAspect square (1:1 do rascunho), badge Instagram, título = legenda com fallback para post sem legenda, clique no permalink (noopener), link "Seguir no Instagram →" derivado do username. Os feeds externos mudam para o subfolder socialFeed/ (pin da S2 previa). Migration 20260818_192948_add_instagram_social_feed_fields (não destrutiva). Stub IG no webServer (porta dev+2000, helper socialStub.ts) + 3 e2e novos no describe serial + kill switch estendido + smoke do picker no admin. Closes #20
17 lines
874 B
TypeScript
17 lines
874 B
TypeScript
/**
|
|
* Port/URL of the social-feed stubs the e2e board (S2 YouTube, S3 Instagram)
|
|
* fetches. The single spelling of the derivation: dev servers live in
|
|
* 3100..4099 (worktree slots, capped at 999), so the offsets never collide
|
|
* with another worktree's dev server or with each other; CI stays on 4000
|
|
* (YouTube) and 5000 (Instagram). Shared by playwright.config.ts (webServer +
|
|
* env) and the frontend spec (state switches) so the two cannot drift apart.
|
|
*/
|
|
export const youtubeStubUrlFor = (baseURL: string): string => {
|
|
const port = new URL(baseURL).port || (baseURL.startsWith('https:') ? '443' : '80')
|
|
return `http://localhost:${Number(port) + 1000}`
|
|
}
|
|
|
|
export const instagramStubUrlFor = (baseURL: string): string => {
|
|
const port = new URL(baseURL).port || (baseURL.startsWith('https:') ? '443' : '80')
|
|
return `http://localhost:${Number(port) + 2000}`
|
|
}
|