Skip to content

Commit e5765a3

Browse files
committed
Fix lint
1 parent f94a56a commit e5765a3

File tree

22 files changed

+57
-47
lines changed

22 files changed

+57
-47
lines changed

frontend/src/citizen-frontend/calendar/reservation-modal/form.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,11 @@ export const reservationForm = mapped(
260260
)
261261
return index === -1
262262
? []
263-
: toDailyReservationRequest(
263+
: (toDailyReservationRequest(
264264
childId,
265265
date,
266266
timesValue[index].day
267-
) ?? []
267+
) ?? [])
268268
})
269269
}
270270
case 'irregularTimes':

frontend/src/citizen-frontend/navigation/Header.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ const HeaderContainer = styled.header`
9090
9191
@media (min-width: ${desktopMin}) {
9292
position: static;
93-
grid: minmax(${headerHeightDesktop}px, min-content) / max-content max-content auto;
93+
grid:
94+
minmax(${headerHeightDesktop}px, min-content)
95+
/ max-content max-content auto;
9496
height: ${headerHeightDesktop}px;
9597
background-color: transparent;
9698
box-shadow: none;

frontend/src/employee-frontend/components/child-information/assistance-need/decision/AssistanceNeedPreschoolDecisionEditPage.tsx

+8-7
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,8 @@ const DecisionEditor = React.memo(function DecisionEditor({
634634
items={units}
635635
selectedItem={
636636
selectedUnit
637-
? units.find((u) => u.id === selectedUnit.value()) ?? null
637+
? (units.find((u) => u.id === selectedUnit.value()) ??
638+
null)
638639
: null
639640
}
640641
getItemLabel={(u) => u?.name ?? ''}
@@ -841,9 +842,9 @@ const DecisionEditor = React.memo(function DecisionEditor({
841842
filterItems={filterEmployees}
842843
selectedItem={
843844
preparer1EmployeeId
844-
? employees.find(
845+
? (employees.find(
845846
(e) => e.id === preparer1EmployeeId.value()
846-
) ?? null
847+
) ?? null)
847848
: null
848849
}
849850
onChange={(e) => preparer1EmployeeId.set(e?.id ?? null)}
@@ -875,9 +876,9 @@ const DecisionEditor = React.memo(function DecisionEditor({
875876
items={employees}
876877
selectedItem={
877878
preparer2EmployeeId
878-
? employees.find(
879+
? (employees.find(
879880
(e) => e.id === preparer2EmployeeId.value()
880-
) ?? null
881+
) ?? null)
881882
: null
882883
}
883884
getItemLabel={formatEmployeeName}
@@ -913,9 +914,9 @@ const DecisionEditor = React.memo(function DecisionEditor({
913914
items={decisionMakers}
914915
selectedItem={
915916
decisionMakerEmployeeId
916-
? decisionMakers.find(
917+
? (decisionMakers.find(
917918
(e) => e.id === decisionMakerEmployeeId.value()
918-
) ?? null
919+
) ?? null)
919920
: null
920921
}
921922
getItemLabel={formatEmployeeName}

frontend/src/employee-frontend/components/child-information/daily-service-times/DailyServiceTimesRow.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,9 @@ export const DailyServiceTimesReadOnly = React.memo(
185185
return (
186186
<div>
187187
<Gap size="xs" />
188-
{i18n.childInformation.dailyServiceTimes.weekdays.monday}
189-
{i18n.childInformation.dailyServiceTimes.weekdays.friday}{' '}
188+
{
189+
i18n.childInformation.dailyServiceTimes.weekdays.monday
190+
}{i18n.childInformation.dailyServiceTimes.weekdays.friday}{' '}
190191
{times.regularTimes.format()}
191192
</div>
192193
)

frontend/src/employee-frontend/components/child-information/placements/service-needs/ServiceNeedEditorRow.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function ServiceNeedEditorRow({
125125
partWeek:
126126
selectedOption && selectedOption.partWeek !== null
127127
? selectedOption.partWeek
128-
: editedServiceNeed?.partWeek ?? false
128+
: (editedServiceNeed?.partWeek ?? false)
129129
}
130130
},
131131
i18n.validationErrors,

frontend/src/employee-frontend/components/invoice/ReplacementDraftInfo.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ export function ReplacementInfo({
129129
<div>
130130
<span data-qa="sent-at">{invoice.sentAt?.format()}</span>
131131
{' ('}
132-
<span data-qa="sent-by">{invoice.sentBy?.name}</span>)
132+
<span data-qa="sent-by">
133+
{invoice.sentBy?.name}
134+
</span>)
133135
</div>
134136
</div>
135137
</FixedSpaceColumn>

frontend/src/employee-frontend/components/person-profile/PersonInvoiceCorrections.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,9 @@ const ChildSection = React.memo(function ChildSection({
251251
childId={child.id}
252252
row={
253253
editTarget?.correctionId
254-
? corrections.find(
254+
? (corrections.find(
255255
(c) => c.data.id === editTarget.correctionId
256-
)?.data ?? null
256+
)?.data ?? null)
257257
: null
258258
}
259259
products={products}

frontend/src/employee-frontend/components/person-shared/PersonDetails.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ export default React.memo(function PersonDetails({
530530
/>
531531
</>
532532
) : (
533-
person.ophPersonOid ?? ''
533+
(person.ophPersonOid ?? '')
534534
)
535535
}
536536
]

frontend/src/employee-frontend/components/reports/AttendanceReservation.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ export default React.memo(function AttendanceReservation() {
160160

161161
const tableComponents = entries.map(([groupId, rowsByTime]) => {
162162
const groupName = showGroupTitle
163-
? filteredGroups.find((group) => group.id === groupId)?.name ??
164-
i18n.reports.attendanceReservation.ungrouped
163+
? (filteredGroups.find((group) => group.id === groupId)?.name ??
164+
i18n.reports.attendanceReservation.ungrouped)
165165
: undefined
166166
return (
167167
<TableScrollable

frontend/src/employee-frontend/components/reports/AttendanceReservationByChild.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,10 @@ export default React.memo(function AttendanceReservationByChild() {
280280
fullDayAbsence: item.fullDayAbsence ? 'Poissa' : '',
281281
reservationStartTime: item.fullDayAbsence
282282
? ''
283-
: item.reservation?.start.format() ?? '-',
283+
: (item.reservation?.start.format() ?? '-'),
284284
reservationEndTime: item.fullDayAbsence
285285
? ''
286-
: item.reservation?.end.format() ?? '-'
286+
: (item.reservation?.end.format() ?? '-')
287287
}
288288
: []
289289
)

frontend/src/employee-frontend/components/reports/Occupancies.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,8 @@ function calculateAverages(
297297
const dateKey = toOccupancyKey(date)
298298
const dividend =
299299
usedValues === 'headcount'
300-
? row.occupancies[dateKey]?.headcount ?? 0
301-
: row.occupancies[dateKey]?.percentage ?? 0
300+
? (row.occupancies[dateKey]?.headcount ?? 0)
301+
: (row.occupancies[dateKey]?.percentage ?? 0)
302302
const divider =
303303
usedValues === 'headcount'
304304
? 1
@@ -453,8 +453,8 @@ export default React.memo(function Occupancies() {
453453
selectedItem={
454454
filters.careAreaId === undefined
455455
? careAreaAll
456-
: areas.find((area) => area.id === filters.careAreaId) ??
457-
null
456+
: (areas.find((area) => area.id === filters.careAreaId) ??
457+
null)
458458
}
459459
placeholder={i18n.reports.occupancies.filters.areaPlaceholder}
460460
getItemLabel={(item) => item.name}
@@ -623,8 +623,8 @@ export default React.memo(function Occupancies() {
623623
filters.type,
624624
filters.careAreaId === undefined
625625
? i18n.common.all
626-
: areas.find((area) => area.id == filters.careAreaId)
627-
?.name ?? ''
626+
: (areas.find((area) => area.id == filters.careAreaId)
627+
?.name ?? '')
628628
)}
629629
/>
630630
<TableScrollable>

frontend/src/employee-frontend/components/unit/tab-calendar/CalendarEventsSection.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,9 @@ const getFormTree = (tree: TreeNode[]) => {
483483
.map((group) => [
484484
group.key,
485485
hasUncheckedChildren(group)
486-
? group.children
486+
? (group.children
487487
?.filter((child) => child.checked)
488-
.map((child) => child.key) ?? []
488+
.map((child) => child.key) ?? [])
489489
: null
490490
]) ?? []
491491
)

frontend/src/employee-frontend/components/unit/tab-calendar/discussion-surveys/survey-editor/DiscussionSurveyForm.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ const getTreeSelectionAsRecord = (tree: TreeNode[]) =>
5454
.map((group) => [
5555
group.key,
5656
hasUncheckedChildren(group)
57-
? group.children
57+
? (group.children
5858
?.filter((child) => child.checked)
59-
.map((child) => child.key) ?? []
59+
.map((child) => child.key) ?? [])
6060
: null
6161
]) ?? []
6262
)

frontend/src/employee-frontend/components/unit/tab-unit-information/Occupancy.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export default React.memo(function OccupancyContainer({
119119
items={[null, ...activeGroups]}
120120
selectedItem={
121121
groupIds !== null && groupIds.length > 0
122-
? activeGroups.find((g) => g.id === groupIds[0]) ?? null
122+
? (activeGroups.find((g) => g.id === groupIds[0]) ?? null)
123123
: null
124124
}
125125
onChange={(g) => setGroupIds(g ? [g.id] : null)}
@@ -152,14 +152,14 @@ export default React.memo(function OccupancyContainer({
152152
) : (
153153
<SimpleOccupanciesForSingleDay
154154
unitId={unitId}
155-
groupId={groupIds !== null ? groupIds[0] ?? null : null}
155+
groupId={groupIds !== null ? (groupIds[0] ?? null) : null}
156156
date={startDate}
157157
/>
158158
)
159159
) : (
160160
<OccupanciesForDateRange
161161
unitId={unitId}
162-
groupId={groupIds !== null ? groupIds[0] ?? null : null}
162+
groupId={groupIds !== null ? (groupIds[0] ?? null) : null}
163163
from={startDate}
164164
to={endDate}
165165
/>

frontend/src/employee-frontend/components/unit/unit-reservations/ChildDayAttendance.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default React.memo(function ChildDayAttendance({
8888
const actualOperationTimes = hasShiftCare
8989
? dateInfo.isHoliday && !dateInfo.shiftCareOpenOnHoliday
9090
? null
91-
: dateInfo.shiftCareOperatingTimes ?? dateInfo.normalOperatingTimes
91+
: (dateInfo.shiftCareOperatingTimes ?? dateInfo.normalOperatingTimes)
9292
: dateInfo.isHoliday
9393
? null
9494
: dateInfo.normalOperatingTimes

frontend/src/employee-frontend/components/unit/unit-reservations/ChildDayReservation.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default React.memo(function ChildDayReservation({
7272
const actualOperationTimes = hasShiftCare
7373
? dateInfo.isHoliday && !dateInfo.shiftCareOpenOnHoliday
7474
? null
75-
: dateInfo.shiftCareOperatingTimes ?? dateInfo.normalOperatingTimes
75+
: (dateInfo.shiftCareOperatingTimes ?? dateInfo.normalOperatingTimes)
7676
: dateInfo.isHoliday
7777
? null
7878
: dateInfo.normalOperatingTimes

frontend/src/employee-mobile-frontend/child-attendance/actions/MarkDeparted.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -392,12 +392,12 @@ const MarkDepartedInner = React.memo(function MarkDepartedWithChild({
392392
absenceTypeNonbillable:
393393
expectedCategories?.includes('NONBILLABLE') &&
394394
absences?.nonBillable !== 'NO_ABSENCE'
395-
? absences?.nonBillable ?? null
395+
? (absences?.nonBillable ?? null)
396396
: null,
397397
absenceTypeBillable:
398398
expectedCategories.includes('BILLABLE') &&
399399
absences?.billable !== 'NO_ABSENCE'
400-
? absences?.billable ?? null
400+
? (absences?.billable ?? null)
401401
: null
402402
}
403403
})

frontend/src/employee-mobile-frontend/messages/state.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const MessageContextProvider = React.memo(
5050
const { user } = useContext(UserContext)
5151
const pinLoggedEmployeeId = user
5252
.map((u) =>
53-
u && u.pinLoginActive ? u.employeeId ?? undefined : undefined
53+
u && u.pinLoginActive ? (u.employeeId ?? undefined) : undefined
5454
)
5555
.getOrElse(undefined)
5656
const shouldFetch = !!unitId && !!pinLoggedEmployeeId

frontend/src/employee-mobile-frontend/staff-attendance/StaffAttendanceEditPage.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,8 @@ const StaffAttendanceEditor = ({
597597
appearance="inline"
598598
text={
599599
groupIdDomValue !== emptyGroupIdDomValue
600-
? groups.find((group) => group.id === groupIdDomValue)
601-
?.name ?? '-'
600+
? (groups.find((group) => group.id === groupIdDomValue)
601+
?.name ?? '-')
602602
: i18n.attendances.noGroup
603603
}
604604
onClick={() => groupEditMode.update(() => true)}

frontend/src/lib-common/api-types/application/ApplicationFormData.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,10 @@ export function apiDataToFormData(
212212
vtjSiblings: vtjSiblingsSiblingBasis,
213213
siblingName: siblingBasisFromVtj
214214
? ''
215-
: application.form.preferences.siblingBasis?.siblingName ?? '',
215+
: (application.form.preferences.siblingBasis?.siblingName ?? ''),
216216
siblingSsn: siblingBasisFromVtj
217217
? ''
218-
: application.form.preferences.siblingBasis?.siblingSsn ?? '',
218+
: (application.form.preferences.siblingBasis?.siblingSsn ?? ''),
219219
siblingUnit: application.form.preferences.siblingBasis?.siblingUnit ?? '',
220220
preferredUnits: application.form.preferences.preferredUnits
221221
},

frontend/src/lib-common/query.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@ export function useSelectMutation<ArgA, DataA, SelectA, ArgB, DataB, SelectB>(
346346
: mutationB.api(arg.value).then((r) => second(r)),
347347
invalidateQueryKeys: (arg: Either<ArgA, ArgB>): QueryKey[] =>
348348
arg.tag === 'first'
349-
? mutationA.invalidateQueryKeys?.(arg.value) ?? []
350-
: mutationB.invalidateQueryKeys?.(arg.value) ?? []
349+
? (mutationA.invalidateQueryKeys?.(arg.value) ?? [])
350+
: (mutationB.invalidateQueryKeys?.(arg.value) ?? [])
351351
}),
352352
[mutationA, mutationB]
353353
)

frontend/src/lib-components/layout/flex-helpers.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,12 @@ export const FixedSpaceFlexWrap = styled.div<FixedSpaceFlexWrapProps>`
103103
justify-content: flex-start;
104104
align-items: flex-start;
105105
106-
margin-bottom: -${(p) => (p.verticalSpacing ? defaultMargins[p.verticalSpacing] : defaultMargins.s)};
107-
margin-right: -${(p) => (p.horizontalSpacing ? defaultMargins[p.horizontalSpacing] : defaultMargins.s)};
106+
margin-bottom: -${(p) =>
107+
p.verticalSpacing ? defaultMargins[p.verticalSpacing] : defaultMargins.s};
108+
margin-right: -${(p) =>
109+
p.horizontalSpacing
110+
? defaultMargins[p.horizontalSpacing]
111+
: defaultMargins.s};
108112
109113
> * {
110114
margin-bottom: ${(p) =>

0 commit comments

Comments
 (0)