From 940395db04d854bfd9034cd15487606d35814475 Mon Sep 17 00:00:00 2001 From: Richard Dominick <34370238+RichDom2185@users.noreply.github.com> Date: Fri, 8 Dec 2023 18:17:33 +0700 Subject: [PATCH 01/12] Replace deprecated `ITreeNode` with `TreeNodeInfo` Done as per migration guide. --- .../subcomponents/StorySimulatorAssetSelection.tsx | 8 ++++---- .../StorySimulatorAssetSelectionHelper.tsx | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pages/academy/storySimulator/subcomponents/StorySimulatorAssetSelection.tsx b/src/pages/academy/storySimulator/subcomponents/StorySimulatorAssetSelection.tsx index e7a45abb2d..a1d8840e3e 100644 --- a/src/pages/academy/storySimulator/subcomponents/StorySimulatorAssetSelection.tsx +++ b/src/pages/academy/storySimulator/subcomponents/StorySimulatorAssetSelection.tsx @@ -1,4 +1,4 @@ -import { Icon, ITreeNode, Tree } from '@blueprintjs/core'; +import { Icon, Tree, TreeNodeInfo } from '@blueprintjs/core'; import { Tooltip2 } from '@blueprintjs/popover2'; import React from 'react'; import { useRequest } from 'src/commons/utils/Hooks'; @@ -12,7 +12,7 @@ import { assetPathsToTree, treeMap } from './StorySimulatorAssetSelectionHelper' import StorySimulatorAssetViewer from './StorySimulatorAssetViewer'; type TreeState = { - nodes: ITreeNode[]; + nodes: TreeNodeInfo[]; }; /** @@ -31,8 +31,8 @@ const StorySimulatorAssetSelection = () => { setAssetTree({ nodes: assetPathsToTree(assetPaths, toolIcons, s3AssetFolders) }); }, [assetPaths]); - const handleNodeClick = (nodeData: ITreeNode) => { - treeMap(assetTree.nodes, (node: ITreeNode) => (node.isSelected = false)); + const handleNodeClick = (nodeData: TreeNodeInfo) => { + treeMap(assetTree.nodes, (node: TreeNodeInfo) => (node.isSelected = false)); nodeData.isSelected = !nodeData.isSelected; nodeData.isExpanded = !nodeData.isExpanded; const selectedPath = nodeData.id.toString(); diff --git a/src/pages/academy/storySimulator/subcomponents/StorySimulatorAssetSelectionHelper.tsx b/src/pages/academy/storySimulator/subcomponents/StorySimulatorAssetSelectionHelper.tsx index 0718000a11..fab135ff5e 100644 --- a/src/pages/academy/storySimulator/subcomponents/StorySimulatorAssetSelectionHelper.tsx +++ b/src/pages/academy/storySimulator/subcomponents/StorySimulatorAssetSelectionHelper.tsx @@ -1,4 +1,4 @@ -import { ITreeNode } from '@blueprintjs/core'; +import { TreeNodeInfo } from '@blueprintjs/core'; import _ from 'lodash'; /** @@ -7,7 +7,7 @@ import _ from 'lodash'; * @param nodes All parent nodes of the blueprint core tree * @param fn Function to apply to every element in the tree */ -export function treeMap(nodes: ITreeNode[] | undefined, fn: (node: ITreeNode) => void) { +export function treeMap(nodes: TreeNodeInfo[] | undefined, fn: (node: TreeNodeInfo) => void) { nodes && nodes.forEach(node => { fn(node); @@ -27,13 +27,13 @@ export function treeMap(nodes: ITreeNode[] | undefined, fn: (node: ITreeNode) => * all blueprint core nodes basded on the file path * @param rootFolders - a default list of parent folder names that you want to display regardless of * whether or not they have contents - * @returns {ITreeNode[]} - a blueprint core tree parent nodes + * @returns {TreeNodeInfo[]} - a blueprint core tree parent nodes */ export function assetPathsToTree( assetPaths: string[], iconRenderer: (pathName: string) => JSX.Element, rootFolders: string[] = [] -): ITreeNode[] { +): TreeNodeInfo[] { const assetObj = {}; assetPaths.forEach(assetPath => _.set(assetObj, assetPath.split('/'), 'FILE')); rootFolders.forEach(folder => { @@ -42,7 +42,7 @@ export function assetPathsToTree( } }); - function helper(parentFolders: string[], assetObj: object | Array): ITreeNode[] { + function helper(parentFolders: string[], assetObj: object | Array): TreeNodeInfo[] { return Object.keys(assetObj).map(file => { const shortPath = '/' + parentFolders.join('/') + '/' + file; return { From a16c5eb6cc397860c898ddd093c261acd7df35aa Mon Sep 17 00:00:00 2001 From: Richard Dominick <34370238+RichDom2185@users.noreply.github.com> Date: Fri, 8 Dec 2023 18:37:49 +0700 Subject: [PATCH 02/12] Upgrade BlueprintJS dependencies to v5 --- package.json | 10 +-- yarn.lock | 185 ++++++++++++++++----------------------------------- 2 files changed, 63 insertions(+), 132 deletions(-) diff --git a/package.json b/package.json index f4921ee477..cdb001d018 100644 --- a/package.json +++ b/package.json @@ -26,11 +26,11 @@ "prepare": "husky install" }, "dependencies": { - "@blueprintjs/core": "^4.20.1", - "@blueprintjs/datetime": "^4.4.37", - "@blueprintjs/icons": "^4.16.0", - "@blueprintjs/popover2": "^1.14.11", - "@blueprintjs/select": "^4.9.24", + "@blueprintjs/core": "^5.7.0", + "@blueprintjs/datetime": "^5.2.0", + "@blueprintjs/icons": "^5.5.0", + "@blueprintjs/popover2": "^2.0.0", + "@blueprintjs/select": "^5.0.0", "@octokit/rest": "^19.0.11", "@sentry/browser": "^7.57.0", "@sourceacademy/sharedb-ace": "^2.0.2", diff --git a/yarn.lock b/yarn.lock index f7e3a28556..6d7f026732 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1168,71 +1168,69 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@blueprintjs/colors@^4.2.1": - version "4.2.1" - resolved "https://registry.yarnpkg.com/@blueprintjs/colors/-/colors-4.2.1.tgz#603b2512caee84feddcb3dbd536534c140b9a1f3" - integrity sha512-Cx7J2YnUuxn+fi+y5XtXnBB7+cFHN4xBrRkaAetp78i3VTCXjUk+d1omrOr8TqbRucUXTdrhbZOUHpzRLFcJpQ== +"@blueprintjs/colors@^5.0.8": + version "5.0.8" + resolved "https://registry.yarnpkg.com/@blueprintjs/colors/-/colors-5.0.8.tgz#c4658d1c314bb69086c8f54179fac84e668f5018" + integrity sha512-Y/gpCMc/NAiScuH6vJGDI6vW2RqgR9ayEwtesVirQz3KnQSAHvbZWlgHzEO4Teyhc6FuXL3Tbj5kfq5JCeEyoQ== dependencies: - tslib "~2.5.0" + tslib "~2.6.2" -"@blueprintjs/core@^4.20.1", "@blueprintjs/core@^4.20.2": - version "4.20.2" - resolved "https://registry.yarnpkg.com/@blueprintjs/core/-/core-4.20.2.tgz#ae1bbaf13bd1bf887b506760c478cc940f6d6e20" - integrity sha512-5v4Nr0jozfAjiOkjY4zvt1XSpt4ldnrSaxtwo506S2cxJYfwFeMTmDshXNPFcc8L1fjZMxi0IWI2WABXzZXS6w== +"@blueprintjs/core@^5.7.0", "@blueprintjs/core@^5.7.2": + version "5.7.2" + resolved "https://registry.yarnpkg.com/@blueprintjs/core/-/core-5.7.2.tgz#494beb68c00e913c71a486a968d39007279f43b1" + integrity sha512-wzYSog3RGsNq95F0stYZ+C6/PBjPidFRzVRnQPeUO/M0tZCL4QEbKC4qNz1flGlXaQH5sD6rjaoRoFaJfouXVg== dependencies: - "@blueprintjs/colors" "^4.2.1" - "@blueprintjs/icons" "^4.16.0" - "@juggle/resize-observer" "^3.4.0" - "@types/dom4" "^2.0.2" + "@blueprintjs/colors" "^5.0.8" + "@blueprintjs/icons" "^5.5.0" + "@popperjs/core" "^2.11.7" classnames "^2.3.1" - dom4 "^2.1.5" normalize.css "^8.0.1" - popper.js "^1.16.1" - react-popper "^1.3.11" + react-popper "^2.3.0" react-transition-group "^4.4.5" - tslib "~2.5.0" + tslib "~2.6.2" -"@blueprintjs/datetime@^4.4.37": - version "4.4.37" - resolved "https://registry.yarnpkg.com/@blueprintjs/datetime/-/datetime-4.4.37.tgz#c3c92cf3b0aa39c26a5727ffd0a5262ca9a1f29c" - integrity sha512-YJiWzUH1eefCMvvvdsLimrLZNk5XW1yTMK4OmX6BP+gAt/u7cNKyv+42XO4tlymeWRqT0K7HbQOPP4ybt/xzEw== +"@blueprintjs/datetime@^5.2.0": + version "5.2.8" + resolved "https://registry.yarnpkg.com/@blueprintjs/datetime/-/datetime-5.2.8.tgz#21f125d64fc3d872565d2b4c58c593136d9152e8" + integrity sha512-HcuCeKJRC7XyLyuDWRdS4OdK7wBqxBnZBoPRjHl6I3C13ZHGXnx159UtOuckNob280BIgX+mKbR1lCBKW1Kn/A== dependencies: - "@blueprintjs/core" "^4.20.2" + "@blueprintjs/core" "^5.7.2" + "@blueprintjs/icons" "^5.5.0" + "@blueprintjs/select" "^5.0.20" classnames "^2.3.1" + date-fns "^2.28.0" + date-fns-tz "^2.0.0" + lodash "^4.17.21" react-day-picker "7.4.9" - tslib "~2.5.0" + tslib "~2.6.2" -"@blueprintjs/icons@^4.16.0": - version "4.16.0" - resolved "https://registry.yarnpkg.com/@blueprintjs/icons/-/icons-4.16.0.tgz#47f9e8abe64d84fc18721080b8f191d8aac075d8" - integrity sha512-cyfgjUZcZCtQrXWUV8FwqYTFEzduV4a0N7yhOU38jY+cBRCLu/sDrD0Osvfk4DGRvNe4YjY7pohVLFSxpg68Uw== +"@blueprintjs/icons@^5.5.0": + version "5.5.0" + resolved "https://registry.yarnpkg.com/@blueprintjs/icons/-/icons-5.5.0.tgz#3694614066a91515f2e993ad574f61e5f0ead323" + integrity sha512-XnGWYZwtYh3+Cf9e2zYweZdwhZTevgufo287hu38Jfdhb7rcbWUwU7ktAmmf21QvGFqw6Ohyu8VVkoZZlE4eMg== dependencies: change-case "^4.1.2" classnames "^2.3.1" - tslib "~2.5.0" + tslib "~2.6.2" -"@blueprintjs/popover2@^1.14.11": - version "1.14.11" - resolved "https://registry.yarnpkg.com/@blueprintjs/popover2/-/popover2-1.14.11.tgz#0698fdeaf6710460cef0b71bed592ca37f40d1f9" - integrity sha512-5XAjeb2mlWjYXC0pqrNDLzHSsX85Zaiv8jixxUN9abarMUUFKGATgGF8MRsWTLAW94Gli6CB1lzVkrYkRHHf6Q== +"@blueprintjs/popover2@^2.0.0": + version "2.0.20" + resolved "https://registry.yarnpkg.com/@blueprintjs/popover2/-/popover2-2.0.20.tgz#35f0272e574cdcdb3aa41192421ede75335aed95" + integrity sha512-tLiMHgDuRDAEYNdFIlmv9eoEMfr4OTAZ7hY51Op7oMVW/zTNYATBYPTDDz9HmRgfFMnkSrE7ejWLLZYbhbKYVA== dependencies: - "@blueprintjs/core" "^4.20.2" - "@juggle/resize-observer" "^3.4.0" - "@popperjs/core" "^2.11.7" + "@blueprintjs/core" "^5.7.2" classnames "^2.3.1" - dom4 "^2.1.5" - react-popper "^2.3.0" - tslib "~2.5.0" + tslib "~2.6.2" -"@blueprintjs/select@^4.9.24": - version "4.9.24" - resolved "https://registry.yarnpkg.com/@blueprintjs/select/-/select-4.9.24.tgz#5814d946486308a05758a9e1408b6f8c31f4a60e" - integrity sha512-OTjesxH/7UZvM7yAdHJ5u3sIjX1N8Rs4CQQ22AfqNl82SIROqkuXI31XEl6YNX1GsYfmAMiw0K7XohEKOMXR5g== +"@blueprintjs/select@^5.0.0", "@blueprintjs/select@^5.0.20": + version "5.0.20" + resolved "https://registry.yarnpkg.com/@blueprintjs/select/-/select-5.0.20.tgz#200dbf11149fcfffab52be0f507e0ae3f607c997" + integrity sha512-t9T8mAXP5enMrieVOVv86J8OOv/+JiGIapiswgmt1MYpSO3mmF+yo3SGw/tOEqHla0Nk/tVxLbxdkwGGY2NYvA== dependencies: - "@blueprintjs/core" "^4.20.2" - "@blueprintjs/popover2" "^1.14.11" + "@blueprintjs/core" "^5.7.2" + "@blueprintjs/icons" "^5.5.0" classnames "^2.3.1" - tslib "~2.5.0" + tslib "~2.6.2" "@craco/craco@^7.1.0": version "7.1.0" @@ -1426,14 +1424,6 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== -"@hypnosphi/create-react-context@^0.3.1": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@hypnosphi/create-react-context/-/create-react-context-0.3.1.tgz#f8bfebdc7665f5d426cba3753e0e9c7d3154d7c6" - integrity sha512-V1klUed202XahrWJLLOT3EXNeCpFHCcJntdFGI15ntCwau+jfT386w7OFTMaCqOgXUH1fa0w/I1oZs+i/Rfr0A== - dependencies: - gud "^1.0.0" - warning "^4.0.3" - "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -1754,11 +1744,6 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" -"@juggle/resize-observer@^3.4.0": - version "3.4.0" - resolved "https://registry.yarnpkg.com/@juggle/resize-observer/-/resize-observer-3.4.0.tgz#08d6c5e20cf7e4cc02fd181c4b0c225cd31dbb60" - integrity sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA== - "@leichtgewicht/ip-codec@^2.0.1": version "2.0.4" resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b" @@ -2653,11 +2638,6 @@ dependencies: "@types/ms" "*" -"@types/dom4@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@types/dom4/-/dom4-2.0.2.tgz#6495303f049689ce936ed328a3e5ede9c51408ee" - integrity sha512-Rt4IC1T7xkCWa0OG1oSsPa0iqnxlDeQqKXZAHrQGLb7wFGncWm85MaxKUjAGejOrUynOgWlFi4c6S6IyJwoK4g== - "@types/eslint-scope@^3.7.3": version "3.7.4" resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.4.tgz#37fc1223f0786c39627068a12e94d6e6fc61de16" @@ -5190,6 +5170,11 @@ data-urls@^2.0.0: whatwg-mimetype "^2.3.0" whatwg-url "^8.0.0" +date-fns-tz@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/date-fns-tz/-/date-fns-tz-2.0.0.tgz#1b14c386cb8bc16fc56fe333d4fc34ae1d1099d5" + integrity sha512-OAtcLdB9vxSXTWHdT8b398ARImVwQMyjfYGkKD2zaGpHseG2UPHbHjXELReErZFxWdSLph3c2zOaaTyHfOhERQ== + date-fns@^2.28.0: version "2.30.0" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0" @@ -5259,18 +5244,6 @@ dedent@^0.7.0: resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== -deep-equal@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a" - integrity sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g== - dependencies: - is-arguments "^1.0.4" - is-date-object "^1.0.1" - is-regex "^1.0.4" - object-is "^1.0.1" - object-keys "^1.1.1" - regexp.prototype.flags "^1.2.0" - deep-equal@^2.0.5: version "2.2.0" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.2.0.tgz#5caeace9c781028b9ff459f33b779346637c43e6" @@ -5321,7 +5294,7 @@ define-lazy-prop@^2.0.0: resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== -define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: +define-properties@^1.1.3, define-properties@^1.1.4: version "1.2.0" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== @@ -5527,11 +5500,6 @@ dom-serializer@^1.0.1: domhandler "^4.2.0" entities "^2.0.0" -dom4@^2.1.5: - version "2.1.6" - resolved "https://registry.yarnpkg.com/dom4/-/dom4-2.1.6.tgz#c90df07134aa0dbd81ed4d6ba1237b36fc164770" - integrity sha512-JkCVGnN4ofKGbjf5Uvc8mmxaATIErKQKSgACdBXpsQ3fY6DlIpAyWfiBSrGkttATssbDCp3psiAKWXk5gmjycA== - domelementtype@1: version "1.3.1" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" @@ -6565,7 +6533,7 @@ function.prototype.name@^1.1.5: es-abstract "^1.19.0" functions-have-names "^1.2.2" -functions-have-names@^1.2.2, functions-have-names@^1.2.3: +functions-have-names@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== @@ -6815,11 +6783,6 @@ grapheme-splitter@^1.0.4: resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== -gud@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0" - integrity sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw== - gzip-size@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-6.0.0.tgz#065367fd50c239c0671cbcbad5be3e2eeb10e462" @@ -7358,7 +7321,7 @@ is-alphanumerical@^1.0.0: is-alphabetical "^1.0.0" is-decimal "^1.0.0" -is-arguments@^1.0.4, is-arguments@^1.1.1: +is-arguments@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== @@ -7532,7 +7495,7 @@ is-potential-custom-element-name@^1.0.1: resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== -is-regex@^1.0.4, is-regex@^1.1.4: +is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== @@ -9492,7 +9455,7 @@ object-inspect@^1.12.2, object-inspect@^1.9.0: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== -object-is@^1.0.1, object-is@^1.1.5: +object-is@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== @@ -9907,11 +9870,6 @@ pkg-up@^3.1.0: dependencies: find-up "^3.0.0" -popper.js@^1.14.4, popper.js@^1.16.1: - version "1.16.1" - resolved "https://registry.yarnpkg.com/popper.js/-/popper.js-1.16.1.tgz#2a223cb3dc7b6213d740e40372be40de43e65b1b" - integrity sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ== - postcss-attribute-case-insensitive@^5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/postcss-attribute-case-insensitive/-/postcss-attribute-case-insensitive-5.0.2.tgz#03d761b24afc04c09e757e92ff53716ae8ea2741" @@ -10909,19 +10867,6 @@ react-papaparse@^4.0.2: "@types/papaparse" "^5.3.1" papaparse "^5.3.1" -react-popper@^1.3.11: - version "1.3.11" - resolved "https://registry.yarnpkg.com/react-popper/-/react-popper-1.3.11.tgz#a2cc3f0a67b75b66cfa62d2c409f9dd1fcc71ffd" - integrity sha512-VSA/bS+pSndSF2fiasHK/PTEEAyOpX60+H5EPAjoArr8JGm+oihu4UbrqcEBpQibJxBVCpYyjAX7abJ+7DoYVg== - dependencies: - "@babel/runtime" "^7.1.2" - "@hypnosphi/create-react-context" "^0.3.1" - deep-equal "^1.1.1" - popper.js "^1.14.4" - prop-types "^15.6.1" - typed-styles "^0.0.7" - warning "^4.0.2" - react-popper@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/react-popper/-/react-popper-2.3.0.tgz#17891c620e1320dce318bad9fede46a5f71c70ba" @@ -11336,15 +11281,6 @@ regex-parser@^2.2.11: resolved "https://registry.yarnpkg.com/regex-parser/-/regex-parser-2.2.11.tgz#3b37ec9049e19479806e878cabe7c1ca83ccfe58" integrity sha512-jbD/FT0+9MBU2XAZluI7w2OBs1RBi6p9M83nkoZayQXXU9e8Robt69FcZc7wU4eJD/YFTjn1JdCk3rbMJajz8Q== -regexp.prototype.flags@^1.2.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz#fe7ce25e7e4cca8db37b6634c8a2c7009199b9cb" - integrity sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA== - dependencies: - call-bind "^1.0.2" - define-properties "^1.2.0" - functions-have-names "^1.2.3" - regexp.prototype.flags@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" @@ -12757,10 +12693,10 @@ tslib@^2.0.3, tslib@^2.4.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.0.tgz#b295854684dbda164e181d259a22cd779dcd7bc3" integrity sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA== -tslib@~2.5.0: - version "2.5.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.3.tgz#24944ba2d990940e6e982c4bea147aba80209913" - integrity sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w== +tslib@~2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== tsutils@^3.21.0: version "3.21.0" @@ -12832,11 +12768,6 @@ typed-array-length@^1.0.4: for-each "^0.3.3" is-typed-array "^1.1.9" -typed-styles@^0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/typed-styles/-/typed-styles-0.0.7.tgz#93392a008794c4595119ff62dde6809dbc40a3d9" - integrity sha512-pzP0PWoZUhsECYjABgCGQlRGL1n7tOHsgwYv3oIiEpJwGhFTuty/YNeduxQYzXXa3Ge5BdT6sHYIQYpl4uJ+5Q== - typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" @@ -13216,7 +13147,7 @@ walker@^1.0.7: dependencies: makeerror "1.0.12" -warning@^4.0.2, warning@^4.0.3: +warning@^4.0.2: version "4.0.3" resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3" integrity sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w== From 93827354acaabc12b0e941d3d540a5ef98f6aeb0 Mon Sep 17 00:00:00 2001 From: Richard Dominick <34370238+RichDom2185@users.noreply.github.com> Date: Fri, 8 Dec 2023 18:38:01 +0700 Subject: [PATCH 03/12] Use public `IconName` type instead of internal API Fixes a compile error following the version upgrade. --- src/commons/navigationBar/NavigationBar.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/commons/navigationBar/NavigationBar.tsx b/src/commons/navigationBar/NavigationBar.tsx index 1ad361a2b7..dc1504a00c 100644 --- a/src/commons/navigationBar/NavigationBar.tsx +++ b/src/commons/navigationBar/NavigationBar.tsx @@ -11,8 +11,7 @@ import { NavbarHeading, Position } from '@blueprintjs/core'; -import { IconNames } from '@blueprintjs/icons'; -import { BlueprintIcons_16Id } from '@blueprintjs/icons/lib/esm/generated-icons/16px/blueprint-icons-16'; +import { IconName, IconNames } from '@blueprintjs/icons'; import { Popover2 } from '@blueprintjs/popover2'; import classNames from 'classnames'; import { Location } from 'history'; @@ -33,7 +32,7 @@ import SicpNavigationBar from './subcomponents/SicpNavigationBar'; export type NavbarEntryInfo = { to: string; - icon: BlueprintIcons_16Id; + icon: IconName; text: string; disabled?: boolean; // entry is not rendered when disabled hasNotifications?: boolean; // whether to render NotificationBadge From 584f149fcfacc7570060df10861205a620b14dc0 Mon Sep 17 00:00:00 2001 From: Richard Dominick <34370238+RichDom2185@users.noreply.github.com> Date: Fri, 8 Dec 2023 20:03:55 +0700 Subject: [PATCH 04/12] Migrate to `Datetime2` package Resolves the issue with the deprecated `DateInput` component. Also made the necessary API changes for the migration. --- package.json | 2 +- .../subcomponents/GroundControlEditCell.tsx | 13 +++++----- yarn.lock | 26 ++++++++++++++++++- 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index cdb001d018..01d0c5a670 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ }, "dependencies": { "@blueprintjs/core": "^5.7.0", - "@blueprintjs/datetime": "^5.2.0", + "@blueprintjs/datetime2": "^2.2.7", "@blueprintjs/icons": "^5.5.0", "@blueprintjs/popover2": "^2.0.0", "@blueprintjs/select": "^5.0.0", diff --git a/src/pages/academy/groundControl/subcomponents/GroundControlEditCell.tsx b/src/pages/academy/groundControl/subcomponents/GroundControlEditCell.tsx index ba9c58083e..686ab97020 100644 --- a/src/pages/academy/groundControl/subcomponents/GroundControlEditCell.tsx +++ b/src/pages/academy/groundControl/subcomponents/GroundControlEditCell.tsx @@ -1,5 +1,5 @@ import { Classes, Dialog, Intent } from '@blueprintjs/core'; -import { DateInput } from '@blueprintjs/datetime'; +import { DateInput3 } from '@blueprintjs/datetime2'; import { IconNames } from '@blueprintjs/icons'; import * as moment from 'moment'; import * as React from 'react'; @@ -60,7 +60,7 @@ const EditCell: React.FunctionComponent = props => { const handleFormatDate = (date: Date) => moment(date).format(dateDisplayFormat); const handleDateChange = React.useCallback( - (selectedDate: Date | null) => setNewDate(moment(selectedDate)), + (selectedDate: string | null) => setNewDate(moment(selectedDate)), [] ); const handleDateError = React.useCallback(() => { @@ -70,15 +70,16 @@ const EditCell: React.FunctionComponent = props => { }, [currentDate]); const dateInput = ( - Date: Fri, 8 Dec 2023 20:05:20 +0700 Subject: [PATCH 05/12] Update prop name Fixes the breaking change introduced by the Blueprint v5 upgrade. --- src/features/remoteExecution/RemoteExecutionDeviceDialog.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/remoteExecution/RemoteExecutionDeviceDialog.tsx b/src/features/remoteExecution/RemoteExecutionDeviceDialog.tsx index a355d38e74..481eb38279 100644 --- a/src/features/remoteExecution/RemoteExecutionDeviceDialog.tsx +++ b/src/features/remoteExecution/RemoteExecutionDeviceDialog.tsx @@ -127,7 +127,7 @@ export default function RemoteExecutionDeviceDialog({ void (typeField.ref.current = element)} + ref={element => void (typeField.ref.current = element)} disabled={isSubmitting || !!deviceToEdit} {...(deviceToEdit ? { value: deviceToEdit.type } : undefined)} > From 2215ecc50dd069a72825a98a335f6fd3e31c003c Mon Sep 17 00:00:00 2001 From: Richard Dominick <34370238+RichDom2185@users.noreply.github.com> Date: Fri, 8 Dec 2023 20:36:41 +0700 Subject: [PATCH 06/12] Update test snapshots --- .../__snapshots__/ContentDisplay.tsx.snap | 2 +- .../__tests__/__snapshots__/Markdown.tsx.snap | 2 +- .../__snapshots__/Assessment.tsx.snap | 507 ++---- .../AssessmentWorkspace.tsx.snap | 1366 +++++++---------- .../__tests__/__snapshots__/Dropdown.tsx.snap | 32 +- .../__snapshots__/NavigationBar.tsx.snap | 236 ++- .../AcademyNavigationBar.tsx.snap | 156 +- .../GitHubAssessmentsNavigationBar.tsx.snap | 48 +- .../NavigationBarLangSelectButton.tsx.snap | 26 +- .../__snapshots__/SicpNavigationBar.tsx.snap | 24 +- .../__tests__/__snapshots__/Repl.tsx.snap | 62 +- .../SideContentAutograder.tsx.snap | 184 ++- .../SideContentContestLeaderboard.tsx.snap | 28 +- .../SideContentContestVoting.tsx.snap | 61 +- .../SideContentEnvVisualizer.tsx.snap | 306 ++-- .../__snapshots__/SicpErrors.tsx.snap | 42 +- .../__snapshots__/ParseJson.tsx.snap | 88 +- .../__snapshots__/GitHubClassroom.tsx.snap | 4 +- .../__snapshots__/Playground.tsx.snap | 1167 ++++++-------- .../__snapshots__/CodeSnippet.tsx.snap | 16 +- .../__snapshots__/SicpExercise.tsx.snap | 10 +- .../__snapshots__/SicpIndexPage.tsx.snap | 212 ++- .../__tests__/__snapshots__/SicpToc.tsx.snap | 198 ++- 23 files changed, 1945 insertions(+), 2832 deletions(-) diff --git a/src/commons/__tests__/__snapshots__/ContentDisplay.tsx.snap b/src/commons/__tests__/__snapshots__/ContentDisplay.tsx.snap index 8b1f36894e..a10dcc05e0 100644 --- a/src/commons/__tests__/__snapshots__/ContentDisplay.tsx.snap +++ b/src/commons/__tests__/__snapshots__/ContentDisplay.tsx.snap @@ -8,7 +8,7 @@ exports[`ContentDisplay page renders correctly 1`] = ` className="col-md-10 col-xs-11 contentdisplay-content-parent" >
Test Content diff --git a/src/commons/__tests__/__snapshots__/Markdown.tsx.snap b/src/commons/__tests__/__snapshots__/Markdown.tsx.snap index 24fac67e60..589070ffae 100644 --- a/src/commons/__tests__/__snapshots__/Markdown.tsx.snap +++ b/src/commons/__tests__/__snapshots__/Markdown.tsx.snap @@ -2,7 +2,7 @@ exports[`Markdown page renders correctly 1`] = `
Welcome to the Source Academy playground!

diff --git a/src/commons/assessment/__tests__/__snapshots__/Assessment.tsx.snap b/src/commons/assessment/__tests__/__snapshots__/Assessment.tsx.snap index 86e6ef8772..3d5f8cd056 100644 --- a/src/commons/assessment/__tests__/__snapshots__/Assessment.tsx.snap +++ b/src/commons/assessment/__tests__/__snapshots__/Assessment.tsx.snap @@ -11,13 +11,13 @@ exports[`Assessment page "loading" content renders correctly 1`] = ` className="col-md-10 col-xs-11 contentdisplay-content-parent" >
Fetching assessment... @@ -80,10 +81,10 @@ exports[`Assessment page does not show attempt Button for upcoming assessments f className="col-md-10 col-xs-11 contentdisplay-content-parent" >

An Odessey to Runes (Duplicate)

@@ -166,7 +166,7 @@ exports[`Assessment page does not show attempt Button for upcoming assessments f className="listing-button" >

The Secret to Streams

@@ -351,7 +348,7 @@ exports[`Assessment page does not show attempt Button for upcoming assessments f className="listing-button" >
- - - - + />

There are no assessments.

@@ -867,10 +842,10 @@ exports[`Assessment page with multiple loaded missions renders correctly 1`] = ` className="col-md-10 col-xs-11 contentdisplay-content-parent" >

An Odessey to Runes (Duplicate)

@@ -953,7 +915,7 @@ exports[`Assessment page with multiple loaded missions renders correctly 1`] = ` className="listing-button" >
@@ -1054,7 +990,7 @@ exports[`Assessment page with multiple loaded missions renders correctly 1`] = ` onClick={[Function]} >

The Secret to Streams

@@ -1186,7 +1096,7 @@ exports[`Assessment page with multiple loaded missions renders correctly 1`] = ` className="listing-button" >
@@ -1310,7 +1181,7 @@ exports[`Assessment page with multiple loaded missions renders correctly 1`] = ` onClick={[Function]} >
@@ -1521,7 +1340,7 @@ exports[`Assessment page with multiple loaded missions renders correctly 1`] = ` onClick={[Function]} >
Getting mission ready... @@ -57,7 +58,7 @@ exports[`AssessmentWorkspace AssessmentWorkspace page "loading" content renders exports[`AssessmentWorkspace AssessmentWorkspace page with ContestVoting question renders correctly 1`] = `
- + Source §1 + + +
Question 1 of 1