Skip to content

Commit b84e69e

Browse files
authored
Merge pull request #388 from SFTtech/milo/dependency-upgrades
dependency upgrades
2 parents 9bd0ed9 + 1553a3b commit b84e69e

57 files changed

Lines changed: 2298 additions & 2669 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.oxlintrc.jsonc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,12 @@
66
"suspicious": "error",
77
"perf": "error",
88
},
9+
"rules": {
10+
"eslint/no-shadow": "off",
11+
"react-perf/jsx-no-jsx-as-prop": "off",
12+
"react-perf/jsx-no-new-object-as-prop": "off",
13+
"react-perf/jsx-no-new-function-as-prop": "off",
14+
"react-perf/jsx-no-new-array-as-prop": "off",
15+
"unicorn/prefer-add-event-listener": "off",
16+
},
917
}

apps/web/src/@types/i18next.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// oxlint-disable-next-line import/no-unassigned-import
12
import "i18next";
23
import type { resources, defaultNS } from "@abrechnung/translations";
34

apps/web/src/app/app.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { LocalizationProvider } from "@mui/x-date-pickers";
55
import { AdapterLuxon } from "@mui/x-date-pickers/AdapterLuxon";
66
import * as React from "react";
77
import { ToastContainer } from "react-toastify";
8+
// oxlint-disable-next-line import/no-unassigned-import
89
import "react-toastify/dist/ReactToastify.css";
910
import { Loading } from "@abrechnung/components";
1011
import { api } from "../core/api";

apps/web/src/app/authenticated-layout/AuthenticatedLayout.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,7 @@ export const AuthenticatedLayout: React.FC = () => {
282282
</Box>
283283
<Box
284284
component="main"
285-
flexGrow={1}
286-
width={{ sm: `calc(100vw - ${drawerWidth}px)`, md: "100vw", overflow: "auto" }}
285+
sx={{ flexGrow: 1, width: { sm: `calc(100vw - ${drawerWidth}px)`, md: "100vw", overflow: "auto" } }}
287286
>
288287
<Toolbar />
289288
<Banner />

apps/web/src/components/ShareSelect.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ const ShareSelectRow: React.FC<RowProps> = ({
134134
}}
135135
to={getAccountLink(account.group_id, account.type, account.id)}
136136
>
137-
<Grid container direction="row" alignItems="center">
137+
<Grid container direction="row" sx={{ alignItems: "center" }}>
138138
<Grid>{getAccountIcon(account.type)}</Grid>
139-
<Grid display="flex" flexDirection="column" sx={{ ml: 1 }}>
139+
<Grid sx={{ display: "flex", flexDirection: "column", ml: 1 }}>
140140
<Typography variant="body2" component="span">
141141
{account.name}
142142
</Typography>
@@ -239,22 +239,22 @@ export const ShareSelect: React.FC<ShareSelectProps> = ({
239239
}
240240
return true;
241241
})
242-
.sort(sortFn);
243-
}, [value, showEvents, editable, searchValue, unfilteredAccounts, shouldDisplayAccount]);
242+
.toSorted(sortFn);
243+
}, [value, showEvents, editable, searchValue, unfilteredAccounts, shouldDisplayAccount, hideShowEventsFilter]);
244244

245245
React.useEffect(() => {
246246
// set displayed split mode to evenly if we have a "shares" split with non-even shares
247247
if (
248248
splitMode === "shares" &&
249-
Object.values(value).reduce((onlyDefaultShares, value) => onlyDefaultShares && value === 1, true) &&
249+
Object.values(value).reduce((onlyDefaultShares, val) => onlyDefaultShares && val === 1, true) &&
250250
(communistShares == null || communistShares === 1 || communistShares === 0)
251251
) {
252252
setFrontendSplitMode("evenly");
253253
}
254-
}, [splitMode, value, setFrontendSplitMode]);
254+
}, [splitMode, value, setFrontendSplitMode, communistShares]);
255255

256256
const { nSelectedPeople, nSelectedEvents } = React.useMemo(() => {
257-
const nSelectedPeople = accounts.reduce((nAccs: number, acc: Account) => {
257+
const selectedPeople = accounts.reduce((nAccs: number, acc: Account) => {
258258
if (acc.type !== "personal") {
259259
return nAccs;
260260
}
@@ -263,7 +263,7 @@ export const ShareSelect: React.FC<ShareSelectProps> = ({
263263
}
264264
return nAccs;
265265
}, 0);
266-
const nSelectedEvents = accounts.reduce((nAccs: number, acc: Account) => {
266+
const selectedEvents = accounts.reduce((nAccs: number, acc: Account) => {
267267
if (acc.type !== "clearing") {
268268
return nAccs;
269269
}
@@ -273,11 +273,11 @@ export const ShareSelect: React.FC<ShareSelectProps> = ({
273273
return nAccs;
274274
}, 0);
275275

276-
return { nSelectedPeople, nSelectedEvents };
277-
}, [unfilteredAccounts, value, shouldDisplayAccount]);
276+
return { nSelectedPeople: selectedPeople, nSelectedEvents: selectedEvents };
277+
}, [value, accounts]);
278278

279279
const nSelected = React.useMemo(() => {
280-
return Object.values(value).reduce((nSelected, val) => nSelected + (val > 0 ? 1 : 0), 0);
280+
return Object.values(value).reduce((selected, val) => selected + (val > 0 ? 1 : 0), 0);
281281
}, [value]);
282282
const isAllSelected = nSelected === accounts.length;
283283
const showSearch = !isSmallScreen && unfilteredAccounts.length > 5;
@@ -307,7 +307,7 @@ export const ShareSelect: React.FC<ShareSelectProps> = ({
307307

308308
return (
309309
<div>
310-
<Grid container direction={isSmallScreen ? "column" : "row"} justifyContent="space-between">
310+
<Stack direction={isSmallScreen ? "column" : "row"} sx={{ justifyContent: "space-between" }}>
311311
<Stack direction="row" spacing={1} sx={{ alignItems: "center", marginY: 1 }}>
312312
<Typography variant="subtitle1">{label}</Typography>
313313
{nSelectedPeople > 0 && (
@@ -351,12 +351,14 @@ export const ShareSelect: React.FC<ShareSelectProps> = ({
351351
select
352352
>
353353
{allowedSplitModes.map((mode) => (
354-
<MenuItem value={mode}>{t(`shareSelect.split_${mode}`)}</MenuItem>
354+
<MenuItem key={mode} value={mode}>
355+
{t(`shareSelect.split_${mode}`)}
356+
</MenuItem>
355357
))}
356358
</TextField>
357359
</Stack>
358360
)}
359-
</Grid>
361+
</Stack>
360362
{communistShares != null &&
361363
(frontendSplitMode === "evenly" ? (
362364
<FormControlLabel

apps/web/src/components/style/Banner.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useConfig } from "@/core/config";
55
export const Banner: React.FC = () => {
66
const cfg = useConfig();
77
return cfg.messages?.map((message, idx) => (
8+
// oxlint-disable-next-line react/no-array-index-key
89
<Alert key={idx} sx={{ borderRadius: 0 }} color={message.type}>
910
{message.title && <AlertTitle>{message.title}</AlertTitle>}
1011
{message.body}

apps/web/src/components/transactions/TransactionIcon.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { PurchaseIcon, TransferIcon } from "@/components/style/AbrechnungIcons";
33
import { Tooltip } from "@mui/material";
44
import * as React from "react";
55
import { useTranslation } from "react-i18next";
6-
import { HelpOutline } from "@mui/icons-material";
6+
import { HelpOutlined } from "@mui/icons-material";
77

88
export const TransactionIcon: React.FC<{ type: TransactionType }> = ({ type }) => {
99
const { t } = useTranslation();
@@ -25,7 +25,7 @@ export const TransactionIcon: React.FC<{ type: TransactionType }> = ({ type }) =
2525

2626
return (
2727
<Tooltip title="Unknown Transaction Type">
28-
<HelpOutline color="primary" />
28+
<HelpOutlined color="primary" />
2929
</Tooltip>
3030
);
3131
};

apps/web/src/i18n.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { initReactI18next } from "react-i18next";
33
import LanguageDetector from "i18next-browser-languagedetector";
44
import { resources, defaultNS } from "@abrechnung/translations";
55

6+
// oxlint-disable-next-line import/no-named-as-default-member
67
i18n.use(LanguageDetector)
78
.use(initReactI18next)
89
.init({

apps/web/src/main.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Provider } from "react-redux";
44
import { PersistGate } from "redux-persist/integration/react";
55
import { App } from "./app/app";
66
import { Loading } from "@abrechnung/components";
7+
// oxlint-disable-next-line import/no-unassigned-import
78
import "./i18n";
89
import { persistor, store } from "./store";
910
import { ConfigProvider } from "./core/config";

apps/web/src/pages/accounts/AccountDetail/AccountInfo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ export const AccountInfo: React.FC<Props> = ({ groupId, account }) => {
127127

128128
return (
129129
<>
130-
<Grid container justifyContent="space-between">
131-
<Grid display="flex" alignItems="center">
130+
<Grid container sx={{ justifyContent: "space-between" }}>
131+
<Grid sx={{ display: "flex", alignItems: "center" }}>
132132
<IconButton sx={{ display: { xs: "none", md: "inline-flex" } }} onClick={navigateBack}>
133133
<ChevronLeft />
134134
</IconButton>

0 commit comments

Comments
 (0)