mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-20 09:53:06 +00:00
B91 — Mount drawer search only when expanded; unify body export
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
This commit is contained in:
parent
5ec167f8dc
commit
c73034aa77
3 changed files with 5 additions and 7 deletions
|
|
@ -2,10 +2,9 @@
|
||||||
|
|
||||||
import type { ReactNode } from 'react'
|
import type { ReactNode } from 'react'
|
||||||
|
|
||||||
import { CampaignGlobalSearchProvider } from '@/components/campaign/dashboard/CampaignGlobalSearchMount'
|
import { CampaignGlobalSearchBody, CampaignGlobalSearchProvider } from '@/components/campaign/dashboard/CampaignGlobalSearchMount'
|
||||||
import { CampaignHomeLayout } from '@/components/campaign/dashboard/CampaignHomeLayout'
|
import { CampaignHomeLayout } from '@/components/campaign/dashboard/CampaignHomeLayout'
|
||||||
import { CampaignHomeSearch } from '@/components/campaign/dashboard/CampaignHomeSearch'
|
import { CampaignHomeSearch } from '@/components/campaign/dashboard/CampaignHomeSearch'
|
||||||
import { CampaignStaffGlobalSearchBody } from '@/components/campaign/dashboard/CampaignStaffGlobalSearch'
|
|
||||||
import { useHomeSearch } from '@/components/campaign/dashboard/HomeSearchContext'
|
import { useHomeSearch } from '@/components/campaign/dashboard/HomeSearchContext'
|
||||||
import {
|
import {
|
||||||
HomeSearchResultsProvider,
|
HomeSearchResultsProvider,
|
||||||
|
|
@ -45,7 +44,7 @@ const CampaignHomeStaffChromeInner = ({
|
||||||
searchResults ? (
|
searchResults ? (
|
||||||
<CampaignHomeStaffSearchSlot searchResults={searchResults} />
|
<CampaignHomeStaffSearchSlot searchResults={searchResults} />
|
||||||
) : (
|
) : (
|
||||||
<CampaignStaffGlobalSearchBody />
|
<CampaignGlobalSearchBody />
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
summarySlot={summarySlot}
|
summarySlot={summarySlot}
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ export const CampaignQuickActionsDrawer = ({
|
||||||
) : (
|
) : (
|
||||||
<p className="text-sm text-muted-foreground">Nenhuma ação rápida nesta página.</p>
|
<p className="text-sm text-muted-foreground">Nenhuma ação rápida nesta página.</p>
|
||||||
)}
|
)}
|
||||||
<CampaignGlobalSearchMount />
|
{expanded ? <CampaignGlobalSearchMount /> : null}
|
||||||
</div>
|
</div>
|
||||||
</DrawerContent>
|
</DrawerContent>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
|
|
|
||||||
|
|
@ -34,12 +34,11 @@ describe('CampaignQuickActionsDrawer (B91)', () => {
|
||||||
|
|
||||||
render(<CampaignQuickActionsDrawer actions={[]} />)
|
render(<CampaignQuickActionsDrawer actions={[]} />)
|
||||||
|
|
||||||
const context = document.getElementById('quickActionContext')
|
expect(screen.queryByLabelText('Buscar na campanha')).toBeNull()
|
||||||
expect(context?.className).toContain('hidden')
|
|
||||||
expect(context?.getAttribute('data-snap')).toBe('collapsed')
|
|
||||||
|
|
||||||
fireEvent.click(screen.getByRole('button', { name: 'Mostrar ações rápidas' }))
|
fireEvent.click(screen.getByRole('button', { name: 'Mostrar ações rápidas' }))
|
||||||
|
|
||||||
|
const context = document.getElementById('quickActionContext')
|
||||||
expect(context?.className).not.toContain('hidden')
|
expect(context?.className).not.toContain('hidden')
|
||||||
expect(context?.getAttribute('data-snap')).toBe('expanded')
|
expect(context?.getAttribute('data-snap')).toBe('expanded')
|
||||||
expect(screen.getByLabelText('Buscar na campanha')).toBeTruthy()
|
expect(screen.getByLabelText('Buscar na campanha')).toBeTruthy()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue