mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-26 21:53:06 +00:00
OH10: prettier format for gate:push
This commit is contained in:
parent
13793e3092
commit
0908f8d4d6
13 changed files with 30 additions and 31 deletions
|
|
@ -86,7 +86,8 @@ export const setMunicipalityPoliticalTrendRecord = async (
|
|||
input: MunicipalityPoliticalTrendInput,
|
||||
options?: { cas?: boolean },
|
||||
) => {
|
||||
const { municipality, status, note, baseUpdatedAt } = municipalityPoliticalTrendSchema.parse(input)
|
||||
const { municipality, status, note, baseUpdatedAt } =
|
||||
municipalityPoliticalTrendSchema.parse(input)
|
||||
const enforceCas = options?.cas === true
|
||||
const currentActor = await getFreshStaffActor(payload, actor)
|
||||
|
||||
|
|
@ -263,7 +264,9 @@ export const setMunicipalityEngagementLevel = async (input: MunicipalityEngageme
|
|||
return setMunicipalityEngagementLevelRecord(payload, actor, input)
|
||||
}
|
||||
|
||||
export const setMunicipalityEngagementLevelCas = async (input: MunicipalityEngagementLevelInput) => {
|
||||
export const setMunicipalityEngagementLevelCas = async (
|
||||
input: MunicipalityEngagementLevelInput,
|
||||
) => {
|
||||
const { payload, actor } = await getCampaignActionContext()
|
||||
return setMunicipalityEngagementLevelRecord(payload, actor, input, { cas: true })
|
||||
}
|
||||
|
|
@ -281,7 +284,8 @@ export const assignMunicipalityAdvisorsRecord = async (
|
|||
input: MunicipalityAdvisorsAssignmentInput,
|
||||
options?: { cas?: boolean },
|
||||
) => {
|
||||
const { municipality, advisors, baseUpdatedAt } = municipalityAdvisorsAssignmentSchema.parse(input)
|
||||
const { municipality, advisors, baseUpdatedAt } =
|
||||
municipalityAdvisorsAssignmentSchema.parse(input)
|
||||
const enforceCas = options?.cas === true
|
||||
|
||||
return withPayloadTransaction(
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
import type { Payload } from 'payload'
|
||||
|
||||
import { assertOpsUpdatedAtCas } from '@/lib/schemas/opsCas'
|
||||
import {
|
||||
municipalityUpdateCreateSchema,
|
||||
type MunicipalityUpdateCreateInput,
|
||||
} from '@/lib/schemas/municipalityUpdate'
|
||||
import { assertOpsUpdatedAtCas } from '@/lib/schemas/opsCas'
|
||||
import type { CampaignUser } from '@/payload-types'
|
||||
import { getCampaignActionContext, reloadCampaignActor } from '@/utilities/campaignActionContext'
|
||||
import { hookFilledCreateData } from '@/utilities/hookFilledData'
|
||||
|
|
|
|||
|
|
@ -11,11 +11,6 @@ import {
|
|||
formatAdvisorNamesTooltip,
|
||||
MunicipalityAdvisorAvatarStack,
|
||||
} from '@/components/campaign/municipality/MunicipalityAdvisorAvatarStack'
|
||||
import {
|
||||
CampaignCellEditOverlay,
|
||||
type CampaignCellEditOverlayVariant,
|
||||
} from '@/components/campaign/shared/CampaignCellEditOverlay'
|
||||
import { useCampaignCellFailureChannel } from '@/components/campaign/shared/useCampaignCellFailureChannel'
|
||||
import { municipalitiesCollection } from '@/components/campaign/opsSync/opsMirrorClient'
|
||||
import {
|
||||
discardOpsAdvisorsOutboxRow,
|
||||
|
|
@ -24,14 +19,19 @@ import {
|
|||
subscribeOpsAdvisorsOutboxRow,
|
||||
} from '@/components/campaign/opsSync/opsMunicipalityOutbox'
|
||||
import type { OpsMunicipalityWriteSyncStatus } from '@/components/campaign/opsSync/opsMunicipalityOutboxModel'
|
||||
import {
|
||||
CampaignCellEditOverlay,
|
||||
type CampaignCellEditOverlayVariant,
|
||||
} from '@/components/campaign/shared/CampaignCellEditOverlay'
|
||||
import { useCampaignCellFailureChannel } from '@/components/campaign/shared/useCampaignCellFailureChannel'
|
||||
import { Alert, AlertDescription } from '@/components/ui/Alert'
|
||||
import { Badge } from '@/components/ui/Badge'
|
||||
import { Command, CommandInput, CommandItem, CommandList } from '@/components/ui/Command'
|
||||
import { Spinner } from '@/components/ui/Spinner'
|
||||
import { postCampaignJson } from '@/lib/campaignJsonRequest'
|
||||
import { resolveOpsHybridEnabled } from '@/lib/campaignOps/opsHybridFlag'
|
||||
import { OPS_UPDATED_AT_CONFLICT_MESSAGE } from '@/lib/schemas/opsCas'
|
||||
import { sameIdSet } from '@/lib/sameIdSet'
|
||||
import { OPS_UPDATED_AT_CONFLICT_MESSAGE } from '@/lib/schemas/opsCas'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { matchesAtWordStart } from '@/lib/wordStartFilter'
|
||||
import type {
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ import { useEffect, useRef, useState } from 'react'
|
|||
|
||||
import type { MunicipalityListEngagementLevelResponse } from '@/app/(campaign)/campanha/(app)/municipios/engagement-level/types'
|
||||
import { MunicipalityLevelBadge } from '@/components/campaign/municipality/MunicipalityLevelBadge'
|
||||
import { municipalitiesCollection } from '@/components/campaign/opsSync/opsMirrorClient'
|
||||
import { enqueueEngagementLevel } from '@/components/campaign/opsSync/opsMunicipalityOutbox'
|
||||
import {
|
||||
CampaignCellEditOverlay,
|
||||
type CampaignCellEditOverlayVariant,
|
||||
} from '@/components/campaign/shared/CampaignCellEditOverlay'
|
||||
import { useCampaignCellFailureChannel } from '@/components/campaign/shared/useCampaignCellFailureChannel'
|
||||
import { municipalitiesCollection } from '@/components/campaign/opsSync/opsMirrorClient'
|
||||
import { enqueueEngagementLevel } from '@/components/campaign/opsSync/opsMunicipalityOutbox'
|
||||
import { Alert, AlertDescription } from '@/components/ui/Alert'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Checkbox } from '@/components/ui/Checkbox'
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ import type {
|
|||
MunicipalityListPoliticalTrendResponse,
|
||||
MunicipalityListSavedPoliticalTrend,
|
||||
} from '@/app/(campaign)/campanha/(app)/municipios/political-trend/types'
|
||||
import { municipalitiesCollection } from '@/components/campaign/opsSync/opsMirrorClient'
|
||||
import { enqueuePoliticalTrend } from '@/components/campaign/opsSync/opsMunicipalityOutbox'
|
||||
import {
|
||||
CampaignCellEditOverlay,
|
||||
type CampaignCellEditOverlayVariant,
|
||||
} from '@/components/campaign/shared/CampaignCellEditOverlay'
|
||||
import { useCampaignCellAutosave } from '@/components/campaign/shared/useCampaignCellAutosave'
|
||||
import { municipalitiesCollection } from '@/components/campaign/opsSync/opsMirrorClient'
|
||||
import { enqueuePoliticalTrend } from '@/components/campaign/opsSync/opsMunicipalityOutbox'
|
||||
import { Alert, AlertDescription } from '@/components/ui/Alert'
|
||||
import { Badge } from '@/components/ui/Badge'
|
||||
import { Field, FieldLabel } from '@/components/ui/field'
|
||||
|
|
|
|||
|
|
@ -3,12 +3,12 @@
|
|||
import { createCollection, localOnlyCollectionOptions } from '@tanstack/db'
|
||||
|
||||
import { collectOpsEstimateOutboxKeys } from '@/components/campaign/opsSync/opsEstimateOutbox'
|
||||
import { collectOpsMunicipalityOutboxKeys } from '@/components/campaign/opsSync/opsMunicipalityOutbox'
|
||||
import {
|
||||
openOpsMirrorStore,
|
||||
type OpsMirrorPersistenceMode,
|
||||
type OpsMirrorStore,
|
||||
} from '@/components/campaign/opsSync/opsMirrorPersistence'
|
||||
import { collectOpsMunicipalityOutboxKeys } from '@/components/campaign/opsSync/opsMunicipalityOutbox'
|
||||
import { votePledgesCollection } from '@/components/campaign/opsSync/opsVotePledgeMirror'
|
||||
import {
|
||||
createEmptyOpsSnapshot,
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ import {
|
|||
applyOpsVotePledgeEstimateWrite,
|
||||
votePledgesCollection,
|
||||
} from '@/components/campaign/opsSync/opsVotePledgeMirror'
|
||||
import type { EngagementLevel } from '@/lib/engagementLevel'
|
||||
import { opsOutboxKey, type OpsOutboxKey } from '@/lib/campaignOps/opsContract'
|
||||
import type { EngagementLevel } from '@/lib/engagementLevel'
|
||||
import type { PoliticalTrendStatusValue } from '@/lib/schemas/municipality'
|
||||
import type {
|
||||
MunicipalitySignalType,
|
||||
|
|
@ -378,7 +378,8 @@ export const enqueueDeclareVotes = async (input: {
|
|||
input.pledgeId !== undefined
|
||||
? votePledgesCollection.get(input.pledgeId)
|
||||
: votePledgesCollection.toArray.find(
|
||||
(row) => row.leadership === input.leadershipId && row.municipality === input.municipalityId,
|
||||
(row) =>
|
||||
row.leadership === input.leadershipId && row.municipality === input.municipalityId,
|
||||
)
|
||||
const pledgeId = input.pledgeId ?? mirrorPledge?.id
|
||||
const baseUpdatedAt =
|
||||
|
|
|
|||
|
|
@ -89,9 +89,8 @@ export const collapseEngagementLevelOutbox = (
|
|||
transactions: OfflineTransaction[],
|
||||
): OfflineTransaction[] => collapseByMetadataKey(transactions, 'municipalityId')
|
||||
|
||||
export const collapseAdvisorsOutbox = (
|
||||
transactions: OfflineTransaction[],
|
||||
): OfflineTransaction[] => collapseByMetadataKey(transactions, 'municipalityId')
|
||||
export const collapseAdvisorsOutbox = (transactions: OfflineTransaction[]): OfflineTransaction[] =>
|
||||
collapseByMetadataKey(transactions, 'municipalityId')
|
||||
|
||||
const collapseByMetadataKey = (
|
||||
transactions: OfflineTransaction[],
|
||||
|
|
|
|||
|
|
@ -27,10 +27,7 @@ type UseCampaignCellAutosaveOptions<TValue, TResponse extends CampaignCellAutosa
|
|||
* OH10 — optional persist path (outbox). When set, replaces the JSON POST.
|
||||
* Must resolve a success-shaped payload so `readSaved` can adopt the value.
|
||||
*/
|
||||
persist?: (
|
||||
value: TValue,
|
||||
signal: AbortSignal,
|
||||
) => Promise<{ ok: boolean; payload: TResponse }>
|
||||
persist?: (value: TValue, signal: AbortSignal) => Promise<{ ok: boolean; payload: TResponse }>
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -321,4 +321,4 @@ const HybridDeclareVotesForm = ({
|
|||
</p>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { z } from 'zod'
|
||||
|
||||
import { ENGAGEMENT_LEVEL_TEXT_MAX_LENGTH, engagementLevels } from '@/lib/engagementLevel'
|
||||
import { optionalBaseUpdatedAtSchema, OPS_UPDATED_AT_CONFLICT_MESSAGE } from '@/lib/schemas/opsCas'
|
||||
import { OPS_UPDATED_AT_CONFLICT_MESSAGE, optionalBaseUpdatedAtSchema } from '@/lib/schemas/opsCas'
|
||||
import { positiveRelationshipId, trimmedNullableText } from '@/lib/schemas/primitives'
|
||||
import { voteEstimateScenarioFieldsSchema } from '@/lib/schemas/votePledge'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { z } from 'zod'
|
||||
|
||||
import { optionalBaseUpdatedAtSchema, OPS_UPDATED_AT_CONFLICT_MESSAGE } from '@/lib/schemas/opsCas'
|
||||
import { OPS_UPDATED_AT_CONFLICT_MESSAGE, optionalBaseUpdatedAtSchema } from '@/lib/schemas/opsCas'
|
||||
import {
|
||||
MAX_VOTE_COUNT,
|
||||
positiveRelationshipId,
|
||||
|
|
@ -107,8 +107,6 @@ export const municipalityUpdateCreateSchema = z
|
|||
}
|
||||
})
|
||||
|
||||
export const MUNICIPALITY_UPDATE_CREATE_SAFE_MESSAGES = [
|
||||
OPS_UPDATED_AT_CONFLICT_MESSAGE,
|
||||
] as const
|
||||
export const MUNICIPALITY_UPDATE_CREATE_SAFE_MESSAGES = [OPS_UPDATED_AT_CONFLICT_MESSAGE] as const
|
||||
|
||||
export type MunicipalityUpdateCreateInput = z.input<typeof municipalityUpdateCreateSchema>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { z } from 'zod'
|
||||
|
||||
import { optionalBaseUpdatedAtSchema, OPS_UPDATED_AT_CONFLICT_MESSAGE } from '@/lib/schemas/opsCas'
|
||||
import { OPS_UPDATED_AT_CONFLICT_MESSAGE, optionalBaseUpdatedAtSchema } from '@/lib/schemas/opsCas'
|
||||
import {
|
||||
MAX_VOTE_COUNT,
|
||||
positiveRelationshipId,
|
||||
|
|
|
|||
Loading…
Reference in a new issue