Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [20.x, 22.x]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-builds-typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [18.x, 20.x]
node-version: [20.x, 22.x]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@
"tslib": "^2.6.3",
"undici": "^6.18.2",
"use-intl": "2.22.1",
"zod": "^3.23.8"
"zod": "3.25.67"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -576,15 +576,15 @@ export const typeHandlers = {
data.map((item) => {
const data = {
update: {
isDefault: type === ValueType.LICENSE ? item.isDefault ?? false : false,
isDefault: type === ValueType.LICENSE ? (item.isDefault ?? false) : false,
type: type as ValueType,
value: { set: item.value },
licenseType:
type === ValueType.LICENSE ? (item.licenseType as ValueLicenseType) : undefined,
isDisabled: item.isDisabled ?? false,
},
create: {
isDefault: type === ValueType.LICENSE ? item.isDefault ?? false : false,
isDefault: type === ValueType.LICENSE ? (item.isDefault ?? false) : false,
type: type as ValueType,
value: item.value,
isDisabled: item.isDisabled ?? false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export class Calls911Controller {
description: data.descriptionData ? null : data.description,
name: data.name,
userId: user.id,
positionId: shouldRemovePosition ? null : position?.id ?? call.positionId,
positionId: shouldRemovePosition ? null : (position?.id ?? call.positionId),
descriptionData: data.descriptionData ?? undefined,
situationCodeId: data.situationCode === null ? null : data.situationCode,
typeId: data.type,
Expand Down
2 changes: 1 addition & 1 deletion apps/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"storage-factory": "^0.2.1",
"use-intl": "2.22.1",
"uuid": "^10.0.0",
"zod": "3.23.8",
"zod": "3.25.67",
"zustand": "^4.5.2"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export function AllUnitsTab({ units }: Props) {
</Link>
) : (
// todo: add information about temporary unit here
unit.user?.username ?? t("Leo.temporaryUnit")
(unit.user?.username ?? t("Leo.temporaryUnit"))
),
callsign: generateCallsign(unit),
badgeNumberString: unit.badgeNumberString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function CallsignsTab({ units }: Props) {
{unit.user.username}
</Link>
) : (
unit.user?.username ?? t("Leo.temporaryUnit")
(unit.user?.username ?? t("Leo.temporaryUnit"))
),
callsign1: unit.callsign,
callsign2: unit.callsign2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function DepartmentWhitelistingTab({ pendingUnits }: Props) {
{officer.user.username}
</Link>
) : (
officer.user?.username ?? common("Leo.temporaryUnit")
(officer.user?.username ?? common("Leo.temporaryUnit"))
),
actions: (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function ManageUnitTab({ unit: data }: Props) {
rank: unit.rankId,
position: unit.position ?? "",
suspended: unit.suspended,
badgeNumberString: BADGE_NUMBERS ? unit.badgeNumberString ?? "" : undefined,
badgeNumberString: BADGE_NUMBERS ? (unit.badgeNumberString ?? "") : undefined,
};

return (
Expand Down
26 changes: 13 additions & 13 deletions apps/client/src/components/admin/values/ManageValueModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,16 @@ function createInitialValues(options: CreateInitialValuesOptions) {
description:
value &&
(isUnitQualification(value) || isDLCategoryValue(value) || isEmergencyVehicleValue(value))
? value.description ?? ""
? (value.description ?? "")
: "",
qualificationType:
value && isUnitQualification(value)
? value.qualificationType
: QualificationValueType.QUALIFICATION,

shouldDo: value && isStatusValue(value) ? value.shouldDo : "",
color: value && isStatusValue(value) ? value.color ?? "" : "",
textColor: value && isStatusValue(value) ? value.textColor ?? "" : "",
color: value && isStatusValue(value) ? (value.color ?? "") : "",
textColor: value && isStatusValue(value) ? (value.textColor ?? "") : "",
type: getTypeForValue(options.type, value),
departments:
value &&
Expand All @@ -117,31 +117,31 @@ function createInitialValues(options: CreateInitialValuesOptions) {
: undefined,
whatPages: value && isStatusValue(value) ? makeDefaultWhatPages(value) : [],

pairedUnitTemplate: value && isDivisionValue(value) ? value.pairedUnitTemplate ?? "" : "",
pairedUnitTemplate: value && isDivisionValue(value) ? (value.pairedUnitTemplate ?? "") : "",
departmentId: value && isDivisionValue(value) ? value.departmentId : "",
isConfidential: value && isDepartmentValue(value) ? value.isConfidential : false,
whitelisted: value && isDepartmentValue(value) ? value.whitelisted : false,
defaultOfficerRankId: value && isDepartmentValue(value) ? value.defaultOfficerRankId : null,
isDefaultDepartment: value && isDepartmentValue(value) ? value.isDefaultDepartment : false,
callsign:
value && (isDepartmentValue(value) || isDivisionValue(value)) ? value.callsign ?? "" : "",
customTemplate: value && isDepartmentValue(value) ? value.customTemplate ?? "" : "",
value && (isDepartmentValue(value) || isDivisionValue(value)) ? (value.callsign ?? "") : "",
customTemplate: value && isDepartmentValue(value) ? (value.customTemplate ?? "") : "",

as: value && isEmployeeValue(value) ? value.as : "",
hash: value && (isVehicleValue(value) || isWeaponValue(value)) ? value.hash ?? "" : undefined,
trimLevels: value && isVehicleValue(value) ? value.trimLevels?.map((v) => v.id) ?? [] : [],
hash: value && (isVehicleValue(value) || isWeaponValue(value)) ? (value.hash ?? "") : undefined,
trimLevels: value && isVehicleValue(value) ? (value.trimLevels?.map((v) => v.id) ?? []) : [],

licenseType: value && isBaseValue(value) ? value.licenseType : null,
isDefault: value && isBaseValue(value) ? value.isDefault : undefined,
priority: value && isCallTypeValue(value) ? value.priority ?? undefined : undefined,
isDisposition: value && isCallTypeValue(value) ? value.isDisposition ?? undefined : undefined,
priority: value && isCallTypeValue(value) ? (value.priority ?? undefined) : undefined,
isDisposition: value && isCallTypeValue(value) ? (value.isDisposition ?? undefined) : undefined,

officerRankImageId: "",
officerRankDepartments:
value && isOfficerRankValue(value) ? options.makeDefaultDepartmentsValues(value) : undefined,

postal: value && isAddressValue(value) ? value.postal ?? "" : "",
county: value && isAddressValue(value) ? value.county ?? "" : "",
postal: value && isAddressValue(value) ? (value.postal ?? "") : "",
county: value && isAddressValue(value) ? (value.county ?? "") : "",

divisions:
value && isEmergencyVehicleValue(value) && options.features.DIVISIONS
Expand All @@ -157,7 +157,7 @@ function createInitialValues(options: CreateInitialValuesOptions) {
? safelyStringifyJSON(value.extraFields)
: "null",

departmentLinks: value && isDepartmentValue(value) ? value.links ?? [] : [],
departmentLinks: value && isDepartmentValue(value) ? (value.links ?? []) : [],
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function TowTaxiCallsTable({ initialData, type, noCallsText }: Props) {
description: <CallDescription nonCard data={call} />,
caller: call.creator
? `${call.creator.name} ${call.creator.surname}`
: call.name ?? leo("dispatch"),
: (call.name ?? leo("dispatch")),
assignedUnit: assignedUnit(call),
createdAt: <FullDate>{call.createdAt}</FullDate>,
actions: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export function RegisterVehicleModal({ vehicle, onClose, onCreate, onUpdate }: P
inspectionStatus: vehicle?.inspectionStatus ?? null,
taxStatus: vehicle?.taxStatus ?? null,
registrationStatus: vehicle?.registrationStatusId ?? "",
citizenId: isDisabled ? citizen.id : vehicle?.citizenId ?? "",
citizenId: isDisabled ? citizen.id : (vehicle?.citizenId ?? ""),
name: isDisabled
? `${citizen.name} ${citizen.surname}`
: vehicle?.citizen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ export function RegisterWeaponModal({ weapon, onClose, onCreate, onUpdate }: Pro
}

const INITIAL_VALUES = {
model: CUSTOM_TEXTFIELD_VALUES ? weapon?.model.value.value ?? "" : weapon?.modelId ?? "",
model: CUSTOM_TEXTFIELD_VALUES ? (weapon?.model.value.value ?? "") : (weapon?.modelId ?? ""),
modelName: weapon?.model.value.value ?? "",
registrationStatus: weapon?.registrationStatusId ?? "",
citizenId: isDisabled ? citizen.id : weapon?.citizenId ?? "",
citizenId: isDisabled ? citizen.id : (weapon?.citizenId ?? ""),
serialNumber: weapon?.serialNumber ?? "",
reApplyForDmv: weapon?.bofStatus === WhitelistStatus.DECLINED ? false : undefined,
name: isDisabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function ManageCourtDateModal({ onCreate, onUpdate, onClose, date }: Prop
const validate = handleValidate(COURT_DATE_SCHEMA);
const INITIAL_VALUES = {
note: date?.note ?? "",
date: typeof date?.date === "string" ? parseISO(date.date) : date?.date ?? new Date(),
date: typeof date?.date === "string" ? parseISO(date.date) : (date?.date ?? new Date()),
};

function handleClose() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function DispatchCallTowModal({ call }: Props) {
const INITIAL_VALUES = {
location: call?.location ?? "",
postal: call?.postal ?? "",
creatorId: isCombined ? null : activeUnit?.citizenId ?? null,
creatorId: isCombined ? null : (activeUnit?.citizenId ?? null),
description: call?.description ?? "",
descriptionData: call?.descriptionData ?? null,
callCountyService: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function DeputyColumn({
...dispatchCodes,
];

const canContextMenuBeOpened = isEligiblePage ? canBeOpened ?? false : false;
const canContextMenuBeOpened = isEligiblePage ? (canBeOpened ?? false) : false;

return (
<ContextMenu>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export function OfficerColumn({
: dispatchCodes),
];

const canContextMenuBeOpened = isEligiblePage ? canBeOpened ?? false : false;
const canContextMenuBeOpened = isEligiblePage ? (canBeOpened ?? false) : false;

return (
<ContextMenu>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export function ManageDeputyModal({ deputy, onClose, onUpdate, onCreate }: Props
callsign: deputy?.callsign ?? "",
callsign2: deputy?.callsign2 ?? "",
division: deputy?.divisionId ?? "",
badgeNumberString: BADGE_NUMBERS ? deputy?.badgeNumberString ?? "" : undefined,
badgeNumberString: BADGE_NUMBERS ? (deputy?.badgeNumberString ?? "") : undefined,
image: undefined,
};

Expand Down
4 changes: 2 additions & 2 deletions apps/client/src/components/form/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ export function Select({ name, onChange, ...rest }: Props) {

if (actionMeta.action === "clear" && Array.isArray(value)) {
onChange({
target: { name, value: rest.isMulti ? fixedOptions : changedValue?.value ?? null },
target: { name, value: rest.isMulti ? fixedOptions : (changedValue?.value ?? null) },
});
return;
}

onChange({
target: { name, value: rest.isMulti ? changedValue : changedValue?.value ?? null },
target: { name, value: rest.isMulti ? changedValue : (changedValue?.value ?? null) },
});
}

Expand Down
4 changes: 2 additions & 2 deletions apps/client/src/components/form/inputs/ImageSelectInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function ImageSelectInput({
<FormField
optional={isOptional}
errorMessage={errors[valueKey] as string}
label={hideLabel ? null : label ?? common("image")}
label={hideLabel ? null : (label ?? common("image"))}
>
<div className="flex gap-2">
<Input
Expand Down Expand Up @@ -119,7 +119,7 @@ export function ImageSelectInput({
<FormField
optional={isOptional}
errorMessage={errors[valueKey] as string}
label={hideLabel ? null : label ?? common("image")}
label={hideLabel ? null : (label ?? common("image"))}
>
<div className="flex">
<Input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ export function ManageIncidentModal<T extends LeoIncident | EmsFdIncident>({
firearmsInvolved: incident?.firearmsInvolved ?? false,
injuriesOrFatalities: incident?.injuriesOrFatalities ?? false,
arrestsMade: incident?.arrestsMade ?? false,
isActive: isDispatch ? true : incident?.isActive ?? false,
isActive: isDispatch ? true : (incident?.isActive ?? false),
situationCodeId: incident?.situationCodeId ?? null,
openModalAfterCreation: true,
fireType: isEmsFdIncident ? incident.fireType ?? "" : "",
fireType: isEmsFdIncident ? (incident.fireType ?? "") : "",
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export function getManageOfficerFieldsDefaults(options: GetManageOfficerFieldsDe
callsign2: options.officer?.callsign2 ?? "",
divisions: options.officer?.divisions.map((v) => ({ value: v.id, label: v.value.value })) ?? [],
badgeNumberString: options.features.BADGE_NUMBERS
? options.officer?.badgeNumberString ?? ""
? (options.officer?.badgeNumberString ?? "")
: undefined,
citizenId: options.officer?.citizenId ?? "",
name: options.officer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export function NameSearchModal() {
}

const warrants =
!currentResult || currentResult.isConfidential ? [] : currentResult.warrants ?? [];
!currentResult || currentResult.isConfidential ? [] : (currentResult.warrants ?? []);

const hasActiveWarrants = warrants.filter((v) => v.status === "ACTIVE").length > 0;
const isArrested =
Expand Down
2 changes: 1 addition & 1 deletion apps/client/src/components/shared/nav/changelog-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function ChangelogModal() {
<Loader className="w-7 h-7" />
</div>
) : !data || error ? (
error?.message ?? "Unable to fetch changelog"
(error?.message ?? "Unable to fetch changelog")
) : (
<ReactMarkdown
remarkPlugins={[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function EditDashboardLayoutModal() {
}

React.useEffect(() => {
const userSortedList = columnName ? user?.[columnName] ?? [] : [];
const userSortedList = columnName ? (user?.[columnName] ?? []) : [];

const list = cardsForType.sort((a, b) => {
return userSortedList.indexOf(a) - userSortedList.indexOf(b);
Expand Down
4 changes: 2 additions & 2 deletions apps/client/src/pages/bleeter/@/[handle].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ export default function BleeterProfilePage(props: BleeterProfilePageProps) {

const followingCount = followingData.isInitialLoading
? props.data.followingCount
: followingData.following?.length ?? props.data.followingCount;
: (followingData.following?.length ?? props.data.followingCount);

const followersCount = followersData.isInitialLoading
? props.data.followersCount
: followersData.followers?.length ?? props.data.followersCount;
: (followersData.followers?.length ?? props.data.followersCount);

return (
<Layout className="dark:text-white">
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"format": "prettier --write \"./(packages|apps)/**/**/*.{js,jsx,ts,mjs,tsx,md,css,json}\" --ignore-path .gitignore",
"lint": "pnpm eslint . --ext .ts,.js,.tsx,.jsx,.mjs",
"lint:fix": "pnpm eslint . --ext .ts,.js,.tsx,.jsx,.mjs --fix",
"prepare": "husky install",
"prepare": "husky",
"bump-version": "node scripts/bump-version.mjs",
"create-images-domain": "node scripts/create-images-domain.mjs",
"postinstall": "husky install",
"postinstall": "husky",
"typecheck": "pnpm turbo run typecheck"
},
"license": "MIT",
Expand All @@ -22,9 +22,9 @@
"@casperiv/eslint-config-next": "8.0.0",
"@casperiv/eslint-config-react": "8.0.0",
"eslint": "8.56.0",
"eslint-plugin-deprecation": "^2.0.0",
"lerna": "^8.1.3",
"lint-staged": "^15.2.5"
"eslint-plugin-deprecation": "^3.0.0",
"lerna": "^8.2.2",
"lint-staged": "^16.1.2"
},
"lint-staged": {
"*.{js,jsx,json,ts,tsx,md,mdx,css,html,yml,yaml,scss,sass}\"": "prettier --write --ignore-path .prettierignore"
Expand All @@ -33,14 +33,14 @@
"node": ">=18.16.0"
},
"dependencies": {
"@faker-js/faker": "^8.4.1",
"@faker-js/faker": "^9.8.0",
"colorette": "2.0.20",
"concurrently": "^8.2.2",
"concurrently": "^9.2.0",
"copy": "^0.3.2",
"dotenv": "^16.4.5",
"husky": "^8.0.3",
"prettier": "3.3.1",
"turbo": "2.0.3"
"dotenv": "^17.0.0",
"husky": "^9.1.7",
"prettier": "3.6.2",
"turbo": "2.5.4"
},
"pnpm": {
"overrides": {
Expand Down
2 changes: 1 addition & 1 deletion packages/schemas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dependencies": {
"@snailycad/types": "workspace:*",
"tslib": "^2.6.3",
"zod": "3.23.8"
"zod": "3.25.67"
},
"tsup": {
"entry": [
Expand Down
Loading
Loading