mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-26 21:53:06 +00:00
B121 — format
This commit is contained in:
parent
9d8dcbbea4
commit
bf042c3217
2 changed files with 19 additions and 9 deletions
|
|
@ -8,21 +8,21 @@ import {
|
||||||
updateLeadershipWizard,
|
updateLeadershipWizard,
|
||||||
} from '@/app/(campaign)/campanha/actions/leadership'
|
} from '@/app/(campaign)/campanha/actions/leadership'
|
||||||
import { declareVotes } from '@/app/(campaign)/campanha/actions/votePledge'
|
import { declareVotes } from '@/app/(campaign)/campanha/actions/votePledge'
|
||||||
|
import { WIZARD_LEADERSHIP_VOTES_SAVED } from '@/lib/campaignWizardCopy'
|
||||||
import {
|
import {
|
||||||
optionalFormText,
|
optionalFormText,
|
||||||
requiredFormText,
|
requiredFormText,
|
||||||
requiredIntegerFormValue,
|
requiredIntegerFormValue,
|
||||||
requiredRelationshipFormValue,
|
requiredRelationshipFormValue,
|
||||||
} from '@/lib/formData'
|
} from '@/lib/formData'
|
||||||
import { MAX_VOTE_COUNT } from '@/lib/schemas/primitives'
|
|
||||||
import { WIZARD_LEADERSHIP_VOTES_SAVED } from '@/lib/campaignWizardCopy'
|
|
||||||
import { VOTE_PLEDGE_DECLARE_SAFE_MESSAGES } from '@/lib/schemas/votePledge'
|
|
||||||
import {
|
import {
|
||||||
LEADERSHIP_DUPLICATE_MESSAGE,
|
LEADERSHIP_DUPLICATE_MESSAGE,
|
||||||
LEADERSHIP_INVALID_CONTACT_MESSAGE,
|
LEADERSHIP_INVALID_CONTACT_MESSAGE,
|
||||||
LEADERSHIP_MUNICIPALITY_SCOPE_MESSAGE,
|
LEADERSHIP_MUNICIPALITY_SCOPE_MESSAGE,
|
||||||
isSupportStatus,
|
isSupportStatus,
|
||||||
} from '@/lib/schemas/leadership'
|
} from '@/lib/schemas/leadership'
|
||||||
|
import { MAX_VOTE_COUNT } from '@/lib/schemas/primitives'
|
||||||
|
import { VOTE_PLEDGE_DECLARE_SAFE_MESSAGES } from '@/lib/schemas/votePledge'
|
||||||
import {
|
import {
|
||||||
runCampaignFormAction,
|
runCampaignFormAction,
|
||||||
type CampaignFormActionState,
|
type CampaignFormActionState,
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,19 @@
|
||||||
|
|
||||||
import { CheckIcon, InfoIcon, PlusIcon, TriangleAlertIcon } from 'lucide-react'
|
import { CheckIcon, InfoIcon, PlusIcon, TriangleAlertIcon } from 'lucide-react'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
import { useActionState, useCallback, useEffect, useMemo, useRef, useState, useTransition } from 'react'
|
import {
|
||||||
|
useActionState,
|
||||||
|
useCallback,
|
||||||
|
useEffect,
|
||||||
|
useMemo,
|
||||||
|
useRef,
|
||||||
|
useState,
|
||||||
|
useTransition,
|
||||||
|
} from 'react'
|
||||||
import { toast } from 'sonner'
|
import { toast } from 'sonner'
|
||||||
|
|
||||||
import type { LeadershipListSupportStatusResponse } from '@/app/(campaign)/campanha/(app)/liderancas/support-status/types'
|
|
||||||
import { declareVotesWizardFormAction } from '@/app/(campaign)/campanha/(app)/acoes/wizardLeadershipFormActions'
|
import { declareVotesWizardFormAction } from '@/app/(campaign)/campanha/(app)/acoes/wizardLeadershipFormActions'
|
||||||
|
import type { LeadershipListSupportStatusResponse } from '@/app/(campaign)/campanha/(app)/liderancas/support-status/types'
|
||||||
import { SupportStatusBadge } from '@/components/campaign/leadership/SupportStatusBadge'
|
import { SupportStatusBadge } from '@/components/campaign/leadership/SupportStatusBadge'
|
||||||
import { WizardLeadershipForm } from '@/components/campaign/leadership/WizardLeadershipForm'
|
import { WizardLeadershipForm } from '@/components/campaign/leadership/WizardLeadershipForm'
|
||||||
import { CampaignFormActionMessage } from '@/components/campaign/shared/CampaignFormActionMessage'
|
import { CampaignFormActionMessage } from '@/components/campaign/shared/CampaignFormActionMessage'
|
||||||
|
|
@ -54,8 +62,6 @@ import {
|
||||||
type SupportStatus,
|
type SupportStatus,
|
||||||
} from '@/lib/schemas/leadership'
|
} from '@/lib/schemas/leadership'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
import { fieldError } from '@/utilities/campaignFormFields'
|
|
||||||
import { supportStatusLabels } from '@/utilities/leadership/leadershipLabels'
|
|
||||||
import {
|
import {
|
||||||
resolveWizardChainEntry,
|
resolveWizardChainEntry,
|
||||||
wizardChainContinueHref,
|
wizardChainContinueHref,
|
||||||
|
|
@ -66,6 +72,8 @@ import {
|
||||||
resolveWizardLeadershipSkip,
|
resolveWizardLeadershipSkip,
|
||||||
type WizardLeadershipTileViewModel,
|
type WizardLeadershipTileViewModel,
|
||||||
} from '@/lib/wizardLeadershipContract'
|
} from '@/lib/wizardLeadershipContract'
|
||||||
|
import { fieldError } from '@/utilities/campaignFormFields'
|
||||||
|
import { supportStatusLabels } from '@/utilities/leadership/leadershipLabels'
|
||||||
|
|
||||||
const SUPPORT_STATUS_ENDPOINT = '/campanha/liderancas/support-status'
|
const SUPPORT_STATUS_ENDPOINT = '/campanha/liderancas/support-status'
|
||||||
const DEFAULT_STATUS: SupportStatus = 'a_abordar'
|
const DEFAULT_STATUS: SupportStatus = 'a_abordar'
|
||||||
|
|
@ -91,8 +99,10 @@ const notesLabel = (notes: string | null): string =>
|
||||||
const secondaryContact = (tile: WizardLeadershipTileViewModel): string | null =>
|
const secondaryContact = (tile: WizardLeadershipTileViewModel): string | null =>
|
||||||
tile.phone?.trim() || tile.email?.trim() || null
|
tile.phone?.trim() || tile.email?.trim() || null
|
||||||
|
|
||||||
const drawerContextLabel = (tile: WizardLeadershipTileViewModel, municipalityName: string): string =>
|
const drawerContextLabel = (
|
||||||
`${tile.name} · ${municipalityName}`
|
tile: WizardLeadershipTileViewModel,
|
||||||
|
municipalityName: string,
|
||||||
|
): string => `${tile.name} · ${municipalityName}`
|
||||||
|
|
||||||
export const WizardLeadershipStep = ({
|
export const WizardLeadershipStep = ({
|
||||||
actionSlug,
|
actionSlug,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue