mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-23 06:33:06 +00:00
style: prettier (C11 touched files)
This commit is contained in:
parent
f394c76432
commit
2ac6f4c8fa
3 changed files with 40 additions and 37 deletions
|
|
@ -149,46 +149,46 @@ export const ActivityOverviewTab = ({
|
||||||
<Link href={`/campanha/demandas?activity=${view.id}`}>Ver todas</Link>
|
<Link href={`/campanha/demandas?activity=${view.id}`}>Ver todas</Link>
|
||||||
</Button>
|
</Button>
|
||||||
) : null}
|
) : null}
|
||||||
{view.municipality ? (
|
{view.municipality ? (
|
||||||
<Button asChild variant="outline" className="min-h-11 shrink-0">
|
<Button asChild variant="outline" className="min-h-11 shrink-0">
|
||||||
<Link
|
<Link
|
||||||
href={`/campanha/demandas/nova?activity=${view.id}&municipality=${view.municipality.id}`}
|
href={`/campanha/demandas/nova?activity=${view.id}&municipality=${view.municipality.id}`}
|
||||||
>
|
>
|
||||||
<PlusIcon data-icon="inline-start" aria-hidden="true" />
|
<PlusIcon data-icon="inline-start" aria-hidden="true" />
|
||||||
Adicionar demanda
|
Adicionar demanda
|
||||||
</Link>
|
</Link>
|
||||||
</Button>
|
</Button>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="flex flex-col gap-4">
|
<CardContent className="flex flex-col gap-4">
|
||||||
{view.demands.length ? (
|
{view.demands.length ? (
|
||||||
<>
|
<>
|
||||||
<ul role="list" className="divide-y">
|
<ul role="list" className="divide-y">
|
||||||
{view.demands.map((demand) => (
|
{view.demands.map((demand) => (
|
||||||
<li
|
<li
|
||||||
key={demand.id}
|
key={demand.id}
|
||||||
className="flex flex-col gap-2 py-3 first:pt-0 last:pb-0 sm:flex-row sm:items-center sm:justify-between"
|
className="flex flex-col gap-2 py-3 first:pt-0 last:pb-0 sm:flex-row sm:items-center sm:justify-between"
|
||||||
>
|
>
|
||||||
<div className="min-w-0">
|
<div className="min-w-0">
|
||||||
<Link
|
<Link
|
||||||
href={`/campanha/demandas/${demand.slug}`}
|
href={`/campanha/demandas/${demand.slug}`}
|
||||||
className="font-medium text-primary underline-offset-4 hover:underline"
|
className="font-medium text-primary underline-offset-4 hover:underline"
|
||||||
>
|
>
|
||||||
{demand.title}
|
{demand.title}
|
||||||
</Link>
|
</Link>
|
||||||
<p className="text-sm text-muted-foreground">
|
<p className="text-sm text-muted-foreground">
|
||||||
{campaignDemandKindLabels[demand.kind]} ·{' '}
|
{campaignDemandKindLabels[demand.kind]} ·{' '}
|
||||||
{campaignDemandStatusLabels[demand.status]}
|
{campaignDemandStatusLabels[demand.status]}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<span className="text-sm text-muted-foreground">
|
<span className="text-sm text-muted-foreground">
|
||||||
{demand.cost == null
|
{demand.cost == null
|
||||||
? 'Custo não registrado'
|
? 'Custo não registrado'
|
||||||
: currencyFormatter.format(demand.cost)}
|
: currencyFormatter.format(demand.cost)}
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
<CampaignListPagination
|
<CampaignListPagination
|
||||||
page={view.page}
|
page={view.page}
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@ import { NativeSelect, NativeSelectOption } from '@/components/ui/native-select'
|
||||||
import { Spinner } from '@/components/ui/Spinner'
|
import { Spinner } from '@/components/ui/Spinner'
|
||||||
import { Textarea } from '@/components/ui/textarea'
|
import { Textarea } from '@/components/ui/textarea'
|
||||||
import { campaignDemandKindLabels, campaignDemandKinds } from '@/lib/schemas/campaignDemand'
|
import { campaignDemandKindLabels, campaignDemandKinds } from '@/lib/schemas/campaignDemand'
|
||||||
|
import type { ActivityRelationOption } from '@/utilities/activityRelationOptions'
|
||||||
import type { CampaignFormActionState } from '@/utilities/campaignFormActionError'
|
import type { CampaignFormActionState } from '@/utilities/campaignFormActionError'
|
||||||
import { fieldError } from '@/utilities/campaignFormFields'
|
import { fieldError } from '@/utilities/campaignFormFields'
|
||||||
import type { ActivityRelationOption } from '@/utilities/activityRelationOptions'
|
|
||||||
|
|
||||||
type DemandFormProps = {
|
type DemandFormProps = {
|
||||||
municipalityOptions: RelationOption[]
|
municipalityOptions: RelationOption[]
|
||||||
|
|
@ -50,7 +50,10 @@ export const DemandForm = ({
|
||||||
(query: string) => searchActivities(query, parsedMunicipalityId),
|
(query: string) => searchActivities(query, parsedMunicipalityId),
|
||||||
[parsedMunicipalityId, searchActivities],
|
[parsedMunicipalityId, searchActivities],
|
||||||
)
|
)
|
||||||
const activityQueryReady = useCallback(() => parsedMunicipalityId !== null, [parsedMunicipalityId])
|
const activityQueryReady = useCallback(
|
||||||
|
() => parsedMunicipalityId !== null,
|
||||||
|
[parsedMunicipalityId],
|
||||||
|
)
|
||||||
|
|
||||||
const activityFieldDescription = parsedMunicipalityId
|
const activityFieldDescription = parsedMunicipalityId
|
||||||
? 'Opcional. Busque atividades do município selecionado.'
|
? 'Opcional. Busque atividades do município selecionado.'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
|
|
||||||
import { ACTIVITY_RELATION_SEARCH_LIMIT } from '@/utilities/activityRelationOptions'
|
|
||||||
import { ACTIVITY_LINKED_DEMANDS_PAGE_SIZE } from '@/utilities/activityDetailPageData'
|
import { ACTIVITY_LINKED_DEMANDS_PAGE_SIZE } from '@/utilities/activityDetailPageData'
|
||||||
|
import { ACTIVITY_RELATION_SEARCH_LIMIT } from '@/utilities/activityRelationOptions'
|
||||||
import { parseDemandListParams } from '@/utilities/campaignDemandData'
|
import { parseDemandListParams } from '@/utilities/campaignDemandData'
|
||||||
|
|
||||||
describe('activityRelationOptions', () => {
|
describe('activityRelationOptions', () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue