brown-ccv / honeycomb

Starter repo for jspsych/react/electron behavioral tasks
https://brown-ccv.github.io/honeycomb-docs/
MIT License
9 stars 8 forks source link

Add cli register #517

Closed YUUU23 closed 1 month ago

YUUU23 commented 2 months ago

Now, direct firestore editing instructions outlined here: https://honeycomb.ccv.brown.edu/docs/firebase#registering-studies may be completed through CLI

github-actions[bot] commented 2 months ago

Visit the preview URL for this PR (updated for commit 58fceba):

https://ccv-honeycomb--pr517-add-cli-register-10x1mzbw.web.app

(expires Thu, 22 Aug 2024 01:39:15 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 4ace1dcea913a952d2a1af84b94a4421bf36e610

RobertGemmaJr commented 2 months ago

This is great! Could you create a new study and add some participants using the CLI and then send a few screenshots here? Just to confirm everything is looking good

RobertGemmaJr commented 2 months ago

Also, @YUUU23 could you set the base of this to be add-commander? It looks like it'll rebase fairly smoothly

YUUU23 commented 2 months ago

This is great! Could you create a new study and add some participants using the CLI and then send a few screenshots here? Just to confirm everything is looking good

honeycomb@4.0.0 cli node cli.mjs register test p3

register data from Firebase given study ID: test and participant ID: p3 ? Currently, there are no participants under this study Continue? adding study with studyID: test and participant ID: p3 yes Successfully added study and participant. Current participantIDs under study test: p3

<img width="1097" alt="image" src="https://github.com/user-attachments/assets/b24dcac6-bd94-46a5-9e09-a47d2d93730e">

- **Adding new participant under existing study** 

(base) happy2na@TheHappy2Na-229 honeycomb % npm run cli register test p4

honeycomb@4.0.0 cli node cli.mjs register test p4

register data from Firebase given study ID: test and participant ID: p4 ? Currently, the participants under this study include: p3 Continue? adding study with studyID: test and participant ID: p4 yes Successfully added study and participant. Current participantIDs under study test: p3 p4

<img width="1079" alt="image" src="https://github.com/user-attachments/assets/b915448f-4313-4c5d-84aa-77b57fce047d">

- **Without providing optional participant**

(base) happy2na@TheHappy2Na-229 honeycomb % npm run cli register test2

honeycomb@4.0.0 cli node cli.mjs register test2

register data from Firebase given study ID: test2 ? Enter a new participant: p1 ? Currently, there are no participants under this study Continue? adding study with studyID: test2 and participant ID: p1 yes Successfully added study and participant. Current participantIDs under study test2: p1


<img width="1083" alt="image" src="https://github.com/user-attachments/assets/95345de3-0696-468c-be7b-8cdee1bb591c">

- **Entirely through prompt**

(base) happy2na@TheHappy2Na-229 honeycomb % npm run cli

honeycomb@4.0.0 cli node cli.mjs

? What would you like to do? Register new participant under study ? Select a study: test2 ? Enter a new participant: p0 ? Currently, the participants under this study include: p1 Continue? adding study with studyID: test2 and participant ID: p0 yes Successfully added study and participant. Current participantIDs under study test2: p1 p0



<img width="1074" alt="image" src="https://github.com/user-attachments/assets/13e5fabb-3485-4904-8482-e2b96b9efd8c">

We will not have cases where the study is not found, since it will register the new study if not found.