diff --git a/.github/workflows/firebase-deploy-test.yml b/.github/workflows/firebase-deploy-test.yml index 3f3a40f..46c1cae 100644 --- a/.github/workflows/firebase-deploy-test.yml +++ b/.github/workflows/firebase-deploy-test.yml @@ -29,7 +29,7 @@ jobs: cache: "npm" - uses: 'google-github-actions/auth@v2' with: - credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' # Replace with the name of your GitHub Actions secret + credentials_json: '${{ secrets.GOOGLE_TEST_CREDENTIALS }}' # Replace with the name of your GitHub Actions secret - name: Install firebase tools run: npm install -g firebase-tools@12.1.0 - name: Enable firebase webframeworks diff --git a/.github/workflows/firebase-deploy.yml b/.github/workflows/firebase-deploy.yml index 3d3607e..a63c568 100644 --- a/.github/workflows/firebase-deploy.yml +++ b/.github/workflows/firebase-deploy.yml @@ -8,7 +8,7 @@ on: branches: ["main"] env: - FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} + #FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} NEXT_PUBLIC_FIREBASE_CONFIG: ${{ secrets.FIREBASE_PRODUCTION_CONFIG }} @@ -18,7 +18,7 @@ jobs: strategy: matrix: - node-version: [16.x] + node-version: [20.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: @@ -28,6 +28,9 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: "npm" + - uses: 'google-github-actions/auth@v2' + with: + credentials_json: '${{ secrets.GOOGLE_PRODUCTION_CREDENTIALS }}' - name: Install firebase tools run: npm install -g firebase-tools@12.1.0 - name: Enable firebase webframeworks diff --git a/README.md b/README.md index 0f87da2..2b7b22a 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,6 @@ -### Live Server +# DataPipe -https://pipe.jspsych.org - -### Development +Send your experiment data directly to the OSF, for free. -``` -npm install -g firebase-tools -npm install -npm run emulators -``` +https://pipe.jspsych.org -The local site will be available at localhost:5000. diff --git a/functions/package-lock.json b/functions/package-lock.json index 0b4b7e1..638d881 100644 --- a/functions/package-lock.json +++ b/functions/package-lock.json @@ -10,7 +10,7 @@ "csv-string": "^4.1.1", "express": "^4.18.2", "firebase-admin": "^11.9.0", - "firebase-functions": "^4.4.0", + "firebase-functions": "^4.8.0", "is-base64": "^1.1.0", "joi": "^17.7.0", "node-fetch": "^3.2.10" @@ -19,7 +19,7 @@ "firebase-functions-test": "^3.0.0" }, "engines": { - "node": "16" + "node": "20" } }, "node_modules/@ampproject/remapping": { @@ -2900,9 +2900,9 @@ } }, "node_modules/firebase-functions": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/firebase-functions/-/firebase-functions-4.4.0.tgz", - "integrity": "sha512-Vdkr9/y/UKQez//cPm2Iu/9CeayqQ2tQF6o3KXozDDBokK9AOlAalVHImCpKo6nWptT/ncZ8djJFk5cR8l+E+A==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/firebase-functions/-/firebase-functions-4.8.0.tgz", + "integrity": "sha512-8+Tgofl/w7reVVzJ1CSVPYwSRwmOMV8fACDdUkytoEP//wKb9olloMptKg2GahUbs6jHAIbT+B/jeMch4ouHQQ==", "dependencies": { "@types/cors": "^2.8.5", "@types/express": "4.17.3", @@ -2918,7 +2918,7 @@ "node": ">=14.10.0" }, "peerDependencies": { - "firebase-admin": "^10.0.0 || ^11.0.0" + "firebase-admin": "^10.0.0 || ^11.0.0 || ^12.0.0" } }, "node_modules/firebase-functions-test": { @@ -8585,9 +8585,9 @@ } }, "firebase-functions": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/firebase-functions/-/firebase-functions-4.4.0.tgz", - "integrity": "sha512-Vdkr9/y/UKQez//cPm2Iu/9CeayqQ2tQF6o3KXozDDBokK9AOlAalVHImCpKo6nWptT/ncZ8djJFk5cR8l+E+A==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/firebase-functions/-/firebase-functions-4.8.0.tgz", + "integrity": "sha512-8+Tgofl/w7reVVzJ1CSVPYwSRwmOMV8fACDdUkytoEP//wKb9olloMptKg2GahUbs6jHAIbT+B/jeMch4ouHQQ==", "requires": { "@types/cors": "^2.8.5", "@types/express": "4.17.3", diff --git a/functions/package.json b/functions/package.json index 6270636..6bbc9a2 100644 --- a/functions/package.json +++ b/functions/package.json @@ -9,7 +9,7 @@ "logs": "firebase functions:log" }, "engines": { - "node": "16" + "node": "20" }, "main": "index.js", "type": "module", @@ -18,7 +18,7 @@ "csv-string": "^4.1.1", "express": "^4.18.2", "firebase-admin": "^11.9.0", - "firebase-functions": "^4.4.0", + "firebase-functions": "^4.8.0", "is-base64": "^1.1.0", "joi": "^17.7.0", "node-fetch": "^3.2.10" diff --git a/pages/admin/new.js b/pages/admin/new.js index 1f145fc..f5b8544 100644 --- a/pages/admin/new.js +++ b/pages/admin/new.js @@ -1,11 +1,6 @@ import { customAlphabet } from "nanoid"; import AuthCheck from "../../components/AuthCheck"; -import { - doc, - getDoc, - writeBatch, - arrayUnion, -} from "firebase/firestore"; +import { doc, getDoc, writeBatch, arrayUnion } from "firebase/firestore"; import { db, auth } from "../../lib/firebase"; import { useContext, useState } from "react"; import { UserContext } from "../../lib/context"; @@ -26,6 +21,7 @@ import { FormHelperText, VStack, Text, + Select, } from "@chakra-ui/react"; export default function NewExperimentPage({}) { @@ -42,7 +38,7 @@ function NewExperimentForm() { const [osfError, setOsfError] = useState(false); const [titleError, setTitleError] = useState(false); const [dataComponentError, setDataComponentError] = useState(false); - + const [data, loading, error] = useDocumentData(doc(db, "users", user.uid)); return ( @@ -53,8 +49,10 @@ function NewExperimentForm() { Create a New Experiment Title - setTitleError(false)} /> - This field is required + setTitleError(false)} /> + + This field is required + Existing OSF Project @@ -70,9 +68,26 @@ function NewExperimentForm() { New OSF Data Component Name - setDataComponentError(false)}/> - This field is required - DataPipe will create a new component with this name in the OSF project and store all data in it. + setDataComponentError(false)} /> + + This field is required + + + DataPipe will create a new component with this name in the OSF + project and store all data in it. + + + + Storage Location + + + Choose the region where the data will be stored. +