diff --git a/client/homebrew/editor/metadataEditor/metadataEditor.less b/client/homebrew/editor/metadataEditor/metadataEditor.less index 5678c2554..7f7ce3060 100644 --- a/client/homebrew/editor/metadataEditor/metadataEditor.less +++ b/client/homebrew/editor/metadataEditor/metadataEditor.less @@ -2,7 +2,7 @@ .metadataEditor{ position : absolute; - z-index : 10000; + z-index : 5; box-sizing : border-box; width : 100%; padding : 25px; diff --git a/client/homebrew/editor/snippetbar/snippetbar.less b/client/homebrew/editor/snippetbar/snippetbar.less index c6f3152a7..be6ebe11a 100644 --- a/client/homebrew/editor/snippetbar/snippetbar.less +++ b/client/homebrew/editor/snippetbar/snippetbar.less @@ -72,7 +72,7 @@ position : absolute; top : 25px; right : 0; - z-index : 1; + z-index : 10; display : flex; align-items : center; justify-content : center; diff --git a/client/homebrew/navbar/error-navitem.jsx b/client/homebrew/navbar/error-navitem.jsx index eb2872c22..8551408c5 100644 --- a/client/homebrew/navbar/error-navitem.jsx +++ b/client/homebrew/navbar/error-navitem.jsx @@ -21,10 +21,11 @@ const ErrorNavItem = createClass({ this.props.parent.setState(state); }; - const error = this.props.error; - const response = error.response; - const status = response.status; - const message = response.body?.message; + const error = this.props.error; + const response = error.response; + const status = response.status; + const HBErrorCode = response.body?.HBErrorCode; + const message = response.body?.message; let errMsg = ''; try { errMsg += `${error.toString()}\n\n`; @@ -40,7 +41,9 @@ const ErrorNavItem = createClass({ {message ?? 'Conflict: please refresh to get latest changes'} ; - } else if(status === 412) { + } + + if(status === 412) { return Oops!
@@ -48,6 +51,36 @@ const ErrorNavItem = createClass({
; } + + if(HBErrorCode === '04') { + return + Oops! +
+ You are no longer signed in as an author of + this brew! Were you signed out from a different + window? Visit our log in page, then try again! +

+ +
+ Sign In +
+
+
+ Not Now +
+
+
; + } + + if(response.body?.errors?.[0].reason == 'storageQuotaExceeded') { + return + Oops! +
+ Can't save because your Google Drive seems to be full! +
+
; + } if(response.req.url.match(/^\/api.*Google.*$/m)){ return @@ -57,6 +90,7 @@ const ErrorNavItem = createClass({ expired! Visit our log in page to sign out and sign back in with Google, then try saving again! +

diff --git a/package-lock.json b/package-lock.json index c4b70d07e..00c5c0ec8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@babel/plugin-transform-runtime": "^7.23.7", "@babel/preset-env": "^7.23.8", "@babel/preset-react": "^7.23.3", - "@googleapis/drive": "^8.5.0", + "@googleapis/drive": "^8.6.0", "body-parser": "^1.20.2", "classnames": "^2.3.2", "codemirror": "^5.65.6", @@ -35,20 +35,20 @@ "marked-smartypants-lite": "^1.0.2", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", - "mongoose": "^8.0.4", + "mongoose": "^8.1.0", "nanoid": "3.3.4", "nconf": "^0.12.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-frame-component": "^4.1.3", - "react-router-dom": "6.21.2", + "react-router-dom": "6.21.3", "sanitize-filename": "1.6.3", "superagent": "^8.1.2", "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" }, "devDependencies": { "eslint": "^8.56.0", - "eslint-plugin-jest": "^27.6.2", + "eslint-plugin-jest": "^27.6.3", "eslint-plugin-react": "^7.33.2", "jest": "^29.7.0", "jest-expect-message": "^1.1.3", @@ -1966,9 +1966,9 @@ } }, "node_modules/@googleapis/drive": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/@googleapis/drive/-/drive-8.5.0.tgz", - "integrity": "sha512-5SIODqhdxcimwR06peQcvqAf0tEpj14oEi8dcFB/KvNaev5NRf2MqMMWA3G6dgDPdLKAX/HTmwGz8OD7oGpe8Q==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/@googleapis/drive/-/drive-8.6.0.tgz", + "integrity": "sha512-Af3/5i6h7gbjHnwFuO9zMTpYOy2yhhfZlNciUEjb14L3ZdT1WNIDM038viIAb9ovFzkrIDqLSfUbFCgh1pywkw==", "dependencies": { "googleapis-common": "^7.0.0" }, @@ -2794,9 +2794,9 @@ } }, "node_modules/@mongodb-js/saslprep": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.1.tgz", - "integrity": "sha512-t7c5K033joZZMspnHg/gWPE4kandgc2OxE74aYOtGKfgB9VPuVJPix0H6fhmm2erj5PBJ21mqcx34lpIGtUCsQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.4.tgz", + "integrity": "sha512-8zJ8N1x51xo9hwPh6AWnKdLGEC5N3lDa6kms1YHmFBoRhTpJR6HG8wWk0td1MVCu9cD4YBrvjZEtd5Obw0Fbnw==", "dependencies": { "sparse-bitfield": "^3.0.3" } @@ -2957,7 +2957,8 @@ "node_modules/@types/node": { "version": "18.15.5", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.5.tgz", - "integrity": "sha512-Ark2WDjjZO7GmvsyFFf81MXuGTA/d6oP38anyxWOL6EREyBKAxKoFHwBhaZxCfLRLpO8JgVXwqOwSwa7jRcjew==" + "integrity": "sha512-Ark2WDjjZO7GmvsyFFf81MXuGTA/d6oP38anyxWOL6EREyBKAxKoFHwBhaZxCfLRLpO8JgVXwqOwSwa7jRcjew==", + "dev": true }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", @@ -2983,11 +2984,10 @@ "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==" }, "node_modules/@types/whatwg-url": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.2.tgz", - "integrity": "sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==", + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.4.tgz", + "integrity": "sha512-lXCmTWSHJvf0TRSO58nm978b8HJ/EdsSsEKLd3ODHFjo+3VGAyyTp4v50nWvwtzBxSMQrVOK7tcuN0zGPLICMw==", "dependencies": { - "@types/node": "*", "@types/webidl-conversions": "*" } }, @@ -5642,9 +5642,9 @@ } }, "node_modules/eslint-plugin-jest": { - "version": "27.6.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.6.2.tgz", - "integrity": "sha512-CI1AlKrsNhYFoP48VU8BVWOi7+qHTq4bRxyUlGjeU8SfFt8abjXhjOuDzUoMp68DoXIx17KpNpIkMrl4s4ZW0g==", + "version": "27.6.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.6.3.tgz", + "integrity": "sha512-+YsJFVH6R+tOiO3gCJon5oqn4KWc+mDq2leudk8mrp8RFubLOo9CVyi3cib4L7XMpxExmkmBZQTPDYVBzgpgOA==", "dev": true, "dependencies": { "@typescript-eslint/utils": "^5.10.0" @@ -10444,22 +10444,22 @@ } }, "node_modules/mongodb-connection-string-url": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-2.6.0.tgz", - "integrity": "sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.0.tgz", + "integrity": "sha512-t1Vf+m1I5hC2M5RJx/7AtxgABy1cZmIPQRMXw+gEIPn/cZNF3Oiy+l0UIypUwVB5trcWHq3crg2g3uAR9aAwsQ==", "dependencies": { - "@types/whatwg-url": "^8.2.1", - "whatwg-url": "^11.0.0" + "@types/whatwg-url": "^11.0.2", + "whatwg-url": "^13.0.0" } }, "node_modules/mongoose": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.0.4.tgz", - "integrity": "sha512-wN9qvdevX3+922VnLT7CpaZRT3jmVCBOK2QMHMGeScQxDRnFMPpkuI9StEPpZo/3x8t+kbzH7F8RMPsyNwyM4w==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.1.0.tgz", + "integrity": "sha512-kOA4Xnq2goqNpN9EmYElGNWfxA9H80fxcr7UdJKWi3UMflza0R7wpTihCpM67dE/0MNFljoa0sjQtlXVkkySAQ==", "dependencies": { "bson": "^6.2.0", "kareem": "2.5.1", - "mongodb": "6.2.0", + "mongodb": "6.3.0", "mpath": "0.9.0", "mquery": "5.0.0", "ms": "2.1.3", @@ -10531,13 +10531,13 @@ } }, "node_modules/mongoose/node_modules/mongodb": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.2.0.tgz", - "integrity": "sha512-d7OSuGjGWDZ5usZPqfvb36laQ9CPhnWkAGHT61x5P95p/8nMVeH8asloMwW6GcYFeB0Vj4CB/1wOTDG2RA9BFA==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.3.0.tgz", + "integrity": "sha512-tt0KuGjGtLUhLoU263+xvQmPHEGTw5LbcNC73EoFRYgSHwZt5tsoJC110hDyO1kjQzpgNrpdcSza9PknWN4LrA==", "dependencies": { "@mongodb-js/saslprep": "^1.1.0", "bson": "^6.2.0", - "mongodb-connection-string-url": "^2.6.0" + "mongodb-connection-string-url": "^3.0.0" }, "engines": { "node": ">=16.20.1" @@ -11873,9 +11873,9 @@ "dev": true }, "node_modules/react-router": { - "version": "6.21.2", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.21.2.tgz", - "integrity": "sha512-jJcgiwDsnaHIeC+IN7atO0XiSRCrOsQAHHbChtJxmgqG2IaYQXSnhqGb5vk2CU/wBQA12Zt+TkbuJjIn65gzbA==", + "version": "6.21.3", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.21.3.tgz", + "integrity": "sha512-a0H638ZXULv1OdkmiK6s6itNhoy33ywxmUFT/xtSoVyf9VnC7n7+VT4LjVzdIHSaF5TIh9ylUgxMXksHTgGrKg==", "dependencies": { "@remix-run/router": "1.14.2" }, @@ -11887,12 +11887,12 @@ } }, "node_modules/react-router-dom": { - "version": "6.21.2", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.21.2.tgz", - "integrity": "sha512-tE13UukgUOh2/sqYr6jPzZTzmzc70aGRP4pAjG2if0IP3aUT+sBtAKUJh0qMh0zylJHGLmzS+XWVaON4UklHeg==", + "version": "6.21.3", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.21.3.tgz", + "integrity": "sha512-kNzubk7n4YHSrErzjLK72j0B5i969GsuCGazRl3G6j1zqZBLjuSlYBdVdkDOgzGdPIffUOc9nmgiadTEVoq91g==", "dependencies": { "@remix-run/router": "1.14.2", - "react-router": "6.21.2" + "react-router": "6.21.3" }, "engines": { "node": ">=14.0.0" @@ -13843,14 +13843,14 @@ } }, "node_modules/tr46": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", - "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", + "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", "dependencies": { - "punycode": "^2.1.1" + "punycode": "^2.3.0" }, "engines": { - "node": ">=12" + "node": ">=14" } }, "node_modules/trim-newlines": { @@ -14760,15 +14760,15 @@ } }, "node_modules/whatwg-url": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", - "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", + "integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==", "dependencies": { - "tr46": "^3.0.0", + "tr46": "^4.1.1", "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=12" + "node": ">=16" } }, "node_modules/which": { diff --git a/package.json b/package.json index e173e2d17..b91bf573c 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "@babel/plugin-transform-runtime": "^7.23.7", "@babel/preset-env": "^7.23.8", "@babel/preset-react": "^7.23.3", - "@googleapis/drive": "^8.5.0", + "@googleapis/drive": "^8.6.0", "body-parser": "^1.20.2", "classnames": "^2.3.2", "codemirror": "^5.65.6", @@ -105,20 +105,20 @@ "marked-smartypants-lite": "^1.0.2", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.30.1", - "mongoose": "^8.0.4", + "mongoose": "^8.1.0", "nanoid": "3.3.4", "nconf": "^0.12.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-frame-component": "^4.1.3", - "react-router-dom": "6.21.2", + "react-router-dom": "6.21.3", "sanitize-filename": "1.6.3", "superagent": "^8.1.2", "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" }, "devDependencies": { "eslint": "^8.56.0", - "eslint-plugin-jest": "^27.6.2", + "eslint-plugin-jest": "^27.6.3", "eslint-plugin-react": "^7.33.2", "jest": "^29.7.0", "jest-expect-message": "^1.1.3", diff --git a/server/app.js b/server/app.js index a19030b3a..970c2cd9c 100644 --- a/server/app.js +++ b/server/app.js @@ -472,9 +472,18 @@ const getPureError = (error)=>{ }; app.use(async (err, req, res, next)=>{ - const status = err.status || err.code || 500; + err.originalUrl = req.originalUrl; console.error(err); + if(err.originalUrl?.startsWith('/api/')) { + // console.log('API error'); + res.status(err.status || err.response?.status || 500).send(err); + return; + } + + // console.log('non-API error'); + const status = err.status || err.code || 500; + req.ogMeta = { ...defaultMetaTags, title : 'Error Page', description : 'Something went wrong!' diff --git a/themes/V3/5ePHB/snippets/classfeature.gen.js b/themes/V3/5ePHB/snippets/classfeature.gen.js index 2597c3ee8..e2e9148b5 100644 --- a/themes/V3/5ePHB/snippets/classfeature.gen.js +++ b/themes/V3/5ePHB/snippets/classfeature.gen.js @@ -42,8 +42,8 @@ module.exports = function(classname){ #### Equipment You start with the following equipment, in addition to the equipment granted by your background: - - *(a)* a martial weapon and a shield or *(b)* two martial weapons - - *(a)* five javelins or *(b)* any simple melee weapon + - (*a*) a martial weapon and a shield or (*b*) two martial weapons + - (*a*) five javelins or (*b*) any simple melee weapon - ${_.sample(['10 lint fluffs', '1 button', 'a cherished lost sock'])} `; };