mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-12 22:13:05 +00:00
format: Prettier
This commit is contained in:
parent
d200a1b012
commit
cf09cb548d
3 changed files with 10 additions and 16 deletions
|
|
@ -30,6 +30,7 @@ flowchart LR
|
|||
**Opções consideradas:** A | B | C
|
||||
**Recomendação:** **A** — módulo novo `supporterQuickActions.ts` espelhando `campaignAdvisorQuickActions.ts` (B87), com superfície lista+detalhe, catálogo de 2 launchers, import gated a coordinator; registro no registry central; testes unit espelhando B87/B85.
|
||||
**Rejeitadas:**
|
||||
|
||||
- **B — superfície inclui `/apoiadores/novo` e `/apoiadores/importar` com o mesmo catálogo:** redundante (a página já é o próprio formulário/wizard); precedente B85 exclui `nova` do detalhe e deixa a página de form com FAB só-busca. Rejeitada.
|
||||
- **C — "Importar CSV" para todo staff (`isUnrestrictedCampaignRole`):** espelha a intenção mas NÃO o gate de servidor — `importar/page.tsx` redireciona não-coordinator para `/apoiadores`; o launcher levaria advisor/candidate a um redirect. O drawer deve espelhar o gate da página (coordinator-only), como o botão "Importar CSV" da lista faz.
|
||||
- **D — catálogo com A1–A5 do Início (prefill de município):** rejeitado pela própria intenção (questão em aberto → recomendação A) e não há município garantido no contexto da ficha de apoiador.
|
||||
|
|
|
|||
|
|
@ -261,9 +261,7 @@ describe('campaignQuickActionRegistry', () => {
|
|||
})
|
||||
|
||||
it('returns empty catalog for unregistered paths', () => {
|
||||
expect(resolveQuickActionsForPath('/campanha/lugar-inexistente', 'coordinator', {})).toEqual(
|
||||
[],
|
||||
)
|
||||
expect(resolveQuickActionsForPath('/campanha/lugar-inexistente', 'coordinator', {})).toEqual([])
|
||||
})
|
||||
|
||||
it('returns empty catalog on conceitos and perfil for staff (B90)', () => {
|
||||
|
|
@ -390,7 +388,11 @@ describe('campaignQuickActionRegistry', () => {
|
|||
const listTrailingSlash = resolveQuickActionsForPath('/campanha/apoiadores/', 'advisor', {})
|
||||
expect(listTrailingSlash.map((action) => action.id)).toEqual(['register-supporter'])
|
||||
|
||||
const detailTrailingSlash = resolveQuickActionsForPath('/campanha/apoiadores/9/', 'candidate', {})
|
||||
const detailTrailingSlash = resolveQuickActionsForPath(
|
||||
'/campanha/apoiadores/9/',
|
||||
'candidate',
|
||||
{},
|
||||
)
|
||||
expect(detailTrailingSlash.map((action) => action.id)).toEqual(['register-supporter'])
|
||||
|
||||
expect(resolveQuickActionsForPath('/campanha/apoiadores', 'leader', {})).toEqual([])
|
||||
|
|
|
|||
|
|
@ -33,10 +33,7 @@ describe('supporterQuickActions paths', () => {
|
|||
describe('resolveSupporterListQuickActions', () => {
|
||||
it('returns register-supporter + import-supporters for coordinator', () => {
|
||||
const actions = resolveSupporterListQuickActions('coordinator')
|
||||
expect(actions.map((action) => action.id)).toEqual([
|
||||
'register-supporter',
|
||||
'import-supporters',
|
||||
])
|
||||
expect(actions.map((action) => action.id)).toEqual(['register-supporter', 'import-supporters'])
|
||||
expect(actions[0]?.href).toBe(SUPPORTER_CREATE_HREF)
|
||||
expect(actions[1]?.href).toBe(SUPPORTER_IMPORT_HREF)
|
||||
})
|
||||
|
|
@ -70,16 +67,10 @@ describe('resolveSupporterDetailQuickActions', () => {
|
|||
describe('resolveSupporterQuickActionsForPath', () => {
|
||||
it('delegates list and detail catalogs (B86)', () => {
|
||||
const list = resolveSupporterQuickActionsForPath('/campanha/apoiadores', 'coordinator', {})
|
||||
expect(list.map((action) => action.id)).toEqual([
|
||||
'register-supporter',
|
||||
'import-supporters',
|
||||
])
|
||||
expect(list.map((action) => action.id)).toEqual(['register-supporter', 'import-supporters'])
|
||||
|
||||
const detail = resolveSupporterQuickActionsForPath('/campanha/apoiadores/7', 'coordinator', {})
|
||||
expect(detail.map((action) => action.id)).toEqual([
|
||||
'register-supporter',
|
||||
'import-supporters',
|
||||
])
|
||||
expect(detail.map((action) => action.id)).toEqual(['register-supporter', 'import-supporters'])
|
||||
})
|
||||
|
||||
it('returns empty catalog on form and wizard pages (search-only FAB)', () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue