mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-12 22:13:05 +00:00
chore: prettier format (B109)
This commit is contained in:
parent
490d5deeb7
commit
fcd0206da6
5 changed files with 16 additions and 16 deletions
|
|
@ -14,8 +14,8 @@ import { useHomeSearch } from '@/components/campaign/dashboard/HomeSearchContext
|
|||
import { useHomeSearchExcludeContext } from '@/components/campaign/dashboard/HomeSearchExcludeContext'
|
||||
import type { HomeSearchSuccessResponse } from '@/lib/campaignHomeSearchHits'
|
||||
import { HOME_SEARCH_GENERIC_ERROR_MESSAGE } from '@/lib/campaignHomeSearchMessages'
|
||||
import { filterHomeSearchResponseForContext } from '@/lib/homeSearchExcludeCurrentEntity'
|
||||
import { postCampaignJson } from '@/lib/campaignJsonRequest'
|
||||
import { filterHomeSearchResponseForContext } from '@/lib/homeSearchExcludeCurrentEntity'
|
||||
|
||||
const HOME_SEARCH_ROUTE = '/campanha/home-search'
|
||||
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ import { usePathname } from 'next/navigation'
|
|||
import { useCallback, useEffect } from 'react'
|
||||
|
||||
import { CampaignGlobalSearchBody } from '@/components/campaign/dashboard/CampaignGlobalSearchMount'
|
||||
import { HomeSearchExcludeProvider } from '@/components/campaign/dashboard/HomeSearchExcludeContext'
|
||||
import { CampaignHomeActionStrip } from '@/components/campaign/dashboard/CampaignHomeActionStrip'
|
||||
import { useHomeSearch } from '@/components/campaign/dashboard/HomeSearchContext'
|
||||
import { HomeSearchExcludeProvider } from '@/components/campaign/dashboard/HomeSearchExcludeContext'
|
||||
import { useCampaignQuickActionContext } from '@/components/campaign/shell/CampaignQuickActionContext'
|
||||
import { useCampaignQuickActionsSnap } from '@/components/campaign/shell/CampaignQuickActionsSnapContext'
|
||||
import { Drawer, DrawerContent, DrawerTitle } from '@/components/ui/Drawer'
|
||||
|
|
@ -116,9 +116,7 @@ export const CampaignQuickActionsDrawer = ({
|
|||
aria-expanded={isDock || isFull}
|
||||
aria-controls="quickActionContext"
|
||||
className="flex w-full shrink-0 cursor-grab flex-col items-center border-0 bg-transparent px-4 pt-2 pb-0.5 active:cursor-grabbing"
|
||||
aria-label={
|
||||
isDock || isFull ? 'Ocultar ações rápidas' : 'Mostrar ações rápidas'
|
||||
}
|
||||
aria-label={isDock || isFull ? 'Ocultar ações rápidas' : 'Mostrar ações rápidas'}
|
||||
>
|
||||
<span aria-hidden className="mb-1 block h-1 w-12 rounded-full bg-muted" />
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { HomeSearchSuccessResponse } from '@/lib/campaignHomeSearchHits'
|
||||
import { parseAdvisorDetailId } from '@/lib/campaignAdvisorQuickActions'
|
||||
import type { HomeSearchSuccessResponse } from '@/lib/campaignHomeSearchHits'
|
||||
import { parseMunicipalityDetailSlug } from '@/lib/campaignMunicipalityQuickActions'
|
||||
import type { CampaignQuickActionContext } from '@/lib/campaignQuickActionContext'
|
||||
import { isDemandDetailPath } from '@/lib/campaignQuickActionDemands'
|
||||
|
|
@ -47,11 +47,11 @@ export const resolveHomeSearchExcludeContext = (
|
|||
const hasExcludeTarget = (context: CampaignQuickActionContext): boolean =>
|
||||
Boolean(
|
||||
context.municipalitySlug ||
|
||||
context.leadershipId !== undefined ||
|
||||
context.organizationSlug ||
|
||||
context.activitySlug ||
|
||||
context.demandSlug ||
|
||||
context.advisorId !== undefined,
|
||||
context.leadershipId !== undefined ||
|
||||
context.organizationSlug ||
|
||||
context.activitySlug ||
|
||||
context.demandSlug ||
|
||||
context.advisorId !== undefined,
|
||||
)
|
||||
|
||||
export const filterHomeSearchResponseForContext = (
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import type { ReactNode } from 'react'
|
|||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
import { CampaignGlobalSearchProvider } from '@/components/campaign/dashboard/CampaignGlobalSearchMount'
|
||||
import { CampaignQuickActionsDrawer } from '@/components/campaign/shell/CampaignQuickActionsDrawer'
|
||||
import { CampaignQuickActionContextProvider } from '@/components/campaign/shell/CampaignQuickActionContext'
|
||||
import { CampaignQuickActionsDrawer } from '@/components/campaign/shell/CampaignQuickActionsDrawer'
|
||||
import { CampaignContentScroll } from '@/components/campaign/shell/CampaignQuickActionsHost'
|
||||
import {
|
||||
CampaignQuickActionsSnapProvider,
|
||||
|
|
|
|||
|
|
@ -29,7 +29,9 @@ const sampleResponse = (): HomeSearchSuccessResponse => ({
|
|||
],
|
||||
territories: [],
|
||||
advisors: [{ id: 9, name: 'Assessor', phone: null, municipalityCount: 2 }],
|
||||
leaderships: [{ kind: 'leadership', id: 42, name: 'Líder', phone: null, municipalitiesSummary: '' }],
|
||||
leaderships: [
|
||||
{ kind: 'leadership', id: 42, name: 'Líder', phone: null, municipalitiesSummary: '' },
|
||||
],
|
||||
stateDeputies: [],
|
||||
activities: [{ id: 1, slug: 'comicio', title: 'Comício', secondary: '' }],
|
||||
demands: [{ id: 2, slug: 'pedido', title: 'Pedido', secondary: '' }],
|
||||
|
|
@ -37,9 +39,9 @@ const sampleResponse = (): HomeSearchSuccessResponse => ({
|
|||
|
||||
describe('homeSearchExcludeCurrentEntity (B109)', () => {
|
||||
it('merges municipality slug from pathname when context is empty', () => {
|
||||
expect(
|
||||
resolveHomeSearchExcludeContext('/campanha/municipios/cairu', {}).municipalitySlug,
|
||||
).toBe('cairu')
|
||||
expect(resolveHomeSearchExcludeContext('/campanha/municipios/cairu', {}).municipalitySlug).toBe(
|
||||
'cairu',
|
||||
)
|
||||
})
|
||||
|
||||
it('filters the current municipality from suggest and search hits', () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue