From 16c3a88a6a664a544a6eb2a5663e7b5d10a34363 Mon Sep 17 00:00:00 2001 From: Noah Overcash Date: Thu, 27 Feb 2025 12:40:49 -0500 Subject: [PATCH] Specify explicit return types in ambiguous case --- package.json | 5 ++++- src/views/CurrentAssignmentView.tsx | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 5699828..32b8ac0 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "formatjs-compile": "formatjs compile-folder --ast --format simple ./translations/ui-calendar ./translations/ui-calendar/compiled" }, "devDependencies": { - "@folio/eslint-config-stripes": "^7.0.0", + "@folio/eslint-config-stripes": "^7.2.0", "@folio/stripes": "^9.0.0", "@folio/stripes-cli": "^3.0.0", "@formatjs/cli": "^6.2.0", @@ -158,5 +158,8 @@ "react-intl": "^6.4.4", "react-query": "^3.39.2", "react-router-dom": "^5.2.0" + }, + "resolutions": { + "@types/react": "^18.3.14" } } diff --git a/src/views/CurrentAssignmentView.tsx b/src/views/CurrentAssignmentView.tsx index 6d33108..88f014f 100644 --- a/src/views/CurrentAssignmentView.tsx +++ b/src/views/CurrentAssignmentView.tsx @@ -12,7 +12,7 @@ import { import SortableMultiColumnList from '../components/SortableMultiColumnList'; import useDataRepository from '../data/useDataRepository'; import permissions from '../types/permissions'; -import { Calendar } from '../types/types'; +import { Calendar, CalendarDTO } from '../types/types'; import { dateFromYYYYMMDD, getLocalizedDate, @@ -47,7 +47,17 @@ export const CurrentAssignmentView: FunctionComponent< ); } - const rows = dataRepository.getServicePoints().map((servicePoint) => { + const rows = dataRepository.getServicePoints().map((servicePoint): { + servicePoint: string; + servicePointId: string; + calendarName: ReactNode; + startDate: ReactNode; + startDateObj?: Date; + endDate: ReactNode; + endDateObj?: Date; + currentStatus: string; + calendar: CalendarDTO | null; + } => { const calendars = dataRepository.getCalendars().filter((calendar) => { return ( isBetweenDatesByDay( @@ -57,6 +67,7 @@ export const CurrentAssignmentView: FunctionComponent< ) && calendar.assignments.includes(servicePoint.id) ); }); + if (calendars.length === 0) { return { servicePoint: servicePoint.name.concat(