Skip to content

Commit

Permalink
chore: bump all deps (#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianAndersen authored Apr 30, 2024
1 parent 772ecde commit 890c10f
Show file tree
Hide file tree
Showing 95 changed files with 2,636 additions and 2,769 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module.exports = {
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json",
},
settings: {
react: {
version: "detect",
Expand All @@ -25,12 +28,13 @@ module.exports = {
"prettier",
],
plugins: ["cypress", "eslint-plugin-no-relative-import-paths"],
ignorePatterns: ["cypress/support", "cypress/plugins"],
ignorePatterns: ["cypress"],
rules: {
"no-relative-import-paths/no-relative-import-paths": [
"error",
{
rootDir: "src",
prefix: "@",
},
],
"unicorn/consistent-function-scoping": [
Expand Down
102 changes: 51 additions & 51 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,65 +20,65 @@
"prepare": "husky install"
},
"dependencies": {
"@date-io/moment": "^2.16.1",
"@emotion/react": "^11.10.5",
"@emotion/server": "^11.10.0",
"@emotion/styled": "^11.10.5",
"@fontsource/roboto": "^4.5.8",
"@mui/icons-material": "^5.11.0",
"@mui/lab": "^5.0.0-alpha.115",
"@mui/material": "^5.11.4",
"@mui/x-date-pickers": "^5.0.13",
"@reduxjs/toolkit": "^1.9.1",
"axios": "^1.2.2",
"@date-io/moment": "^3.0.0",
"@emotion/react": "^11.11.4",
"@emotion/server": "^11.11.0",
"@emotion/styled": "^11.11.5",
"@fontsource/roboto": "^5.0.13",
"@mui/icons-material": "^5.15.15",
"@mui/lab": "^5.0.0-alpha.170",
"@mui/material": "^5.15.15",
"@mui/x-date-pickers": "^7.3.1",
"@reduxjs/toolkit": "^2.2.3",
"axios": "^1.6.8",
"draft-js": "^0.11.7",
"moment": "^2.29.4",
"next": "^13.1.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"moment": "^2.30.1",
"next": "^14.2.3",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-draft-wysiwyg": "^1.15.0",
"react-hook-form": "^7.42.0",
"react-jwt": "^1.1.8",
"react-hook-form": "^7.51.3",
"react-jwt": "^1.2.1",
"react-qr-barcode-scanner": "^1.0.6",
"react-quill": "^2.0.0",
"react-redux": "^8.0.5",
"sanitize-html": "^2.11.0",
"sharp": "^0.31.3",
"react-redux": "^9.1.1",
"sanitize-html": "^2.13.0",
"sharp": "^0.33.3",
"string-similarity": "^4.0.4",
"swr": "^2.0.0",
"validator": "^13.7.0"
"swr": "^2.2.5",
"validator": "^13.11.0"
},
"devDependencies": {
"@boklisten/bl-model": "^0.25.30",
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"@testing-library/react": "^13.4.0",
"@types/draft-js": "^0.11.10",
"@types/node": "18.11.18",
"@types/react": "18.0.26",
"@types/react-draft-wysiwyg": "^1.13.5",
"@types/react-redux": "^7.1.25",
"@types/sanitize-html": "^2.9.5",
"@types/string-similarity": "^4.0.0",
"@types/validator": "^13.7.10",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"cypress": "^12.3.0",
"eslint": "8.48.0",
"eslint-config-next": "13.4.19",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-typescript": "^3.6.0",
"eslint-plugin-cypress": "^2.14.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-no-relative-import-paths": "^1.5.2",
"@boklisten/bl-model": "^0.25.37",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@testing-library/react": "^15.0.5",
"@types/draft-js": "^0.11.18",
"@types/node": "20.12.7",
"@types/react": "18.3.1",
"@types/react-draft-wysiwyg": "^1.13.8",
"@types/react-redux": "^7.1.33",
"@types/sanitize-html": "^2.11.0",
"@types/string-similarity": "^4.0.2",
"@types/validator": "^13.11.9",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"cypress": "^13.8.1",
"eslint": "8.56.0",
"eslint-config-next": "14.2.3",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-cypress": "^3.0.2",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-no-relative-import-paths": "^1.5.4",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-unicorn": "^48.0.1",
"husky": ">=6",
"lint-staged": ">=10",
"prettier": "^3.0.3",
"pretty-quick": "^3.1.3",
"typescript": "^4.9.4"
"eslint-plugin-unicorn": "^52.0.0",
"husky": ">=9.0.11",
"lint-staged": ">=15.2.2",
"prettier": "^3.2.5",
"pretty-quick": "^4.0.0",
"typescript": "^5.4.5"
},
"browserslist": [
"defaults",
Expand Down
4 changes: 2 additions & 2 deletions src/api/api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios, { AxiosError, AxiosResponse } from "axios";

import { apiPath, getHeaders } from "api/apiRequest";
import { fetchNewTokens } from "api/token";
import { apiPath, getHeaders } from "@/api/apiRequest";
import { fetchNewTokens } from "@/api/token";

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const get = async <T = any>(
Expand Down
4 changes: 2 additions & 2 deletions src/api/apiRequest.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getAccessToken, haveAccessToken } from "api/token";
import BL_CONFIG from "utils/bl-config";
import { getAccessToken, haveAccessToken } from "@/api/token";
import BL_CONFIG from "@/utils/bl-config";

export const apiPath = (collection: string, query?: string) => {
const path = BL_CONFIG.api.basePath;
Expand Down
4 changes: 2 additions & 2 deletions src/api/auth.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { haveAccessToken, removeTokens, getAccessTokenBody } from "api/token";
import { UserPermission } from "utils/types";
import { haveAccessToken, removeTokens, getAccessTokenBody } from "@/api/token";
import { UserPermission } from "@/utils/types";

export const isLoggedIn = () => haveAccessToken();

Expand Down
6 changes: 3 additions & 3 deletions src/api/login.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { add } from "api/api";
import { parseTokensFromResponseDataAndStore } from "api/token";
import BL_CONFIG from "utils/bl-config";
import { add } from "@/api/api";
import { parseTokensFromResponseDataAndStore } from "@/api/token";
import BL_CONFIG from "@/utils/bl-config";

export const login = async (username: string, password: string) => {
const apiResponse = await add(BL_CONFIG.login.local.url, {
Expand Down
6 changes: 3 additions & 3 deletions src/api/token.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import axios from "axios";
import { decodeToken } from "react-jwt";

import { add, get, remove } from "api/storage";
import BL_CONFIG from "utils/bl-config";
import { AccessToken } from "utils/types";
import { add, get, remove } from "@/api/storage";
import BL_CONFIG from "@/utils/bl-config";
import { AccessToken } from "@/utils/types";

const accessTokenName = BL_CONFIG.token.accessToken;
const refreshTokenName = BL_CONFIG.token.refreshToken;
Expand Down
16 changes: 8 additions & 8 deletions src/components/BranchSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import { useRouter } from "next/router";
import { useEffect } from "react";
import useSWR, { SWRResponse } from "swr";

import { fetcher } from "api/requests";
import { add, get } from "api/storage";
import { setCart, setDeliveryMethod } from "redux/cart";
import { useAppSelector, useAppDispatch } from "redux/hooks";
import { selectBranch, setSelectedBranch } from "redux/selectedBranch";
import { setSelectedCustomerItemActions } from "redux/selectedCustomerItemActions";
import { setSelectedSubjects } from "redux/selectedSubjects";
import BL_CONFIG from "utils/bl-config";
import { fetcher } from "@/api/requests";
import { add, get } from "@/api/storage";
import { setCart, setDeliveryMethod } from "@/redux/cart";
import { useAppSelector, useAppDispatch } from "@/redux/hooks";
import { selectBranch, setSelectedBranch } from "@/redux/selectedBranch";
import { setSelectedCustomerItemActions } from "@/redux/selectedCustomerItemActions";
import { setSelectedSubjects } from "@/redux/selectedSubjects";
import BL_CONFIG from "@/utils/bl-config";

export const branchListUrl = `${BL_CONFIG.api.basePath}branches?og=name&active=true&sort=name`;

Expand Down
8 changes: 4 additions & 4 deletions src/components/CustomerItemOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ import moment from "moment";
import { useRouter } from "next/router";
import React, { useState } from "react";

import { setCart } from "redux/cart";
import { useAppDispatch, useAppSelector } from "redux/hooks";
import { setCart } from "@/redux/cart";
import { useAppDispatch, useAppSelector } from "@/redux/hooks";
import {
CustomerItemAction,
selectCustomerItemActions,
setSelectedCustomerItemActions,
} from "redux/selectedCustomerItemActions";
} from "@/redux/selectedCustomerItemActions";
import {
generateCartItemsFromCustomerItemActions,
getExtendTime,
} from "utils/cartUtils";
} from "@/utils/cartUtils";

const calculateMaxDeadline = (): string => {
const now = moment();
Expand Down
6 changes: 3 additions & 3 deletions src/components/DynamicLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Link as MuiLink, LinkProps as MuiLinkProps } from "@mui/material";
import NextLink, { LinkProps as NextLinkProps } from "next/link";
import { ForwardedRef, forwardRef, useEffect, useState } from "react";

import { isLoggedIn } from "api/auth";
import { getAccessToken, getRefreshToken } from "api/token";
import BL_CONFIG from "utils/bl-config";
import { isLoggedIn } from "@/api/auth";
import { getAccessToken, getRefreshToken } from "@/api/token";
import BL_CONFIG from "@/utils/bl-config";

type CustomNextLinkProps = Omit<NextLinkProps, "href"> & {
_href: NextLinkProps["href"];
Expand Down
4 changes: 2 additions & 2 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import moment from "moment";
import Image from "next/image";
import React from "react";

import DynamicLink from "components/DynamicLink";
import ContactInfo from "components/info/ContactInfo";
import DynamicLink from "@/components/DynamicLink";
import ContactInfo from "@/components/info/ContactInfo";

export default function Footer() {
return (
Expand Down
8 changes: 4 additions & 4 deletions src/components/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import Typography from "@mui/material/Typography";
import Image from "next/image";
import React from "react";

import BranchSelect from "components/BranchSelect";
import DynamicLink from "components/DynamicLink";
import DropDownMenu from "components/SideMenuDrawer";
import BL_CONFIG from "utils/bl-config";
import BranchSelect from "@/components/BranchSelect";
import DynamicLink from "@/components/DynamicLink";
import DropDownMenu from "@/components/SideMenuDrawer";
import BL_CONFIG from "@/utils/bl-config";

interface TabLinkProps {
title: string;
Expand Down
6 changes: 3 additions & 3 deletions src/components/OrderHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Button from "@mui/material/Button";
import moment from "moment";
import React, { useState } from "react";

import { get } from "api/api";
import { get } from "@/api/api";

// fetchPayments(orders);
// types are from a business POV
Expand Down Expand Up @@ -267,7 +267,7 @@ const OrderHistory = ({ orders }: { orders: Order[] }) => {

{/**
eslint-disable-next-line @typescript-eslint/ban-ts-comment
@ts-ignore*/}
@ts-expect-error orderItemInfo type is outdated*/}
{orderItem.info?.["amountLeftToPay"] && (
<TableRow>
<TableCell align="center">
Expand All @@ -276,7 +276,7 @@ const OrderHistory = ({ orders }: { orders: Order[] }) => {
<TableCell align="center">
{/**
eslint-disable-next-line @typescript-eslint/ban-ts-comment
@ts-ignore*/}
@ts-expect-error orderItemInfo type is outdated*/}
{orderItem.info["amountLeftToPay"]} kr
</TableCell>
</TableRow>
Expand Down
6 changes: 3 additions & 3 deletions src/components/SideMenuDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import SwipeableDrawer from "@mui/material/SwipeableDrawer";
import { useRouter } from "next/router";
import React, { useState, KeyboardEvent, MouseEvent, ReactNode } from "react";

import { isLoggedIn, logout } from "api/auth";
import DynamicLink from "components/DynamicLink";
import BL_CONFIG from "utils/bl-config";
import { isLoggedIn, logout } from "@/api/auth";
import DynamicLink from "@/components/DynamicLink";
import BL_CONFIG from "@/utils/bl-config";

interface DrawerLinkProps {
title: string;
Expand Down
12 changes: 6 additions & 6 deletions src/components/SubjectSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import Typography from "@mui/material/Typography";
import { useRouter } from "next/router";
import React, { useState } from "react";

import FixedSuccessButton from "components/FixedSuccessButton";
import { setCart } from "redux/cart";
import { useAppDispatch, useAppSelector } from "redux/hooks";
import { selectBranch } from "redux/selectedBranch";
import { selectSubjects, setSelectedSubjects } from "redux/selectedSubjects";
import { generateCartItemsFromSubjects } from "utils/cartUtils";
import FixedSuccessButton from "@/components/FixedSuccessButton";
import { setCart } from "@/redux/cart";
import { useAppDispatch, useAppSelector } from "@/redux/hooks";
import { selectBranch } from "@/redux/selectedBranch";
import { selectSubjects, setSelectedSubjects } from "@/redux/selectedSubjects";
import { generateCartItemsFromSubjects } from "@/utils/cartUtils";

const SubjectCheckbox = ({ subject }: { subject: string }) => {
const dispatch = useAppDispatch();
Expand Down
14 changes: 7 additions & 7 deletions src/components/cart/Cart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import { useRouter } from "next/router";

import { isLoggedIn } from "api/auth";
import BackButton from "components/cart/BackButton";
import CartTableHeader from "components/cart/CartTableHeader";
import CartTableRow from "components/cart/CartTableRow";
import FixedSuccessButton from "components/FixedSuccessButton";
import { selectCartItems } from "redux/cart";
import { useAppSelector } from "redux/hooks";
import { isLoggedIn } from "@/api/auth";
import BackButton from "@/components/cart/BackButton";
import CartTableHeader from "@/components/cart/CartTableHeader";
import CartTableRow from "@/components/cart/CartTableRow";
import FixedSuccessButton from "@/components/FixedSuccessButton";
import { selectCartItems } from "@/redux/cart";
import { useAppSelector } from "@/redux/hooks";

const Cart = () => {
const cartItems = useAppSelector(selectCartItems);
Expand Down
10 changes: 5 additions & 5 deletions src/components/cart/CartTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { BranchItem, OrderItemType } from "@boklisten/bl-model";
import { TableCell, TableRow, Tooltip } from "@mui/material";
import moment from "moment";

import RemoveCartItemButton from "components/cart/RemoveCartItemButton";
import SelectDeadline from "components/cart/SelectDeadline";
import { CartItem } from "redux/cart";
import { useAppSelector } from "redux/hooks";
import { selectSubjects } from "redux/selectedSubjects";
import RemoveCartItemButton from "@/components/cart/RemoveCartItemButton";
import SelectDeadline from "@/components/cart/SelectDeadline";
import { CartItem } from "@/redux/cart";
import { useAppSelector } from "@/redux/hooks";
import { selectSubjects } from "@/redux/selectedSubjects";

const getReadableOrderType = (orderItemType: OrderItemType) =>
orderItemType === "extend" ? "forlenging" : "utkjøp";
Expand Down
4 changes: 2 additions & 2 deletions src/components/cart/RemoveCartItemButton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import CancelIcon from "@mui/icons-material/Cancel";
import { IconButton } from "@mui/material";

import { CartItem, removeCartItem } from "redux/cart";
import { useAppDispatch } from "redux/hooks";
import { CartItem, removeCartItem } from "@/redux/cart";
import { useAppDispatch } from "@/redux/hooks";

const RemoveCartItemButton = ({ cartItem }: { cartItem: CartItem }) => {
const dispatch = useAppDispatch();
Expand Down
6 changes: 3 additions & 3 deletions src/components/cart/SelectDeadline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { Branch, Period } from "@boklisten/bl-model";
import { FormControl, InputLabel, MenuItem, Select } from "@mui/material";
import moment from "moment";

import { CartItem, updatePeriod } from "redux/cart";
import { useAppDispatch } from "redux/hooks";
import { CartItem, updatePeriod } from "@/redux/cart";
import { useAppDispatch } from "@/redux/hooks";
import {
getOrderItemTypeFromBranch,
getPartlyPaymentPeriodDate,
getRentPeriodDate,
} from "utils/cartUtils";
} from "@/utils/cartUtils";

const getDeadline = (period: Period, branch: Branch) => {
const deadline =
Expand Down
Loading

0 comments on commit 890c10f

Please sign in to comment.