mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-23 16:13:04 +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
|
**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.
|
**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:**
|
**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.
|
- **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.
|
- **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.
|
- **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', () => {
|
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)', () => {
|
it('returns empty catalog on conceitos and perfil for staff (B90)', () => {
|
||||||
|
|
@ -390,7 +388,11 @@ describe('campaignQuickActionRegistry', () => {
|
||||||
const listTrailingSlash = resolveQuickActionsForPath('/campanha/apoiadores/', 'advisor', {})
|
const listTrailingSlash = resolveQuickActionsForPath('/campanha/apoiadores/', 'advisor', {})
|
||||||
expect(listTrailingSlash.map((action) => action.id)).toEqual(['register-supporter'])
|
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(detailTrailingSlash.map((action) => action.id)).toEqual(['register-supporter'])
|
||||||
|
|
||||||
expect(resolveQuickActionsForPath('/campanha/apoiadores', 'leader', {})).toEqual([])
|
expect(resolveQuickActionsForPath('/campanha/apoiadores', 'leader', {})).toEqual([])
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,7 @@ describe('supporterQuickActions paths', () => {
|
||||||
describe('resolveSupporterListQuickActions', () => {
|
describe('resolveSupporterListQuickActions', () => {
|
||||||
it('returns register-supporter + import-supporters for coordinator', () => {
|
it('returns register-supporter + import-supporters for coordinator', () => {
|
||||||
const actions = resolveSupporterListQuickActions('coordinator')
|
const actions = resolveSupporterListQuickActions('coordinator')
|
||||||
expect(actions.map((action) => action.id)).toEqual([
|
expect(actions.map((action) => action.id)).toEqual(['register-supporter', 'import-supporters'])
|
||||||
'register-supporter',
|
|
||||||
'import-supporters',
|
|
||||||
])
|
|
||||||
expect(actions[0]?.href).toBe(SUPPORTER_CREATE_HREF)
|
expect(actions[0]?.href).toBe(SUPPORTER_CREATE_HREF)
|
||||||
expect(actions[1]?.href).toBe(SUPPORTER_IMPORT_HREF)
|
expect(actions[1]?.href).toBe(SUPPORTER_IMPORT_HREF)
|
||||||
})
|
})
|
||||||
|
|
@ -70,16 +67,10 @@ describe('resolveSupporterDetailQuickActions', () => {
|
||||||
describe('resolveSupporterQuickActionsForPath', () => {
|
describe('resolveSupporterQuickActionsForPath', () => {
|
||||||
it('delegates list and detail catalogs (B86)', () => {
|
it('delegates list and detail catalogs (B86)', () => {
|
||||||
const list = resolveSupporterQuickActionsForPath('/campanha/apoiadores', 'coordinator', {})
|
const list = resolveSupporterQuickActionsForPath('/campanha/apoiadores', 'coordinator', {})
|
||||||
expect(list.map((action) => action.id)).toEqual([
|
expect(list.map((action) => action.id)).toEqual(['register-supporter', 'import-supporters'])
|
||||||
'register-supporter',
|
|
||||||
'import-supporters',
|
|
||||||
])
|
|
||||||
|
|
||||||
const detail = resolveSupporterQuickActionsForPath('/campanha/apoiadores/7', 'coordinator', {})
|
const detail = resolveSupporterQuickActionsForPath('/campanha/apoiadores/7', 'coordinator', {})
|
||||||
expect(detail.map((action) => action.id)).toEqual([
|
expect(detail.map((action) => action.id)).toEqual(['register-supporter', 'import-supporters'])
|
||||||
'register-supporter',
|
|
||||||
'import-supporters',
|
|
||||||
])
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('returns empty catalog on form and wizard pages (search-only FAB)', () => {
|
it('returns empty catalog on form and wizard pages (search-only FAB)', () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue