From 32f7227e7d59ffb0fd5c04b2cf07569244d49a24 Mon Sep 17 00:00:00 2001 From: meziyum Date: Wed, 15 Mar 2023 04:14:10 +0530 Subject: [PATCH 01/41] Initial Refactor --- src/client/components/input/drag-and-drop.js | 95 +++++++++----------- 1 file changed, 42 insertions(+), 53 deletions(-) diff --git a/src/client/components/input/drag-and-drop.js b/src/client/components/input/drag-and-drop.js index 4b5e60ec62..f1ff79ab09 100644 --- a/src/client/components/input/drag-and-drop.js +++ b/src/client/components/input/drag-and-drop.js @@ -19,43 +19,34 @@ import * as bootstrap from 'react-bootstrap'; import PropTypes from 'prop-types'; import React from 'react'; +import { useState } from 'react'; const {Card, Form} = bootstrap; -class DragAndDrop extends React.Component { - constructor() { - super(); - this.handleClick = this.handleClick.bind(this); - this.handleDragOver = this.handleDragOver.bind(this); - this.handleDrop = this.handleDrop.bind(this); - this.state = { - achievement: { - name: 'drag badge to set', - src: '/images/blankbadge.svg' - } - }; - } +function DragAndDrop(props) { + const [achievement, setAchievement] = useState({ + name: 'drag badge to set', + src: '/images/blankbadge.svg' + }); - handleClick(ev) { + const handleClick = (ev) => { ev.preventDefault(); - this.setState({ - achievement: { - name: 'drag badge to set', - src: '/images/blankbadge.svg' - } + setAchievement({ + name: 'drag badge to set', + src: '/images/blankbadge.svg' }); } - handleDragOver(ev) { + const handleDragOver = (ev) => { ev.preventDefault(); } - addChild(data) { - this.setState({achievement: data}); + const addChild = (data) => { + setAchievement(data); } - handleDrop(ev) { + const handleDrop = (ev) => { ev.preventDefault(); let data; @@ -65,38 +56,36 @@ class DragAndDrop extends React.Component { catch (err) { return; } - this.addChild(data); + addChild(data); } - render() { - return ( - - - - - - -
- {this.state.achievement.name} -
-
-
- ); - } + return ( + + + + + + +
+ {achievement.name} +
+
+
+ ); } DragAndDrop.displayName = 'DragAndDrop'; From ec37cd2536f6bb3814f8064dd1f31a917260fa48 Mon Sep 17 00:00:00 2001 From: meziyum Date: Wed, 15 Mar 2023 04:51:48 +0530 Subject: [PATCH 02/41] ES-Lint fixes --- src/client/components/input/drag-and-drop.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/client/components/input/drag-and-drop.js b/src/client/components/input/drag-and-drop.js index f1ff79ab09..4ffc1d84f1 100644 --- a/src/client/components/input/drag-and-drop.js +++ b/src/client/components/input/drag-and-drop.js @@ -19,10 +19,10 @@ import * as bootstrap from 'react-bootstrap'; import PropTypes from 'prop-types'; import React from 'react'; -import { useState } from 'react'; const {Card, Form} = bootstrap; +const {useState} = React; function DragAndDrop(props) { const [achievement, setAchievement] = useState({ @@ -30,7 +30,7 @@ function DragAndDrop(props) { src: '/images/blankbadge.svg' }); - const handleClick = (ev) => { + function handleClick(ev) { ev.preventDefault(); setAchievement({ name: 'drag badge to set', @@ -38,15 +38,15 @@ function DragAndDrop(props) { }); } - const handleDragOver = (ev) => { + function handleDragOver(ev) { ev.preventDefault(); } - const addChild = (data) => { + function addChild(data) { setAchievement(data); } - const handleDrop = (ev) => { + function handleDrop(ev) { ev.preventDefault(); let data; From e70d09129ba9e9b78a91bb6f7ba528c60aa5ecb2 Mon Sep 17 00:00:00 2001 From: meziyum Date: Wed, 15 Mar 2023 05:01:50 +0530 Subject: [PATCH 03/41] eslint-disable react/jsx-no-bind --- src/client/components/input/drag-and-drop.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/components/input/drag-and-drop.js b/src/client/components/input/drag-and-drop.js index 4ffc1d84f1..de01f44646 100644 --- a/src/client/components/input/drag-and-drop.js +++ b/src/client/components/input/drag-and-drop.js @@ -58,7 +58,7 @@ function DragAndDrop(props) { } addChild(data); } - + /* eslint-disable react/jsx-no-bind */ return ( Date: Wed, 15 Mar 2023 05:09:33 +0530 Subject: [PATCH 04/41] Fix react/jsx-no-bind --- src/client/components/input/drag-and-drop.js | 23 ++++++++------------ 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/client/components/input/drag-and-drop.js b/src/client/components/input/drag-and-drop.js index de01f44646..cd820eff04 100644 --- a/src/client/components/input/drag-and-drop.js +++ b/src/client/components/input/drag-and-drop.js @@ -22,31 +22,24 @@ import React from 'react'; const {Card, Form} = bootstrap; -const {useState} = React; +const {useState, useCallback} = React; function DragAndDrop(props) { const [achievement, setAchievement] = useState({ name: 'drag badge to set', src: '/images/blankbadge.svg' }); - - function handleClick(ev) { + const handleClick = useCallback((ev) => { ev.preventDefault(); setAchievement({ name: 'drag badge to set', src: '/images/blankbadge.svg' }); - } - - function handleDragOver(ev) { + }); + const handleDragOver = useCallback((ev) => { ev.preventDefault(); - } - - function addChild(data) { - setAchievement(data); - } - - function handleDrop(ev) { + }); + const handleDrop = useCallback((ev) => { ev.preventDefault(); let data; @@ -57,8 +50,10 @@ function DragAndDrop(props) { return; } addChild(data); + }); + function addChild(data) { + setAchievement(data); } - /* eslint-disable react/jsx-no-bind */ return ( Date: Wed, 15 Mar 2023 05:13:10 +0530 Subject: [PATCH 05/41] add_child fix --- src/client/components/input/drag-and-drop.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/components/input/drag-and-drop.js b/src/client/components/input/drag-and-drop.js index cd820eff04..181d2ca62e 100644 --- a/src/client/components/input/drag-and-drop.js +++ b/src/client/components/input/drag-and-drop.js @@ -29,6 +29,9 @@ function DragAndDrop(props) { name: 'drag badge to set', src: '/images/blankbadge.svg' }); + function addChild(data) { + setAchievement(data); + } const handleClick = useCallback((ev) => { ev.preventDefault(); setAchievement({ @@ -51,9 +54,6 @@ function DragAndDrop(props) { } addChild(data); }); - function addChild(data) { - setAchievement(data); - } return ( Date: Wed, 22 Mar 2023 03:22:34 +0530 Subject: [PATCH 06/41] Convert to .tsx The .js file has been converted to .tsx for proper typesafe. The tsconfig has strict mode set to false even then we are using event definition in typescript for future proofing in case we need to change the mode to strict. --- .../{drag-and-drop.js => drag-and-drop.tsx} | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) rename src/client/components/input/{drag-and-drop.js => drag-and-drop.tsx} (74%) diff --git a/src/client/components/input/drag-and-drop.js b/src/client/components/input/drag-and-drop.tsx similarity index 74% rename from src/client/components/input/drag-and-drop.js rename to src/client/components/input/drag-and-drop.tsx index 181d2ca62e..b2ce13da36 100644 --- a/src/client/components/input/drag-and-drop.js +++ b/src/client/components/input/drag-and-drop.tsx @@ -24,35 +24,41 @@ import React from 'react'; const {Card, Form} = bootstrap; const {useState, useCallback} = React; -function DragAndDrop(props) { - const [achievement, setAchievement] = useState({ +type Achievement = { + name: string; + src: string; + id: string; +}; +type Props = { + name: string; +}; + +function DragAndDrop({name}: Props) { + const [achievement, setAchievement] = useState({ name: 'drag badge to set', src: '/images/blankbadge.svg' }); - function addChild(data) { - setAchievement(data); - } - const handleClick = useCallback((ev) => { - ev.preventDefault(); + const handleClick = useCallback((event: React.MouseEvent) => { + event.preventDefault(); setAchievement({ name: 'drag badge to set', src: '/images/blankbadge.svg' }); }); - const handleDragOver = useCallback((ev) => { - ev.preventDefault(); + const handleDragOver = useCallback((event: React.DragEvent) => { + event.preventDefault(); }); - const handleDrop = useCallback((ev) => { - ev.preventDefault(); + const handleDrop = useCallback((event: React.DragEvent) => { + event.preventDefault(); let data; try { - data = JSON.parse(ev.dataTransfer.getData('text')); + data = JSON.parse(event.dataTransfer.getData('text')); } - catch (err) { + catch (error) { return; } - addChild(data); + setAchievement(data); }); return ( From ae13dda69a674ea4cc200a032bb356afb7dd8d93 Mon Sep 17 00:00:00 2001 From: meziyum Date: Wed, 22 Mar 2023 04:12:31 +0530 Subject: [PATCH 07/41] Documentation --- src/client/components/input/drag-and-drop.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/client/components/input/drag-and-drop.tsx b/src/client/components/input/drag-and-drop.tsx index b2ce13da36..64a48e4e29 100644 --- a/src/client/components/input/drag-and-drop.tsx +++ b/src/client/components/input/drag-and-drop.tsx @@ -24,15 +24,34 @@ import React from 'react'; const {Card, Form} = bootstrap; const {useState, useCallback} = React; +/** +* The Achievement interface, defining the properties of an achievement. +* @typedef +* @property {string} name - The name of the achievement. +* @property {string} src - The source URL of the achievement's badge image. +* @property {string} id - The ID of the achievement. +*/ type Achievement = { name: string; src: string; id: string; }; +/** + * Props for DragAndDropImage component + * @typedef {Object} Props + * @property {string} name - The name of the DragAndDrop component. + */ type Props = { name: string; }; +/** +* A component for a drag-and-drop card that displays an achievement. +* The card displays an image of the achievement and allows the user to drag and drop a different achievement onto it. +* When a new achievement is dropped onto the card, it is displayed instead of the original achievement. +* @param {Props} props - The props object containing the following: +* @returns {JSX.Element} A React component that displays a drag-and-drop card for an achievement. +*/ function DragAndDrop({name}: Props) { const [achievement, setAchievement] = useState({ name: 'drag badge to set', From af579d22fa4f44f2ca92c3bf290a7eda5dadc090 Mon Sep 17 00:00:00 2001 From: meziyum Date: Wed, 22 Mar 2023 04:48:45 +0530 Subject: [PATCH 08/41] JSX.Element --- src/client/components/input/drag-and-drop.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/components/input/drag-and-drop.tsx b/src/client/components/input/drag-and-drop.tsx index 64a48e4e29..6886b98200 100644 --- a/src/client/components/input/drag-and-drop.tsx +++ b/src/client/components/input/drag-and-drop.tsx @@ -52,7 +52,7 @@ type Props = { * @param {Props} props - The props object containing the following: * @returns {JSX.Element} A React component that displays a drag-and-drop card for an achievement. */ -function DragAndDrop({name}: Props) { +function DragAndDrop({name}: Props): JSX.Element { const [achievement, setAchievement] = useState({ name: 'drag badge to set', src: '/images/blankbadge.svg' From ca5ac34beefa6e191297dfc16b0e239e0567c6e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 19:49:24 +0000 Subject: [PATCH 09/41] chore(deps-dev): bump @babel/preset-react from 7.18.6 to 7.22.15 Bumps [@babel/preset-react](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-react) from 7.18.6 to 7.22.15. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.22.15/packages/babel-preset-react) --- updated-dependencies: - dependency-name: "@babel/preset-react" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 132 ++++++++++++++++++++++++++++++--------------------- 2 files changed, 80 insertions(+), 54 deletions(-) diff --git a/package.json b/package.json index 33f83fd093..ca24d3f02a 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "@babel/plugin-transform-classes": "^7.16.7", "@babel/plugin-transform-runtime": "^7.17.0", "@babel/preset-env": "^7.10.1", - "@babel/preset-react": "^7.18.6", + "@babel/preset-react": "^7.22.15", "@babel/preset-typescript": "^7.12.1", "@babel/register": "^7.17.0", "@faker-js/faker": "^7.2.0", diff --git a/yarn.lock b/yarn.lock index c504e90081..615a3e19b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -125,12 +125,12 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-annotate-as-pure@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb" - integrity sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA== +"@babel/helper-annotate-as-pure@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" + integrity sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg== dependencies: - "@babel/types" "^7.18.6" + "@babel/types" "^7.22.5" "@babel/helper-builder-binary-assignment-operator-visitor@^7.16.0": version "7.16.0" @@ -284,6 +284,13 @@ dependencies: "@babel/types" "^7.18.6" +"@babel/helper-module-imports@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz#16146307acdc40cc00c3b2c647713076464bdbf0" + integrity sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w== + dependencies: + "@babel/types" "^7.22.15" + "@babel/helper-module-transforms@^7.16.0", "@babel/helper-module-transforms@^7.20.11": version "7.20.11" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz#df4c7af713c557938c50ea3ad0117a7944b2f1b0" @@ -305,10 +312,10 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629" - integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ== +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" + integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== "@babel/helper-remap-async-to-generator@^7.16.0", "@babel/helper-remap-async-to-generator@^7.16.4": version "7.16.4" @@ -370,6 +377,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== +"@babel/helper-string-parser@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" + integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== + "@babel/helper-validator-identifier@^7.15.7": version "7.15.7" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" @@ -385,10 +397,15 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== -"@babel/helper-validator-option@^7.14.5", "@babel/helper-validator-option@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" - integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== +"@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== + +"@babel/helper-validator-option@^7.14.5", "@babel/helper-validator-option@^7.18.6", "@babel/helper-validator-option@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz#694c30dfa1d09a6534cdfcafbe56789d36aba040" + integrity sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA== "@babel/helper-wrap-function@^7.16.0": version "7.16.0" @@ -651,12 +668,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-syntax-jsx@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz#a8feef63b010150abd97f1649ec296e849943ca0" - integrity sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q== +"@babel/plugin-syntax-jsx@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz#a6b68e84fb76e759fc3b93e901876ffabbe1d918" + integrity sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-logical-assignment-operators@^7.10.4", "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": version "7.10.4" @@ -912,38 +929,38 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-transform-react-display-name@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.18.6.tgz#8b1125f919ef36ebdfff061d664e266c666b9415" - integrity sha512-TV4sQ+T013n61uMoygyMRm+xf04Bd5oqFpv2jAEQwSZ8NwQA7zeRPg1LMVg2PWi3zWBz+CLKD+v5bcpZ/BS0aA== +"@babel/plugin-transform-react-display-name@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.22.5.tgz#3c4326f9fce31c7968d6cb9debcaf32d9e279a2b" + integrity sha512-PVk3WPYudRF5z4GKMEYUrLjPl38fJSKNaEOkFuoprioowGuWN6w2RKznuFNSlJx7pzzXXStPUnNSOEO0jL5EVw== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-react-jsx-development@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.18.6.tgz#dbe5c972811e49c7405b630e4d0d2e1380c0ddc5" - integrity sha512-SA6HEjwYFKF7WDjWcMcMGUimmw/nhNRDWxr+KaLSCrkD/LMDBvWRmHAYgE1HDeF8KUuI8OAu+RT6EOtKxSW2qA== +"@babel/plugin-transform-react-jsx-development@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.22.5.tgz#e716b6edbef972a92165cd69d92f1255f7e73e87" + integrity sha512-bDhuzwWMuInwCYeDeMzyi7TaBgRQei6DqxhbyniL7/VG4RSS7HtSL2QbY4eESy1KJqlWt8g3xeEBGPuo+XqC8A== dependencies: - "@babel/plugin-transform-react-jsx" "^7.18.6" + "@babel/plugin-transform-react-jsx" "^7.22.5" -"@babel/plugin-transform-react-jsx@^7.18.6": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.20.7.tgz#025d85a1935fd7e19dfdcb1b1d4df34d4da484f7" - integrity sha512-Tfq7qqD+tRj3EoDhY00nn2uP2hsRxgYGi5mLQ5TimKav0a9Lrpd4deE+fcLXU8zFYRjlKPHZhpCvfEA6qnBxqQ== +"@babel/plugin-transform-react-jsx@^7.22.15", "@babel/plugin-transform-react-jsx@^7.22.5": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.22.15.tgz#7e6266d88705d7c49f11c98db8b9464531289cd6" + integrity sha512-oKckg2eZFa8771O/5vi7XeTvmM6+O9cxZu+kanTU7tD4sin5nO/G8jGJhq8Hvt2Z0kUoEDRayuZLaUlYl8QuGA== dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/plugin-syntax-jsx" "^7.18.6" - "@babel/types" "^7.20.7" + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-module-imports" "^7.22.15" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-jsx" "^7.22.5" + "@babel/types" "^7.22.15" -"@babel/plugin-transform-react-pure-annotations@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.18.6.tgz#561af267f19f3e5d59291f9950fd7b9663d0d844" - integrity sha512-I8VfEPg9r2TRDdvnHgPepTKvuRomzA8+u+nhY7qSI1fR2hRNebasZEETLyM5mAUr0Ku56OkXJ0I7NHJnO6cJiQ== +"@babel/plugin-transform-react-pure-annotations@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.22.5.tgz#1f58363eef6626d6fa517b95ac66fe94685e32c0" + integrity sha512-gP4k85wx09q+brArVinTXhWiyzLl9UpmGva0+mWyKxk6JZequ05x3eUcIUE+FyttPKJFRRVtAvQaJ6YF9h1ZpA== dependencies: - "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-annotate-as-pure" "^7.22.5" + "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-transform-regenerator@^7.16.0": version "7.16.0" @@ -1122,17 +1139,17 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/preset-react@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.18.6.tgz#979f76d6277048dc19094c217b507f3ad517dd2d" - integrity sha512-zXr6atUmyYdiWRVLOZahakYmOBHtWc2WGCkP8PYTgZi0iJXDY2CN180TdrIW4OGOAdLc7TifzDIvtx6izaRIzg== +"@babel/preset-react@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.22.15.tgz#9a776892b648e13cc8ca2edf5ed1264eea6b6afc" + integrity sha512-Csy1IJ2uEh/PecCBXXoZGAZBeCATTuePzCSB7dLYWS0vOEj6CNpjxIhW4duWwZodBNueH7QO14WbGn8YyeuN9w== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-validator-option" "^7.18.6" - "@babel/plugin-transform-react-display-name" "^7.18.6" - "@babel/plugin-transform-react-jsx" "^7.18.6" - "@babel/plugin-transform-react-jsx-development" "^7.18.6" - "@babel/plugin-transform-react-pure-annotations" "^7.18.6" + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-validator-option" "^7.22.15" + "@babel/plugin-transform-react-display-name" "^7.22.5" + "@babel/plugin-transform-react-jsx" "^7.22.15" + "@babel/plugin-transform-react-jsx-development" "^7.22.5" + "@babel/plugin-transform-react-pure-annotations" "^7.22.5" "@babel/preset-typescript@^7.12.1": version "7.16.0" @@ -1195,6 +1212,15 @@ "@babel/helper-validator-identifier" "^7.19.1" to-fast-properties "^2.0.0" +"@babel/types@^7.22.15", "@babel/types@^7.22.5": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.0.tgz#8c1f020c9df0e737e4e247c0619f58c68458aaeb" + integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg== + dependencies: + "@babel/helper-string-parser" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.20" + to-fast-properties "^2.0.0" + "@cospired/i18n-iso-languages@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@cospired/i18n-iso-languages/-/i18n-iso-languages-4.0.0.tgz#fbd54bd046e28295a2ab8f3806c77b0d92852b29" From b6aaeba76da81b393d6c7440284dcb31013a6efe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 19:56:27 +0000 Subject: [PATCH 10/41] chore(deps-dev): bump @faker-js/faker from 7.2.0 to 8.1.0 Bumps [@faker-js/faker](https://github.com/faker-js/faker) from 7.2.0 to 8.1.0. - [Release notes](https://github.com/faker-js/faker/releases) - [Changelog](https://github.com/faker-js/faker/blob/next/CHANGELOG.md) - [Commits](https://github.com/faker-js/faker/compare/v7.2.0...v8.1.0) --- updated-dependencies: - dependency-name: "@faker-js/faker" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 33f83fd093..78b82f2d0b 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,7 @@ "@babel/preset-react": "^7.18.6", "@babel/preset-typescript": "^7.12.1", "@babel/register": "^7.17.0", - "@faker-js/faker": "^7.2.0", + "@faker-js/faker": "^8.1.0", "@types/express": "^4.17.15", "@types/lodash": "^4.14.191", "@types/react-select": "^4.0.18", diff --git a/yarn.lock b/yarn.lock index c504e90081..6e2afa4b3c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1348,10 +1348,10 @@ resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.47.0.tgz#5478fdf443ff8158f9de171c704ae45308696c7d" integrity sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og== -"@faker-js/faker@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@faker-js/faker/-/faker-7.2.0.tgz#c5fe4c34f3a3664ac64fe1a21bac2004ea5faa22" - integrity sha512-dzjQ0LFT+bPLWg0yyV3MpxaLJp/+VW4a0SnjNSWJ4YpJ928LXDOZAN+kB2/JPPisI3Ra0w2BxbD4M9J7o0jcpw== +"@faker-js/faker@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@faker-js/faker/-/faker-8.1.0.tgz#e14896f1c57af2495e341dc4c7bf04125c8aeafd" + integrity sha512-38DT60rumHfBYynif3lmtxMqMqmsOQIxQgEuPZxCk2yUYN0eqWpTACgxi0VpidvsJB8CRxCpvP7B3anK85FjtQ== "@fortawesome/fontawesome-common-types@6.1.1": version "6.1.1" From 97b568bd367adc83bc85a8f92f9f430767f61ea1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Sep 2023 21:45:27 +0000 Subject: [PATCH 11/41] chore(deps): bump get-func-name from 2.0.0 to 2.0.2 Bumps [get-func-name](https://github.com/chaijs/get-func-name) from 2.0.0 to 2.0.2. - [Release notes](https://github.com/chaijs/get-func-name/releases) - [Commits](https://github.com/chaijs/get-func-name/commits/v2.0.2) --- updated-dependencies: - dependency-name: get-func-name dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c504e90081..2fb26eedad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4637,9 +4637,9 @@ get-caller-file@^2.0.5: integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== get-func-name@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" - integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= + version "2.0.2" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" + integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: version "1.1.1" From 1a1c5f45c4b524308987f74162b3c6ec26c3ee5b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 15:11:05 +0000 Subject: [PATCH 12/41] chore(deps): bump postcss from 8.4.11 to 8.4.31 Bumps [postcss](https://github.com/postcss/postcss) from 8.4.11 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.4.11...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2fb26eedad..f75ecdb41e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6232,10 +6232,10 @@ nanoid@3.1.25: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.25.tgz#09ca32747c0e543f0e1814b7d3793477f9c8e152" integrity sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q== -nanoid@^3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.1.tgz#6347a18cac88af88f58af0b3594b723d5e99bb35" - integrity sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw== +nanoid@^3.3.6: + version "3.3.6" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" + integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA== natural-compare@^1.4.0: version "1.4.0" @@ -6866,11 +6866,11 @@ postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== postcss@^8.2.14, postcss@^8.4.7: - version "8.4.11" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.11.tgz#a06229f23820b4ddd46500a3e38dbca1598a8e8d" - integrity sha512-D+jFLnT0ilGfy4CVBGbC+XE68HkVpT8+CUkDrcSpgxmo4RKco2uaZ4kIoyVGEm+m8KN/+Vwgs8MtpNbQ3/ma9w== + version "8.4.31" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.31.tgz#92b451050a9f914da6755af352bdc0192508656d" + integrity sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ== dependencies: - nanoid "^3.3.1" + nanoid "^3.3.6" picocolors "^1.0.0" source-map-js "^1.0.2" From b331f05789a7ef9d8807fc1f1899ccc3f253229c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Oct 2023 16:40:44 +0000 Subject: [PATCH 13/41] chore(deps-dev): bump @babel/plugin-proposal-object-rest-spread Bumps [@babel/plugin-proposal-object-rest-spread](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-proposal-object-rest-spread) from 7.17.3 to 7.20.7. - [Release notes](https://github.com/babel/babel/releases) - [Commits](https://github.com/babel/babel/commits/v7.20.7/packages/babel-plugin-proposal-object-rest-spread) --- updated-dependencies: - dependency-name: "@babel/plugin-proposal-object-rest-spread" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 37 ++++++++++++++++--------------------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 503f8e2c11..86adf97a0d 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "@babel/core": "^7.20.12", "@babel/node": "^7.14.2", "@babel/plugin-proposal-class-properties": "^7.10.1", - "@babel/plugin-proposal-object-rest-spread": "^7.17.3", + "@babel/plugin-proposal-object-rest-spread": "^7.20.7", "@babel/plugin-transform-classes": "^7.16.7", "@babel/plugin-transform-runtime": "^7.17.0", "@babel/preset-env": "^7.10.1", diff --git a/yarn.lock b/yarn.lock index 034d9ac7e9..412af24f49 100644 --- a/yarn.lock +++ b/yarn.lock @@ -78,12 +78,7 @@ dependencies: "@babel/highlight" "^7.18.6" -"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.16.4", "@babel/compat-data@^7.17.0": - version "7.17.7" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.7.tgz#078d8b833fbbcc95286613be8c716cef2b519fa2" - integrity sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ== - -"@babel/compat-data@^7.20.5": +"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.16.4", "@babel/compat-data@^7.20.5": version "7.20.10" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.10.tgz#9d92fa81b87542fff50e848ed585b4212c1d34ec" integrity sha512-sEnuDPpOJR/fcafHMjpcpGN5M2jbUGUHwmuWKM/YdPzeEDJg8bgmbcWQFUfE32MQjti1koACvoPVsDe8Uq+idg== @@ -140,7 +135,7 @@ "@babel/helper-explode-assignable-expression" "^7.16.0" "@babel/types" "^7.16.0" -"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.16.3", "@babel/helper-compilation-targets@^7.16.7", "@babel/helper-compilation-targets@^7.20.7": +"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.16.3", "@babel/helper-compilation-targets@^7.20.7": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz#a6cd33e93629f5eb473b021aac05df62c4cd09bb" integrity sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ== @@ -312,7 +307,7 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== @@ -551,16 +546,16 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@^7.16.0", "@babel/plugin-proposal-object-rest-spread@^7.17.3": - version "7.17.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.17.3.tgz#d9eb649a54628a51701aef7e0ea3d17e2b9dd390" - integrity sha512-yuL5iQA/TbZn+RGAfxQXfi7CNLmKi1f8zInn4IgobuCWcAb7i+zj4TYzQ9l8cEzVyJ89PDGuqxK1xZpUDISesw== +"@babel/plugin-proposal-object-rest-spread@^7.16.0", "@babel/plugin-proposal-object-rest-spread@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz#aa662940ef425779c75534a5c41e9d936edc390a" + integrity sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg== dependencies: - "@babel/compat-data" "^7.17.0" - "@babel/helper-compilation-targets" "^7.16.7" - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/compat-data" "^7.20.5" + "@babel/helper-compilation-targets" "^7.20.7" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.16.7" + "@babel/plugin-transform-parameters" "^7.20.7" "@babel/plugin-proposal-optional-catch-binding@^7.16.0": version "7.16.0" @@ -915,12 +910,12 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/helper-replace-supers" "^7.16.0" -"@babel/plugin-transform-parameters@^7.16.3", "@babel/plugin-transform-parameters@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.7.tgz#a1721f55b99b736511cb7e0152f61f17688f331f" - integrity sha512-AT3MufQ7zZEhU2hwOA11axBnExW0Lszu4RL/tAlUJBuNoRak+wehQW8h6KcXOcgjY42fHtDxswuMhMjFEuv/aw== +"@babel/plugin-transform-parameters@^7.16.3", "@babel/plugin-transform-parameters@^7.20.7": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.15.tgz#719ca82a01d177af358df64a514d64c2e3edb114" + integrity sha512-hjk7qKIqhyzhhUvRT683TYQOFa/4cQKwQy7ALvTpODswN40MljzNDa0YldevS6tGbxwaEKVn502JmY0dP7qEtQ== dependencies: - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-transform-property-literals@^7.16.0": version "7.16.0" From aa029d8b0c34dd28d623697bb8c98911a0c1946a Mon Sep 17 00:00:00 2001 From: David Kellner <52860029+kellnerd@users.noreply.github.com> Date: Mon, 16 Oct 2023 18:21:36 +0200 Subject: [PATCH 14/41] chore(ts): follow the latest type renaming in bookbrainz-data --- src/client/components/pages/entities/wikipedia-extract.tsx | 4 ++-- src/common/helpers/utils.ts | 4 ++-- src/common/helpers/wikimedia.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/components/pages/entities/wikipedia-extract.tsx b/src/client/components/pages/entities/wikipedia-extract.tsx index e8433e425a..95bfb08907 100644 --- a/src/client/components/pages/entities/wikipedia-extract.tsx +++ b/src/client/components/pages/entities/wikipedia-extract.tsx @@ -20,13 +20,13 @@ import {Col, Row} from 'react-bootstrap'; import React, {useEffect, useState} from 'react'; import {WikipediaArticleExtract, buildWikipediaUrl, getWikidataId} from '../../../../common/helpers/wikimedia'; import DOMPurify from 'isomorphic-dompurify'; -import type {EntityT} from 'bookbrainz-data/lib/types/entity'; +import type {LazyLoadedEntityT} from 'bookbrainz-data/lib/types/entity'; import {getAliasLanguageCodes} from '../../../../common/helpers/utils'; import {uniq} from 'lodash'; type Props = { - entity: EntityT, + entity: LazyLoadedEntityT, articleExtract?: WikipediaArticleExtract, }; diff --git a/src/common/helpers/utils.ts b/src/common/helpers/utils.ts index 6e92b86461..0e718ec8a6 100644 --- a/src/common/helpers/utils.ts +++ b/src/common/helpers/utils.ts @@ -1,8 +1,8 @@ import {EntityType, Relationship, RelationshipForDisplay} from '../../client/entity-editor/relationship-editor/types'; import {isString, kebabCase, toString, upperFirst} from 'lodash'; -import type {EntityT} from 'bookbrainz-data/lib/types/entity'; import {IdentifierType} from '../../client/unified-form/interface/type'; +import type {LazyLoadedEntityT} from 'bookbrainz-data/lib/types/entity'; /** * Regular expression for valid BookBrainz UUIDs (bbid) @@ -318,7 +318,7 @@ export async function getEntityAlias(orm, bbid:string, type:EntityType):Promise< return entityData; } -export function getAliasLanguageCodes(entity: EntityT) { +export function getAliasLanguageCodes(entity: LazyLoadedEntityT) { return entity.aliasSet?.aliases .map((alias) => alias.language?.isoCode1) // less common languages (and [Multiple languages]) do not have a two-letter ISO code, ignore them for now diff --git a/src/common/helpers/wikimedia.ts b/src/common/helpers/wikimedia.ts index fef10fe264..819eedd048 100644 --- a/src/common/helpers/wikimedia.ts +++ b/src/common/helpers/wikimedia.ts @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -import type {EntityT, EntityTypeString} from 'bookbrainz-data/lib/types/entity'; +import type {EntityTypeString, LazyLoadedEntityT} from 'bookbrainz-data/lib/types/entity'; export type WikipediaArticle = { @@ -56,7 +56,7 @@ const wikidataIdentifierTypeIds: Record = { Work: 21 }; -export function getWikidataId(entity: EntityT) { +export function getWikidataId(entity: LazyLoadedEntityT) { const identifiers = entity.identifierSet?.identifiers; const wikidataTypeId = wikidataIdentifierTypeIds[entity.type]; return identifiers?.find((identifier) => identifier.typeId === wikidataTypeId)?.value; From 41b4658a1d814b7f4490c26cb6a0e57d41566340 Mon Sep 17 00:00:00 2001 From: David Kellner <52860029+kellnerd@users.noreply.github.com> Date: Mon, 16 Oct 2023 18:22:17 +0200 Subject: [PATCH 15/41] chore: resolve linter error --- src/client/components/input/drag-and-drop.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/components/input/drag-and-drop.tsx b/src/client/components/input/drag-and-drop.tsx index 6886b98200..7ec2ec3fa9 100644 --- a/src/client/components/input/drag-and-drop.tsx +++ b/src/client/components/input/drag-and-drop.tsx @@ -36,6 +36,7 @@ type Achievement = { src: string; id: string; }; + /** * Props for DragAndDropImage component * @typedef {Object} Props From f311d9c660d5f531beaf545c05a41636951598ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 19:50:37 +0000 Subject: [PATCH 16/41] chore(deps): bump express-session from 1.17.2 to 1.17.3 Bumps [express-session](https://github.com/expressjs/session) from 1.17.2 to 1.17.3. - [Release notes](https://github.com/expressjs/session/releases) - [Changelog](https://github.com/expressjs/session/blob/master/HISTORY.md) - [Commits](https://github.com/expressjs/session/compare/v1.17.2...v1.17.3) --- updated-dependencies: - dependency-name: express-session dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 86adf97a0d..5b1faa43a8 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "date-fns": "^2.15.0", "debug": "^4.3.2", "express": "^4.18.2", - "express-session": "^1.17.1", + "express-session": "^1.17.3", "express-slow-down": "^1.3.1", "http-status": "^1.6.2", "immutable": "^3.8.2", diff --git a/yarn.lock b/yarn.lock index 412af24f49..9b272058be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3241,10 +3241,10 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= -cookie@0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" - integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== +cookie@0.4.2: + version "0.4.2" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" + integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== cookie@0.5.0: version "0.5.0" @@ -4301,12 +4301,12 @@ expect@^28.1.3: jest-message-util "^28.1.3" jest-util "^28.1.3" -express-session@^1.17.1: - version "1.17.2" - resolved "https://registry.yarnpkg.com/express-session/-/express-session-1.17.2.tgz#397020374f9bf7997f891b85ea338767b30d0efd" - integrity sha512-mPcYcLA0lvh7D4Oqr5aNJFMtBMKPLl++OKKxkHzZ0U0oDq1rpKBnkR5f5vCHR26VeArlTOEF9td4x5IjICksRQ== +express-session@^1.17.3: + version "1.17.3" + resolved "https://registry.yarnpkg.com/express-session/-/express-session-1.17.3.tgz#14b997a15ed43e5949cb1d073725675dd2777f36" + integrity sha512-4+otWXlShYlG1Ma+2Jnn+xgKUZTMJ5QD3YvfilX3AcocOAbIkVylSWEklzALe/+Pu4qV6TYBj5GwOBFfdKqLBw== dependencies: - cookie "0.4.1" + cookie "0.4.2" cookie-signature "1.0.6" debug "2.6.9" depd "~2.0.0" From 285a1bff51d9b269c0c69c6a7684c041fd38d339 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Oct 2023 19:51:06 +0000 Subject: [PATCH 17/41] chore(deps): bump react-redux from 7.2.6 to 8.1.3 Bumps [react-redux](https://github.com/reduxjs/react-redux) from 7.2.6 to 8.1.3. - [Release notes](https://github.com/reduxjs/react-redux/releases) - [Changelog](https://github.com/reduxjs/react-redux/blob/master/CHANGELOG.md) - [Commits](https://github.com/reduxjs/react-redux/compare/v7.2.6...v8.1.3) --- updated-dependencies: - dependency-name: react-redux dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 68 ++++++++++++++++++++++++++-------------------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index 86adf97a0d..8a33770128 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "react-datepicker": "^4.7.0", "react-dom": "^16.13.1", "react-hot-loader": "^4.13.0", - "react-redux": "^7.2.6", + "react-redux": "^8.1.3", "react-select": "^4.3.1", "react-select-fast-filter-options": "^0.2.3", "react-simple-star-rating": "^4.0.5", diff --git a/yarn.lock b/yarn.lock index 412af24f49..5a7e01d51c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1166,12 +1166,12 @@ pirates "^4.0.5" source-map-support "^0.5.16" -"@babel/runtime@^7.12.0", "@babel/runtime@^7.13.10", "@babel/runtime@^7.13.8", "@babel/runtime@^7.14.0", "@babel/runtime@^7.15.4", "@babel/runtime@^7.17.7", "@babel/runtime@^7.2.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": - version "7.17.8" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.8.tgz#3e56e4aff81befa55ac3ac6a0967349fd1c5bca2" - integrity sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA== +"@babel/runtime@^7.12.0", "@babel/runtime@^7.12.1", "@babel/runtime@^7.13.10", "@babel/runtime@^7.13.8", "@babel/runtime@^7.14.0", "@babel/runtime@^7.17.7", "@babel/runtime@^7.2.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": + version "7.23.2" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.2.tgz#062b0ac103261d68a966c4c7baf2ae3e62ec3885" + integrity sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg== dependencies: - regenerator-runtime "^0.13.4" + regenerator-runtime "^0.14.0" "@babel/template@^7.16.0", "@babel/template@^7.16.7", "@babel/template@^7.18.10", "@babel/template@^7.20.7": version "7.20.7" @@ -1840,10 +1840,10 @@ dependencies: "@types/node" "*" -"@types/hoist-non-react-statics@^3.3.0": - version "3.3.1" - resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f" - integrity sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA== +"@types/hoist-non-react-statics@^3.3.1": + version "3.3.3" + resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.3.tgz#8bb41d9a88164f82dd2745ff05e637e655f34d19" + integrity sha512-Wny3a2UXn5FEA1l7gc6BbpoV5mD1XijZqgkp4TRgDCDL5r3B5ieOFGUX5h3n78Tr1MEG7BfvoM8qeztdvNU0fw== dependencies: "@types/react" "*" hoist-non-react-statics "^3.3.0" @@ -1934,16 +1934,6 @@ dependencies: "@types/react" "*" -"@types/react-redux@^7.1.20": - version "7.1.22" - resolved "https://registry.yarnpkg.com/@types/react-redux/-/react-redux-7.1.22.tgz#0eab76a37ef477cc4b53665aeaf29cb60631b72a" - integrity sha512-GxIA1kM7ClU73I6wg9IRTVwSO9GS+SAKZKe0Enj+82HMU6aoESFU2HNAdNi3+J53IaOHPiUfT3kSG4L828joDQ== - dependencies: - "@types/hoist-non-react-statics" "^3.3.0" - "@types/react" "*" - hoist-non-react-statics "^3.3.0" - redux "^4.0.0" - "@types/react-select@^4.0.18": version "4.0.18" resolved "https://registry.yarnpkg.com/@types/react-select/-/react-select-4.0.18.tgz#f907f406411afa862217a9d86c54a301367a35c1" @@ -2010,6 +2000,11 @@ resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.2.tgz#fc25ad9943bcac11cceb8168db4f275e0e72e756" integrity sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg== +"@types/use-sync-external-store@^0.0.3": + version "0.0.3" + resolved "https://registry.yarnpkg.com/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz#b6725d5f4af24ace33b36fafd295136e75509f43" + integrity sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA== + "@types/warning@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/warning/-/warning-3.0.0.tgz#0d2501268ad8f9962b740d387c4654f5f8e23e52" @@ -7189,11 +7184,6 @@ react-is@^16.13.1, react-is@^16.3.2, react-is@^16.7.0, react-is@^16.8.6: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== -react-is@^17.0.2: - version "17.0.2" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" - integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== - react-is@^18.0.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" @@ -7231,17 +7221,17 @@ react-popper@^2.2.5: react-fast-compare "^3.0.1" warning "^4.0.2" -react-redux@^7.2.6: - version "7.2.6" - resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.6.tgz#49633a24fe552b5f9caf58feb8a138936ddfe9aa" - integrity sha512-10RPdsz0UUrRL1NZE0ejTkucnclYSgXp5q+tB5SWx2qeG2ZJQJyymgAhwKy73yiL/13btfB6fPr+rgbMAaZIAQ== +react-redux@^8.1.3: + version "8.1.3" + resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-8.1.3.tgz#4fdc0462d0acb59af29a13c27ffef6f49ab4df46" + integrity sha512-n0ZrutD7DaX/j9VscF+uTALI3oUPa/pO4Z3soOBIjuRn/FzVu6aehhysxZCLi6y7duMf52WNZGMl7CtuK5EnRw== dependencies: - "@babel/runtime" "^7.15.4" - "@types/react-redux" "^7.1.20" + "@babel/runtime" "^7.12.1" + "@types/hoist-non-react-statics" "^3.3.1" + "@types/use-sync-external-store" "^0.0.3" hoist-non-react-statics "^3.3.2" - loose-envify "^1.4.0" - prop-types "^15.7.2" - react-is "^17.0.2" + react-is "^18.0.0" + use-sync-external-store "^1.0.0" react-select-fast-filter-options@^0.2.3: version "0.2.3" @@ -7403,7 +7393,7 @@ redux-thunk@^2.2.0: resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.4.1.tgz#0dd8042cf47868f4b29699941de03c9301a75714" integrity sha512-OOYGNY5Jy2TWvTL1KgAlVy6dcx3siPJ1wTq741EPyUKfn6W6nChdICjZwCd0p8AZBs5kWpZlbkXW2nE/zjUa+Q== -redux@^4.0.0, redux@^4.2.0: +redux@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/redux/-/redux-4.2.0.tgz#46f10d6e29b6666df758780437651eeb2b969f13" integrity sha512-oSBmcKKIuIR4ME29/AeNUnl5L+hvBq7OaJWzaptTQJAntaPvxIJqfnjbaEiCzzaIz+XmVILfqAM3Ob0aXLPfjA== @@ -7432,6 +7422,11 @@ regenerator-runtime@^0.13.4: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== +regenerator-runtime@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" + integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== + regenerator-transform@^0.14.2: version "0.14.5" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.5.tgz#c98da154683671c9c4dcb16ece736517e1b7feb4" @@ -8502,6 +8497,11 @@ url-parse@^1.5.3: querystringify "^2.1.1" requires-port "^1.0.0" +use-sync-external-store@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" + integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== + util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" From bb6c4038cf69c45df56495e8d0f9c8e2a69b20d3 Mon Sep 17 00:00:00 2001 From: David Kellner <52860029+kellnerd@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:34:13 +0200 Subject: [PATCH 18/41] chore(deps): update bookbrainz-data to v5.0.0 --- package.json | 2 +- yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 86adf97a0d..82733665d3 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "@fortawesome/free-solid-svg-icons": "^6.4.2", "@fortawesome/react-fontawesome": "^0.1.11", "array-move": "^3.0.1", - "bookbrainz-data": "4.1.1", + "bookbrainz-data": "^5.0.0", "chart.js": "^2.9.4", "chartjs-adapter-date-fns": "^1.0.0", "classnames": "^2.3.2", diff --git a/yarn.lock b/yarn.lock index 412af24f49..c6fdd90361 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1591,10 +1591,10 @@ resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== -"@metabrainz/bookshelf@^1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@metabrainz/bookshelf/-/bookshelf-1.3.1.tgz#e8a1e607b1dc074ecfc43781aced87e9ea42e496" - integrity sha512-zlcMCXPrhddIfAyiD+XawtwRRn8cs3/f3ELYz3vTrRLm5dZKtWSpXPRn3uBgunejgV2Zc3/ljRkXQEW1EbpYXg== +"@metabrainz/bookshelf@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@metabrainz/bookshelf/-/bookshelf-1.4.0.tgz#83b44ccebbf8421fdffa79ecbc103b4e43da3881" + integrity sha512-m1znuBtL4fX6tQctFFVvl6WYTg3gDUuwqM4B7d4VaKepI4/L1Qoar65VD2zto+oknPsFBmKrBLOJAD614nMF7Q== dependencies: bluebird "^3.7.2" create-error "~0.3.1" @@ -2692,12 +2692,12 @@ body-parser@1.20.1: type-is "~1.6.18" unpipe "1.0.0" -bookbrainz-data@4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/bookbrainz-data/-/bookbrainz-data-4.1.1.tgz#911b55f9772f1dc0d813ba66477b544c47b08bcf" - integrity sha512-nCf6v9e62lqRqCZjjMWkdQO4VW8HbCgP1CzY8R6J3TSB0fgQb+fAMhu00I84H7qIsqc5Q1obspHrBxQ5Y78fXg== +bookbrainz-data@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/bookbrainz-data/-/bookbrainz-data-5.0.0.tgz#02ef3ef8483300fed33d1e3bc64b21466fdb62e5" + integrity sha512-CqpJHYrQGeQjxhjJBbzdSpl6FEvrINc05yAb23ClDsLEEgDvWMPoB85+FElCtR+KcvqA44oMmq95ez3nHVvX0g== dependencies: - "@metabrainz/bookshelf" "^1.3.1" + "@metabrainz/bookshelf" "^1.4.0" bookshelf-virtuals-plugin "^1.0.0" deep-diff "^1.0.2" immutable "^3.8.2" From 68b83def4164e092529bf17d6151bd17adc6a5ae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:27:11 +0000 Subject: [PATCH 19/41] chore(deps): bump @babel/traverse from 7.20.12 to 7.23.2 Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.20.12 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 125 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 98 insertions(+), 27 deletions(-) diff --git a/yarn.lock b/yarn.lock index 412af24f49..c02e77962a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -78,6 +78,14 @@ dependencies: "@babel/highlight" "^7.18.6" +"@babel/code-frame@^7.22.13": + version "7.22.13" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" + integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w== + dependencies: + "@babel/highlight" "^7.22.13" + chalk "^2.4.2" + "@babel/compat-data@^7.13.11", "@babel/compat-data@^7.16.4", "@babel/compat-data@^7.20.5": version "7.20.10" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.10.tgz#9d92fa81b87542fff50e848ed585b4212c1d34ec" @@ -113,6 +121,16 @@ "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" +"@babel/generator@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.0.tgz#df5c386e2218be505b34837acbcb874d7a983420" + integrity sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g== + dependencies: + "@babel/types" "^7.23.0" + "@jridgewell/gen-mapping" "^0.3.2" + "@jridgewell/trace-mapping" "^0.3.17" + jsesc "^2.5.1" + "@babel/helper-annotate-as-pure@^7.16.0", "@babel/helper-annotate-as-pure@^7.16.7": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz#bb2339a7534a9c128e3102024c60760a3a7f3862" @@ -206,6 +224,11 @@ resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== +"@babel/helper-environment-visitor@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" + integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== + "@babel/helper-explode-assignable-expression@^7.16.0": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.0.tgz#753017337a15f46f9c09f674cff10cee9b9d7778" @@ -222,13 +245,13 @@ "@babel/template" "^7.16.7" "@babel/types" "^7.16.7" -"@babel/helper-function-name@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" - integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== +"@babel/helper-function-name@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" + integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== dependencies: - "@babel/template" "^7.18.10" - "@babel/types" "^7.19.0" + "@babel/template" "^7.22.15" + "@babel/types" "^7.23.0" "@babel/helper-get-function-arity@^7.16.7": version "7.16.7" @@ -244,12 +267,12 @@ dependencies: "@babel/types" "^7.16.0" -"@babel/helper-hoist-variables@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" - integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== +"@babel/helper-hoist-variables@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" + integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== dependencies: - "@babel/types" "^7.18.6" + "@babel/types" "^7.22.5" "@babel/helper-member-expression-to-functions@^7.16.0": version "7.16.0" @@ -367,6 +390,13 @@ dependencies: "@babel/types" "^7.18.6" +"@babel/helper-split-export-declaration@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" + integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== + dependencies: + "@babel/types" "^7.22.5" + "@babel/helper-string-parser@^7.19.4": version "7.19.4" resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" @@ -439,6 +469,15 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/highlight@^7.22.13": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.20.tgz#4ca92b71d80554b01427815e06f2df965b9c1f54" + integrity sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg== + dependencies: + "@babel/helper-validator-identifier" "^7.22.20" + chalk "^2.4.2" + js-tokens "^4.0.0" + "@babel/node@^7.14.2": version "7.16.0" resolved "https://registry.yarnpkg.com/@babel/node/-/node-7.16.0.tgz#855e783ba4cbca88dbdebf4b01c2d95844c4afdf" @@ -456,6 +495,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.7.tgz#66fe23b3c8569220817d5feb8b9dcdc95bb4f71b" integrity sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg== +"@babel/parser@^7.22.15", "@babel/parser@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.0.tgz#da950e622420bf96ca0d0f2909cdddac3acd8719" + integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.16.2": version "7.16.2" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.2.tgz#2977fca9b212db153c195674e57cfab807733183" @@ -1173,7 +1217,7 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.16.0", "@babel/template@^7.16.7", "@babel/template@^7.18.10", "@babel/template@^7.20.7": +"@babel/template@^7.16.0", "@babel/template@^7.16.7", "@babel/template@^7.20.7": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw== @@ -1182,23 +1226,32 @@ "@babel/parser" "^7.20.7" "@babel/types" "^7.20.7" -"@babel/traverse@^7.13.0", "@babel/traverse@^7.16.0", "@babel/traverse@^7.16.7", "@babel/traverse@^7.20.10", "@babel/traverse@^7.20.12", "@babel/traverse@^7.20.7", "@babel/traverse@^7.7.2": - version "7.20.12" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.12.tgz#7f0f787b3a67ca4475adef1f56cb94f6abd4a4b5" - integrity sha512-MsIbFN0u+raeja38qboyF8TIT7K0BFzz/Yd/77ta4MsUsmP2RAnidIlwq7d5HFQrH/OZJecGV6B71C4zAgpoSQ== +"@babel/template@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" + integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.20.7" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.19.0" - "@babel/helper-hoist-variables" "^7.18.6" - "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.20.7" - "@babel/types" "^7.20.7" + "@babel/code-frame" "^7.22.13" + "@babel/parser" "^7.22.15" + "@babel/types" "^7.22.15" + +"@babel/traverse@^7.13.0", "@babel/traverse@^7.16.0", "@babel/traverse@^7.16.7", "@babel/traverse@^7.20.10", "@babel/traverse@^7.20.12", "@babel/traverse@^7.20.7", "@babel/traverse@^7.7.2": + version "7.23.2" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.2.tgz#329c7a06735e144a506bdb2cad0268b7f46f4ad8" + integrity sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw== + dependencies: + "@babel/code-frame" "^7.22.13" + "@babel/generator" "^7.23.0" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/parser" "^7.23.0" + "@babel/types" "^7.23.0" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0-beta.49", "@babel/types@^7.16.0", "@babel/types@^7.16.7", "@babel/types@^7.18.6", "@babel/types@^7.19.0", "@babel/types@^7.20.2", "@babel/types@^7.20.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": +"@babel/types@^7.0.0-beta.49", "@babel/types@^7.16.0", "@babel/types@^7.16.7", "@babel/types@^7.18.6", "@babel/types@^7.20.2", "@babel/types@^7.20.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": version "7.20.7" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.7.tgz#54ec75e252318423fc07fb644dc6a58a64c09b7f" integrity sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg== @@ -1207,7 +1260,7 @@ "@babel/helper-validator-identifier" "^7.19.1" to-fast-properties "^2.0.0" -"@babel/types@^7.22.15", "@babel/types@^7.22.5": +"@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.0.tgz#8c1f020c9df0e737e4e247c0619f58c68458aaeb" integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg== @@ -1552,6 +1605,11 @@ resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + "@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" @@ -1570,6 +1628,11 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== +"@jridgewell/sourcemap-codec@^1.4.14": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + "@jridgewell/trace-mapping@^0.3.13", "@jridgewell/trace-mapping@^0.3.9": version "0.3.14" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz#b231a081d8f66796e475ad588a1ef473112701ed" @@ -1578,6 +1641,14 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" +"@jridgewell/trace-mapping@^0.3.17": + version "0.3.20" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz#72e45707cf240fa6b081d0366f8265b0cd10197f" + integrity sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@jridgewell/trace-mapping@^0.3.4": version "0.3.4" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz#f6a0832dffd5b8a6aaa633b7d9f8e8e94c83a0c3" @@ -2888,7 +2959,7 @@ chai@^4.3.6: pathval "^1.1.1" type-detect "^4.0.5" -chalk@^2.0.0: +chalk@^2.0.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== From 25337e45b3a413d5a858af43969d16bd12343830 Mon Sep 17 00:00:00 2001 From: anshg1214 Date: Sat, 28 Oct 2023 10:31:19 +0000 Subject: [PATCH 20/41] feat: Hide External Service Tab for other profiles --- src/client/containers/editor.js | 29 +++++++++++++------- src/client/controllers/editor/achievement.js | 1 + src/client/controllers/editor/editor.js | 1 + src/server/routes/editor.tsx | 4 +++ 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/client/containers/editor.js b/src/client/containers/editor.js index 97d5cbb394..39cf1d5323 100644 --- a/src/client/containers/editor.js +++ b/src/client/containers/editor.js @@ -27,7 +27,7 @@ import React from 'react'; const {Col, Nav, Row} = bootstrap; function EditorContainer(props) { - const {tabActive, editor, children} = props; + const {tabActive, editor, children, user} = props; return (
@@ -85,14 +85,19 @@ function EditorContainer(props) { Collections - - - External Services - - + { + user && user.id === editor.id ? + ( + + + External Services + + + ) : null + } @@ -109,7 +114,11 @@ EditorContainer.propTypes = { name: PropTypes.string, title: PropTypes.object }).isRequired, - tabActive: PropTypes.number.isRequired + tabActive: PropTypes.number.isRequired, + user: PropTypes.object +}; +EditorContainer.defaultProps = { + user: null }; export default EditorContainer; diff --git a/src/client/controllers/editor/achievement.js b/src/client/controllers/editor/achievement.js index 591cdc4e04..8808d78b27 100644 --- a/src/client/controllers/editor/achievement.js +++ b/src/client/controllers/editor/achievement.js @@ -37,6 +37,7 @@ ReactDOM.hydrate( {tab} diff --git a/src/server/routes/editor.tsx b/src/server/routes/editor.tsx index 5f9e0f0a3c..8bc6fe8d3b 100644 --- a/src/server/routes/editor.tsx +++ b/src/server/routes/editor.tsx @@ -333,6 +333,7 @@ router.get('/:id', async (req, res, next) => { const markup = ReactDOMServer.renderToString( { const markup = ReactDOMServer.renderToString( { const markup = ReactDOMServer.renderToString( { const markup = ReactDOMServer.renderToString( Date: Thu, 9 Nov 2023 16:11:42 +0100 Subject: [PATCH 21/41] chore: update fontawesome packages --- package.json | 4 ++-- yarn.lock | 30 ++++++++++-------------------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 86adf97a0d..d7e2dbb33f 100644 --- a/package.json +++ b/package.json @@ -31,8 +31,8 @@ "@babel/runtime": "^7.17.7", "@cospired/i18n-iso-languages": "^4.0.0", "@elastic/elasticsearch": "^5.6.22", - "@fortawesome/fontawesome-svg-core": "^1.2.30", - "@fortawesome/free-brands-svg-icons": "^6.1.1", + "@fortawesome/fontawesome-svg-core": "^6.4.2", + "@fortawesome/free-brands-svg-icons": "^6.4.2", "@fortawesome/free-solid-svg-icons": "^6.4.2", "@fortawesome/react-fontawesome": "^0.1.11", "array-move": "^3.0.1", diff --git a/yarn.lock b/yarn.lock index c02e77962a..5ff680ec9a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1427,34 +1427,24 @@ resolved "https://registry.yarnpkg.com/@faker-js/faker/-/faker-8.1.0.tgz#e14896f1c57af2495e341dc4c7bf04125c8aeafd" integrity sha512-38DT60rumHfBYynif3lmtxMqMqmsOQIxQgEuPZxCk2yUYN0eqWpTACgxi0VpidvsJB8CRxCpvP7B3anK85FjtQ== -"@fortawesome/fontawesome-common-types@6.1.1": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.1.1.tgz#7dc996042d21fc1ae850e3173b5c67b0549f9105" - integrity sha512-wVn5WJPirFTnzN6tR95abCx+ocH+3IFLXAgyavnf9hUmN0CfWoDjPT/BAWsUVwSlYYVBeCLJxaqi7ZGe4uSjBA== - "@fortawesome/fontawesome-common-types@6.4.2": version "6.4.2" resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-6.4.2.tgz#1766039cad33f8ad87f9467b98e0d18fbc8f01c5" integrity sha512-1DgP7f+XQIJbLFCTX1V2QnxVmpLdKdzzo2k8EmvDOePfchaIGQ9eCHj2up3/jNEbZuBqel5OxiaOJf37TWauRA== -"@fortawesome/fontawesome-common-types@^0.2.36": - version "0.2.36" - resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.36.tgz#b44e52db3b6b20523e0c57ef8c42d315532cb903" - integrity sha512-a/7BiSgobHAgBWeN7N0w+lAhInrGxksn13uK7231n2m8EDPE3BMCl9NZLTGrj9ZXfCmC6LM0QLqXidIizVQ6yg== - -"@fortawesome/fontawesome-svg-core@^1.2.30": - version "1.2.36" - resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.36.tgz#4f2ea6f778298e0c47c6524ce2e7fd58eb6930e3" - integrity sha512-YUcsLQKYb6DmaJjIHdDWpBIGCcyE/W+p/LMGvjQem55Mm2XWVAP5kWTMKWLv9lwpCVjpLxPyOMOyUocP1GxrtA== +"@fortawesome/fontawesome-svg-core@^6.4.2": + version "6.4.2" + resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-6.4.2.tgz#37f4507d5ec645c8b50df6db14eced32a6f9be09" + integrity sha512-gjYDSKv3TrM2sLTOKBc5rH9ckje8Wrwgx1CxAPbN5N3Fm4prfi7NsJVWd1jklp7i5uSCVwhZS5qlhMXqLrpAIg== dependencies: - "@fortawesome/fontawesome-common-types" "^0.2.36" + "@fortawesome/fontawesome-common-types" "6.4.2" -"@fortawesome/free-brands-svg-icons@^6.1.1": - version "6.1.1" - resolved "https://registry.yarnpkg.com/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-6.1.1.tgz#3580961d4f42bd51dc171842402f23a18a5480b1" - integrity sha512-mFbI/czjBZ+paUtw5NPr2IXjun5KAC8eFqh1hnxowjA4mMZxWz4GCIksq6j9ZSa6Uxj9JhjjDVEd77p2LN2Blg== +"@fortawesome/free-brands-svg-icons@^6.4.2": + version "6.4.2" + resolved "https://registry.yarnpkg.com/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-6.4.2.tgz#9b8e78066ea6dd563da5dfa686615791d0f7cc71" + integrity sha512-LKOwJX0I7+mR/cvvf6qIiqcERbdnY+24zgpUSouySml+5w8B4BJOx8EhDR/FTKAu06W12fmUIcv6lzPSwYKGGg== dependencies: - "@fortawesome/fontawesome-common-types" "6.1.1" + "@fortawesome/fontawesome-common-types" "6.4.2" "@fortawesome/free-solid-svg-icons@^6.4.2": version "6.4.2" From 07173110d3acc138f8e4e200777e3aa67843ef7d Mon Sep 17 00:00:00 2001 From: Monkey Do Date: Thu, 9 Nov 2023 18:16:33 +0100 Subject: [PATCH 22/41] Test dependencies: replace UUID package and duplicate faker package (#1035) * chore(tests): Replace UUID package with faker helper * chore(tests): Remove duplicate faker package * chore(tests): Fix use of faker utilities * chore(tests): fix usage of faker random number utility --- package.json | 2 -- test/src/server/helpers/collections.js | 6 ++--- test/src/server/helpers/revisions.js | 4 ++- test/src/server/routes/collection.js | 5 ++-- test/test-helpers/create-entities.js | 37 +++++++++++++------------- yarn.lock | 10 ------- 6 files changed, 26 insertions(+), 38 deletions(-) diff --git a/package.json b/package.json index 680bc47b90..d129e4c048 100644 --- a/package.json +++ b/package.json @@ -127,7 +127,6 @@ "eslint-plugin-node": "^11.1.0", "eslint-plugin-react": "^7.26.1", "eslint-webpack-plugin": "^2.4.1", - "faker": "^4.1.0", "file-loader": "^6.2.0", "jsdom": "22.1.0", "jsdom-global": "3.0.2", @@ -141,7 +140,6 @@ "sass-loader": "^13.2.0", "sinon": "^14.0.0", "typescript": "^4.0.5", - "uuid": "^8.3.2", "webpack": "^5.76.0", "webpack-bundle-analyzer": "^4.3.0", "webpack-cli": "^4.10.0", diff --git a/test/src/server/helpers/collections.js b/test/src/server/helpers/collections.js index 13fd1ce85a..ff9a2d271a 100644 --- a/test/src/server/helpers/collections.js +++ b/test/src/server/helpers/collections.js @@ -25,7 +25,7 @@ import { } from '../../../../src/server/helpers/collections'; import assertArrays from 'chai-arrays'; import chai from 'chai'; -import {date} from 'faker'; +import {faker} from '@faker-js/faker'; import isSorted from 'chai-sorted'; import orm from '../../../bookbrainz-data'; @@ -50,8 +50,8 @@ describe('getOrderedPublicCollections', () => { }; // create 5 public author collections for (let i = 1; i <= 5; i++) { - collectionAttrib.lastModified = date.recent(); - collectionAttrib.createdAt = date.recent(); + collectionAttrib.lastModified = faker.date.recent(); + collectionAttrib.createdAt = faker.date.recent(); promiseArray.push( new UserCollection(collectionAttrib).save(null, {method: 'insert'}) ); diff --git a/test/src/server/helpers/revisions.js b/test/src/server/helpers/revisions.js index 568a92aa6f..922f484d1e 100644 --- a/test/src/server/helpers/revisions.js +++ b/test/src/server/helpers/revisions.js @@ -19,11 +19,13 @@ import { } from '../../../../src/server/helpers/revisions'; import chai from 'chai'; -import {date} from 'faker'; +import {faker} from '@faker-js/faker'; import isSorted from 'chai-sorted'; import orm from '../../../bookbrainz-data'; +const {date} = faker; + const {expect} = chai; chai.use(isSorted); diff --git a/test/src/server/routes/collection.js b/test/src/server/routes/collection.js index 94678db1f5..91d20a1fcc 100644 --- a/test/src/server/routes/collection.js +++ b/test/src/server/routes/collection.js @@ -1,12 +1,11 @@ import {createAuthor, createEditor, truncateEntities} from '../../../test-helpers/create-entities'; import {generateIndex, refreshIndex, searchByName} from '../../../../src/common/helpers/search'; - import app from '../../../../src/server/app'; import assertArrays from 'chai-arrays'; import chai from 'chai'; import chaiHttp from 'chai-http'; +import {faker} from '@faker-js/faker'; import orm from '../../../bookbrainz-data'; -import {v4 as uuidv4} from 'uuid'; chai.use(chaiHttp); @@ -856,7 +855,7 @@ describe('POST /collection/:collectionID/add', () => { }; const collection = await new UserCollection(collectionData).save(null, {method: 'insert'}); const data = { - bbids: [uuidv4()] + bbids: [faker.string.uuid()] }; const response = await agent.post(`/collection/${collection.get('id')}/add`).send(data); const item = await new UserCollectionItem().where('collection_id', collection.get('id')).fetchAll({}); diff --git a/test/test-helpers/create-entities.js b/test/test-helpers/create-entities.js index 0790b5c588..83c1caf96d 100644 --- a/test/test-helpers/create-entities.js +++ b/test/test-helpers/create-entities.js @@ -17,14 +17,13 @@ */ /* eslint-disable no-console */ -import {internet, random} from 'faker'; - import {faker} from '@faker-js/faker'; import {isNil} from 'lodash'; import orm from '../bookbrainz-data'; -import {v4 as uuidv4} from 'uuid'; +const {internet, random, string} = faker; + const { bookshelf, util, Editor, EditorType, Revision, Relationship, RelationshipAttribute, RelationshipType, RelationshipAttributeTextValue, RelationshipAttributeSet, @@ -137,7 +136,7 @@ const entityAttribs = { aliasSetId: 1, annotationId: 1, // bbid should normally be overwritten when calling create{Entity} - bbid: uuidv4(), + bbid: string.uuid(), disambiguationId: 1, identifierSetId: 1, relationshipSetId: 1, @@ -151,12 +150,12 @@ export function createEditor(editorId, privs = 1) { const gender = await new Gender({name: 'test'}) .save(null, {method: 'insert', transacting}); - editorAttribs.id = editorId || random.number(); + editorAttribs.id = editorId || random.numeric(5); editorAttribs.genderId = gender.id; editorAttribs.typeId = editorType.id; editorAttribs.name = internet.userName(); editorAttribs.privs = privs; - editorAttribs.metabrainzUserId = random.number(); + editorAttribs.metabrainzUserId = random.numeric(5); editorAttribs.cachedMetabrainzName = editorAttribs.name; const editor = await new Editor(editorAttribs) @@ -224,8 +223,8 @@ async function createRelationshipAttributeSet() { } async function createRelationshipSet(sourceBbid, targetBbid, targetEntityType = 'Author', attributeSetId) { - const safeTargetBbid = targetBbid || uuidv4(); - const safeSourceBbid = sourceBbid || uuidv4(); + const safeTargetBbid = targetBbid || string.uuid(); + const safeSourceBbid = sourceBbid || string.uuid(); /* Create the relationship target entity */ await new Entity({bbid: safeTargetBbid, type: targetEntityType}) @@ -274,7 +273,7 @@ async function createLanguageSet() { } export function getRandomUUID() { - return uuidv4(); + return string.uuid(); } async function createEntityPrerequisites(entityBbid, entityType) { @@ -304,7 +303,7 @@ async function createEntityPrerequisites(entityBbid, entityType) { } export async function createEdition(optionalBBID, optionalEditionAttribs = {}) { - const bbid = optionalBBID || uuidv4(); + const bbid = optionalBBID || string.uuid(); await new Entity({bbid, type: 'Edition'}) .save(null, {method: 'insert'}); await createEntityPrerequisites(bbid, 'Edition'); @@ -315,7 +314,7 @@ export async function createEdition(optionalBBID, optionalEditionAttribs = {}) { } export async function createWork(optionalBBID, optionalWorkAttribs = {}) { - const bbid = optionalBBID || uuidv4(); + const bbid = optionalBBID || string.uuid(); await new Entity({bbid, type: 'Work'}) .save(null, {method: 'insert'}); await createEntityPrerequisites(bbid, 'Work'); @@ -336,7 +335,7 @@ export async function createWork(optionalBBID, optionalWorkAttribs = {}) { if (!workType) { workType = await new WorkType({description: 'A work type', - label: `Work Type ${optionalWorkAttribs.typeId || random.number()}`, + label: `Work Type ${optionalWorkAttribs.typeId || random.numeric(5)}`, ...optionalWorkTypeAttribs}) .save(null, {method: 'insert'}); } @@ -353,7 +352,7 @@ export async function createWork(optionalBBID, optionalWorkAttribs = {}) { } export async function createEditionGroup(optionalBBID, optionalEditionGroupAttrib = {}) { - const bbid = optionalBBID || uuidv4(); + const bbid = optionalBBID || string.uuid(); await new Entity({bbid, type: 'EditionGroup'}) .save(null, {method: 'insert'}); await createEntityPrerequisites(bbid, 'EditionGroup'); @@ -362,7 +361,7 @@ export async function createEditionGroup(optionalBBID, optionalEditionGroupAttri optionalEditionGroupTypeAttrib.id = optionalEditionGroupAttrib.typeId; } const editionGroupType = await new EditionGroupType( - {label: `Edition Group Type ${optionalEditionGroupAttrib.typeId || random.number()}`, ...optionalEditionGroupTypeAttrib} + {label: `Edition Group Type ${optionalEditionGroupAttrib.typeId || random.numeric(5)}`, ...optionalEditionGroupTypeAttrib} ) .save(null, {method: 'insert'}); @@ -377,12 +376,12 @@ export async function createEditionGroup(optionalBBID, optionalEditionGroupAttri } export async function createAuthor(optionalBBID, optionalAuthorAttribs = {}) { - const bbid = optionalBBID || uuidv4(); + const bbid = optionalBBID || string.uuid(); await new Entity({bbid, type: 'Author'}) .save(null, {method: 'insert'}); await createEntityPrerequisites(bbid, 'Author'); - const area = await new Area({gid: uuidv4(), name: 'Rlyeh'}) + const area = await new Area({gid: string.uuid(), name: 'Rlyeh'}) .save(null, {method: 'insert'}); // Front-end requires 'Person' and 'Group' types @@ -422,7 +421,7 @@ export async function createAuthor(optionalBBID, optionalAuthorAttribs = {}) { } export async function createSeries(optionalBBID, optionalSeriesAttribs = {}) { - const bbid = optionalBBID || uuidv4(); + const bbid = optionalBBID || string.uuid(); await new Entity({bbid, type: 'Series'}) .save(null, {method: 'insert'}); await createEntityPrerequisites(bbid, 'Work'); @@ -462,7 +461,7 @@ async function fetchOrCreatePublisherType(PublisherTypeModel, optionalPublisherA } export async function createPublisher(optionalBBID, optionalPublisherAttribs = {}, optionalPublisherTypeAttribs = {}) { - const bbid = optionalBBID || uuidv4(); + const bbid = optionalBBID || string.uuid(); await new Entity({bbid, type: 'Publisher'}) .save(null, {method: 'insert'}); await createEntityPrerequisites(bbid, 'Publisher'); @@ -475,7 +474,7 @@ export async function createPublisher(optionalBBID, optionalPublisherAttribs = { .fetch({require: false}); } if (!area) { - area = await new Area({gid: uuidv4(), name: `Area ${optionalPublisherAttribs.areaId || random.number()}`, ...optionalAreaAttribs}) + area = await new Area({gid: string.uuid(), name: `Area ${optionalPublisherAttribs.areaId || random.numeric(5)}`, ...optionalAreaAttribs}) .save(null, {method: 'insert'}); } diff --git a/yarn.lock b/yarn.lock index 8e0ac11152..11cc108a2e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4437,11 +4437,6 @@ extend@^3.0.0: resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== -faker@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/faker/-/faker-4.1.0.tgz#1e45bbbecc6774b3c195fad2835109c6d748cc3f" - integrity sha1-HkW7vsxndLPBlfrSg1EJxtdIzD8= - fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" @@ -8588,11 +8583,6 @@ uuid@^7.0.3: resolved "https://registry.yarnpkg.com/uuid/-/uuid-7.0.3.tgz#c5c9f2c8cf25dc0a372c4df1441c41f5bd0c680b" integrity sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg== -uuid@^8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - v8-compile-cache@^2.0.3: version "2.3.0" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee" From b420835c1cb5448837cef54f044f853b004a4203 Mon Sep 17 00:00:00 2001 From: Moritz Ruth Date: Mon, 13 Nov 2023 20:28:53 +0100 Subject: [PATCH 23/41] docs(static): fix mischaracterization of a book mentioned in an example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Michael Scott’s »The Secrets of the Immortal Nicholas Flamel – The Alchemyst« is a fictional novel, not a biography. --- src/client/components/pages/help.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/components/pages/help.js b/src/client/components/pages/help.js index 3e9d36ce2b..de8e1f3ef7 100644 --- a/src/client/components/pages/help.js +++ b/src/client/components/pages/help.js @@ -128,7 +128,7 @@ function HelpPage() { Example:
  • The Alchemist (philosophical novel) by Paulo Coelho
  • -
  • The Alchemyst (Nicolas Flamel biography) by Michael Scott
  • +
  • The Alchemyst (YA novel featuring Nicolas Flamel) by Michael Scott
From eaaee7e38917a7c77f187ffc9839f630168f5461 Mon Sep 17 00:00:00 2001 From: anshg1214 Date: Fri, 17 Nov 2023 14:13:09 +0000 Subject: [PATCH 24/41] feat: Add `user` prop to EDITOR_PROPS --- src/client/controllers/editor/editor.js | 1 - src/client/helpers/props.js | 3 ++- src/server/routes/editor.tsx | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/client/controllers/editor/editor.js b/src/client/controllers/editor/editor.js index bcfdf919ff..e8643b3a53 100644 --- a/src/client/controllers/editor/editor.js +++ b/src/client/controllers/editor/editor.js @@ -64,7 +64,6 @@ const markup = ( {tab} diff --git a/src/client/helpers/props.js b/src/client/helpers/props.js index 5e2cfe55dd..0bb84072b1 100644 --- a/src/client/helpers/props.js +++ b/src/client/helpers/props.js @@ -32,7 +32,8 @@ const LAYOUT_PROPS = [ const EDITOR_PROPS = [ 'editor', - 'tabActive' + 'tabActive', + 'user' ]; export function extractLayoutProps(props) { diff --git a/src/server/routes/editor.tsx b/src/server/routes/editor.tsx index 8bc6fe8d3b..5f9e0f0a3c 100644 --- a/src/server/routes/editor.tsx +++ b/src/server/routes/editor.tsx @@ -333,7 +333,6 @@ router.get('/:id', async (req, res, next) => { const markup = ReactDOMServer.renderToString( { const markup = ReactDOMServer.renderToString( { const markup = ReactDOMServer.renderToString( { const markup = ReactDOMServer.renderToString( Date: Fri, 17 Nov 2023 14:14:39 +0000 Subject: [PATCH 25/41] feat: Pass user prop only once --- src/client/controllers/editor/achievement.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/client/controllers/editor/achievement.js b/src/client/controllers/editor/achievement.js index 8808d78b27..591cdc4e04 100644 --- a/src/client/controllers/editor/achievement.js +++ b/src/client/controllers/editor/achievement.js @@ -37,7 +37,6 @@ ReactDOM.hydrate( Date: Mon, 27 Nov 2023 19:56:02 +0000 Subject: [PATCH 26/41] chore(deps-dev): bump @types/lodash from 4.14.191 to 4.14.202 Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.14.191 to 4.14.202. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash) --- updated-dependencies: - dependency-name: "@types/lodash" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9a1fbb603b..366cfd9196 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "@babel/register": "^7.17.0", "@faker-js/faker": "^8.1.0", "@types/express": "^4.17.15", - "@types/lodash": "^4.14.191", + "@types/lodash": "^4.14.202", "@types/react-select": "^4.0.18", "@typescript-eslint/eslint-plugin": "^4.28.3", "@typescript-eslint/parser": "^4.6.1", diff --git a/yarn.lock b/yarn.lock index 06f214db31..c957bb8aea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1943,10 +1943,10 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= -"@types/lodash@^4.14.191": - version "4.14.191" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.191.tgz#09511e7f7cba275acd8b419ddac8da9a6a79e2fa" - integrity sha512-BdZ5BCCvho3EIXw6wUCXHe7rS53AIDPLE+JzwgT+OsJk53oBfbSmZZ7CX4VaRoN78N+TJpFi9QPlfIVNmJYWxQ== +"@types/lodash@^4.14.202": + version "4.14.202" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.202.tgz#f09dbd2fb082d507178b2f2a5c7e74bd72ff98f8" + integrity sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ== "@types/mime@^1": version "1.3.2" From c71c573771ffbb15cd7f1eee75dcf6109905038b Mon Sep 17 00:00:00 2001 From: kirtanchandak Date: Mon, 18 Dec 2023 12:31:28 +0530 Subject: [PATCH 27/41] auth endpoint fixed on client side --- src/client/components/pages/entities/cbReviewModal.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/components/pages/entities/cbReviewModal.tsx b/src/client/components/pages/entities/cbReviewModal.tsx index eaafcdca73..829a86957c 100644 --- a/src/client/components/pages/entities/cbReviewModal.tsx +++ b/src/client/components/pages/entities/cbReviewModal.tsx @@ -502,7 +502,9 @@ class CBReviewModal extends React.Component< private accessToken = ''; componentDidMount = async () => { - this.accessToken = await this.getAccessToken(); + if (typeof window !== "undefined") { + this.accessToken = await this.getAccessToken(); + } }; render() { From 594b5df7edd3161507c1878c7802c2cd06545185 Mon Sep 17 00:00:00 2001 From: Sidharth Date: Mon, 25 Dec 2023 00:39:58 +0530 Subject: [PATCH 28/41] fix BB-779 - Added function to give the index of the first unbalanced paranthesis. - If an unbalanced paranthesis if found in the url, the substring before that would be valid. --- src/client/helpers/utils.tsx | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/src/client/helpers/utils.tsx b/src/client/helpers/utils.tsx index 6545b33980..cb70e02a2a 100644 --- a/src/client/helpers/utils.tsx +++ b/src/client/helpers/utils.tsx @@ -171,6 +171,28 @@ export function dateObjectToISOString(value: DateObject) { return date; } +/** + * Find the first index of an unbalanced paranthesis in a url string. + * @function firstIndexOfUnbalancedParanthesis + * @param {string} url - URL string. + * @returns {number} idx - index of the first unbalanced parathesis. If no unbalanced paranthesis found, returns -1 + */ +function firstIndexOfUnbalancedParanthesis(url: string): number { + let cnt = 0; + for (let i = 0; i <= url.length; i++) { + if (url[i] === '(') { + cnt += 1; + } + else if (url[i] === ')') { + cnt -= 1; + } + if (cnt < 0) { + return i; + } + } + return -1; +} + /** * Convert any string url that has a prefix http|https|ftp|ftps to a clickable link * and then rendered the HTML string as real HTML. @@ -180,10 +202,20 @@ export function dateObjectToISOString(value: DateObject) { */ export function stringToHTMLWithLinks(content: string) { // eslint-disable-next-line max-len, no-useless-escape - const urlRegex = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%~*@\.\w_]*)#?(?:[\.\!\/\\:\w]*))?)/g; + const urlRegex = /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/g; const replacedContent = content.replace( urlRegex, - (url) => `${url}` + (url) => { + let cleanUrl: string = url; + let suffix = ''; + const firstUnbalancedParanthesis = firstIndexOfUnbalancedParanthesis(url); + if (firstUnbalancedParanthesis !== -1) { + cleanUrl = url.substring(0, firstUnbalancedParanthesis); + suffix = url.substring(firstUnbalancedParanthesis); + } + let link = `${cleanUrl}`; + return link + suffix; + } ); const sanitizedHtml = DOMPurify.sanitize(replacedContent, {ADD_ATTR: ['target']}); // eslint-disable-next-line react/no-danger From 4d15347850eca9f42d18ade8b76061cbf26a890c Mon Sep 17 00:00:00 2001 From: anshg1214 Date: Sun, 29 Oct 2023 11:38:44 +0000 Subject: [PATCH 29/41] feat: Show already selected achievements --- src/client/components/input/drag-and-drop.tsx | 38 +++++++++++++------ .../pages/parts/editor-achievements.js | 19 ++++++++-- src/client/controllers/editor/achievement.js | 1 + src/server/routes/editor.tsx | 14 +++++++ 4 files changed, 57 insertions(+), 15 deletions(-) diff --git a/src/client/components/input/drag-and-drop.tsx b/src/client/components/input/drag-and-drop.tsx index 7ec2ec3fa9..10f99b8ab2 100644 --- a/src/client/components/input/drag-and-drop.tsx +++ b/src/client/components/input/drag-and-drop.tsx @@ -33,8 +33,8 @@ const {useState, useCallback} = React; */ type Achievement = { name: string; - src: string; - id: string; + badgeUrl: string; + id: number; }; /** @@ -44,6 +44,7 @@ type Achievement = { */ type Props = { name: string; + initialAchievement?: Achievement; }; /** @@ -53,16 +54,14 @@ type Props = { * @param {Props} props - The props object containing the following: * @returns {JSX.Element} A React component that displays a drag-and-drop card for an achievement. */ -function DragAndDrop({name}: Props): JSX.Element { - const [achievement, setAchievement] = useState({ - name: 'drag badge to set', - src: '/images/blankbadge.svg' - }); +function DragAndDrop({name, initialAchievement}: Props): JSX.Element { + const [achievement, setAchievement] = useState(initialAchievement); const handleClick = useCallback((event: React.MouseEvent) => { event.preventDefault(); setAchievement({ - name: 'drag badge to set', - src: '/images/blankbadge.svg' + badgeUrl: '/images/blankbadge.svg', + id: null, + name: 'drag badge to set' }); }); const handleDragOver = useCallback((event: React.DragEvent) => { @@ -78,7 +77,11 @@ function DragAndDrop({name}: Props): JSX.Element { catch (error) { return; } - setAchievement(data); + setAchievement({ + badgeUrl: data.src, + id: data.id, + name: data.name + }); }); return ( @@ -98,7 +101,7 @@ function DragAndDrop({name}: Props): JSX.Element {
@@ -111,7 +114,18 @@ function DragAndDrop({name}: Props): JSX.Element { DragAndDrop.displayName = 'DragAndDrop'; DragAndDrop.propTypes = { + initialAchievement: PropTypes.shape({ + badgeUrl: PropTypes.string, + id: PropTypes.number, + name: PropTypes.string.isRequired + }), name: PropTypes.string.isRequired }; +DragAndDrop.defaultProps = { + initialAchievement: { + badgeUrl: '/images/blankbadge.svg', + name: 'drag badge to set' + } +}; export default DragAndDrop; diff --git a/src/client/components/pages/parts/editor-achievements.js b/src/client/components/pages/parts/editor-achievements.js index e09b994808..bc0033408b 100644 --- a/src/client/components/pages/parts/editor-achievements.js +++ b/src/client/components/pages/parts/editor-achievements.js @@ -39,6 +39,7 @@ class EditorAchievementTab extends React.Component { */ constructor(props) { super(props); + this.currAchievement = props.currAchievement; this.state = { achievement: props.achievement, editor: props.editor @@ -91,9 +92,18 @@ class EditorAchievementTab extends React.Component { method="post" > - - - + + +