From 637b7fa1059c93b417f5e21cf2645b1a7fbc6425 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 00:42:36 +0000 Subject: [PATCH 1/8] Update dependency postcss to v8.4.47 --- package-lock.json | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 72060f9..63a1434 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7955,9 +7955,9 @@ "dev": true }, "node_modules/picocolors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", - "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true, "license": "ISC" }, @@ -8020,9 +8020,9 @@ } }, "node_modules/postcss": { - "version": "8.4.40", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.40.tgz", - "integrity": "sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q==", + "version": "8.4.47", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", + "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", "dev": true, "funding": [ { @@ -8041,8 +8041,8 @@ "license": "MIT", "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.1", - "source-map-js": "^1.2.0" + "picocolors": "^1.1.0", + "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" @@ -8943,10 +8943,11 @@ } }, "node_modules/source-map-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", - "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } From 69812ef5e827296cd486f59fafa034e4ba37c073 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 04:55:51 +0000 Subject: [PATCH 2/8] Update dependency start-server-and-test to v2.0.8 --- package-lock.json | 63 ++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index 63a1434..6fcc8a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -323,11 +323,6 @@ "ms": "^2.1.1" } }, - "node_modules/@cypress/xvfb/node_modules/ms": { - "version": "2.1.3", - "dev": true, - "license": "MIT" - }, "node_modules/@dinero.js/calculator-number": { "version": "2.0.0-alpha.14", "license": "MIT", @@ -905,11 +900,15 @@ }, "node_modules/@hapi/hoek": { "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", + "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==", "dev": true, "license": "BSD-3-Clause" }, "node_modules/@hapi/topo": { "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", + "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -1418,7 +1417,9 @@ } }, "node_modules/@sideway/address": { - "version": "4.1.4", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.5.tgz", + "integrity": "sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -1427,11 +1428,15 @@ }, "node_modules/@sideway/formula": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", + "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==", "dev": true, "license": "BSD-3-Clause" }, "node_modules/@sideway/pinpoint": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", + "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==", "dev": true, "license": "BSD-3-Clause" }, @@ -3402,9 +3407,9 @@ } }, "node_modules/axios": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz", - "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", @@ -4332,13 +4337,13 @@ "license": "MIT" }, "node_modules/debug": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", - "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -6621,13 +6626,15 @@ } }, "node_modules/joi": { - "version": "17.11.0", + "version": "17.13.3", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.13.3.tgz", + "integrity": "sha512-otDA4ldcIx+ZXsKHWmp0YizCweVRZG96J10b0FevjfuncLO1oX59THoAmHkNubYJ+9gWsYsp5k8v4ib6oDv1fA==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "@hapi/hoek": "^9.0.0", - "@hapi/topo": "^5.0.0", - "@sideway/address": "^4.1.3", + "@hapi/hoek": "^9.3.0", + "@hapi/topo": "^5.1.0", + "@sideway/address": "^4.1.5", "@sideway/formula": "^3.0.1", "@sideway/pinpoint": "^2.0.0" } @@ -7525,7 +7532,9 @@ } }, "node_modules/ms": { - "version": "2.1.2", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true, "license": "MIT" }, @@ -8994,20 +9003,20 @@ "license": "MIT" }, "node_modules/start-server-and-test": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-2.0.5.tgz", - "integrity": "sha512-2CV4pz69NJVJKQmJeSr+O+SPtOreu0yxvhPmSXclzmAKkPREuMabyMh+Txpzemjx0RDzXOcG2XkhiUuxjztSQw==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/start-server-and-test/-/start-server-and-test-2.0.8.tgz", + "integrity": "sha512-v2fV6NV2F7tL1ocwfI4Wpait+IKjRbT5l3ZZ+ZikXdMLmxYsS8ynGAsCQAUVXkVyGyS+UibsRnvgHkMvJIvCsw==", "dev": true, "license": "MIT", "dependencies": { "arg": "^5.0.2", "bluebird": "3.7.2", "check-more-types": "2.24.0", - "debug": "4.3.6", + "debug": "4.3.7", "execa": "5.1.1", "lazy-ass": "1.6.0", "ps-tree": "1.2.0", - "wait-on": "7.2.0" + "wait-on": "8.0.1" }, "bin": { "server-test": "src/bin/start.js", @@ -10220,12 +10229,14 @@ } }, "node_modules/wait-on": { - "version": "7.2.0", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-8.0.1.tgz", + "integrity": "sha512-1wWQOyR2LVVtaqrcIL2+OM+x7bkpmzVROa0Nf6FryXkS+er5Sa1kzFGjzZRqLnHa3n1rACFLeTwUqE1ETL9Mig==", "dev": true, "license": "MIT", "dependencies": { - "axios": "^1.6.1", - "joi": "^17.11.0", + "axios": "^1.7.7", + "joi": "^17.13.3", "lodash": "^4.17.21", "minimist": "^1.2.8", "rxjs": "^7.8.1" From bca8571c1847c750befb6bb76a304f700541fae3 Mon Sep 17 00:00:00 2001 From: tudor <7089284+tudddorrr@users.noreply.github.com> Date: Fri, 1 Nov 2024 22:54:40 +0000 Subject: [PATCH 3/8] allow updating game names --- src/api/updateGame.ts | 2 +- src/pages/Organisation.tsx | 85 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 82 insertions(+), 5 deletions(-) diff --git a/src/api/updateGame.ts b/src/api/updateGame.ts index 4adfeed..de5500b 100644 --- a/src/api/updateGame.ts +++ b/src/api/updateGame.ts @@ -5,7 +5,7 @@ import makeValidatedRequest from './makeValidatedRequest' import { Prop } from '../entities/prop' const updateGame = makeValidatedRequest( - (gameId: number, data: { props: Prop[] }) => api.patch(`/games/${gameId}`, data), + (gameId: number, data: { name?: string, props?: Prop[] }) => api.patch(`/games/${gameId}`, data), z.object({ game: gameSchema }) diff --git a/src/pages/Organisation.tsx b/src/pages/Organisation.tsx index 37804de..e8fdde7 100644 --- a/src/pages/Organisation.tsx +++ b/src/pages/Organisation.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react' +import { useCallback, useEffect, useState } from 'react' import { format } from 'date-fns' import { useRecoilValue } from 'recoil' import Page from '../components/Page' @@ -8,8 +8,8 @@ import TableCell from '../components/tables/TableCell' import organisationState from '../state/organisationState' import useOrganisation from '../api/useOrganisation' import Button from '../components/Button' -import { IconPlus } from '@tabler/icons-react' -import ErrorMessage from '../components/ErrorMessage' +import { IconCheck, IconPencil, IconPlus, IconX } from '@tabler/icons-react' +import ErrorMessage, { TaloError } from '../components/ErrorMessage' import NewInvite from '../modals/NewInvite' import SecondaryNav from '../components/SecondaryNav' import { secondaryNavRoutes } from './Dashboard' @@ -19,6 +19,9 @@ import userState, { AuthedUser } from '../state/userState' import SecondaryTitle from '../components/SecondaryTitle' import { UserType } from '../entities/user' import userTypeMap from '../constants/userTypeMap' +import TextInput from '../components/TextInput' +import updateGame from '../api/updateGame' +import buildError from '../utils/buildError' function Organisation() { const organisation = useRecoilValue(organisationState) @@ -26,6 +29,40 @@ function Organisation() { const [showModal, setShowModal] = useState(false) const user = useRecoilValue(userState) as AuthedUser + const [editingGameId, setEditingGameId] = useState(null) + const [editingGameName, setEditingGameName] = useState('') + const [editingGameNameError, setEditingGameNameError] = useState(null) + + useEffect(() => { + if (editingGameId) { + setEditingGameName(games.find((game) => game.id === editingGameId)!.name) + } else { + setEditingGameName('') + } + + setEditingGameNameError(null) + }, [editingGameId, games]) + + const onUpdateGameName = useCallback(async () => { + try { + const { game } = await updateGame(editingGameId!, { name: editingGameName }) + + mutate((data) => { + return { + ...data!, + games: data!.games.map((existingGame) => { + if (existingGame.id === editingGameId) return { ...existingGame, name: game.name } + return existingGame + }) + } + }, false) + + setEditingGameId(null) + } catch (err) { + setEditingGameNameError(buildError(err)) + } + }, [editingGameId, editingGameName, mutate]) + return ( Games + {editingGameNameError && } + {(game) => ( <> - {game.name} + + {editingGameId === game.id && + <> + +
+
({ @@ -117,7 +117,7 @@ export default function PlayerProfile() { <> {format(new Date(alias.createdAt), 'dd MMM Y, HH:mm')} - {format(new Date(alias.updatedAt), 'dd MMM Y, HH:mm')} + {format(new Date(alias.lastSeenAt), 'dd MMM Y, HH:mm')} )} From 4e0d9fc96d779def192a9175055016e28bd4ca52 Mon Sep 17 00:00:00 2001 From: tudor <7089284+tudddorrr@users.noreply.github.com> Date: Sat, 2 Nov 2024 10:24:43 +0000 Subject: [PATCH 7/8] remove codecov --- .github/workflows/ci.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0eeb236..df0d053 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,11 +20,7 @@ jobs: - name: Install deps run: npm ci --prefer-offline - - run: npm test -- --silent --coverage - - - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} + - run: npm test -- --silent e2e-tests: runs-on: ubuntu-latest From c5695e8b8e1f22089313c7155ad2fcf90a08bf72 Mon Sep 17 00:00:00 2001 From: tudor <7089284+tudddorrr@users.noreply.github.com> Date: Sat, 2 Nov 2024 10:33:22 +0000 Subject: [PATCH 8/8] 0.39.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6fcc8a9..901c029 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "frontend", - "version": "0.38.1", + "version": "0.39.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "version": "0.38.1", + "version": "0.39.0", "license": "MIT", "dependencies": { "@dinero.js/currencies": "^2.0.0-alpha.11", diff --git a/package.json b/package.json index c9db700..b67e00a 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "lint-staged": { "*.{ts,js,tsx,jsx}": "eslint --fix" }, - "version": "0.38.1", + "version": "0.39.0", "engines": { "node": "20.x" },