diff --git a/package-lock.json b/package-lock.json index adb704ed0..c4b135e89 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@emotion/styled": "^11.11.0", "@minoru/react-dnd-treeview": "^3.4.4", "@mui/icons-material": "^5.13.7", - "@mui/lab": "^5.0.0-alpha.133", + "@mui/lab": "^5.0.0-alpha.137", "@mui/material": "^5.11.13", "@mui/x-data-grid": "^6.9.0", "@testing-library/jest-dom": "^5.16.5", @@ -25,11 +25,12 @@ "@types/react-dom": "^17.0.11", "@types/signals": "^1.0.1", "@types/throttle-debounce": "^5.0.0", - "@uiw/react-textarea-code-editor": "^2.1.6", + "@uiw/react-textarea-code-editor": "^2.1.7", "comlink": "^4.3.1", "command-exists": "^1.2.9", "convert-units": "^3.0.0-beta.5", "glob": "^9.3.0", + "keycloak-js": "^21.1.1", "ky": "^0.33.2", "material-ui-popup-state": "^5.0.9", "notistack": "^3.0.1", @@ -1878,9 +1879,9 @@ "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==" }, "node_modules/@babel/runtime": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz", - "integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.6.tgz", + "integrity": "sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ==", "dependencies": { "regenerator-runtime": "^0.13.11" }, @@ -3486,15 +3487,15 @@ } }, "node_modules/@mui/lab": { - "version": "5.0.0-alpha.133", - "resolved": "https://registry.npmjs.org/@mui/lab/-/lab-5.0.0-alpha.133.tgz", - "integrity": "sha512-pPL5/f6si8eCXlsnOZrO+/zg5Yv6qKa9OpI6nGP77Mpn7iYHm9qrcsWFIBs6YjgxqJf6dA2IqtHaSNOSndrXDw==", + "version": "5.0.0-alpha.137", + "resolved": "https://registry.npmjs.org/@mui/lab/-/lab-5.0.0-alpha.137.tgz", + "integrity": "sha512-bHfcfti9/GnB657QpTdlK1fc9gjkP3SC+NrXyb9NCr0rT5Cq7TEkBGXyY5wGUSCyHR3CrMvchkIsfG5sH/NJ9A==", "dependencies": { - "@babel/runtime": "^7.21.0", - "@mui/base": "5.0.0-beta.4", - "@mui/system": "^5.13.2", + "@babel/runtime": "^7.22.6", + "@mui/base": "5.0.0-beta.8", + "@mui/system": "^5.14.1", "@mui/types": "^7.2.4", - "@mui/utils": "^5.13.1", + "@mui/utils": "^5.14.1", "clsx": "^1.2.1", "prop-types": "^15.8.1", "react-is": "^18.2.0" @@ -3527,14 +3528,14 @@ } }, "node_modules/@mui/lab/node_modules/@mui/base": { - "version": "5.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.4.tgz", - "integrity": "sha512-ejhtqYJpjDgHGEljjMBQWZ22yEK0OzIXNa7toJmmXsP4TT3W7xVy8bTJ0TniPDf+JNjrsgfgiFTDGdlEhV1E+g==", + "version": "5.0.0-beta.8", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.8.tgz", + "integrity": "sha512-b4vVjMZx5KzzEMf4arXKoeV5ZegAMOoPwoy1vfUBwhvXc2QtaaAyBp50U7OA2L06Leubc1A+lEp3eqwZoFn87g==", "dependencies": { - "@babel/runtime": "^7.21.0", + "@babel/runtime": "^7.22.6", "@emotion/is-prop-valid": "^1.2.1", "@mui/types": "^7.2.4", - "@mui/utils": "^5.13.1", + "@mui/utils": "^5.14.1", "@popperjs/core": "^2.11.8", "clsx": "^1.2.1", "prop-types": "^15.8.1", @@ -3603,12 +3604,12 @@ } }, "node_modules/@mui/private-theming": { - "version": "5.13.1", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.13.1.tgz", - "integrity": "sha512-HW4npLUD9BAkVppOUZHeO1FOKUJWAwbpy0VQoGe3McUYTlck1HezGHQCfBQ5S/Nszi7EViqiimECVl9xi+/WjQ==", + "version": "5.13.7", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.13.7.tgz", + "integrity": "sha512-qbSr+udcij5F9dKhGX7fEdx2drXchq7htLNr2Qg2Ma+WJ6q0ERlEqGSBiPiVDJkptcjeVL4DGmcf1wl5+vD4EA==", "dependencies": { - "@babel/runtime": "^7.21.0", - "@mui/utils": "^5.13.1", + "@babel/runtime": "^7.22.5", + "@mui/utils": "^5.13.7", "prop-types": "^15.8.1" }, "engines": { @@ -3660,15 +3661,15 @@ } }, "node_modules/@mui/system": { - "version": "5.13.2", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.13.2.tgz", - "integrity": "sha512-TPyWmRJPt0JPVxacZISI4o070xEJ7ftxpVtu6LWuYVOUOINlhoGOclam4iV8PDT3EMQEHuUrwU49po34UdWLlw==", + "version": "5.14.1", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.14.1.tgz", + "integrity": "sha512-u+xlsU34Jdkgx1CxmBnIC4Y08uPdVX5iEd3S/1dggDFtOGp+Lj8xmKRJAQ8PJOOJLOh8pDwaZx4AwXikL4l1QA==", "dependencies": { - "@babel/runtime": "^7.21.0", - "@mui/private-theming": "^5.13.1", + "@babel/runtime": "^7.22.6", + "@mui/private-theming": "^5.13.7", "@mui/styled-engine": "^5.13.2", "@mui/types": "^7.2.4", - "@mui/utils": "^5.13.1", + "@mui/utils": "^5.14.1", "clsx": "^1.2.1", "csstype": "^3.1.2", "prop-types": "^15.8.1" @@ -3712,13 +3713,13 @@ } }, "node_modules/@mui/utils": { - "version": "5.13.1", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.13.1.tgz", - "integrity": "sha512-6lXdWwmlUbEU2jUI8blw38Kt+3ly7xkmV9ljzY4Q20WhsJMWiNry9CX8M+TaP/HbtuyR8XKsdMgQW7h7MM3n3A==", + "version": "5.14.1", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.14.1.tgz", + "integrity": "sha512-39KHKK2JeqRmuUcLDLwM+c2XfVC136C5/yUyQXmO2PVbOb2Bol4KxtkssEqCbTwg87PSCG3f1Tb0keRsK7cVGw==", "dependencies": { - "@babel/runtime": "^7.21.0", + "@babel/runtime": "^7.22.6", "@types/prop-types": "^15.7.5", - "@types/react-is": "^18.2.0", + "@types/react-is": "^18.2.1", "prop-types": "^15.8.1", "react-is": "^18.2.0" }, @@ -4723,9 +4724,9 @@ } }, "node_modules/@types/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/@types/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-1vz2yObaQkLL7YFe/pme2cpvDsCwI1WXIfL+5eLz0MI9gFG24Re16RzUsI8t9XZn9ZWvgLNDrJBmrqXJO7GNQQ==", + "version": "18.2.1", + "resolved": "https://registry.npmjs.org/@types/react-is/-/react-is-18.2.1.tgz", + "integrity": "sha512-wyUkmaaSZEzFZivD8F2ftSyAfk6L+DfFliVj/mYdOXbVjRcS87fQJLTnhk6dRZPuJjI+9g6RZJO4PNCngUrmyw==", "dependencies": { "@types/react": "*" } @@ -4919,9 +4920,9 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -5100,9 +5101,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -5175,9 +5176,9 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -5210,9 +5211,9 @@ } }, "node_modules/@uiw/react-textarea-code-editor": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@uiw/react-textarea-code-editor/-/react-textarea-code-editor-2.1.6.tgz", - "integrity": "sha512-ad5WX7w1GtzLD486Xf69QV0ybmyw+7IedMvl/rbV/3owtOpSMwtFY6EkTBfKuX4YKfVG3tmmPY+SLYsFCkNzHg==", + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@uiw/react-textarea-code-editor/-/react-textarea-code-editor-2.1.7.tgz", + "integrity": "sha512-mh3+PLiWPM9eclpdQ16jhm1mlS9IEwwiNkfQX34RACB9M0p7JoSI8Tq0T+3sTgbGzgwkrruOvsXUY6NKYLohZQ==", "dependencies": { "@babel/runtime": "^7.18.6", "rehype": "~12.0.1", @@ -6107,6 +6108,25 @@ "resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz", "integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==" }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/batch": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", @@ -7100,9 +7120,9 @@ } }, "node_modules/css-loader/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -9445,9 +9465,9 @@ } }, "node_modules/fork-ts-checker-webpack-plugin/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -9587,19 +9607,6 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -12677,9 +12684,9 @@ } }, "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -13127,6 +13134,11 @@ "url": "https://opencollective.com/js-sdsl" } }, + "node_modules/js-sha256": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", + "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -13352,6 +13364,15 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/keycloak-js": { + "version": "21.1.2", + "resolved": "https://registry.npmjs.org/keycloak-js/-/keycloak-js-21.1.2.tgz", + "integrity": "sha512-+6r1BvmutWGJBtibo7bcFbHWIlA7XoXRCwcA4vopeJh59Nv2Js0ju2u+t8AYth+C6Cg7/BNfO3eCTbsl/dTBHw==", + "dependencies": { + "base64-js": "^1.5.1", + "js-sha256": "^0.9.0" + } + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -15353,9 +15374,9 @@ } }, "node_modules/postcss-loader/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -16360,9 +16381,9 @@ } }, "node_modules/react-app-rewired/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "bin": { "semver": "bin/semver" @@ -16752,9 +16773,9 @@ } }, "node_modules/react-scripts/node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -17520,9 +17541,9 @@ } }, "node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -18685,9 +18706,9 @@ } }, "node_modules/tough-cookie": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.2.tgz", - "integrity": "sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", "dependencies": { "psl": "^1.1.33", "punycode": "^2.1.1", @@ -19724,9 +19745,9 @@ } }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "engines": { "node": ">=0.10.0" } @@ -21436,9 +21457,9 @@ "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==" }, "@babel/runtime": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.5.tgz", - "integrity": "sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.6.tgz", + "integrity": "sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ==", "requires": { "regenerator-runtime": "^0.13.11" } @@ -22640,29 +22661,29 @@ } }, "@mui/lab": { - "version": "5.0.0-alpha.133", - "resolved": "https://registry.npmjs.org/@mui/lab/-/lab-5.0.0-alpha.133.tgz", - "integrity": "sha512-pPL5/f6si8eCXlsnOZrO+/zg5Yv6qKa9OpI6nGP77Mpn7iYHm9qrcsWFIBs6YjgxqJf6dA2IqtHaSNOSndrXDw==", + "version": "5.0.0-alpha.137", + "resolved": "https://registry.npmjs.org/@mui/lab/-/lab-5.0.0-alpha.137.tgz", + "integrity": "sha512-bHfcfti9/GnB657QpTdlK1fc9gjkP3SC+NrXyb9NCr0rT5Cq7TEkBGXyY5wGUSCyHR3CrMvchkIsfG5sH/NJ9A==", "requires": { - "@babel/runtime": "^7.21.0", - "@mui/base": "5.0.0-beta.4", - "@mui/system": "^5.13.2", + "@babel/runtime": "^7.22.6", + "@mui/base": "5.0.0-beta.8", + "@mui/system": "^5.14.1", "@mui/types": "^7.2.4", - "@mui/utils": "^5.13.1", + "@mui/utils": "^5.14.1", "clsx": "^1.2.1", "prop-types": "^15.8.1", "react-is": "^18.2.0" }, "dependencies": { "@mui/base": { - "version": "5.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.4.tgz", - "integrity": "sha512-ejhtqYJpjDgHGEljjMBQWZ22yEK0OzIXNa7toJmmXsP4TT3W7xVy8bTJ0TniPDf+JNjrsgfgiFTDGdlEhV1E+g==", + "version": "5.0.0-beta.8", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.8.tgz", + "integrity": "sha512-b4vVjMZx5KzzEMf4arXKoeV5ZegAMOoPwoy1vfUBwhvXc2QtaaAyBp50U7OA2L06Leubc1A+lEp3eqwZoFn87g==", "requires": { - "@babel/runtime": "^7.21.0", + "@babel/runtime": "^7.22.6", "@emotion/is-prop-valid": "^1.2.1", "@mui/types": "^7.2.4", - "@mui/utils": "^5.13.1", + "@mui/utils": "^5.14.1", "@popperjs/core": "^2.11.8", "clsx": "^1.2.1", "prop-types": "^15.8.1", @@ -22691,12 +22712,12 @@ } }, "@mui/private-theming": { - "version": "5.13.1", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.13.1.tgz", - "integrity": "sha512-HW4npLUD9BAkVppOUZHeO1FOKUJWAwbpy0VQoGe3McUYTlck1HezGHQCfBQ5S/Nszi7EViqiimECVl9xi+/WjQ==", + "version": "5.13.7", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.13.7.tgz", + "integrity": "sha512-qbSr+udcij5F9dKhGX7fEdx2drXchq7htLNr2Qg2Ma+WJ6q0ERlEqGSBiPiVDJkptcjeVL4DGmcf1wl5+vD4EA==", "requires": { - "@babel/runtime": "^7.21.0", - "@mui/utils": "^5.13.1", + "@babel/runtime": "^7.22.5", + "@mui/utils": "^5.13.7", "prop-types": "^15.8.1" } }, @@ -22712,15 +22733,15 @@ } }, "@mui/system": { - "version": "5.13.2", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.13.2.tgz", - "integrity": "sha512-TPyWmRJPt0JPVxacZISI4o070xEJ7ftxpVtu6LWuYVOUOINlhoGOclam4iV8PDT3EMQEHuUrwU49po34UdWLlw==", + "version": "5.14.1", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.14.1.tgz", + "integrity": "sha512-u+xlsU34Jdkgx1CxmBnIC4Y08uPdVX5iEd3S/1dggDFtOGp+Lj8xmKRJAQ8PJOOJLOh8pDwaZx4AwXikL4l1QA==", "requires": { - "@babel/runtime": "^7.21.0", - "@mui/private-theming": "^5.13.1", + "@babel/runtime": "^7.22.6", + "@mui/private-theming": "^5.13.7", "@mui/styled-engine": "^5.13.2", "@mui/types": "^7.2.4", - "@mui/utils": "^5.13.1", + "@mui/utils": "^5.14.1", "clsx": "^1.2.1", "csstype": "^3.1.2", "prop-types": "^15.8.1" @@ -22733,13 +22754,13 @@ "requires": {} }, "@mui/utils": { - "version": "5.13.1", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.13.1.tgz", - "integrity": "sha512-6lXdWwmlUbEU2jUI8blw38Kt+3ly7xkmV9ljzY4Q20WhsJMWiNry9CX8M+TaP/HbtuyR8XKsdMgQW7h7MM3n3A==", + "version": "5.14.1", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.14.1.tgz", + "integrity": "sha512-39KHKK2JeqRmuUcLDLwM+c2XfVC136C5/yUyQXmO2PVbOb2Bol4KxtkssEqCbTwg87PSCG3f1Tb0keRsK7cVGw==", "requires": { - "@babel/runtime": "^7.21.0", + "@babel/runtime": "^7.22.6", "@types/prop-types": "^15.7.5", - "@types/react-is": "^18.2.0", + "@types/react-is": "^18.2.1", "prop-types": "^15.8.1", "react-is": "^18.2.0" } @@ -23488,9 +23509,9 @@ } }, "@types/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/@types/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-1vz2yObaQkLL7YFe/pme2cpvDsCwI1WXIfL+5eLz0MI9gFG24Re16RzUsI8t9XZn9ZWvgLNDrJBmrqXJO7GNQQ==", + "version": "18.2.1", + "resolved": "https://registry.npmjs.org/@types/react-is/-/react-is-18.2.1.tgz", + "integrity": "sha512-wyUkmaaSZEzFZivD8F2ftSyAfk6L+DfFliVj/mYdOXbVjRcS87fQJLTnhk6dRZPuJjI+9g6RZJO4PNCngUrmyw==", "requires": { "@types/react": "*" } @@ -23665,9 +23686,9 @@ } }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "requires": { "lru-cache": "^6.0.0" } @@ -23764,9 +23785,9 @@ } }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "requires": { "lru-cache": "^6.0.0" } @@ -23816,9 +23837,9 @@ } }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "requires": { "lru-cache": "^6.0.0" } @@ -23840,9 +23861,9 @@ } }, "@uiw/react-textarea-code-editor": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@uiw/react-textarea-code-editor/-/react-textarea-code-editor-2.1.6.tgz", - "integrity": "sha512-ad5WX7w1GtzLD486Xf69QV0ybmyw+7IedMvl/rbV/3owtOpSMwtFY6EkTBfKuX4YKfVG3tmmPY+SLYsFCkNzHg==", + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@uiw/react-textarea-code-editor/-/react-textarea-code-editor-2.1.7.tgz", + "integrity": "sha512-mh3+PLiWPM9eclpdQ16jhm1mlS9IEwwiNkfQX34RACB9M0p7JoSI8Tq0T+3sTgbGzgwkrruOvsXUY6NKYLohZQ==", "requires": { "@babel/runtime": "^7.18.6", "rehype": "~12.0.1", @@ -24536,6 +24557,11 @@ "resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz", "integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==" }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, "batch": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", @@ -25251,9 +25277,9 @@ } }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "requires": { "lru-cache": "^6.0.0" } @@ -27000,9 +27026,9 @@ } }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "requires": { "lru-cache": "^6.0.0" } @@ -27109,12 +27135,6 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "optional": true - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -29444,9 +29464,9 @@ } }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "requires": { "lru-cache": "^6.0.0" } @@ -29790,6 +29810,11 @@ "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", "integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==" }, + "js-sha256": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", + "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -29967,6 +29992,15 @@ } } }, + "keycloak-js": { + "version": "21.1.2", + "resolved": "https://registry.npmjs.org/keycloak-js/-/keycloak-js-21.1.2.tgz", + "integrity": "sha512-+6r1BvmutWGJBtibo7bcFbHWIlA7XoXRCwcA4vopeJh59Nv2Js0ju2u+t8AYth+C6Cg7/BNfO3eCTbsl/dTBHw==", + "requires": { + "base64-js": "^1.5.1", + "js-sha256": "^0.9.0" + } + }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -31274,9 +31308,9 @@ } }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "requires": { "lru-cache": "^6.0.0" } @@ -31924,9 +31958,9 @@ }, "dependencies": { "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true } } @@ -32216,9 +32250,9 @@ } }, "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "requires": { "lru-cache": "^6.0.0" } @@ -32767,9 +32801,9 @@ } }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" }, "send": { "version": "0.18.0", @@ -33658,9 +33692,9 @@ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" }, "tough-cookie": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.2.tgz", - "integrity": "sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", "requires": { "psl": "^1.1.33", "punycode": "^2.1.1", @@ -34419,9 +34453,9 @@ } }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==" }, "workbox-background-sync": { "version": "6.5.4", diff --git a/package.json b/package.json index 081b0ab46..2606affcc 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "@emotion/styled": "^11.11.0", "@minoru/react-dnd-treeview": "^3.4.4", "@mui/icons-material": "^5.13.7", - "@mui/lab": "^5.0.0-alpha.133", + "@mui/lab": "^5.0.0-alpha.137", "@mui/material": "^5.11.13", "@mui/x-data-grid": "^6.9.0", "@testing-library/jest-dom": "^5.16.5", @@ -20,7 +20,7 @@ "@types/react-dom": "^17.0.11", "@types/signals": "^1.0.1", "@types/throttle-debounce": "^5.0.0", - "@uiw/react-textarea-code-editor": "^2.1.6", + "@uiw/react-textarea-code-editor": "^2.1.7", "comlink": "^4.3.1", "command-exists": "^1.2.9", "convert-units": "^3.0.0-beta.5", @@ -47,7 +47,8 @@ "typescript": "^4.9.5", "use-interval": "^1.4.0", "usehooks-ts": "^2.9.1", - "web-vitals": "^3.3.1" + "web-vitals": "^3.3.1", + "keycloak-js": "^21.1.1" }, "scripts": { "format": "prettier --ignore-path .gitignore --ignore-path .prettierignore --write --plugin-search-dir=. .", diff --git a/src/ThreeEditor/js/viewport/ViewportManager.js b/src/ThreeEditor/js/viewport/ViewportManager.js index 80e5dae32..da60d2322 100644 --- a/src/ThreeEditor/js/viewport/ViewportManager.js +++ b/src/ThreeEditor/js/viewport/ViewportManager.js @@ -353,7 +353,7 @@ function ViewManager(editor) { ); } - renderer.setPixelRatio(window.devicePixelRatio); + renderer.setPixelRatio(1); renderer.setSize(container.dom.offsetWidth, container.dom.offsetHeight); pmremGenerator = new THREE.PMREMGenerator(renderer); diff --git a/src/WrapperApp/components/InputEditor/InputFilesEditor.tsx b/src/WrapperApp/components/InputEditor/InputFilesEditor.tsx index b1bc7e2a4..4f66ba2b8 100644 --- a/src/WrapperApp/components/InputEditor/InputFilesEditor.tsx +++ b/src/WrapperApp/components/InputEditor/InputFilesEditor.tsx @@ -30,6 +30,8 @@ export function InputFilesEditor(props: InputFilesEditorProps) { const { demoMode } = useConfig(); const inputFiles = props.inputFiles ?? _defaultShInputFiles; const theme = useTheme(); + const largeFileSize = 100_000; + const largeFileLinesLimit = 500; const canBeDeleted = (name: string) => { switch (props.simulator) { @@ -48,6 +50,25 @@ export function InputFilesEditor(props: InputFilesEditorProps) { props.onChange?.call(null, updateFn(inputFiles)); }; + const truncateFile = (file: string) => { + var result: string[] = []; + var lines = file.split('\n').slice(0, largeFileLinesLimit); + let totalLength = 0; + + for (const line of lines) { + if (totalLength + line.length <= largeFileSize) { + totalLength += line.length; + result.push(line); + } else { + result.push(line.substring(0, largeFileSize - totalLength)); + break; + } + } + + result.push("\n\n... Output truncated ..."); + return result.join('\n'); + }; + return ( { + const isLargeFile = value.length > largeFileSize; + const content = !isLargeFile + ? value + : truncateFile(value); return (

@@ -151,18 +176,30 @@ export function InputFilesEditor(props: InputFilesEditorProps) { Delete )} + {isLargeFile && ( + + File is to large, displaying first few lines... + + )}

- - updateInputFiles(old => { - return { ...old, [name]: evn.target.value }; - }) - } + onChange={evn => { + if (!isLargeFile) { + updateInputFiles(old => { + return { ...old, [name]: evn.target.value }; + }) + } + }} + disabled={isLargeFile} data-color-mode={theme.palette.mode} padding={15} style={{ diff --git a/src/WrapperApp/components/Panels/LoginPanel.tsx b/src/WrapperApp/components/Panels/LoginPanel.tsx index 789b58fb9..4451304cf 100644 --- a/src/WrapperApp/components/Panels/LoginPanel.tsx +++ b/src/WrapperApp/components/Panels/LoginPanel.tsx @@ -6,7 +6,7 @@ import { useAuth } from '../../../services/AuthService'; export default function LoginPanel() { const { altAuth } = useConfig(); - const { login } = useAuth(); + const { login, tokenLogin } = useAuth(); const theme = useTheme(); const [username, setUsername] = useState(''); @@ -95,7 +95,7 @@ export default function LoginPanel() { color='info' fullWidth variant={theme.palette.mode === 'dark' ? 'outlined' : 'contained'} - onClick={() => login('demo', 'demo')}> + onClick={tokenLogin}> Connect with PLGrid diff --git a/src/WrapperApp/components/Simulation/SimulationPanel.tsx b/src/WrapperApp/components/Simulation/SimulationPanel.tsx index 422e4ec77..739b11a0b 100644 --- a/src/WrapperApp/components/Simulation/SimulationPanel.tsx +++ b/src/WrapperApp/components/Simulation/SimulationPanel.tsx @@ -1,6 +1,5 @@ import { Box, Fade, Modal } from '@mui/material'; import { ChangeEvent, useCallback, useEffect, useState } from 'react'; -import useInterval from 'use-interval'; import { useConfig } from '../../../config/ConfigService'; import { isFullSimulationData } from '../../../services/LoaderService'; @@ -15,6 +14,7 @@ import { SimulationInputFiles, StatusState } from '../../../types/ResponseTypes'; +import useIntervalAsync from '../../../util/hooks/useIntervalAsync'; import { InputFilesEditor } from '../InputEditor/InputFilesEditor'; import { DemoCardGrid, PaginatedSimulationsFromBackend } from './SimulationCardGrid'; import { PageNavigationProps, PageParamProps } from './SimulationPanelBar'; @@ -70,7 +70,7 @@ export default function SimulationPanel({ const [simulationInfo, setSimulationInfo] = useState([]); const [simulationsStatusData, setSimulationsStatusData] = useState([]); - const [simulationIDInterval, setSimulationIDInterval] = useState(null); + const [simulationIDInterval, setSimulationIDInterval] = useState(); const [controller] = useState(new AbortController()); const updateSimulationInfo = useCallback( @@ -95,16 +95,15 @@ export default function SimulationPanel({ [controller.signal, getFullSimulationData, setResultsSimulationData, trackedId] ); - const updateSimulationData = useCallback( - () => - !demoMode && - getPageStatus(simulationInfo, true, handleBeforeCacheWrite, controller.signal).then( - s => { - setSimulationsStatusData([...s]); - } - ), - [demoMode, getPageStatus, simulationInfo, handleBeforeCacheWrite, controller.signal] - ); + const updateSimulationData = useCallback(() => { + if (demoMode) return Promise.resolve(); + + return getPageStatus(simulationInfo, true, handleBeforeCacheWrite, controller.signal).then( + s => { + setSimulationsStatusData([...s]); + } + ); + }, [demoMode, getPageStatus, simulationInfo, handleBeforeCacheWrite, controller.signal]); useEffect(() => { if (!demoMode) @@ -112,7 +111,7 @@ export default function SimulationPanel({ .then(() => { setBackendAlive(true); updateSimulationInfo(); - setSimulationIDInterval(10000); + setSimulationIDInterval(30000); }) .catch(() => { setBackendAlive(false); @@ -121,7 +120,7 @@ export default function SimulationPanel({ return () => { controller.abort(); - setSimulationIDInterval(null); + setSimulationIDInterval(undefined); }; }, [ controller.signal, @@ -134,13 +133,9 @@ export default function SimulationPanel({ controller ]); - useInterval(updateSimulationInfo, simulationIDInterval, true); + useIntervalAsync(updateSimulationInfo, simulationIDInterval); - useInterval( - updateSimulationData, - simulationIDInterval !== null && simulationInfo.length > 0 ? 1000 : null, - true - ); + useIntervalAsync(updateSimulationData, simulationInfo.length > 0 ? 1000 : simulationIDInterval); const handleLoadResults = async (taskId: string | null, simulation: unknown) => { if (taskId === null) return goToResults?.call(null); diff --git a/src/services/AuthService.tsx b/src/services/AuthService.tsx index 4d2148f53..6a63b3043 100644 --- a/src/services/AuthService.tsx +++ b/src/services/AuthService.tsx @@ -1,3 +1,4 @@ +import Keycloak from 'keycloak-js'; import ky, { HTTPError } from 'ky'; import { KyInstance } from 'ky/distribution/types/ky'; import { useSnackbar } from 'notistack'; @@ -15,8 +16,9 @@ import { hasFields } from '../util/customGuards'; import useIntervalAsync from '../util/hooks/useIntervalAsync'; import { snakeToCamelCase } from '../util/Notation/Notation'; import { createGenericContext, GenericContextProviderProps } from './GenericContext'; +import { keycloakConfig } from './keycloakConfig'; -type AuthUser = Pick; +type AuthUser = Pick; const isAuthUser = (obj: unknown): obj is AuthUser => { return hasFields(obj, 'username') && typeof obj.username === 'string'; @@ -64,18 +66,21 @@ export interface AuthContext { isAuthorized: boolean; isServerReachable: boolean; login: (...args: RequestAuthLogin) => void; + tokenLogin: () => void; logout: (...args: RequestAuthLogout) => void; refresh: (...args: RequestAuthRefresh) => void; authKy: KyInstance; } const [useAuth, AuthContextProvider] = createGenericContext(); +const keycloak = new Keycloak(keycloakConfig); const Auth = ({ children }: GenericContextProviderProps) => { const { backendUrl, demoMode } = useConfig(); const [user, setUser] = useState(load(StorageKey.USER, isAuthUser)); - const [reachInterval, setReachInterval] = useState(undefined); - const [refreshInterval, setRefreshInterval] = useState(180000); + const [reachInterval, setReachInterval] = useState(); + const [refreshInterval, setRefreshInterval] = useState(180000); // 3 minutes in ms default interval for refresh token + const [keyCloakInterval, setKeyCloakInterval] = useState(); const [isServerReachable, setIsServerReachable] = useState(null); const { enqueueSnackbar } = useSnackbar(); @@ -174,21 +179,52 @@ const Auth = ({ children }: GenericContextProviderProps) => { reachServer(); }, [reachServer]); - const refresh = useCallback(() => { - if (demoMode || !isServerReachable) return Promise.resolve(setRefreshInterval(undefined)); - - return kyIntervalRef - .get(`auth/refresh`) - .json() - .then(({ accessExp }) => setRefreshInterval(getRefreshDelay(accessExp))) + useEffect(() => { + if (user !== null && user.source !== 'keycloak' && isServerReachable) + setRefreshInterval(prev => (prev === undefined ? 3000 : prev)); + // 3 seconds in ms default interval for refresh when logged in with username and password + else if (!isServerReachable || !user?.source) setRefreshInterval(undefined); + }, [isServerReachable, user]); + + const tokenLogin = useCallback(() => { + const username = keycloak.tokenParsed?.preferred_username; + kyRef + .post(`auth/keycloak`, { + headers: { + Authorization: `Bearer ${keycloak.token}` + }, + json: { + username + } + }) + .then(() => { + setUser({ + username, + source: 'keycloak' + }); + }) .catch((_: HTTPError) => {}); - }, [demoMode, isServerReachable, kyIntervalRef]); + }, [kyRef]); useEffect(() => { - if (user !== null && refreshInterval === undefined && isServerReachable) - setRefreshInterval(3000); - else if (!isServerReachable || user === null) setRefreshInterval(undefined); - }, [isServerReachable, refreshInterval, user]); + keycloak + .init({ + pkceMethod: 'S256', + checkLoginIframe: false + }) + .then(auth => { + console.log('after init', auth); + + if (auth) { + setKeyCloakInterval( + keycloak.tokenParsed?.exp !== undefined + ? getRefreshDelay(keycloak.tokenParsed.exp * 1000) + : undefined + ); + tokenLogin(); + } + }); + }, [tokenLogin]); const login = useCallback( (...[username, password]: RequestAuthLogin) => { @@ -208,13 +244,50 @@ const Auth = ({ children }: GenericContextProviderProps) => { ); const logout = useCallback(() => { + keycloak.logout(); kyRef .delete(`auth/logout`) .json() - .then(_response => setUser(null)) - .catch((_: HTTPError) => {}); + .catch((_: HTTPError) => {}) + .finally(() => setUser(null)); }, [kyRef]); + const tokenRefresh = useCallback(() => { + if (!keycloak.authenticated) { + setKeyCloakInterval(undefined); + + return Promise.resolve(); + } + + return keycloak + .updateToken(300) // 5 minutes in seconds minimum remaining lifetime for token before refresh is allowed + .then(refreshed => { + if (refreshed) + console.log( + `Token refreshed ${keycloak.tokenParsed?.exp} -> ${keycloak.tokenParsed?.exp}` + ); + }) + .catch(() => { + console.log('Failed to refresh token'); + logout(); + }); + }, [logout]); + + useIntervalAsync(tokenRefresh, keycloak.authenticated ? keyCloakInterval : undefined); + + const refresh = useCallback(async () => { + if (user?.source === 'keycloak') return tokenLogin(); + if (demoMode || !isServerReachable) return Promise.resolve(setRefreshInterval(undefined)); + + try { + const { accessExp } = await kyIntervalRef + .get(`auth/refresh`) + .json(); + + return setRefreshInterval(getRefreshDelay(accessExp)); + } catch (_) {} + }, [demoMode, isServerReachable, kyIntervalRef, tokenLogin, user?.source]); + const authKy = useMemo(() => kyRef, [kyRef]); const isAuthorized = useMemo(() => user !== null || demoMode, [demoMode, user]); @@ -231,6 +304,7 @@ const Auth = ({ children }: GenericContextProviderProps) => { isAuthorized, isServerReachable: Boolean(isServerReachable), login, + tokenLogin: keycloak.login, logout, authKy, refresh diff --git a/src/services/keycloakConfig.ts b/src/services/keycloakConfig.ts new file mode 100644 index 000000000..75f2b30f8 --- /dev/null +++ b/src/services/keycloakConfig.ts @@ -0,0 +1,6 @@ +export const keycloakConfig = { + url: 'https://sso.pre.plgrid.pl/auth/', + realm: 'PLGrid', + clientId: 'yaptide-staging', + enableLogging: true +}; diff --git a/src/types/ResponseTypes.ts b/src/types/ResponseTypes.ts index bc3c24da4..0092a4d5b 100644 --- a/src/types/ResponseTypes.ts +++ b/src/types/ResponseTypes.ts @@ -103,6 +103,7 @@ type AuthData = Omit< type AuthStatus = Omit< { username: string; + source?: string; } & YaptideResponse, never >;