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