From d1ff50e4571092ebdbded7bf893137a770b81fc5 Mon Sep 17 00:00:00 2001 From: ImJustChew Date: Fri, 23 Aug 2024 00:12:05 +0800 Subject: [PATCH 1/5] fix(deps): remove @capacitor and react-pdf-viewer from dependabot group --- .github/dependabot.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9619dc19..17b19d15 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -14,6 +14,9 @@ updates: applies-to: "version-updates" patterns: - "*" + exclude-patterns: + - "@capacitor*" + - "@react-pdf-viewer/core" security: applies-to: "security-updates" patterns: From 304772bec7c76bc2c4d160a411ec2b7c252f05d5 Mon Sep 17 00:00:00 2001 From: Pakapool Date: Thu, 12 Sep 2024 10:50:47 +0800 Subject: [PATCH 2/5] Updated calendar page --- package-lock.json | 522 ++++++++++++++---- src/components/Calendar/Calendar.tsx | 7 +- .../Calendar/timetableToCalendarEvent.tsx | 6 +- 3 files changed, 430 insertions(+), 105 deletions(-) diff --git a/package-lock.json b/package-lock.json index f2bf1e4a..98a99dc6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1811,9 +1811,9 @@ "license": "MIT" }, "node_modules/@babel/runtime": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.0.tgz", - "integrity": "sha512-7dRy4DwXwtzBrPbZflqxnvfxLF8kdZXPkhymtDeFoFqE6ldzjQFgYTtYIFARcLEYDrqfBfYcZt1WqFxRoyC9Rw==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.6.tgz", + "integrity": "sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ==", "license": "MIT", "dependencies": { "regenerator-runtime": "^0.14.0" @@ -2326,13 +2326,6 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@fastify/busboy": { - "version": "2.1.1", - "license": "MIT", - "engines": { - "node": ">=14" - } - }, "node_modules/@firebase/analytics": { "version": "0.10.7", "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.7.tgz", @@ -2372,9 +2365,9 @@ "license": "Apache-2.0" }, "node_modules/@firebase/app": { - "version": "0.10.8", - "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.10.8.tgz", - "integrity": "sha512-xSLmW0/RShcnUEXH7l+wC0AFWaUtty4tUFF2loIgbtXTRmra0UH/SqYDf/IcfreUninRrCsusNmvoTidGkXJPw==", + "version": "0.10.10", + "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.10.10.tgz", + "integrity": "sha512-sDqkdeFdVn5uygQm5EuIKOQ6/wxTcX/qKfm0MR46AiwLRHGLCDUMrXBkc8GhkK3ca2d6mPUSfPmndggo43D6PQ==", "license": "Apache-2.0", "dependencies": { "@firebase/component": "0.6.8", @@ -2427,12 +2420,12 @@ "license": "Apache-2.0" }, "node_modules/@firebase/app-compat": { - "version": "0.2.38", - "resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.2.38.tgz", - "integrity": "sha512-36ZrSvkYLW7QR01Sii2X+IY18ErMpRg6e2B2f/DVTtJBolthwXOnNBps+wvaVBvegdvdVPspgDXZUV0ppqh45w==", + "version": "0.2.40", + "resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.2.40.tgz", + "integrity": "sha512-2L5MW4MH2ya7Wvw0hzWy3ZWeB4SqC5gYXDAV5AS1lBTL4zL3k8dsqJmry/cFV00GgkCI01WJbcXvFMCXJvgyow==", "license": "Apache-2.0", "dependencies": { - "@firebase/app": "0.10.8", + "@firebase/app": "0.10.10", "@firebase/component": "0.6.8", "@firebase/logger": "0.4.2", "@firebase/util": "1.9.7", @@ -2444,16 +2437,16 @@ "license": "Apache-2.0" }, "node_modules/@firebase/auth": { - "version": "1.7.6", - "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-1.7.6.tgz", - "integrity": "sha512-T+lA5xoug9CByGYkD5WkfTh2ujEYq/frGZPbk0H+fNU6fNl7nqg88KcsmzsC6Fsqbjm3LLEb/i6wJvF6NSNEig==", + "version": "1.7.8", + "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-1.7.8.tgz", + "integrity": "sha512-1KJlDrTrEEFTIBj9MxjAWjQ4skecBD4bmoayQ0l14QDbNc1a8qGbi+MFSJkH7O6VnGE6bTMcWSw6RrQNecqKaw==", "license": "Apache-2.0", "dependencies": { "@firebase/component": "0.6.8", "@firebase/logger": "0.4.2", "@firebase/util": "1.9.7", "tslib": "^2.1.0", - "undici": "5.28.4" + "undici": "6.19.7" }, "peerDependencies": { "@firebase/app": "0.x", @@ -2466,17 +2459,17 @@ } }, "node_modules/@firebase/auth-compat": { - "version": "0.5.11", - "resolved": "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.5.11.tgz", - "integrity": "sha512-7rE3MkQDoWwI2qd8qsra4/QZCO2GzQSbCL6AVQpult9+Nbimg+5A+YeHxpLTcYAxUV6HDg2CqTDQreFLhcm1CQ==", + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.5.13.tgz", + "integrity": "sha512-rV6TMxUU6wBBZ2ouDMtjJsJXeewtvYvVzslzt3/P7O/kxiWlreHT/2M/1guMiXKo3zk52XK3GqP0uM2bN7fEow==", "license": "Apache-2.0", "dependencies": { - "@firebase/auth": "1.7.6", + "@firebase/auth": "1.7.8", "@firebase/auth-types": "0.12.2", "@firebase/component": "0.6.8", "@firebase/util": "1.9.7", "tslib": "^2.1.0", - "undici": "5.28.4" + "undici": "6.19.7" }, "peerDependencies": { "@firebase/app-compat": "0.x" @@ -2542,9 +2535,9 @@ } }, "node_modules/@firebase/firestore": { - "version": "4.6.5", - "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.6.5.tgz", - "integrity": "sha512-0+Ascaht4qUzj4pCopMPWmoAujk8HKjwCpaNYOOjbYMZ65RVfZPsfZwwbWi/zWMXj6xvPsai5oBiErUUkrLwNw==", + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.7.1.tgz", + "integrity": "sha512-WliQNa8GVcH6EWkH0NAf+uAnxNiBuH+G8Buzr2ZS1NznOhJDK/q6Hsjv5TzNrijLTAdEfj/wk9VEv994KDSjxg==", "license": "Apache-2.0", "dependencies": { "@firebase/component": "0.6.8", @@ -2554,7 +2547,7 @@ "@grpc/grpc-js": "~1.9.0", "@grpc/proto-loader": "^0.7.8", "tslib": "^2.1.0", - "undici": "5.28.4" + "undici": "6.19.7" }, "engines": { "node": ">=10.10.0" @@ -2564,13 +2557,13 @@ } }, "node_modules/@firebase/firestore-compat": { - "version": "0.3.34", - "resolved": "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.34.tgz", - "integrity": "sha512-OBP2F/Ccydl2U2j8XIfpKBxf0EnQHEhbZ4LTwbSS2QlG9+8TwhvKFkKk/ZljWYqaype+qFKPuXZ5flCqYEETeA==", + "version": "0.3.36", + "resolved": "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.36.tgz", + "integrity": "sha512-NtoIm7CT9f+SFB7cPMCtyCSxZReh/+SII5X4TQH394S3dwhru9HIfvEOKAMuAnXsSsLH72jXPUgdsEAUqg6Oug==", "license": "Apache-2.0", "dependencies": { "@firebase/component": "0.6.8", - "@firebase/firestore": "4.6.5", + "@firebase/firestore": "4.7.1", "@firebase/firestore-types": "3.0.2", "@firebase/util": "1.9.7", "tslib": "^2.1.0" @@ -2590,7 +2583,9 @@ } }, "node_modules/@firebase/functions": { - "version": "0.11.6", + "version": "0.11.7", + "resolved": "https://registry.npmjs.org/@firebase/functions/-/functions-0.11.7.tgz", + "integrity": "sha512-xaUsGI2kYrI8zJXgrNB7SrJKB8v1vJqR16YYi6g6dFTgBz4+VzWJFqqVU60BbdAWm6fXnUrg9gjlJQeqomT2Vg==", "license": "Apache-2.0", "dependencies": { "@firebase/app-check-interop-types": "0.3.2", @@ -2599,18 +2594,20 @@ "@firebase/messaging-interop-types": "0.2.2", "@firebase/util": "1.9.7", "tslib": "^2.1.0", - "undici": "5.28.4" + "undici": "6.19.7" }, "peerDependencies": { "@firebase/app": "0.x" } }, "node_modules/@firebase/functions-compat": { - "version": "0.3.12", + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.3.13.tgz", + "integrity": "sha512-qcZvJO2ed6PAD+18DanVztw7WyQVQK43HoRhxusHAwDFvK/xY+mcGpj+IpfdxTNMBGCOIxKFp4Xqk/c2nubBlQ==", "license": "Apache-2.0", "dependencies": { "@firebase/component": "0.6.8", - "@firebase/functions": "0.11.6", + "@firebase/functions": "0.11.7", "@firebase/functions-types": "0.6.2", "@firebase/util": "1.9.7", "tslib": "^2.1.0" @@ -2621,6 +2618,8 @@ }, "node_modules/@firebase/functions-types": { "version": "0.6.2", + "resolved": "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.6.2.tgz", + "integrity": "sha512-0KiJ9lZ28nS2iJJvimpY4nNccV21rkQyor5Iheu/nq8aKXJqtJdeSlZDspjPSBBiHRzo7/GMUttegnsEITqR+w==", "license": "Apache-2.0" }, "node_modules/@firebase/installations": { @@ -2763,24 +2762,28 @@ "license": "Apache-2.0" }, "node_modules/@firebase/storage": { - "version": "0.12.6", + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/@firebase/storage/-/storage-0.13.1.tgz", + "integrity": "sha512-L6AJ5tWgHSi2g/gbc/2Pbm3qxmoEg9THmPIOpRsLwuz9LPeWbhyMQeGlqxWqtZGQO/z/LMjGYadNlupQj0HNfw==", "license": "Apache-2.0", "dependencies": { "@firebase/component": "0.6.8", "@firebase/util": "1.9.7", "tslib": "^2.1.0", - "undici": "5.28.4" + "undici": "6.19.7" }, "peerDependencies": { "@firebase/app": "0.x" } }, "node_modules/@firebase/storage-compat": { - "version": "0.3.9", + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.3.11.tgz", + "integrity": "sha512-EEa9jgm/aRVIGSD0ByYAsZ0tvEKfVwSp9uFoa/97BISGWGjSNPIWjenaDvpDZ7aL8OxaGIpwuk700aHy7/T0Ug==", "license": "Apache-2.0", "dependencies": { "@firebase/component": "0.6.8", - "@firebase/storage": "0.12.6", + "@firebase/storage": "0.13.1", "@firebase/storage-types": "0.8.2", "@firebase/util": "1.9.7", "tslib": "^2.1.0" @@ -2791,6 +2794,8 @@ }, "node_modules/@firebase/storage-types": { "version": "0.8.2", + "resolved": "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.8.2.tgz", + "integrity": "sha512-0vWu99rdey0g53lA7IShoA2Lol1jfnPovzLDUBuon65K7uKG9G+L5uO05brD9pMw+l4HRFw23ah3GwTGpEav6g==", "license": "Apache-2.0", "peerDependencies": { "@firebase/app-types": "0.x", @@ -3387,10 +3392,94 @@ "url": "https://opencollective.com/js-sdsl" } }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", + "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", + "license": "BSD-3-Clause", + "optional": true, + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "license": "MIT", + "optional": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "optional": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "optional": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@mapbox/node-pre-gyp/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "optional": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@mongodb-js/saslprep": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.8.tgz", - "integrity": "sha512-qKwC/M/nNNaKUBMQ0nuzm47b7ZYWQHN3pcXq4IIcoSBc2hOIrflAxJduIvvqmhoz3gR2TacTAs8vlsCVPkiEdQ==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.9.tgz", + "integrity": "sha512-tVkljjeEaAhCqTzajSdgbQ6gE6f3oneVwa3iXR6csiEwXXOFsiC6Uh9iAjAhXPtqa/XMDHWjjeNH/77m/Yq2dw==", "license": "MIT", "dependencies": { "sparse-bitfield": "^3.0.3" @@ -7098,22 +7187,6 @@ "version": "0.0.1", "license": "MIT" }, - "node_modules/@types/eslint": { - "version": "8.56.10", - "license": "MIT", - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.7", - "license": "MIT", - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "node_modules/@types/estree": { "version": "1.0.5", "license": "MIT" @@ -7762,8 +7835,10 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-assertions": { - "version": "1.9.0", + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "license": "MIT", "peerDependencies": { "acorn": "^8" @@ -7893,6 +7968,28 @@ "node": ">= 8" } }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "license": "ISC", + "optional": true + }, + "node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/arg": { "version": "5.0.2", "license": "MIT" @@ -8521,6 +8618,22 @@ ], "license": "CC-BY-4.0" }, + "node_modules/canvas": { + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.11.2.tgz", + "integrity": "sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.0", + "nan": "^2.17.0", + "simple-get": "^3.0.3" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/capacitor-set-version": { "version": "2.2.0", "license": "MIT", @@ -8850,6 +8963,16 @@ "simple-swizzle": "^0.2.2" } }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "license": "ISC", + "optional": true, + "bin": { + "color-support": "bin.js" + } + }, "node_modules/colorette": { "version": "2.0.20", "dev": true, @@ -8950,6 +9073,13 @@ "url": "https://opencollective.com/date-fns" } }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "license": "ISC", + "optional": true + }, "node_modules/content-type": { "version": "1.0.5", "license": "MIT", @@ -9343,6 +9473,19 @@ "node": ">=14.16" } }, + "node_modules/decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "license": "MIT", + "optional": true, + "dependencies": { + "mimic-response": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/deep-equal": { "version": "2.2.3", "dev": true, @@ -9529,6 +9672,13 @@ "node": ">=0.4.0" } }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "license": "MIT", + "optional": true + }, "node_modules/detect-libc": { "version": "2.0.3", "license": "Apache-2.0", @@ -9703,7 +9853,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.16.0", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "license": "MIT", "dependencies": { "graceful-fs": "^4.2.4", @@ -10873,26 +11025,26 @@ } }, "node_modules/firebase": { - "version": "10.12.5", - "resolved": "https://registry.npmjs.org/firebase/-/firebase-10.12.5.tgz", - "integrity": "sha512-J0yL3yh12CfFprTkSOQ9HqBugERyqvWwOuOoo1j1QHmYe9cYLKnBmtNCvGIYInDcsVUnJoRXCM+hxbGf48oVhg==", + "version": "10.13.1", + "resolved": "https://registry.npmjs.org/firebase/-/firebase-10.13.1.tgz", + "integrity": "sha512-L5BSkmvB2dzCUMpr8i/O8WMJC3Nqj5Ld8Wj/qnak+tz2Ga+JH6/FO93xArg9IGhktCrPXVODoWp6t9ybdgmXCA==", "license": "Apache-2.0", "dependencies": { "@firebase/analytics": "0.10.7", "@firebase/analytics-compat": "0.2.13", - "@firebase/app": "0.10.8", + "@firebase/app": "0.10.10", "@firebase/app-check": "0.8.7", "@firebase/app-check-compat": "0.3.14", - "@firebase/app-compat": "0.2.38", + "@firebase/app-compat": "0.2.40", "@firebase/app-types": "0.9.2", - "@firebase/auth": "1.7.6", - "@firebase/auth-compat": "0.5.11", + "@firebase/auth": "1.7.8", + "@firebase/auth-compat": "0.5.13", "@firebase/database": "1.0.7", "@firebase/database-compat": "1.0.7", - "@firebase/firestore": "4.6.5", - "@firebase/firestore-compat": "0.3.34", - "@firebase/functions": "0.11.6", - "@firebase/functions-compat": "0.3.12", + "@firebase/firestore": "4.7.1", + "@firebase/firestore-compat": "0.3.36", + "@firebase/functions": "0.11.7", + "@firebase/functions-compat": "0.3.13", "@firebase/installations": "0.6.8", "@firebase/installations-compat": "0.2.8", "@firebase/messaging": "0.12.10", @@ -10901,8 +11053,8 @@ "@firebase/performance-compat": "0.2.8", "@firebase/remote-config": "0.4.8", "@firebase/remote-config-compat": "0.2.8", - "@firebase/storage": "0.12.6", - "@firebase/storage-compat": "0.3.9", + "@firebase/storage": "0.13.1", + "@firebase/storage-compat": "0.3.11", "@firebase/util": "1.9.7", "@firebase/vertexai-preview": "0.0.3" } @@ -11158,6 +11310,28 @@ "node": ">=10" } }, + "node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/gaxios": { "version": "6.7.0", "license": "Apache-2.0", @@ -11649,6 +11823,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "license": "ISC", + "optional": true + }, "node_modules/hasown": { "version": "2.0.2", "license": "MIT", @@ -13438,6 +13619,32 @@ "node": ">=12" } }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "license": "MIT", + "optional": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", + "optional": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/make-error": { "version": "1.3.6", "license": "ISC" @@ -13466,7 +13673,9 @@ } }, "node_modules/micromatch": { - "version": "4.0.7", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "license": "MIT", "dependencies": { "braces": "^3.0.3", @@ -13526,6 +13735,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/mingo": { "version": "6.4.15", "resolved": "https://registry.npmjs.org/mingo/-/mingo-6.4.15.tgz", @@ -13588,9 +13810,9 @@ } }, "node_modules/mongodb": { - "version": "6.8.0", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.8.0.tgz", - "integrity": "sha512-HGQ9NWDle5WvwMnrvUxsFYPd3JEbqD3RgABHBQRuoCEND0qzhsd0iH5ypHsf1eJ+sXmvmyKpP+FLOKY8Il7jMw==", + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.8.1.tgz", + "integrity": "sha512-qsS+gl5EJb+VzJqUjXSZ5Y5rbuM/GZlZUEJ2OIVYP10L9rO9DQ0DGp+ceTzsmoADh6QYMWd9MSdG9IxRyYUkEA==", "license": "Apache-2.0", "dependencies": { "@mongodb-js/saslprep": "^1.1.5", @@ -13688,6 +13910,13 @@ "thenify-all": "^1.0.0" } }, + "node_modules/nan": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.20.0.tgz", + "integrity": "sha512-bk3gXBZDGILuuo/6sKtr0DQmSThYHLtNCdSdXk9YkxD/jK6X2vmCyyXBBxyqZ4XcnzTyYEAThfX3DCEnLf6igw==", + "license": "MIT", + "optional": true + }, "node_modules/nanoid": { "version": "3.3.7", "funding": [ @@ -13956,6 +14185,22 @@ "node": ">=6" } }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/normalize-path": { "version": "3.0.0", "license": "MIT", @@ -13987,6 +14232,20 @@ "node": ">=8" } }, + "node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, "node_modules/nth-check": { "version": "2.1.1", "license": "BSD-2-Clause", @@ -14412,19 +14671,22 @@ "node_modules/path2d-polyfill": { "version": "2.0.1", "license": "MIT", + "optional": true, "engines": { "node": ">=8" } }, "node_modules/pdfjs-dist": { - "version": "3.4.120", + "version": "3.11.174", + "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-3.11.174.tgz", + "integrity": "sha512-TdTZPf1trZ8/UFu5Cx/GXB7GZM30LT+wWUNfsi6Bq8ePLnb+woNKtDymI2mxZYBpMbonNFqKmiz684DIfnd8dA==", "license": "Apache-2.0", - "dependencies": { - "path2d-polyfill": "^2.0.1", - "web-streams-polyfill": "^3.2.1" + "engines": { + "node": ">=18" }, "optionalDependencies": { - "canvas": "^2.11.0" + "canvas": "^2.11.2", + "path2d-polyfill": "^2.0.1" } }, "node_modules/pend": { @@ -15559,13 +15821,13 @@ "license": "MIT" }, "node_modules/rxdb": { - "version": "15.31.0", - "resolved": "https://registry.npmjs.org/rxdb/-/rxdb-15.31.0.tgz", - "integrity": "sha512-hwQvvOBwBZV9NM3DdD2fTSAwuY+/vc9H0knUAF6aJhXk7PQt87q5JtwyiHjkt0xQsqygQC30yRzJPFmGw2XU8w==", + "version": "15.33.0", + "resolved": "https://registry.npmjs.org/rxdb/-/rxdb-15.33.0.tgz", + "integrity": "sha512-SkNSXSvf0EL3oUTtyJYcPac/R2P0Xs67PzsSQhaIak/+39mgcMC0Lzsd9GDUmZHNamCAk6iUEgmMyWtp7wagDw==", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@babel/runtime": "7.25.0", + "@babel/runtime": "7.25.6", "@types/clone": "2.1.4", "@types/cors": "2.8.17", "@types/express": "4.17.21", @@ -15579,7 +15841,7 @@ "custom-idle-queue": "3.0.1", "dexie": "4.0.8", "event-reduce-js": "5.2.7", - "firebase": "10.12.5", + "firebase": "10.13.1", "get-graphql-from-jsonschema": "8.1.0", "graphql": "15.9.0", "graphql-ws": "5.16.0", @@ -15589,7 +15851,7 @@ "jsonschema-key-compression": "1.7.0", "lokijs": "1.5.12", "mingo": "6.4.15", - "mongodb": "6.8.0", + "mongodb": "6.8.1", "nats": "2.28.2", "oblivious-set": "1.4.0", "ohash": "1.1.3", @@ -15786,6 +16048,13 @@ "randombytes": "^2.1.0" } }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC", + "optional": true + }, "node_modules/set-function-length": { "version": "1.2.2", "license": "MIT", @@ -15896,6 +16165,39 @@ "version": "3.0.7", "license": "ISC" }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "optional": true + }, + "node_modules/simple-get": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz", + "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==", + "license": "MIT", + "optional": true, + "dependencies": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "node_modules/simple-peer": { "version": "9.11.1", "resolved": "https://registry.npmjs.org/simple-peer/-/simple-peer-9.11.1.tgz", @@ -17372,13 +17674,12 @@ } }, "node_modules/undici": { - "version": "5.28.4", + "version": "6.19.7", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.19.7.tgz", + "integrity": "sha512-HR3W/bMGPSr90i8AAp2C4DM3wChFdJPLrWYpIS++LxS8K+W535qftjt+4MyjNYHeWabMj1nvtmLIi7l++iq91A==", "license": "MIT", - "dependencies": { - "@fastify/busboy": "^2.0.0" - }, "engines": { - "node": ">=14.0" + "node": ">=18.17" } }, "node_modules/undici-types": { @@ -17699,19 +18000,20 @@ } }, "node_modules/webpack": { - "version": "5.91.0", + "version": "5.94.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", + "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", "license": "MIT", "dependencies": { - "@types/eslint-scope": "^3.7.3", "@types/estree": "^1.0.5", "@webassemblyjs/ast": "^1.12.1", "@webassemblyjs/wasm-edit": "^1.12.1", "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.9.0", + "acorn-import-attributes": "^1.9.5", "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.16.0", + "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", @@ -17776,7 +18078,9 @@ } }, "node_modules/webpack-bundle-analyzer/node_modules/ws": { - "version": "7.5.9", + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", "license": "MIT", "engines": { "node": ">=8.3.0" @@ -17935,6 +18239,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "license": "ISC", + "optional": true, + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, "node_modules/widest-line": { "version": "3.1.0", "license": "MIT", @@ -18271,7 +18585,9 @@ } }, "node_modules/ws": { - "version": "8.17.0", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "license": "MIT", "engines": { "node": ">=10.0.0" diff --git a/src/components/Calendar/Calendar.tsx b/src/components/Calendar/Calendar.tsx index 4a91f83d..300906cd 100644 --- a/src/components/Calendar/Calendar.tsx +++ b/src/components/Calendar/Calendar.tsx @@ -29,6 +29,7 @@ import { ErrorBoundary, ErrorComponent, } from "next/dist/client/components/error-boundary"; +import { useSettings } from "@/hooks/contexts/settings"; const CalendarError: ErrorComponent = ({ error, reset }) => { return
An error occurred: {error.message}
; @@ -40,6 +41,7 @@ const Calendar = () => { const { events, addEvent, removeEvent, displayContainer, HOUR_HEIGHT } = useCalendar(); const { courses, colorMap, getSemesterCourses } = useUserTimetable(); + const { language } = useSettings(); //week movers const moveBackward = () => { @@ -142,7 +144,10 @@ const Calendar = () => { ); }); // flatten and add to events - const calendarEvents = timetableToCalendarEvent(timetableCourses.flat()); + const calendarEvents = timetableToCalendarEvent( + timetableCourses.flat(), + language, + ); calendarEvents.forEach((event) => { addEvent(event); diff --git a/src/components/Calendar/timetableToCalendarEvent.tsx b/src/components/Calendar/timetableToCalendarEvent.tsx index a73700ff..fcb7b1b5 100644 --- a/src/components/Calendar/timetableToCalendarEvent.tsx +++ b/src/components/Calendar/timetableToCalendarEvent.tsx @@ -3,9 +3,11 @@ import { CourseTimeslotData } from "@/types/timetable"; import { semesterInfo } from "@/const/semester"; import { parseSlotTime, scheduleTimeSlots } from "@/const/timetable"; import { CalendarEvent } from "./calendar.types"; +import { Language } from "@/types/settings"; export const timetableToCalendarEvent = ( timetable: CourseTimeslotData[], + language: Language, ): CalendarEvent[] => { return timetable.map((t) => { const semester = semesterInfo.find((s) => s.id == t.course.semester)!; @@ -20,6 +22,8 @@ export const timetableToCalendarEvent = ( minutes: endTime[1], }); + const title = language == "en" ? t.course.name_en : t.course.name_zh; + return { id: t.course.raw_id + @@ -29,7 +33,7 @@ export const timetableToCalendarEvent = ( t.startTime + "-" + t.endTime, - title: t.course.name_zh, + title: title, location: t.venue, allDay: false, start: startDate, From 4198fa81a359d3ebe565c04343cee20b82c11f20 Mon Sep 17 00:00:00 2001 From: ImJustChew Date: Sun, 29 Sep 2024 00:08:21 +0900 Subject: [PATCH 3/5] fix: fixed unable to add repeating events --- src/components/Calendar/eventFormSchema.tsx | 27 +++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/components/Calendar/eventFormSchema.tsx b/src/components/Calendar/eventFormSchema.tsx index 519a922c..4c1d7df5 100644 --- a/src/components/Calendar/eventFormSchema.tsx +++ b/src/components/Calendar/eventFormSchema.tsx @@ -15,14 +15,27 @@ const schemaDetails = z.object({ details: z.string().optional(), location: z.string().optional(), allDay: z.boolean(), - repeat: z.union([ + repeat: z.discriminatedUnion("type", [ z.object({ - type: z.union([ - z.literal("daily"), - z.literal("weekly"), - z.literal("monthly"), - z.literal("yearly"), - ]), + type: z.literal("daily"), + interval: z.number(), + mode: z.union([z.literal("count"), z.literal("date")]), + value: z.number(), + }), + z.object({ + type: z.literal("weekly"), + interval: z.number(), + mode: z.union([z.literal("count"), z.literal("date")]), + value: z.number(), + }), + z.object({ + type: z.literal("monthly"), + interval: z.number(), + mode: z.union([z.literal("count"), z.literal("date")]), + value: z.number(), + }), + z.object({ + type: z.literal("yearly"), interval: z.number(), mode: z.union([z.literal("count"), z.literal("date")]), value: z.number(), From 53e066b2b455316e642d6b52c8977e4cfc19a223 Mon Sep 17 00:00:00 2001 From: ImJustChew Date: Sun, 29 Sep 2024 00:30:13 +0900 Subject: [PATCH 4/5] fix: used html time picker instead for reliability --- src/components/Calendar/AddEventButton.tsx | 21 +++-- src/components/ui/custom_timeselect.tsx | 98 ++++++++++------------ 2 files changed, 59 insertions(+), 60 deletions(-) diff --git a/src/components/Calendar/AddEventButton.tsx b/src/components/Calendar/AddEventButton.tsx index d835940c..7386bde3 100644 --- a/src/components/Calendar/AddEventButton.tsx +++ b/src/components/Calendar/AddEventButton.tsx @@ -216,9 +216,14 @@ export const AddEventButton = ({ - { + { + const timesplits = e.target.value.split(":"); + const d = set(field.value, { + hours: parseInt(timesplits[0]), + minutes: parseInt(timesplits[1]), + }); const diff = form.getValues("end").getTime() - form.getValues("start").getTime(); @@ -231,7 +236,7 @@ export const AddEventButton = ({ form.trigger(["end"]); } }} - date={field.value} + value={format(field.value, "HH:mm")} /> )} @@ -241,10 +246,10 @@ export const AddEventButton = ({ name="end" render={({ field }) => ( - diff --git a/src/components/ui/custom_timeselect.tsx b/src/components/ui/custom_timeselect.tsx index cf3564d1..bb8015db 100644 --- a/src/components/ui/custom_timeselect.tsx +++ b/src/components/ui/custom_timeselect.tsx @@ -7,6 +7,7 @@ import { Command, CommandGroup, CommandItem } from "@/components/ui/command"; import { set } from "date-fns"; import { Popover, PopoverContent } from "./popover"; import { PopoverAnchor, PopoverPortal } from "@radix-ui/react-popover"; +import { Input } from "./input"; export const getNearestTime = (date: Date, minuteStep: number) => { const minutes = date.getMinutes(); @@ -136,60 +137,53 @@ export function TimeSelect({ className={clsx(label && "gap-1.5", parentClassName, "grid items-center")} > - -
-
- {/* Avoid having the "Search" Icon */} - setOpen(true)} - placeholder={placeholder} - className="ml-2 bg-transparent outline-none placeholder:text-muted-foreground flex-1 overflow-hidden w-full" - /> -
+
+
+ setInputValue(v.target.value)} + onKeyDown={handleKeyDown} + onBlur={handleInputBlur} + onFocus={() => setOpen(true)} + placeholder={placeholder} + className="ml-2 bg-transparent outline-none placeholder:text-muted-foreground flex-1 overflow-hidden w-full" + />
- - - - e.preventDefault()} - className="p-0 w-28 h-0 border-none" - > -
- {open && selectables.length > 0 ? ( -
- - {selectables.map((framework) => { - return ( - { - e.preventDefault(); - e.stopPropagation(); - }} - onSelect={(value) => { - setInputValue(framework.label); - setSelected(framework.value); - setOpen(false); - }} - > - {framework.label} - - ); - })} - -
- ) : null} +
+ + + e.preventDefault()} + className="p-0 w-28 h-0 border-none" + > +
+ {open && selectables.length > 0 ? ( +
+ {selectables.map((framework) => { + return ( +
{ + e.preventDefault(); + e.stopPropagation(); + }} + onSelect={(value) => { + setInputValue(framework.label); + setSelected(framework.value); + setOpen(false); + }} + > + {framework.label} +
+ ); + })}
- - - - + ) : null} +
+
+
); From 1a83f62ff9e66a30f49bea325c3dde95b52c30df Mon Sep 17 00:00:00 2001 From: ImJustChew Date: Sun, 29 Sep 2024 00:53:42 +0900 Subject: [PATCH 5/5] fix: fixed events erroring when triggering deletion --- src/components/Calendar/EventPopover.tsx | 8 +++----- src/components/Calendar/UpcomingEvents.tsx | 2 +- src/components/Calendar/calendar_hook.tsx | 19 +++++++++++-------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/components/Calendar/EventPopover.tsx b/src/components/Calendar/EventPopover.tsx index 8759ed5b..8eb03383 100644 --- a/src/components/Calendar/EventPopover.tsx +++ b/src/components/Calendar/EventPopover.tsx @@ -34,9 +34,7 @@ const ConfirmDeleteEvent: FC<{ event: DisplayCalendarEvent }> = ({ event }) => { 確認刪除 - -

確定要刪除這個事件嗎?

-
+ 確定要刪除這個事件嗎?
@@ -67,7 +65,7 @@ const UpdateRepeatedEventDialog: FC<{ 更新重複事件 -

您要更新所有重複事件還是只更新這個事件?

+ 您要更新所有重複事件還是只更新這個事件?
@@ -103,7 +101,7 @@ const DeleteRepeatedEventDialog: FC<{ 刪除重複事件 -

您要刪除所有重複事件還是只刪除這個事件?

+ 您要刪除所有重複事件還是只刪除這個事件
diff --git a/src/components/Calendar/UpcomingEvents.tsx b/src/components/Calendar/UpcomingEvents.tsx index 6ee5f8da..90bdd01a 100644 --- a/src/components/Calendar/UpcomingEvents.tsx +++ b/src/components/Calendar/UpcomingEvents.tsx @@ -59,7 +59,7 @@ const UpcomingEvents = () => { brightness > 186 ? 0.2 : 0.95, ); return ( - +
{ case UpdateType.THIS: // add this date to excluded dates await eventsCol!.findOne(event.id).update({ - $set: { - actualEnd: getActualEndDate(event), + $set: serializeEvent({ + actualEnd: getDisplayEndDate(event), excludedDates: [ ...(event.excludedDates || []), event.displayStart, ], - }, + }), }); break; case UpdateType.FOLLOWING: //set the repeat end date to the new event start date - const newEvent = { - ...event, + const { displayStart, displayEnd, ...originalEvent } = event; + const newEvent: CalendarEvent = { + ...originalEvent, repeat: { ...event.repeat!, - count: undefined, - date: subDays(event.displayStart, 1), + value: subDays(displayStart, 1).getTime(), }, }; await eventsCol!.findOne(event.id).update({