From 294e1c7a03b0b9d7bef8d99295c06401fc895b52 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 29 Jul 2024 10:57:50 -0400 Subject: [PATCH 01/17] deps: firebase revert breaking change --- package-lock.json | 933 ++++++++++++++++++++++++++++------------------ package.json | 2 +- 2 files changed, 572 insertions(+), 363 deletions(-) diff --git a/package-lock.json b/package-lock.json index 722a9d6..b02e736 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "@types/react": "^18.2.64", "@types/react-dom": "^18.2.21", "astro": "^4.3.6", - "firebase": "^10.8.1", + "firebase": "^9.23.0", "i": "^0.3.7", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -1772,23 +1772,15 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@fastify/busboy": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", - "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", - "engines": { - "node": ">=14" - } - }, "node_modules/@firebase/analytics": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.4.tgz", - "integrity": "sha512-OJEl/8Oye/k+vJ1zV/1L6eGpc1XzAj+WG2TPznJ7PszL7sOFLBXkL9IjHfOCGDGpXeO3btozy/cYUqv4zgNeHg==", - "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/installations": "0.6.7", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.9.6", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@firebase/analytics/-/analytics-0.10.0.tgz", + "integrity": "sha512-Locv8gAqx0e+GX/0SI3dzmBY5e9kjVDtD+3zCFLJ0tH2hJwuCAiL+5WkHuxKj92rqQj/rvkBUCfA1ewlX2hehg==", + "dependencies": { + "@firebase/component": "0.6.4", + "@firebase/installations": "0.6.4", + "@firebase/logger": "0.4.0", + "@firebase/util": "1.9.3", "tslib": "^2.1.0" }, "peerDependencies": { @@ -1796,14 +1788,14 @@ } }, "node_modules/@firebase/analytics-compat": { - "version": "0.2.10", - "resolved": "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.2.10.tgz", - "integrity": "sha512-ia68RcLQLLMFWrM10JfmFod7eJGwqr4/uyrtzHpTDnxGX/6gNCBTOuxdAbyWIqXI5XmcMQdz9hDijGKOHgDfPw==", - "dependencies": { - "@firebase/analytics": "0.10.4", - "@firebase/analytics-types": "0.8.2", - "@firebase/component": "0.6.7", - "@firebase/util": "1.9.6", + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/@firebase/analytics-compat/-/analytics-compat-0.2.6.tgz", + "integrity": "sha512-4MqpVLFkGK7NJf/5wPEEP7ePBJatwYpyjgJ+wQHQGHfzaCDgntOnl9rL2vbVGGKCnRqWtZDIWhctB86UWXaX2Q==", + "dependencies": { + "@firebase/analytics": "0.10.0", + "@firebase/analytics-types": "0.8.0", + "@firebase/component": "0.6.4", + "@firebase/util": "1.9.3", "tslib": "^2.1.0" }, "peerDependencies": { @@ -1811,30 +1803,30 @@ } }, "node_modules/@firebase/analytics-types": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.8.2.tgz", - "integrity": "sha512-EnzNNLh+9/sJsimsA/FGqzakmrAUKLeJvjRHlg8df1f97NLUlFidk9600y0ZgWOp3CAxn6Hjtk+08tixlUOWyw==" + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@firebase/analytics-types/-/analytics-types-0.8.0.tgz", + "integrity": "sha512-iRP+QKI2+oz3UAh4nPEq14CsEjrjD6a5+fuypjScisAh9kXKFvdJOZJDwk7kikLvWVLGEs9+kIUS4LPQV7VZVw==" }, "node_modules/@firebase/app": { - "version": "0.10.5", - "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.10.5.tgz", - "integrity": "sha512-iY/fNot+hWPk9sTX8aHMqlcX9ynRvpGkskWAdUZ2eQQdLo8d1hSFYcYNwPv0Q/frGMasw8udKWMcFOEpC9fG8g==", + "version": "0.9.13", + "resolved": "https://registry.npmjs.org/@firebase/app/-/app-0.9.13.tgz", + "integrity": "sha512-GfiI1JxJ7ecluEmDjPzseRXk/PX31hS7+tjgBopL7XjB2hLUdR+0FTMXy2Q3/hXezypDvU6or7gVFizDESrkXw==", "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.9.6", + "@firebase/component": "0.6.4", + "@firebase/logger": "0.4.0", + "@firebase/util": "1.9.3", "idb": "7.1.1", "tslib": "^2.1.0" } }, "node_modules/@firebase/app-check": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.8.4.tgz", - "integrity": "sha512-2tjRDaxcM5G7BEpytiDcIl+NovV99q8yEqRMKDbn4J4i/XjjuThuB4S+4PkmTnZiCbdLXQiBhkVxNlUDcfog5Q==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@firebase/app-check/-/app-check-0.8.0.tgz", + "integrity": "sha512-dRDnhkcaC2FspMiRK/Vbp+PfsOAEP6ZElGm9iGFJ9fDqHoPs0HOPn7dwpJ51lCFi1+2/7n5pRPGhqF/F03I97g==", "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.9.6", + "@firebase/component": "0.6.4", + "@firebase/logger": "0.4.0", + "@firebase/util": "1.9.3", "tslib": "^2.1.0" }, "peerDependencies": { @@ -1842,15 +1834,15 @@ } }, "node_modules/@firebase/app-check-compat": { - "version": "0.3.11", - "resolved": "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.3.11.tgz", - "integrity": "sha512-t01zaH3RJpKEey0nGduz3Is+uSz7Sj4U5nwOV6lWb+86s5xtxpIvBJzu/lKxJfYyfZ29eJwpdjEgT1/lm4iQyA==", - "dependencies": { - "@firebase/app-check": "0.8.4", - "@firebase/app-check-types": "0.5.2", - "@firebase/component": "0.6.7", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.9.6", + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/@firebase/app-check-compat/-/app-check-compat-0.3.7.tgz", + "integrity": "sha512-cW682AxsyP1G+Z0/P7pO/WT2CzYlNxoNe5QejVarW2o5ZxeWSSPAiVEwpEpQR/bUlUmdeWThYTMvBWaopdBsqw==", + "dependencies": { + "@firebase/app-check": "0.8.0", + "@firebase/app-check-types": "0.5.0", + "@firebase/component": "0.6.4", + "@firebase/logger": "0.4.0", + "@firebase/util": "1.9.3", "tslib": "^2.1.0" }, "peerDependencies": { @@ -1858,141 +1850,172 @@ } }, "node_modules/@firebase/app-check-interop-types": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.2.tgz", - "integrity": "sha512-LMs47Vinv2HBMZi49C09dJxp0QT5LwDzFaVGf/+ITHe3BlIhUiLNttkATSXplc89A2lAaeTqjgqVkiRfUGyQiQ==" + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@firebase/app-check-interop-types/-/app-check-interop-types-0.3.0.tgz", + "integrity": "sha512-xAxHPZPIgFXnI+vb4sbBjZcde7ZluzPPaSK7Lx3/nmuVk4TjZvnL8ONnkd4ERQKL8WePQySU+pRcWkh8rDf5Sg==" }, "node_modules/@firebase/app-check-types": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@firebase/app-check-types/-/app-check-types-0.5.2.tgz", - "integrity": "sha512-FSOEzTzL5bLUbD2co3Zut46iyPWML6xc4x+78TeaXMSuJap5QObfb+rVvZJtla3asN4RwU7elaQaduP+HFizDA==" + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@firebase/app-check-types/-/app-check-types-0.5.0.tgz", + "integrity": "sha512-uwSUj32Mlubybw7tedRzR24RP8M8JUVR3NPiMk3/Z4bCmgEKTlQBwMXrehDAZ2wF+TsBq0SN1c6ema71U/JPyQ==" }, "node_modules/@firebase/app-compat": { - "version": "0.2.35", - "resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.2.35.tgz", - "integrity": "sha512-vgay/WRjeH0r97/Q6L6df2CMx7oyNFDsE5yPQ9oR1G+zx2eT0s8vNNh0WlKqQxUEWaOLRnXhQ8gy7uu0cBgTRg==", - "dependencies": { - "@firebase/app": "0.10.5", - "@firebase/component": "0.6.7", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.9.6", + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/@firebase/app-compat/-/app-compat-0.2.13.tgz", + "integrity": "sha512-j6ANZaWjeVy5zg6X7uiqh6lM6o3n3LD1+/SJFNs9V781xyryyZWXe+tmnWNWPkP086QfJoNkWN9pMQRqSG4vMg==", + "dependencies": { + "@firebase/app": "0.9.13", + "@firebase/component": "0.6.4", + "@firebase/logger": "0.4.0", + "@firebase/util": "1.9.3", "tslib": "^2.1.0" } }, "node_modules/@firebase/app-types": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.2.tgz", - "integrity": "sha512-oMEZ1TDlBz479lmABwWsWjzHwheQKiAgnuKxE0pz0IXCVx7/rtlkx1fQ6GfgK24WCrxDKMplZrT50Kh04iMbXQ==" + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@firebase/app-types/-/app-types-0.9.0.tgz", + "integrity": "sha512-AeweANOIo0Mb8GiYm3xhTEBVCmPwTYAu9Hcd2qSkLuga/6+j9b1Jskl5bpiSQWy9eJ/j5pavxj6eYogmnuzm+Q==" + }, + "node_modules/@firebase/auth": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-0.23.2.tgz", + "integrity": "sha512-dM9iJ0R6tI1JczuGSxXmQbXAgtYie0K4WvKcuyuSTCu9V8eEDiz4tfa1sO3txsfvwg7nOY3AjoCyMYEdqZ8hdg==", + "dependencies": { + "@firebase/component": "0.6.4", + "@firebase/logger": "0.4.0", + "@firebase/util": "1.9.3", + "node-fetch": "2.6.7", + "tslib": "^2.1.0" + }, + "peerDependencies": { + "@firebase/app": "0.x" + } }, "node_modules/@firebase/auth-compat": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.5.9.tgz", - "integrity": "sha512-RX8Zh/3zz2CsVbmYfgHkfUm4fAEPCl+KHVIImNygV5jTGDF6oKOhBIpf4Yigclyu8ESQKZ4elyN0MBYm9/7zGw==", - "dependencies": { - "@firebase/auth": "1.7.4", - "@firebase/auth-types": "0.12.2", - "@firebase/component": "0.6.7", - "@firebase/util": "1.9.6", - "tslib": "^2.1.0", - "undici": "5.28.4" + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@firebase/auth-compat/-/auth-compat-0.4.2.tgz", + "integrity": "sha512-Q30e77DWXFmXEt5dg5JbqEDpjw9y3/PcP9LslDPR7fARmAOTIY9MM6HXzm9KC+dlrKH/+p6l8g9ifJiam9mc4A==", + "dependencies": { + "@firebase/auth": "0.23.2", + "@firebase/auth-types": "0.12.0", + "@firebase/component": "0.6.4", + "@firebase/util": "1.9.3", + "node-fetch": "2.6.7", + "tslib": "^2.1.0" }, "peerDependencies": { "@firebase/app-compat": "0.x" } }, - "node_modules/@firebase/auth-compat/node_modules/@firebase/auth": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-1.7.4.tgz", - "integrity": "sha512-d2Fw17s5QesojwebrA903el20Li9/YGgkoOGJjagM4I1qAT36APa/FcZ+OX86KxbYKCtQKTMqraU8pxG7C2JWA==", + "node_modules/@firebase/auth-compat/node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.9.6", - "tslib": "^2.1.0", - "undici": "5.28.4" + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" }, "peerDependencies": { - "@firebase/app": "0.x", - "@react-native-async-storage/async-storage": "^1.18.1" + "encoding": "^0.1.0" }, "peerDependenciesMeta": { - "@react-native-async-storage/async-storage": { + "encoding": { "optional": true } } }, "node_modules/@firebase/auth-interop-types": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.3.tgz", - "integrity": "sha512-Fc9wuJGgxoxQeavybiuwgyi+0rssr76b+nHpj+eGhXFYAdudMWyfBHvFL/I5fEHniUM/UQdFzi9VXJK2iZF7FQ==" + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@firebase/auth-interop-types/-/auth-interop-types-0.2.1.tgz", + "integrity": "sha512-VOaGzKp65MY6P5FI84TfYKBXEPi6LmOCSMMzys6o2BN2LOsqy7pCuZCup7NYnfbk5OkkQKzvIfHOzTm0UDpkyg==" }, "node_modules/@firebase/auth-types": { - "version": "0.12.2", - "resolved": "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.12.2.tgz", - "integrity": "sha512-qsEBaRMoGvHO10unlDJhaKSuPn4pyoTtlQuP1ghZfzB6rNQPuhp/N/DcFZxm9i4v0SogjCbf9reWupwIvfmH6w==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@firebase/auth-types/-/auth-types-0.12.0.tgz", + "integrity": "sha512-pPwaZt+SPOshK8xNoiQlK5XIrS97kFYc3Rc7xmy373QsOJ9MmqXxLaYssP5Kcds4wd2qK//amx/c+A8O2fVeZA==", "peerDependencies": { "@firebase/app-types": "0.x", "@firebase/util": "1.x" } }, + "node_modules/@firebase/auth/node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/@firebase/component": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@firebase/component/-/component-0.6.7.tgz", - "integrity": "sha512-baH1AA5zxfaz4O8w0vDwETByrKTQqB5CDjRls79Sa4eAGAoERw4Tnung7XbMl3jbJ4B/dmmtsMrdki0KikwDYA==", + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/@firebase/component/-/component-0.6.4.tgz", + "integrity": "sha512-rLMyrXuO9jcAUCaQXCMjCMUsWrba5fzHlNK24xz5j2W6A/SRmK8mZJ/hn7V0fViLbxC0lPMtrK1eYzk6Fg03jA==", "dependencies": { - "@firebase/util": "1.9.6", + "@firebase/util": "1.9.3", "tslib": "^2.1.0" } }, "node_modules/@firebase/database": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@firebase/database/-/database-1.0.5.tgz", - "integrity": "sha512-cAfwBqMQuW6HbhwI3Cb/gDqZg7aR0OmaJ85WUxlnoYW2Tm4eR0hFl5FEijI3/gYPUiUcUPQvTkGV222VkT7KPw==", - "dependencies": { - "@firebase/app-check-interop-types": "0.3.2", - "@firebase/auth-interop-types": "0.2.3", - "@firebase/component": "0.6.7", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.9.6", + "version": "0.14.4", + "resolved": "https://registry.npmjs.org/@firebase/database/-/database-0.14.4.tgz", + "integrity": "sha512-+Ea/IKGwh42jwdjCyzTmeZeLM3oy1h0mFPsTy6OqCWzcu/KFqRAr5Tt1HRCOBlNOdbh84JPZC47WLU18n2VbxQ==", + "dependencies": { + "@firebase/auth-interop-types": "0.2.1", + "@firebase/component": "0.6.4", + "@firebase/logger": "0.4.0", + "@firebase/util": "1.9.3", "faye-websocket": "0.11.4", "tslib": "^2.1.0" } }, "node_modules/@firebase/database-compat": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-1.0.5.tgz", - "integrity": "sha512-NDSMaDjQ+TZEMDMmzJwlTL05kh1+0Y84C+kVMaOmNOzRGRM7VHi29I6YUhCetXH+/b1Wh4ZZRyp1CuWkd8s6hg==", - "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/database": "1.0.5", - "@firebase/database-types": "1.0.3", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.9.6", + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@firebase/database-compat/-/database-compat-0.3.4.tgz", + "integrity": "sha512-kuAW+l+sLMUKBThnvxvUZ+Q1ZrF/vFJ58iUY9kAcbX48U03nVzIF6Tmkf0p3WVQwMqiXguSgtOPIB6ZCeF+5Gg==", + "dependencies": { + "@firebase/component": "0.6.4", + "@firebase/database": "0.14.4", + "@firebase/database-types": "0.10.4", + "@firebase/logger": "0.4.0", + "@firebase/util": "1.9.3", "tslib": "^2.1.0" } }, "node_modules/@firebase/database-types": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-1.0.3.tgz", - "integrity": "sha512-39V/Riv2R3O/aUjYKh0xypj7NTNXNAK1bcgY5Kx+hdQPRS/aPTS8/5c0CGFYKgVuFbYlnlnhrCTYsh2uNhGwzA==", + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@firebase/database-types/-/database-types-0.10.4.tgz", + "integrity": "sha512-dPySn0vJ/89ZeBac70T+2tWWPiJXWbmRygYv0smT5TfE3hDrQ09eKMF3Y+vMlTdrMWq7mUdYW5REWPSGH4kAZQ==", "dependencies": { - "@firebase/app-types": "0.9.2", - "@firebase/util": "1.9.6" + "@firebase/app-types": "0.9.0", + "@firebase/util": "1.9.3" } }, "node_modules/@firebase/firestore": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-4.6.3.tgz", - "integrity": "sha512-d/+N2iUsiJ/Dc7fApdpdmmTXzwuTCromsdA1lKwYfZtMIOd1fI881NSLwK2wV4I38wkLnvfKJUV6WpU1f3/ONg==", - "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.9.6", - "@firebase/webchannel-wrapper": "1.0.0", - "@grpc/grpc-js": "~1.9.0", - "@grpc/proto-loader": "^0.7.8", - "tslib": "^2.1.0", - "undici": "5.28.4" + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-3.13.0.tgz", + "integrity": "sha512-NwcnU+madJXQ4fbLkGx1bWvL612IJN/qO6bZ6dlPmyf7QRyu5azUosijdAN675r+bOOJxMtP1Bv981bHBXAbUg==", + "dependencies": { + "@firebase/component": "0.6.4", + "@firebase/logger": "0.4.0", + "@firebase/util": "1.9.3", + "@firebase/webchannel-wrapper": "0.10.1", + "@grpc/grpc-js": "~1.7.0", + "@grpc/proto-loader": "^0.6.13", + "node-fetch": "2.6.7", + "tslib": "^2.1.0" }, "engines": { "node": ">=10.10.0" @@ -2002,14 +2025,14 @@ } }, "node_modules/@firebase/firestore-compat": { - "version": "0.3.32", - "resolved": "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.32.tgz", - "integrity": "sha512-at71mwK7a/mUXH0OgyY0+gUzedm/EUydDFYSFsBoO8DYowZ23Mgd6P4Rzq/Ll3zI/3xJN7LGe7Qp4iE/V/3Arg==", - "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/firestore": "4.6.3", - "@firebase/firestore-types": "3.0.2", - "@firebase/util": "1.9.6", + "version": "0.3.12", + "resolved": "https://registry.npmjs.org/@firebase/firestore-compat/-/firestore-compat-0.3.12.tgz", + "integrity": "sha512-mazuNGAx5Kt9Nph0pm6ULJFp/+j7GSsx+Ncw1GrnKl+ft1CQ4q2LcUssXnjqkX2Ry0fNGqUzC1mfIUrk9bYtjQ==", + "dependencies": { + "@firebase/component": "0.6.4", + "@firebase/firestore": "3.13.0", + "@firebase/firestore-types": "2.5.1", + "@firebase/util": "1.9.3", "tslib": "^2.1.0" }, "peerDependencies": { @@ -2017,40 +2040,59 @@ } }, "node_modules/@firebase/firestore-types": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-3.0.2.tgz", - "integrity": "sha512-wp1A+t5rI2Qc/2q7r2ZpjUXkRVPtGMd6zCLsiWurjsQpqPgFin3AhNibKcIzoF2rnToNa/XYtyWXuifjOOwDgg==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@firebase/firestore-types/-/firestore-types-2.5.1.tgz", + "integrity": "sha512-xG0CA6EMfYo8YeUxC8FeDzf6W3FX1cLlcAGBYV6Cku12sZRI81oWcu61RSKM66K6kUENP+78Qm8mvroBcm1whw==", "peerDependencies": { "@firebase/app-types": "0.x", "@firebase/util": "1.x" } }, + "node_modules/@firebase/firestore/node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/@firebase/functions": { - "version": "0.11.5", - "resolved": "https://registry.npmjs.org/@firebase/functions/-/functions-0.11.5.tgz", - "integrity": "sha512-qrHJ+l62mZiU5UZiVi84t/iLXZlhRuSvBQsa2qvNLgPsEWR7wdpWhRmVdB7AU8ndkSHJjGlMICqrVnz47sgU7Q==", - "dependencies": { - "@firebase/app-check-interop-types": "0.3.2", - "@firebase/auth-interop-types": "0.2.3", - "@firebase/component": "0.6.7", - "@firebase/messaging-interop-types": "0.2.2", - "@firebase/util": "1.9.6", - "tslib": "^2.1.0", - "undici": "5.28.4" + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@firebase/functions/-/functions-0.10.0.tgz", + "integrity": "sha512-2U+fMNxTYhtwSpkkR6WbBcuNMOVaI7MaH3cZ6UAeNfj7AgEwHwMIFLPpC13YNZhno219F0lfxzTAA0N62ndWzA==", + "dependencies": { + "@firebase/app-check-interop-types": "0.3.0", + "@firebase/auth-interop-types": "0.2.1", + "@firebase/component": "0.6.4", + "@firebase/messaging-interop-types": "0.2.0", + "@firebase/util": "1.9.3", + "node-fetch": "2.6.7", + "tslib": "^2.1.0" }, "peerDependencies": { "@firebase/app": "0.x" } }, "node_modules/@firebase/functions-compat": { - "version": "0.3.11", - "resolved": "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.3.11.tgz", - "integrity": "sha512-Qn+ts/M6Lj2/6i1cp5V5TRR+Hi9kyXyHbo+w9GguINJ87zxrCe6ulx3TI5AGQkoQa8YFHUhT3DMGmLFiJjWTSQ==", - "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/functions": "0.11.5", - "@firebase/functions-types": "0.6.2", - "@firebase/util": "1.9.6", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@firebase/functions-compat/-/functions-compat-0.3.5.tgz", + "integrity": "sha512-uD4jwgwVqdWf6uc3NRKF8cSZ0JwGqSlyhPgackyUPe+GAtnERpS4+Vr66g0b3Gge0ezG4iyHo/EXW/Hjx7QhHw==", + "dependencies": { + "@firebase/component": "0.6.4", + "@firebase/functions": "0.10.0", + "@firebase/functions-types": "0.6.0", + "@firebase/util": "1.9.3", "tslib": "^2.1.0" }, "peerDependencies": { @@ -2058,18 +2100,37 @@ } }, "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==" + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@firebase/functions-types/-/functions-types-0.6.0.tgz", + "integrity": "sha512-hfEw5VJtgWXIRf92ImLkgENqpL6IWpYaXVYiRkFY1jJ9+6tIhWM7IzzwbevwIIud/jaxKVdRzD7QBWfPmkwCYw==" + }, + "node_modules/@firebase/functions/node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } }, "node_modules/@firebase/installations": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@firebase/installations/-/installations-0.6.7.tgz", - "integrity": "sha512-i6iGoXRu5mX4rTsiMSSKrgh9pSEzD4hwBEzRh5kEhOTr8xN/wvQcCPZDSMVYKwM2XyCPBLVq0JzjyerwL0Rihg==", + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/@firebase/installations/-/installations-0.6.4.tgz", + "integrity": "sha512-u5y88rtsp7NYkCHC3ElbFBrPtieUybZluXyzl7+4BsIz4sqb4vSAuwHEUgCgCeaQhvsnxDEU6icly8U9zsJigA==", "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/util": "1.9.6", - "idb": "7.1.1", + "@firebase/component": "0.6.4", + "@firebase/util": "1.9.3", + "idb": "7.0.1", "tslib": "^2.1.0" }, "peerDependencies": { @@ -2077,14 +2138,14 @@ } }, "node_modules/@firebase/installations-compat": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/@firebase/installations-compat/-/installations-compat-0.2.7.tgz", - "integrity": "sha512-RPcbD+3nqHbnhVjIOpWK2H5qzZ8pAAAScceiWph0VNTqpKyPQ5tDcp4V5fS0ELpfgsHYvroMLDKfeHxpfvm8cw==", - "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/installations": "0.6.7", - "@firebase/installations-types": "0.5.2", - "@firebase/util": "1.9.6", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@firebase/installations-compat/-/installations-compat-0.2.4.tgz", + "integrity": "sha512-LI9dYjp0aT9Njkn9U4JRrDqQ6KXeAmFbRC0E7jI7+hxl5YmRWysq5qgQl22hcWpTk+cm3es66d/apoDU/A9n6Q==", + "dependencies": { + "@firebase/component": "0.6.4", + "@firebase/installations": "0.6.4", + "@firebase/installations-types": "0.5.0", + "@firebase/util": "1.9.3", "tslib": "^2.1.0" }, "peerDependencies": { @@ -2092,31 +2153,36 @@ } }, "node_modules/@firebase/installations-types": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.5.2.tgz", - "integrity": "sha512-que84TqGRZJpJKHBlF2pkvc1YcXrtEDOVGiDjovP/a3s6W4nlbohGXEsBJo0JCeeg/UG9A+DEZVDUV9GpklUzA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.5.0.tgz", + "integrity": "sha512-9DP+RGfzoI2jH7gY4SlzqvZ+hr7gYzPODrbzVD82Y12kScZ6ZpRg/i3j6rleto8vTFC8n6Len4560FnV1w2IRg==", "peerDependencies": { "@firebase/app-types": "0.x" } }, + "node_modules/@firebase/installations/node_modules/idb": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/idb/-/idb-7.0.1.tgz", + "integrity": "sha512-UUxlE7vGWK5RfB/fDwEGgRf84DY/ieqNha6msMV99UsEMQhJ1RwbCd8AYBj3QMgnE3VZnfQvm4oKVCJTYlqIgg==" + }, "node_modules/@firebase/logger": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.4.2.tgz", - "integrity": "sha512-Q1VuA5M1Gjqrwom6I6NUU4lQXdo9IAQieXlujeHZWvRt1b7qQ0KwBaNAjgxG27jgF9/mUwsNmO8ptBCGVYhB0A==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.4.0.tgz", + "integrity": "sha512-eRKSeykumZ5+cJPdxxJRgAC3G5NknY2GwEbKfymdnXtnT0Ucm4pspfR6GT4MUQEDuJwRVbVcSx85kgJulMoFFA==", "dependencies": { "tslib": "^2.1.0" } }, "node_modules/@firebase/messaging": { - "version": "0.12.9", - "resolved": "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.12.9.tgz", - "integrity": "sha512-IH+JJmzbFGZXV3+TDyKdqqKPVfKRqBBg2BfYYOy7cm7J+SwV+uJMe8EnDKYeQLEQhtpwciPfJ3qQXJs2lbxDTw==", - "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/installations": "0.6.7", - "@firebase/messaging-interop-types": "0.2.2", - "@firebase/util": "1.9.6", - "idb": "7.1.1", + "version": "0.12.4", + "resolved": "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.12.4.tgz", + "integrity": "sha512-6JLZct6zUaex4g7HI3QbzeUrg9xcnmDAPTWpkoMpd/GoSVWH98zDoWXMGrcvHeCAIsLpFMe4MPoZkJbrPhaASw==", + "dependencies": { + "@firebase/component": "0.6.4", + "@firebase/installations": "0.6.4", + "@firebase/messaging-interop-types": "0.2.0", + "@firebase/util": "1.9.3", + "idb": "7.0.1", "tslib": "^2.1.0" }, "peerDependencies": { @@ -2124,13 +2190,13 @@ } }, "node_modules/@firebase/messaging-compat": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.2.9.tgz", - "integrity": "sha512-5jN6wyhwPgBH02zOtmmoOeyfsmoD7ty48D1m0vVPsFg55RqN2Z3Q9gkZ5GmPklFPjTPLcxB1ObcHOZvThTkm7g==", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@firebase/messaging-compat/-/messaging-compat-0.2.4.tgz", + "integrity": "sha512-lyFjeUhIsPRYDPNIkYX1LcZMpoVbBWXX4rPl7c/rqc7G+EUea7IEtSt4MxTvh6fDfPuzLn7+FZADfscC+tNMfg==", "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/messaging": "0.12.9", - "@firebase/util": "1.9.6", + "@firebase/component": "0.6.4", + "@firebase/messaging": "0.12.4", + "@firebase/util": "1.9.3", "tslib": "^2.1.0" }, "peerDependencies": { @@ -2138,19 +2204,24 @@ } }, "node_modules/@firebase/messaging-interop-types": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.2.tgz", - "integrity": "sha512-l68HXbuD2PPzDUOFb3aG+nZj5KA3INcPwlocwLZOzPp9rFM9yeuI9YLl6DQfguTX5eAGxO0doTR+rDLDvQb5tA==" + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@firebase/messaging-interop-types/-/messaging-interop-types-0.2.0.tgz", + "integrity": "sha512-ujA8dcRuVeBixGR9CtegfpU4YmZf3Lt7QYkcj693FFannwNuZgfAYaTmbJ40dtjB81SAu6tbFPL9YLNT15KmOQ==" + }, + "node_modules/@firebase/messaging/node_modules/idb": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/idb/-/idb-7.0.1.tgz", + "integrity": "sha512-UUxlE7vGWK5RfB/fDwEGgRf84DY/ieqNha6msMV99UsEMQhJ1RwbCd8AYBj3QMgnE3VZnfQvm4oKVCJTYlqIgg==" }, "node_modules/@firebase/performance": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/@firebase/performance/-/performance-0.6.7.tgz", - "integrity": "sha512-d+Q4ltjdJZqjzcdms5i0UC9KLYX7vKGcygZ+7zHA/Xk+bAbMD2CPU0nWTnlNFWifZWIcXZ/2mAMvaGMW3lypUA==", - "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/installations": "0.6.7", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.9.6", + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/@firebase/performance/-/performance-0.6.4.tgz", + "integrity": "sha512-HfTn/bd8mfy/61vEqaBelNiNnvAbUtME2S25A67Nb34zVuCSCRIX4SseXY6zBnOFj3oLisaEqhVcJmVPAej67g==", + "dependencies": { + "@firebase/component": "0.6.4", + "@firebase/installations": "0.6.4", + "@firebase/logger": "0.4.0", + "@firebase/util": "1.9.3", "tslib": "^2.1.0" }, "peerDependencies": { @@ -2158,15 +2229,15 @@ } }, "node_modules/@firebase/performance-compat": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.2.7.tgz", - "integrity": "sha512-cb8ge/5iTstxfIGW+iiY+7l3FtN8gobNh9JSQNZgLC9xmcfBYWEs8IeEWMI6S8T+At0oHc3lv+b2kpRMUWr8zQ==", - "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/logger": "0.4.2", - "@firebase/performance": "0.6.7", - "@firebase/performance-types": "0.2.2", - "@firebase/util": "1.9.6", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@firebase/performance-compat/-/performance-compat-0.2.4.tgz", + "integrity": "sha512-nnHUb8uP9G8islzcld/k6Bg5RhX62VpbAb/Anj7IXs/hp32Eb2LqFPZK4sy3pKkBUO5wcrlRWQa6wKOxqlUqsg==", + "dependencies": { + "@firebase/component": "0.6.4", + "@firebase/logger": "0.4.0", + "@firebase/performance": "0.6.4", + "@firebase/performance-types": "0.2.0", + "@firebase/util": "1.9.3", "tslib": "^2.1.0" }, "peerDependencies": { @@ -2174,19 +2245,19 @@ } }, "node_modules/@firebase/performance-types": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.2.2.tgz", - "integrity": "sha512-gVq0/lAClVH5STrIdKnHnCo2UcPLjJlDUoEB/tB4KM+hAeHUxWKnpT0nemUPvxZ5nbdY/pybeyMe8Cs29gEcHA==" + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@firebase/performance-types/-/performance-types-0.2.0.tgz", + "integrity": "sha512-kYrbr8e/CYr1KLrLYZZt2noNnf+pRwDq2KK9Au9jHrBMnb0/C9X9yWSXmZkFt4UIdsQknBq8uBB7fsybZdOBTA==" }, "node_modules/@firebase/remote-config": { - "version": "0.4.7", - "resolved": "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.4.7.tgz", - "integrity": "sha512-5oPNrPFLsbsjpq0lUEIXoDF2eJK7vAbyXe/DEuZQxnwJlfR7aQbtUlEkRgQWcicXpyDmAmDLo7q7lDbCYa6CpA==", - "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/installations": "0.6.7", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.9.6", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@firebase/remote-config/-/remote-config-0.4.4.tgz", + "integrity": "sha512-x1ioTHGX8ZwDSTOVp8PBLv2/wfwKzb4pxi0gFezS5GCJwbLlloUH4YYZHHS83IPxnua8b6l0IXUaWd0RgbWwzQ==", + "dependencies": { + "@firebase/component": "0.6.4", + "@firebase/installations": "0.6.4", + "@firebase/logger": "0.4.0", + "@firebase/util": "1.9.3", "tslib": "^2.1.0" }, "peerDependencies": { @@ -2194,15 +2265,15 @@ } }, "node_modules/@firebase/remote-config-compat": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.2.7.tgz", - "integrity": "sha512-Fq0oneQ4SluLnfr5/HfzRS1TZf1ANj1rWbCCW3+oC98An3nE+sCdp+FSuHsEVNwgMg4Tkwx9Oom2lkKeU+Vn+w==", - "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/logger": "0.4.2", - "@firebase/remote-config": "0.4.7", - "@firebase/remote-config-types": "0.3.2", - "@firebase/util": "1.9.6", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/@firebase/remote-config-compat/-/remote-config-compat-0.2.4.tgz", + "integrity": "sha512-FKiki53jZirrDFkBHglB3C07j5wBpitAaj8kLME6g8Mx+aq7u9P7qfmuSRytiOItADhWUj7O1JIv7n9q87SuwA==", + "dependencies": { + "@firebase/component": "0.6.4", + "@firebase/logger": "0.4.0", + "@firebase/remote-config": "0.4.4", + "@firebase/remote-config-types": "0.3.0", + "@firebase/util": "1.9.3", "tslib": "^2.1.0" }, "peerDependencies": { @@ -2210,33 +2281,33 @@ } }, "node_modules/@firebase/remote-config-types": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.3.2.tgz", - "integrity": "sha512-0BC4+Ud7y2aPTyhXJTMTFfrGGLqdYXrUB9sJVAB8NiqJswDTc4/2qrE/yfUbnQJhbSi6ZaTTBKyG3n1nplssaA==" + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@firebase/remote-config-types/-/remote-config-types-0.3.0.tgz", + "integrity": "sha512-RtEH4vdcbXZuZWRZbIRmQVBNsE7VDQpet2qFvq6vwKLBIQRQR5Kh58M4ok3A3US8Sr3rubYnaGqZSurCwI8uMA==" }, "node_modules/@firebase/storage": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/@firebase/storage/-/storage-0.12.5.tgz", - "integrity": "sha512-nGWBOGFNr10j0LA4NJ3/Yh3us/lb0Q1xSIKZ38N6FcS+vY54nqJ7k3zE3PENregHC8+8txRow++A568G3v8hOA==", + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/@firebase/storage/-/storage-0.11.2.tgz", + "integrity": "sha512-CtvoFaBI4hGXlXbaCHf8humajkbXhs39Nbh6MbNxtwJiCqxPy9iH3D3CCfXAvP0QvAAwmJUTK3+z9a++Kc4nkA==", "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/util": "1.9.6", - "tslib": "^2.1.0", - "undici": "5.28.4" + "@firebase/component": "0.6.4", + "@firebase/util": "1.9.3", + "node-fetch": "2.6.7", + "tslib": "^2.1.0" }, "peerDependencies": { "@firebase/app": "0.x" } }, "node_modules/@firebase/storage-compat": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.3.8.tgz", - "integrity": "sha512-qDfY9kMb6Ch2hZb40sBjDQ8YPxbjGOxuT+gU1Z0iIVSSpSX0f4YpGJCypUXiA0T11n6InCXB+T/Dknh2yxVTkg==", - "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/storage": "0.12.5", - "@firebase/storage-types": "0.8.2", - "@firebase/util": "1.9.6", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@firebase/storage-compat/-/storage-compat-0.3.2.tgz", + "integrity": "sha512-wvsXlLa9DVOMQJckbDNhXKKxRNNewyUhhbXev3t8kSgoCotd1v3MmqhKKz93ePhDnhHnDs7bYHy+Qa8dRY6BXw==", + "dependencies": { + "@firebase/component": "0.6.4", + "@firebase/storage": "0.11.2", + "@firebase/storage-types": "0.8.0", + "@firebase/util": "1.9.3", "tslib": "^2.1.0" }, "peerDependencies": { @@ -2244,45 +2315,45 @@ } }, "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==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.8.0.tgz", + "integrity": "sha512-isRHcGrTs9kITJC0AVehHfpraWFui39MPaU7Eo8QfWlqW7YPymBmRgjDrlOgFdURh6Cdeg07zmkLP5tzTKRSpg==", "peerDependencies": { "@firebase/app-types": "0.x", "@firebase/util": "1.x" } }, - "node_modules/@firebase/util": { - "version": "1.9.6", - "resolved": "https://registry.npmjs.org/@firebase/util/-/util-1.9.6.tgz", - "integrity": "sha512-IBr1MZbp4d5MjBCXL3TW1dK/PDXX4yOGbiwRNh1oAbE/+ci5Uuvy9KIrsFYY80as1I0iOaD5oOMA9Q8j4TJWcw==", + "node_modules/@firebase/storage/node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", "dependencies": { - "tslib": "^2.1.0" - } - }, - "node_modules/@firebase/vertexai-preview": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@firebase/vertexai-preview/-/vertexai-preview-0.0.2.tgz", - "integrity": "sha512-NOOL63kFQRq45ioi5P+hlqj/4LNmvn1URhGjQdvyV54c1Irvoq26aW861PRRLjrSMIeNeiLtCLD5pe+ediepAg==", - "dependencies": { - "@firebase/app-check-interop-types": "0.3.2", - "@firebase/component": "0.6.7", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.9.6", - "tslib": "^2.1.0" + "whatwg-url": "^5.0.0" }, "engines": { - "node": ">=18.0.0" + "node": "4.x || >=6.0.0" }, "peerDependencies": { - "@firebase/app": "0.x", - "@firebase/app-types": "0.x" + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/@firebase/util": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/@firebase/util/-/util-1.9.3.tgz", + "integrity": "sha512-DY02CRhOZwpzO36fHpuVysz6JZrscPiBXD0fXp6qSrL9oNOx5KWICKdR95C0lSITzxp0TZosVyHqzatE8JbcjA==", + "dependencies": { + "tslib": "^2.1.0" } }, "node_modules/@firebase/webchannel-wrapper": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-1.0.0.tgz", - "integrity": "sha512-zuWxyfXNbsKbm96HhXzainONPFqRcoZblQ++e9cAIGUuHfl2cFSBzW01jtesqWG/lqaUyX3H8O1y9oWboGNQBA==" + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.10.1.tgz", + "integrity": "sha512-Dq5rYfEpdeel0bLVN+nfD1VWmzCkK+pJbSjIawGE+RY4+NIJqhbUDDQjvV0NUK84fMfwxvtFoCtEe70HfZjFcw==" }, "node_modules/@floating-ui/core": { "version": "1.6.3", @@ -2345,18 +2416,18 @@ "integrity": "sha512-XGndio0l5/Gvd6CLIABvsav9HHezgDFFhDfHk1bvLfr9ni8dojqLSvBbotJEjmIwNHL7vK4QzBJTdBRoB+c1ww==" }, "node_modules/@grpc/grpc-js": { - "version": "1.9.15", - "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.9.15.tgz", - "integrity": "sha512-nqE7Hc0AzI+euzUwDAy0aY5hCp10r734gMGRdU+qOPX0XSceI2ULrcXB5U2xSc5VkWwalCj4M7GzCAygZl2KoQ==", + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.7.3.tgz", + "integrity": "sha512-H9l79u4kJ2PVSxUNA08HMYAnUBLj9v6KjYQ7SQ71hOZcEXhShE/y5iQCesP8+6/Ik/7i2O0a10bPquIcYfufog==", "dependencies": { - "@grpc/proto-loader": "^0.7.8", + "@grpc/proto-loader": "^0.7.0", "@types/node": ">=12.12.47" }, "engines": { "node": "^8.13.0 || >=10.10.0" } }, - "node_modules/@grpc/proto-loader": { + "node_modules/@grpc/grpc-js/node_modules/@grpc/proto-loader": { "version": "0.7.13", "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.7.13.tgz", "integrity": "sha512-AiXO/bfe9bmxBjxxtYxFAXGZvMaN5s8kO+jBHAJCON8rJoB5YS/D6X7ZNc6XQkuHNmyl4CYaMI1fJ/Gn27RGGw==", @@ -2373,6 +2444,170 @@ "node": ">=6" } }, + "node_modules/@grpc/grpc-js/node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, + "node_modules/@grpc/grpc-js/node_modules/protobufjs": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.2.tgz", + "integrity": "sha512-RXyHaACeqXeqAKGLDl68rQKbmObRsTIn4TYVUUug1KfS47YWCo5MacGITEryugIgZqORCvJWEk4l449POg5Txg==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/node": ">=13.7.0", + "long": "^5.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@grpc/proto-loader": { + "version": "0.6.13", + "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.6.13.tgz", + "integrity": "sha512-FjxPYDRTn6Ec3V0arm1FtSpmP6V50wuph2yILpyvTKzjc76oDdoihXqM1DzOW5ubvCC8GivfCnNtfaRE8myJ7g==", + "dependencies": { + "@types/long": "^4.0.1", + "lodash.camelcase": "^4.3.0", + "long": "^4.0.0", + "protobufjs": "^6.11.3", + "yargs": "^16.2.0" + }, + "bin": { + "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@grpc/proto-loader/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@grpc/proto-loader/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@grpc/proto-loader/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/@grpc/proto-loader/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@grpc/proto-loader/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/@grpc/proto-loader/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/@grpc/proto-loader/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@grpc/proto-loader/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@grpc/proto-loader/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@grpc/proto-loader/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@grpc/proto-loader/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "engines": { + "node": ">=10" + } + }, "node_modules/@hapi/hoek": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", @@ -5579,6 +5814,11 @@ "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.6.tgz", "integrity": "sha512-OpXEVoCKSS3lQqjx9GGGOapBeuW5eUboYHRlHP9urXPX25IKZ6AnP5ZRxtVf63iieUbsHxLn8NQ5Nlftc6yzAA==" }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" + }, "node_modules/@types/mdast": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", @@ -10475,58 +10715,36 @@ } }, "node_modules/firebase": { - "version": "10.12.2", - "resolved": "https://registry.npmjs.org/firebase/-/firebase-10.12.2.tgz", - "integrity": "sha512-ZxEdtSvP1I9su1yf32D8TIdgxtPgxwr6z3jYAR1TXS/t+fVfpoPc/N1/N2bxOco9mNjUoc+od34v5Fn4GeKs6Q==", - "dependencies": { - "@firebase/analytics": "0.10.4", - "@firebase/analytics-compat": "0.2.10", - "@firebase/app": "0.10.5", - "@firebase/app-check": "0.8.4", - "@firebase/app-check-compat": "0.3.11", - "@firebase/app-compat": "0.2.35", - "@firebase/app-types": "0.9.2", - "@firebase/auth": "1.7.4", - "@firebase/auth-compat": "0.5.9", - "@firebase/database": "1.0.5", - "@firebase/database-compat": "1.0.5", - "@firebase/firestore": "4.6.3", - "@firebase/firestore-compat": "0.3.32", - "@firebase/functions": "0.11.5", - "@firebase/functions-compat": "0.3.11", - "@firebase/installations": "0.6.7", - "@firebase/installations-compat": "0.2.7", - "@firebase/messaging": "0.12.9", - "@firebase/messaging-compat": "0.2.9", - "@firebase/performance": "0.6.7", - "@firebase/performance-compat": "0.2.7", - "@firebase/remote-config": "0.4.7", - "@firebase/remote-config-compat": "0.2.7", - "@firebase/storage": "0.12.5", - "@firebase/storage-compat": "0.3.8", - "@firebase/util": "1.9.6", - "@firebase/vertexai-preview": "0.0.2" - } - }, - "node_modules/firebase/node_modules/@firebase/auth": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@firebase/auth/-/auth-1.7.4.tgz", - "integrity": "sha512-d2Fw17s5QesojwebrA903el20Li9/YGgkoOGJjagM4I1qAT36APa/FcZ+OX86KxbYKCtQKTMqraU8pxG7C2JWA==", - "dependencies": { - "@firebase/component": "0.6.7", - "@firebase/logger": "0.4.2", - "@firebase/util": "1.9.6", - "tslib": "^2.1.0", - "undici": "5.28.4" - }, - "peerDependencies": { - "@firebase/app": "0.x", - "@react-native-async-storage/async-storage": "^1.18.1" - }, - "peerDependenciesMeta": { - "@react-native-async-storage/async-storage": { - "optional": true - } + "version": "9.23.0", + "resolved": "https://registry.npmjs.org/firebase/-/firebase-9.23.0.tgz", + "integrity": "sha512-/4lUVY0lUvBDIaeY1q6dUYhS8Sd18Qb9CgWkPZICUo9IXpJNCEagfNZXBBFCkMTTN5L5gx2Hjr27y21a9NzUcA==", + "dependencies": { + "@firebase/analytics": "0.10.0", + "@firebase/analytics-compat": "0.2.6", + "@firebase/app": "0.9.13", + "@firebase/app-check": "0.8.0", + "@firebase/app-check-compat": "0.3.7", + "@firebase/app-compat": "0.2.13", + "@firebase/app-types": "0.9.0", + "@firebase/auth": "0.23.2", + "@firebase/auth-compat": "0.4.2", + "@firebase/database": "0.14.4", + "@firebase/database-compat": "0.3.4", + "@firebase/firestore": "3.13.0", + "@firebase/firestore-compat": "0.3.12", + "@firebase/functions": "0.10.0", + "@firebase/functions-compat": "0.3.5", + "@firebase/installations": "0.6.4", + "@firebase/installations-compat": "0.2.4", + "@firebase/messaging": "0.12.4", + "@firebase/messaging-compat": "0.2.4", + "@firebase/performance": "0.6.4", + "@firebase/performance-compat": "0.2.4", + "@firebase/remote-config": "0.4.4", + "@firebase/remote-config-compat": "0.2.4", + "@firebase/storage": "0.11.2", + "@firebase/storage-compat": "0.3.2", + "@firebase/util": "1.9.3" } }, "node_modules/flat-cache": { @@ -12430,9 +12648,9 @@ } }, "node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" }, "node_modules/longest-streak": { "version": "3.1.0", @@ -14702,9 +14920,9 @@ } }, "node_modules/protobufjs": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.3.2.tgz", - "integrity": "sha512-RXyHaACeqXeqAKGLDl68rQKbmObRsTIn4TYVUUug1KfS47YWCo5MacGITEryugIgZqORCvJWEk4l449POg5Txg==", + "version": "6.11.4", + "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz", + "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==", "hasInstallScript": true, "dependencies": { "@protobufjs/aspromise": "^1.1.2", @@ -14717,11 +14935,13 @@ "@protobufjs/path": "^1.1.2", "@protobufjs/pool": "^1.1.0", "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.1", "@types/node": ">=13.7.0", - "long": "^5.0.0" + "long": "^4.0.0" }, - "engines": { - "node": ">=12.0.0" + "bin": { + "pbjs": "bin/pbjs", + "pbts": "bin/pbts" } }, "node_modules/protocol-buffers-schema": { @@ -17368,17 +17588,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/undici": { - "version": "5.28.4", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", - "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", - "dependencies": { - "@fastify/busboy": "^2.0.0" - }, - "engines": { - "node": ">=14.0" - } - }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", diff --git a/package.json b/package.json index de1e8a7..cc97441 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "@types/react": "^18.2.64", "@types/react-dom": "^18.2.21", "astro": "^4.3.6", - "firebase": "^10.8.1", + "firebase": "^9.23.0", "i": "^0.3.7", "react": "^18.2.0", "react-dom": "^18.2.0", From 60b3b6468fbdb614324e3a0f39cf650a540d5666 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 29 Jul 2024 12:12:21 -0400 Subject: [PATCH 02/17] chore: emulators --- firebase.json | 8 +++++++- package.json | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/firebase.json b/firebase.json index 8c7d46f..05e2062 100644 --- a/firebase.json +++ b/firebase.json @@ -20,6 +20,12 @@ "ui": { "enabled": true }, - "singleProjectMode": true + "singleProjectMode": true, + "firestore": { + "port": 8080 + }, + "auth": { + "port": 9099 + } } } diff --git a/package.json b/package.json index cc97441..0164f15 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "build": "astro check && astro build", "preview": "astro preview", "astro": "astro", - "check": "astro check" + "check": "astro check", + "emulators": "firebase emulators:start" }, "dependencies": { "@astrojs/check": "^0.5.3", From 60287f69599ba3418a749dc9a68b160d23d7a2af Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 29 Jul 2024 12:13:31 -0400 Subject: [PATCH 03/17] feat: functions for auth and history data --- src/firebase-config.json | 8 +++++ src/firebase.js | 71 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 src/firebase-config.json create mode 100644 src/firebase.js diff --git a/src/firebase-config.json b/src/firebase-config.json new file mode 100644 index 0000000..7ffbd5e --- /dev/null +++ b/src/firebase-config.json @@ -0,0 +1,8 @@ +{ + "apiKey": "AIzaSyBaGckKaSh8Kg7h6QnucrxP5pKPSETFRLE", + "authDomain": "mmp-site-b1c9b.firebaseapp.com", + "projectId": "mmp-site-b1c9b", + "storageBucket": "mmp-site-b1c9b.appspot.com", + "messagingSenderId": "364364593490", + "appId": "1:364364593490:web:9636e89bda12afe7f2a28b" +} \ No newline at end of file diff --git a/src/firebase.js b/src/firebase.js new file mode 100644 index 0000000..a727969 --- /dev/null +++ b/src/firebase.js @@ -0,0 +1,71 @@ +import { initializeApp } from "firebase/app" +import { addDoc, collection, getDocs, getFirestore } from "firebase/firestore" +import { getAuth, GoogleAuthProvider, signInWithPopup, signOut } from "firebase/auth" +import firebaseConfig from "./firebase-config.json" + +const provider = new GoogleAuthProvider() +provider.setCustomParameters({ + hd: "brown.edu", +}) + +const app = initializeApp(firebaseConfig) +const db = getFirestore(app) +export const auth = getAuth(app) + +export const addHistoryData = async (inputs) => { + try { + const docRef = await addDoc(collection(db, "history"), { + name: inputs.name, + institution: inputs.institution, + email: inputs.email, + description: inputs.description, + date: new Date(), + }) + console.log("Document written with ID: ", docRef.id) + } catch (e) { + console.error("Error adding document: ", e) + } +} + +export const getAdminUsers = async () => { + const querySnapshot = await getDocs(collection(db, "admin")) + const data = [] + querySnapshot.forEach((doc) => { + data.push(doc.data()) + }) + return data.map((user) => { + return user.email + }) +} + +export const getHistoryData = async () => { + const querySnapshot = await getDocs(collection(db, "history")) + const data = [] + querySnapshot.forEach((doc) => { + data.push(doc.data()) + }) + return data +} + +export const handleLogin = async () => { + try { + const result = await signInWithPopup(auth, provider) + const { email } = result.user + const adminUsers = await getAdminUsers() + if (!adminUsers.includes(email.toLowerCase())) { + return null + } else { + return result.user + } + } catch (error) { + console.log(error) + } +} + +export const handleLogout = async () => { + try { + await signOut(auth) + } catch (error) { + console.log(error) + } +} From f5c3a74d8673ff36a8d7f5cdea3fb454c7d97262 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 29 Jul 2024 12:13:50 -0400 Subject: [PATCH 04/17] feat: login component --- src/components/Login.tsx | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/components/Login.tsx diff --git a/src/components/Login.tsx b/src/components/Login.tsx new file mode 100644 index 0000000..ee4070a --- /dev/null +++ b/src/components/Login.tsx @@ -0,0 +1,40 @@ +import React, { useState } from "react" +import { type UserInfo } from "firebase/auth" +import { handleLogin, handleLogout } from "../firebase" +import Button from "./Button.tsx" + +interface LoginProps { + currentUser: UserInfo | null | undefined + setUserFunction: (loggedUser: UserInfo | null | undefined) => void +} + +const Login: React.FC<LoginProps> = ({ currentUser, setUserFunction }) => { + const [message, setMessage] = useState("") + + const login = async () => { + await handleLogin().then((loggedUser) => { + if (!loggedUser) + setMessage( + "You must be an admin on this project in order to see this data. If you believe this to be an error, please reach out to David Lindstrom." + ) + setUserFunction(loggedUser) + }) + } + const logout = async () => { + await handleLogout() + setUserFunction(null) + } + return ( + <section className="flex flex-col gap-6"> + <div> + {currentUser ? ( + <Button onClick={logout}>Logout</Button> + ) : ( + <Button onClick={() => login()}>Login</Button> + )} + </div> + <div>{message && <p>{message}</p>}</div> + </section> + ) +} +export default Login From 00aecd7b182250bf8b402da5e09393814a99b347 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 29 Jul 2024 13:04:46 -0400 Subject: [PATCH 05/17] feat: History table component --- src/components/HistoryTable.tsx | 47 +++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/components/HistoryTable.tsx diff --git a/src/components/HistoryTable.tsx b/src/components/HistoryTable.tsx new file mode 100644 index 0000000..938e393 --- /dev/null +++ b/src/components/HistoryTable.tsx @@ -0,0 +1,47 @@ +import React from "react" +import { type Timestamp } from "firebase/firestore" + +export interface HistoryTableProps { + data: Array<{ + name: string + institution: string + email: string + description: string + date: Timestamp + }> +} + +const HistoryTable: React.FC<HistoryTableProps> = ({ data }) => { + return ( + <div className="w-full overflow-x-scroll no-scrollbar"> + <table className="table-fixed border-spacing-2"> + <thead> + <tr className="bg-neutral-100 text-left text-neutral-900"> + <th>Name</th> + <th>Institution</th> + <th>Email</th> + <th>Description</th> + <th>Download Date</th> + </tr> + </thead> + + <tbody> + {data && + data.map(({ name, institution, email, description, date }, i) => { + const stringDate = date.toDate().toDateString() + return ( + <tr key={i}> + <td>{name}</td> + <td>{institution}</td> + <td>{email}</td> + <td>{description}</td> + <td>{stringDate}</td> + </tr> + ) + })} + </tbody> + </table> + </div> + ) +} +export default HistoryTable From 5c3527cb6337c38ee037e1b354a3478479085f8a Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 29 Jul 2024 13:05:10 -0400 Subject: [PATCH 06/17] feat: History Page --- src/components/HistoryPage.tsx | 47 ++++++++++++++++++++++++++++++++++ src/consts.ts | 10 +++++++- src/pages/history.astro | 8 ++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 src/components/HistoryPage.tsx create mode 100644 src/pages/history.astro diff --git a/src/components/HistoryPage.tsx b/src/components/HistoryPage.tsx new file mode 100644 index 0000000..f9494ff --- /dev/null +++ b/src/components/HistoryPage.tsx @@ -0,0 +1,47 @@ +import { useEffect, useState } from "react" +import type { UserInfo } from "firebase/auth" +import Login from "../components/Login" +import HistoryTable from "../components/HistoryTable" +import { getHistoryData } from "../firebase" + +const HistoryPage = () => { + const [user, setUser] = useState<UserInfo | null | undefined>(null) + const [historyData, setHistoryData] = useState<any[] | null>(null) + const setUserFunction = (loggedUser: UserInfo | null | undefined) => { + setUser(loggedUser) + } + + useEffect(() => { + const getData = async () => { + return await getHistoryData() + } + + if (user) { + getData().then((data) => { + setHistoryData(data) + }) + } + }, [user]) + + return ( + <div className="space-y-8"> + <section> + <div className="flex justify-end"> + <Login currentUser={user} setUserFunction={setUserFunction} /> + </div> + {!user && ( + <p> + This section of the website is reserved for administrators to view download statistics. + </p> + )} + </section> + {historyData && ( + <section> + <HistoryTable data={historyData} /> + </section> + )} + </div> + ) +} + +export default HistoryPage diff --git a/src/consts.ts b/src/consts.ts index 3850337..e47692b 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -1,4 +1,12 @@ export const SITE_TITLE = "MMP" export const SITE_DESCRIPTION = "Mesoamerican Migration Project" -export const LINKS = ["people", "news", "publications", "study-design", "data", "documentation"] +export const LINKS = [ + "people", + "news", + "publications", + "study-design", + "data", + "documentation", + "history", +] diff --git a/src/pages/history.astro b/src/pages/history.astro new file mode 100644 index 0000000..41ee3dd --- /dev/null +++ b/src/pages/history.astro @@ -0,0 +1,8 @@ +--- +import Layout from "../layouts/Layout.astro" +import HistoryPage from "../components/HistoryPage" +--- + +<Layout title="Admin" description="History Table of Downloads"> + <HistoryPage client:only="react" /> +</Layout> From 933c246bcb44a20b682d860adf4f89eb1cb75017 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Thu, 1 Aug 2024 09:34:27 -0400 Subject: [PATCH 07/17] feat: show total number of downloads --- src/components/HistoryPage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/HistoryPage.tsx b/src/components/HistoryPage.tsx index f9494ff..b13e2d1 100644 --- a/src/components/HistoryPage.tsx +++ b/src/components/HistoryPage.tsx @@ -36,7 +36,8 @@ const HistoryPage = () => { )} </section> {historyData && ( - <section> + <section className="space-y-2"> + <p>Number of downloads: {historyData.length}</p> <HistoryTable data={historyData} /> </section> )} From 4219253f511c6e0921b959e1c017198efd225b2c Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 5 Aug 2024 10:49:25 -0400 Subject: [PATCH 08/17] refactor: history -> activity --- .../{HistoryPage.tsx => ActivityPage.tsx} | 20 +++++++++---------- .../{HistoryTable.tsx => ActivityTable.tsx} | 8 ++++---- src/consts.ts | 2 +- src/pages/{history.astro => activity.astro} | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) rename src/components/{HistoryPage.tsx => ActivityPage.tsx} (69%) rename src/components/{HistoryTable.tsx => ActivityTable.tsx} (84%) rename src/pages/{history.astro => activity.astro} (57%) diff --git a/src/components/HistoryPage.tsx b/src/components/ActivityPage.tsx similarity index 69% rename from src/components/HistoryPage.tsx rename to src/components/ActivityPage.tsx index b13e2d1..1ea8d94 100644 --- a/src/components/HistoryPage.tsx +++ b/src/components/ActivityPage.tsx @@ -1,10 +1,10 @@ import { useEffect, useState } from "react" import type { UserInfo } from "firebase/auth" import Login from "../components/Login" -import HistoryTable from "../components/HistoryTable" import { getHistoryData } from "../firebase" +import ActivityTable from "./ActivityTable.tsx" -const HistoryPage = () => { +const ActivityPage = () => { const [user, setUser] = useState<UserInfo | null | undefined>(null) const [historyData, setHistoryData] = useState<any[] | null>(null) const setUserFunction = (loggedUser: UserInfo | null | undefined) => { @@ -25,24 +25,24 @@ const HistoryPage = () => { return ( <div className="space-y-8"> - <section> - <div className="flex justify-end"> - <Login currentUser={user} setUserFunction={setUserFunction} /> - </div> + <section className="space-y-6"> + <Login currentUser={user} setUserFunction={setUserFunction} /> {!user && ( <p> This section of the website is reserved for administrators to view download statistics. </p> )} </section> - {historyData && ( + {user && historyData && ( <section className="space-y-2"> - <p>Number of downloads: {historyData.length}</p> - <HistoryTable data={historyData} /> + <h3> + <span className="font-bold px-2">{historyData.length}</span> download(s) + </h3> + <ActivityTable data={historyData} /> </section> )} </div> ) } -export default HistoryPage +export default ActivityPage diff --git a/src/components/HistoryTable.tsx b/src/components/ActivityTable.tsx similarity index 84% rename from src/components/HistoryTable.tsx rename to src/components/ActivityTable.tsx index 938e393..546af63 100644 --- a/src/components/HistoryTable.tsx +++ b/src/components/ActivityTable.tsx @@ -1,7 +1,7 @@ import React from "react" import { type Timestamp } from "firebase/firestore" -export interface HistoryTableProps { +export interface ActivityTableProps { data: Array<{ name: string institution: string @@ -11,10 +11,10 @@ export interface HistoryTableProps { }> } -const HistoryTable: React.FC<HistoryTableProps> = ({ data }) => { +const ActivityTable: React.FC<ActivityTableProps> = ({ data }) => { return ( <div className="w-full overflow-x-scroll no-scrollbar"> - <table className="table-fixed border-spacing-2"> + <table className="table-fixed border-spacing-2 w-full"> <thead> <tr className="bg-neutral-100 text-left text-neutral-900"> <th>Name</th> @@ -44,4 +44,4 @@ const HistoryTable: React.FC<HistoryTableProps> = ({ data }) => { </div> ) } -export default HistoryTable +export default ActivityTable diff --git a/src/consts.ts b/src/consts.ts index e47692b..5d7956c 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -8,5 +8,5 @@ export const LINKS = [ "study-design", "data", "documentation", - "history", + "activity", ] diff --git a/src/pages/history.astro b/src/pages/activity.astro similarity index 57% rename from src/pages/history.astro rename to src/pages/activity.astro index 41ee3dd..80e4ba9 100644 --- a/src/pages/history.astro +++ b/src/pages/activity.astro @@ -1,8 +1,8 @@ --- import Layout from "../layouts/Layout.astro" -import HistoryPage from "../components/HistoryPage" +import ActivityPage from "../components/ActivityPage" --- <Layout title="Admin" description="History Table of Downloads"> - <HistoryPage client:only="react" /> + <ActivityPage client:only="react" /> </Layout> From 054163dba094e99578125c887d0064b8ab3a722e Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 5 Aug 2024 10:49:39 -0400 Subject: [PATCH 09/17] style: error message is error --- src/components/Login.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Login.tsx b/src/components/Login.tsx index ee4070a..f5c48dd 100644 --- a/src/components/Login.tsx +++ b/src/components/Login.tsx @@ -28,12 +28,12 @@ const Login: React.FC<LoginProps> = ({ currentUser, setUserFunction }) => { <section className="flex flex-col gap-6"> <div> {currentUser ? ( - <Button onClick={logout}>Logout</Button> + <Button onClick={() => logout()}>Log Out</Button> ) : ( - <Button onClick={() => login()}>Login</Button> + <Button onClick={() => login()}>Log In</Button> )} </div> - <div>{message && <p>{message}</p>}</div> + {message && <p className="text-primary-300">{message}</p>} </section> ) } From aa3f520b0e0ad7f4708935a79fb0f9fe94378b67 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 5 Aug 2024 11:31:45 -0400 Subject: [PATCH 10/17] style: 3 columns, fixed w for user and date --- src/components/ActivityTable.tsx | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/components/ActivityTable.tsx b/src/components/ActivityTable.tsx index 546af63..736a012 100644 --- a/src/components/ActivityTable.tsx +++ b/src/components/ActivityTable.tsx @@ -16,12 +16,10 @@ const ActivityTable: React.FC<ActivityTableProps> = ({ data }) => { <div className="w-full overflow-x-scroll no-scrollbar"> <table className="table-fixed border-spacing-2 w-full"> <thead> - <tr className="bg-neutral-100 text-left text-neutral-900"> - <th>Name</th> - <th>Institution</th> - <th>Email</th> + <tr className="text-xl bg-neutral-100 text-left text-neutral-900"> <th>Description</th> - <th>Download Date</th> + <th className="w-1/4 overflow-auto">User</th> + <th className="w-1/5">Download Date</th> </tr> </thead> @@ -31,10 +29,18 @@ const ActivityTable: React.FC<ActivityTableProps> = ({ data }) => { const stringDate = date.toDate().toDateString() return ( <tr key={i}> - <td>{name}</td> - <td>{institution}</td> - <td>{email}</td> - <td>{description}</td> + <td> + <p>{description}</p> + </td> + <td> + <div> + <p className="text-lg font-semibold text-neutral-900">{name}</p> + <p className="text-neutral-700 italic overflow-hidden overflow-ellipsis "> + {email} + </p> + <p className="small">{institution}</p> + </div> + </td> <td>{stringDate}</td> </tr> ) From 5b5e55c46e8a80212cb6f978448538eeaa385c80 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 5 Aug 2024 14:13:18 -0400 Subject: [PATCH 11/17] Update src/firebase.js Co-authored-by: Anna Murphy <35873035+anna-murphy@users.noreply.github.com> --- src/firebase.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/firebase.js b/src/firebase.js index a727969..0e39926 100644 --- a/src/firebase.js +++ b/src/firebase.js @@ -19,7 +19,7 @@ export const addHistoryData = async (inputs) => { institution: inputs.institution, email: inputs.email, description: inputs.description, - date: new Date(), + date: Timestamp.now(), }) console.log("Document written with ID: ", docRef.id) } catch (e) { From d5772649f6e38620f0a27819fd362a8a96b401ff Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 5 Aug 2024 14:14:27 -0400 Subject: [PATCH 12/17] style: semibold error, email to david --- src/components/ActivityTable.tsx | 2 +- src/components/Login.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/ActivityTable.tsx b/src/components/ActivityTable.tsx index 736a012..f9987f8 100644 --- a/src/components/ActivityTable.tsx +++ b/src/components/ActivityTable.tsx @@ -18,7 +18,7 @@ const ActivityTable: React.FC<ActivityTableProps> = ({ data }) => { <thead> <tr className="text-xl bg-neutral-100 text-left text-neutral-900"> <th>Description</th> - <th className="w-1/4 overflow-auto">User</th> + <th className="w-1/4">User</th> <th className="w-1/5">Download Date</th> </tr> </thead> diff --git a/src/components/Login.tsx b/src/components/Login.tsx index f5c48dd..54a2e04 100644 --- a/src/components/Login.tsx +++ b/src/components/Login.tsx @@ -1,5 +1,6 @@ import React, { useState } from "react" import { type UserInfo } from "firebase/auth" +import { set } from "react-hook-form" import { handleLogin, handleLogout } from "../firebase" import Button from "./Button.tsx" @@ -15,7 +16,7 @@ const Login: React.FC<LoginProps> = ({ currentUser, setUserFunction }) => { await handleLogin().then((loggedUser) => { if (!loggedUser) setMessage( - "You must be an admin on this project in order to see this data. If you believe this to be an error, please reach out to David Lindstrom." + "You must be an admin on this project in order to see this data. If you believe this to be an error, please reach out to David Lindstrom (david_lindstrom@brown.edu)." ) setUserFunction(loggedUser) }) @@ -23,6 +24,7 @@ const Login: React.FC<LoginProps> = ({ currentUser, setUserFunction }) => { const logout = async () => { await handleLogout() setUserFunction(null) + setMessage("") } return ( <section className="flex flex-col gap-6"> @@ -33,7 +35,7 @@ const Login: React.FC<LoginProps> = ({ currentUser, setUserFunction }) => { <Button onClick={() => login()}>Log In</Button> )} </div> - {message && <p className="text-primary-300">{message}</p>} + {message && <p className="font-semibold text-primary-300">{message}</p>} </section> ) } From 066a514bc1b1b6d5ec77429cbf30f747eb866fd8 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Tue, 6 Aug 2024 09:59:16 -0400 Subject: [PATCH 13/17] refactor: history -> activity components --- src/components/ActivityPage.tsx | 43 +++++++++++++++++++++----------- src/components/ActivityTable.tsx | 10 ++------ src/firebase.js | 4 +-- 3 files changed, 32 insertions(+), 25 deletions(-) diff --git a/src/components/ActivityPage.tsx b/src/components/ActivityPage.tsx index 1ea8d94..4cda3f4 100644 --- a/src/components/ActivityPage.tsx +++ b/src/components/ActivityPage.tsx @@ -1,27 +1,40 @@ import { useEffect, useState } from "react" import type { UserInfo } from "firebase/auth" +import type { Timestamp } from "firebase/firestore" import Login from "../components/Login" -import { getHistoryData } from "../firebase" +import { getActivityData } from "../firebase" import ActivityTable from "./ActivityTable.tsx" -const ActivityPage = () => { - const [user, setUser] = useState<UserInfo | null | undefined>(null) - const [historyData, setHistoryData] = useState<any[] | null>(null) - const setUserFunction = (loggedUser: UserInfo | null | undefined) => { - setUser(loggedUser) - } +export interface activityType { + name: string + institution: string + email: string + description: string + date: Timestamp +} - useEffect(() => { - const getData = async () => { - return await getHistoryData() - } +const getData = async () => { + return await getActivityData() +} +function useActivityData(user: UserInfo | null | undefined) { + const [activityData, setActivityData] = useState<activityType[] | null>(null) + useEffect(() => { if (user) { getData().then((data) => { - setHistoryData(data) + setActivityData(data) }) } }, [user]) + return activityData +} + +const ActivityPage = () => { + const [user, setUser] = useState<UserInfo | null | undefined>(null) + const setUserFunction = (loggedUser: UserInfo | null | undefined) => { + setUser(loggedUser) + } + const activityData = useActivityData(user) return ( <div className="space-y-8"> @@ -33,12 +46,12 @@ const ActivityPage = () => { </p> )} </section> - {user && historyData && ( + {user && activityData && ( <section className="space-y-2"> <h3> - <span className="font-bold px-2">{historyData.length}</span> download(s) + <span className="font-bold px-2">{activityData.length}</span> download(s) </h3> - <ActivityTable data={historyData} /> + <ActivityTable data={activityData} /> </section> )} </div> diff --git a/src/components/ActivityTable.tsx b/src/components/ActivityTable.tsx index f9987f8..9035fad 100644 --- a/src/components/ActivityTable.tsx +++ b/src/components/ActivityTable.tsx @@ -1,14 +1,8 @@ import React from "react" -import { type Timestamp } from "firebase/firestore" +import type { activityType } from "./ActivityPage.tsx" export interface ActivityTableProps { - data: Array<{ - name: string - institution: string - email: string - description: string - date: Timestamp - }> + data: activityType[] } const ActivityTable: React.FC<ActivityTableProps> = ({ data }) => { diff --git a/src/firebase.js b/src/firebase.js index 0e39926..314a4f0 100644 --- a/src/firebase.js +++ b/src/firebase.js @@ -12,7 +12,7 @@ const app = initializeApp(firebaseConfig) const db = getFirestore(app) export const auth = getAuth(app) -export const addHistoryData = async (inputs) => { +export const addActivityData = async (inputs) => { try { const docRef = await addDoc(collection(db, "history"), { name: inputs.name, @@ -38,7 +38,7 @@ export const getAdminUsers = async () => { }) } -export const getHistoryData = async () => { +export const getActivityData = async () => { const querySnapshot = await getDocs(collection(db, "history")) const data = [] querySnapshot.forEach((doc) => { From f23a09454d8612ba6adec51882a7a71cd3941c60 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Tue, 6 Aug 2024 10:00:28 -0400 Subject: [PATCH 14/17] refactor: history data to a hook --- src/components/ActivityPage.tsx | 29 ++--------------------------- src/hooks/activity.ts | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 27 deletions(-) create mode 100644 src/hooks/activity.ts diff --git a/src/components/ActivityPage.tsx b/src/components/ActivityPage.tsx index 4cda3f4..8e244b9 100644 --- a/src/components/ActivityPage.tsx +++ b/src/components/ActivityPage.tsx @@ -1,34 +1,9 @@ -import { useEffect, useState } from "react" +import { useState } from "react" import type { UserInfo } from "firebase/auth" -import type { Timestamp } from "firebase/firestore" import Login from "../components/Login" -import { getActivityData } from "../firebase" +import { useActivityData } from "../hooks/activity.ts" import ActivityTable from "./ActivityTable.tsx" -export interface activityType { - name: string - institution: string - email: string - description: string - date: Timestamp -} - -const getData = async () => { - return await getActivityData() -} - -function useActivityData(user: UserInfo | null | undefined) { - const [activityData, setActivityData] = useState<activityType[] | null>(null) - useEffect(() => { - if (user) { - getData().then((data) => { - setActivityData(data) - }) - } - }, [user]) - return activityData -} - const ActivityPage = () => { const [user, setUser] = useState<UserInfo | null | undefined>(null) const setUserFunction = (loggedUser: UserInfo | null | undefined) => { diff --git a/src/hooks/activity.ts b/src/hooks/activity.ts new file mode 100644 index 0000000..4ef77e4 --- /dev/null +++ b/src/hooks/activity.ts @@ -0,0 +1,28 @@ +import type { Timestamp } from "firebase/firestore" +import type { UserInfo } from "firebase/auth" +import { useEffect, useState } from "react" +import { getActivityData } from "../firebase" + +export interface activityType { + name: string + institution: string + email: string + description: string + date: Timestamp +} + +const getData = async () => { + return await getActivityData() +} + +export function useActivityData(user: UserInfo | null | undefined) { + const [activityData, setActivityData] = useState<activityType[] | null>(null) + useEffect(() => { + if (user) { + getData().then((data) => { + setActivityData(data) + }) + } + }, [user]) + return activityData +} From f505deea09f7d09fbec4078a4c4c98b9b17ae387 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Tue, 6 Aug 2024 10:04:32 -0400 Subject: [PATCH 15/17] fix: activitytable needs the type from the hook --- src/components/ActivityTable.tsx | 2 +- src/components/Login.tsx | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/ActivityTable.tsx b/src/components/ActivityTable.tsx index 9035fad..e10a28f 100644 --- a/src/components/ActivityTable.tsx +++ b/src/components/ActivityTable.tsx @@ -1,5 +1,5 @@ import React from "react" -import type { activityType } from "./ActivityPage.tsx" +import type { activityType } from "../hooks/activity.ts" export interface ActivityTableProps { data: activityType[] diff --git a/src/components/Login.tsx b/src/components/Login.tsx index 54a2e04..1bff73a 100644 --- a/src/components/Login.tsx +++ b/src/components/Login.tsx @@ -1,6 +1,5 @@ import React, { useState } from "react" import { type UserInfo } from "firebase/auth" -import { set } from "react-hook-form" import { handleLogin, handleLogout } from "../firebase" import Button from "./Button.tsx" From 8c8cc116959a5a8b64c7e780b14b5660ff525caf Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:40:01 -0400 Subject: [PATCH 16/17] refactor: addHistory -> addActivity from main --- src/components/DataForm.tsx | 4 ++-- src/firebase.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/DataForm.tsx b/src/components/DataForm.tsx index b5654d4..eaaa7ea 100644 --- a/src/components/DataForm.tsx +++ b/src/components/DataForm.tsx @@ -1,7 +1,7 @@ import { Controller, type SubmitHandler, useForm } from "react-hook-form" import * as Form from "@radix-ui/react-form" import React from "react" -import { addHistoryData } from "../firebase" +import { addActivityData } from "../firebase" import { Input } from "./Input.tsx" import { Textarea } from "./Textarea.tsx" import Button from "./Button.tsx" @@ -17,7 +17,7 @@ const DataForm = () => { const { handleSubmit, control, register } = useForm<Inputs>() const formRef = React.useRef<HTMLFormElement>(null) const onSubmit: SubmitHandler<Inputs> = async (data) => { - await addHistoryData(data) + await addActivityData(data) if (formRef.current) formRef.current.submit() } return ( diff --git a/src/firebase.js b/src/firebase.js index 314a4f0..2c501cb 100644 --- a/src/firebase.js +++ b/src/firebase.js @@ -1,5 +1,5 @@ import { initializeApp } from "firebase/app" -import { addDoc, collection, getDocs, getFirestore } from "firebase/firestore" +import { addDoc, collection, getDocs, getFirestore, Timestamp } from "firebase/firestore" import { getAuth, GoogleAuthProvider, signInWithPopup, signOut } from "firebase/auth" import firebaseConfig from "./firebase-config.json" From 17faf470a3a79eb62fbb6cf7c40de49fbb2bf4d8 Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:43:48 -0400 Subject: [PATCH 17/17] style: vertical align top of table cells --- src/components/ActivityTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ActivityTable.tsx b/src/components/ActivityTable.tsx index e10a28f..363de19 100644 --- a/src/components/ActivityTable.tsx +++ b/src/components/ActivityTable.tsx @@ -22,7 +22,7 @@ const ActivityTable: React.FC<ActivityTableProps> = ({ data }) => { data.map(({ name, institution, email, description, date }, i) => { const stringDate = date.toDate().toDateString() return ( - <tr key={i}> + <tr key={i} className="align-top"> <td> <p>{description}</p> </td>