Skip to content

Commit

Permalink
Specify explicit return types in ambiguous case (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncovercash authored Feb 27, 2025
1 parent 5af6f24 commit af9349d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
}
15 changes: 13 additions & 2 deletions src/views/CurrentAssignmentView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand All @@ -57,6 +67,7 @@ export const CurrentAssignmentView: FunctionComponent<
) && calendar.assignments.includes(servicePoint.id)
);
});

if (calendars.length === 0) {
return {
servicePoint: servicePoint.name.concat(
Expand Down

0 comments on commit af9349d

Please sign in to comment.