mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 15:13:07 +00:00
B81 — format
This commit is contained in:
parent
7f2ac29368
commit
09e76ec8cb
4 changed files with 7 additions and 14 deletions
|
|
@ -128,10 +128,7 @@ export const UNCOVERED_MUNICIPALITIES_LIST_HREF =
|
|||
'/campanha/municipios?coverage=sem_assessor&sort=votos' as const
|
||||
|
||||
/** Staff Início catalog with hrefs — shared by quick-action registries (B81+). */
|
||||
const staffHomeQuickActionsByRole = new Map<
|
||||
CampaignRole,
|
||||
readonly ResolvedCampaignHomeAction[]
|
||||
>()
|
||||
const staffHomeQuickActionsByRole = new Map<CampaignRole, readonly ResolvedCampaignHomeAction[]>()
|
||||
|
||||
export const resolveStaffHomeQuickActions = (
|
||||
role: CampaignRole,
|
||||
|
|
|
|||
|
|
@ -2,13 +2,12 @@ import {
|
|||
resolveStaffHomeQuickActions,
|
||||
type ResolvedCampaignHomeAction,
|
||||
} from '@/lib/campaignHomeActions'
|
||||
import type { CampaignQuickActionContext } from '@/lib/campaignQuickActionContext'
|
||||
import { CAMPAIGN_TERRITORIES_HOME } from '@/lib/campaignPaths'
|
||||
import type { CampaignQuickActionContext } from '@/lib/campaignQuickActionContext'
|
||||
import type { CampaignRole } from '@/lib/campaignRoles'
|
||||
|
||||
const isTerritoriesListPath = (pathname: string): boolean =>
|
||||
pathname === CAMPAIGN_TERRITORIES_HOME ||
|
||||
pathname.startsWith(`${CAMPAIGN_TERRITORIES_HOME}/`)
|
||||
pathname === CAMPAIGN_TERRITORIES_HOME || pathname.startsWith(`${CAMPAIGN_TERRITORIES_HOME}/`)
|
||||
|
||||
/**
|
||||
* Pathname + role + page context → contextual quick actions.
|
||||
|
|
|
|||
|
|
@ -73,8 +73,8 @@ describe('toHomeActionButtonProps', () => {
|
|||
|
||||
describe('UNCOVERED_MUNICIPALITIES_LIST_HREF', () => {
|
||||
it('matches canonical municipality list builder (client/server parity)', () => {
|
||||
expect(
|
||||
buildMunicipalityListHref({ page: 1, coverage: 'sem_assessor', sort: 'votos' }, 1),
|
||||
).toBe(UNCOVERED_MUNICIPALITIES_LIST_HREF)
|
||||
expect(buildMunicipalityListHref({ page: 1, coverage: 'sem_assessor', sort: 'votos' }, 1)).toBe(
|
||||
UNCOVERED_MUNICIPALITIES_LIST_HREF,
|
||||
)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import { UNCOVERED_MUNICIPALITIES_LIST_HREF, homeActionsForRole } from '@/lib/campaignHomeActions'
|
||||
import {
|
||||
isCampaignActionsPath,
|
||||
isCampaignHomePath,
|
||||
|
|
@ -12,10 +13,6 @@ import {
|
|||
QUICK_ACTIONS_SNAP_EXPANDED,
|
||||
quickActionsSnapIsExpanded,
|
||||
} from '@/lib/campaignQuickActionSnap'
|
||||
import {
|
||||
UNCOVERED_MUNICIPALITIES_LIST_HREF,
|
||||
homeActionsForRole,
|
||||
} from '@/lib/campaignHomeActions'
|
||||
|
||||
describe('campaignQuickActionMount', () => {
|
||||
it('treats Início as exact match only', () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue