From cfe15ef5a825f681cbfd714503dbe11fcc8970c1 Mon Sep 17 00:00:00 2001 From: Timothee Date: Tue, 12 Mar 2024 20:25:40 +0100 Subject: [PATCH] fixed search bar loading, bumped version, improved readme --- README.md | 8 +- apps/client/package.json | 20 +- apps/client/public/index.html | 2 +- .../src/components/Layout/Sider/Sider.tsx | 24 +- apps/client/src/components/Loader/Loader.tsx | 1 - .../components/SiderSearch/SiderSearch.tsx | 8 +- apps/dev/package.json | 10 +- apps/server/package.json | 12 +- package.json | 2 +- yarn.lock | 681 +++++++++--------- 10 files changed, 391 insertions(+), 377 deletions(-) diff --git a/README.md b/README.md index e0cbb61a..f19b7593 100644 --- a/README.md +++ b/README.md @@ -91,14 +91,14 @@ You can follow the instructions [here](https://github.com/Yooooomi/your_spotify/ | API_ENDPOINT | REQUIRED | The endpoint of your server | | SPOTIFY_PUBLIC | REQUIRED | The public key of your Spotify application (cf [Creating the Spotify Application](#creating-the-spotify-application)) | | SPOTIFY_SECRET | REQUIRED | The secret key of your Spotify application (cf [Creating the Spotify Application](#creating-the-spotify-application)) | -| CORS | _not defined_ | List of comma-separated origin allowed | -| MAX_IMPORT_CACHE_SIZE | Infinite | The maximum element in the cache when importing data from an outside source, more cache means less requests to Spotify, resulting in faster imports | -| MONGO_ENDPOINT | mongodb://mongo:27017/your_spotify | The endpoint of the Mongo database, where **mongo** is the name of your service in the compose file | -| PORT | 8080 | The port of the server, do not modify if you're using docker | | TIMEZONE | Europe/Paris | The timezone of your stats, only affects read requests since data is saved with UTC time | +| MONGO_ENDPOINT | mongodb://mongo:27017/your_spotify | The endpoint of the Mongo database, where **mongo** is the name of your service in the compose file | | LOG_LEVEL | info | The log level, debug is useful if you encouter any bugs | +| CORS | _not defined_ | List of comma-separated origin allowed | | COOKIE_VALIDITY_MS | 1h | Validity time of the authentication cookie, following [this pattern](https://github.com/vercel/ms) | +| MAX_IMPORT_CACHE_SIZE | Infinite | The maximum element in the cache when importing data from an outside source, more cache means less requests to Spotify, resulting in faster imports | | MONGO_NO_ADMIN_RIGHTS | false | Do not ask for admin right on the Mongo database | +| PORT | 8080 | The port of the server, **do not** modify if you're using docker | ## CORS diff --git a/apps/client/package.json b/apps/client/package.json index 17eb9575..0ea392e0 100644 --- a/apps/client/package.json +++ b/apps/client/package.json @@ -1,6 +1,6 @@ { "name": "@your_spotify/client", - "version": "1.8.1", + "version": "1.9.0", "private": true, "scripts": { "start": "DISABLE_ESLINT_PLUGIN=true react-scripts start", @@ -12,29 +12,29 @@ "dependencies": { "@emotion/react": "11.11.4", "@emotion/styled": "11.11.0", - "@mui/icons-material": "5.15.11", - "@mui/material": "5.15.11", - "@mui/system": "5.15.11", - "@mui/x-date-pickers": "6.19.5", + "@mui/icons-material": "5.15.12", + "@mui/material": "5.15.12", + "@mui/system": "5.15.12", + "@mui/x-date-pickers": "6.19.6", "@reduxjs/toolkit": "2.2.1", "axios": "1.6.7", "clsx": "2.1.0", - "date-fns": "3.3.1", + "date-fns": "3.4.0", "react": "^18.2.0", "react-copy-to-clipboard": "^5.1.0", "react-dom": "^18.2.0", "react-infinite-scroll-component": "^6.1.0", "react-redux": "9.1.0", - "react-router-dom": "6.22.2", - "recharts": "2.12.1", + "react-router-dom": "6.22.3", + "recharts": "2.12.2", "redux": "5.0.1", "web-vitals": "3.5.2" }, "devDependencies": { - "@types/node": "20.11.22", + "@types/node": "20.11.26", "@types/react-copy-to-clipboard": "5.0.7", "@types/react-date-range": "1.4.9", - "@types/react-dom": "18.2.19", + "@types/react-dom": "18.2.21", "@your_spotify/dev": "*", "react-scripts": "^5.0.1" }, diff --git a/apps/client/public/index.html b/apps/client/public/index.html index 725e7f9d..04433d37 100644 --- a/apps/client/public/index.html +++ b/apps/client/public/index.html @@ -12,7 +12,7 @@ Restricting connect-src is done at start of the client server. --> - + diff --git a/apps/client/src/components/Layout/Sider/Sider.tsx b/apps/client/src/components/Layout/Sider/Sider.tsx index f972f3f3..6d3f2b36 100644 --- a/apps/client/src/components/Layout/Sider/Sider.tsx +++ b/apps/client/src/components/Layout/Sider/Sider.tsx @@ -4,23 +4,23 @@ import { useLocation, useNavigate } from "react-router-dom"; import { useSelector } from "react-redux"; import { SystemUpdateAlt as UpdateIcon } from "@mui/icons-material"; -import { Tooltip } from '@mui/material'; -import s from './index.module.css'; -import { useShareLink } from '../../../services/hooks/hooks'; -import { alertMessage } from '../../../services/redux/modules/message/reducer'; -import { selectUser } from '../../../services/redux/modules/user/selector'; -import { useAppDispatch } from '../../../services/redux/tools'; -import { LayoutContext } from '../LayoutContext'; -import SiderTitle from './SiderTitle'; -import SiderSearch from '../../SiderSearch'; -import { Album, Artist, TrackWithFullAlbum } from '../../../services/types'; -import SiderCategory from './SiderCategory/SiderCategory'; -import { links } from './types'; +import { Tooltip } from "@mui/material"; +import { useShareLink } from "../../../services/hooks/hooks"; +import { alertMessage } from "../../../services/redux/modules/message/reducer"; +import { selectUser } from "../../../services/redux/modules/user/selector"; +import { useAppDispatch } from "../../../services/redux/tools"; +import { LayoutContext } from "../LayoutContext"; +import SiderSearch from "../../SiderSearch"; +import { Album, Artist, TrackWithFullAlbum } from "../../../services/types"; import { selectUpdateAvailable, selectVersion, } from "../../../services/redux/modules/settings/selector"; import Text from "../../Text"; +import SiderCategory from "./SiderCategory/SiderCategory"; +import { links } from "./types"; +import SiderTitle from "./SiderTitle"; +import s from "./index.module.css"; interface SiderProps { className?: string; diff --git a/apps/client/src/components/Loader/Loader.tsx b/apps/client/src/components/Loader/Loader.tsx index fe8c5daa..ab619d8e 100644 --- a/apps/client/src/components/Loader/Loader.tsx +++ b/apps/client/src/components/Loader/Loader.tsx @@ -10,7 +10,6 @@ interface LoaderProps extends HTMLProps<"div"> { export default function Loader({ text, className, ...other }: LoaderProps) { return ( - // eslint-disable-next-line react/jsx-props-no-spreading
{text && ( diff --git a/apps/client/src/components/SiderSearch/SiderSearch.tsx b/apps/client/src/components/SiderSearch/SiderSearch.tsx index 30ee6ee5..238dff90 100644 --- a/apps/client/src/components/SiderSearch/SiderSearch.tsx +++ b/apps/client/src/components/SiderSearch/SiderSearch.tsx @@ -40,7 +40,7 @@ export default function SiderSearch({ const internOnArtistClick = useCallback( (artist: Artist) => { - setSearch(''); + setSearch(""); onArtistClick?.(artist); }, [onArtistClick], @@ -48,7 +48,7 @@ export default function SiderSearch({ const internOnAlbumClick = useCallback( (album: Album) => { - setSearch(''); + setSearch(""); onAlbumClick?.(album); }, [onAlbumClick], @@ -76,7 +76,7 @@ export default function SiderSearch({ - {loading && results === null && } + {loading && results === null && } {!loading && search.length < 3 && ( At least 3 characters @@ -139,7 +139,7 @@ export default function SiderSearch({