Skip to content

Commit

Permalink
Merge pull request #9 from RADAR-base/feat/initial-components
Browse files Browse the repository at this point in the history
Add initial enrolment flow
  • Loading branch information
mpgxvii authored Sep 13, 2024
2 parents 0ca96a3 + 5c3b64f commit cc6c8be
Show file tree
Hide file tree
Showing 28 changed files with 1,605 additions and 236 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
npm run start &
npm run test
env:
ORY_KRATOS_URL: http://localhost:4455
ORY_KRATOS_URL: http://localhost:4433
16 changes: 3 additions & 13 deletions cypress/integration/pages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,10 @@ context("Ory Kratos pages", () => {
cy.get('[name="method"]').should("exist")
})

it("can load the registration page", () => {
it("can load the registration page if eligibile", () => {
sessionStorage.setItem("eligible", "")
cy.visit("/registration")
cy.get('[name="traits.email"]').type(email)
cy.get('[name="password"]').type(password)
cy.get('[name="method"]').click()
cy.location("pathname").should("eq", "/verification")

cy.visit("/")
cy.get('[data-testid="logout"]').should(
"have.attr",
"aria-disabled",
"false",
)
cy.get('[data-testid="session-content"]').should("contain.text", email)
cy.get('[name="traits.email"]').should("exist")
})

it("can load the verification page", () => {
Expand Down
55 changes: 55 additions & 0 deletions data/consent-questionnaire.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
export const consentQuestions = [
{
field_name: "consent",
form_name: "consent",
section_header: "",
field_type: "info",
field_label: "",
select_choices_or_calculations: [
{
label:
"We invite you to take part in this research study. This Participant Information Questionnaire will explain the study to help you decide whether you want to take part. It is entirely up to you whether or not to join the study.",
code: "Patient Information Sheet",
},
{
label:
"If you join the study you will contribute to research that might help find ways to improve health and medical care. However, taking part does not give direct benefits. You will be able to see the data being recorded each day, to give you information on your activity and mobility.",
code: "Data Information",
},
],
field_note: "",
text_validation_type_or_show_slider_number: "",
text_validation_min: "",
text_validation_max: "",
identifier: "",
branching_logic: "",
required_field: "",
custom_alignment: "",
question_number: "",
matrix_group_name: "2MW",
matrix_ranking: "",
field_annotation: "",
evaluated_logic: "",
},
{
field_name: "has_consent",
form_name: "consent",
section_header: "",
field_type: "checkbox",
field_label: "I give my consent to take part in this study.",
select_choices_or_calculations: "",
field_note: "",
text_validation_type_or_show_slider_number: "",
text_validation_min: "",
text_validation_max: "",
identifier: "",
branching_logic: "",
required_field: "yes",
custom_alignment: "",
question_number: "",
matrix_group_name: "",
matrix_ranking: "",
field_annotation: "",
evaluated_logic: "",
},
]
86 changes: 86 additions & 0 deletions data/eligibility-questionnaire.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
export const eligibilityQuestions = [
{
field_name: "age",
form_name: "eligibility",
section_header: "",
field_type: "text",
field_label: "How old are you?",
select_choices_or_calculations: "",
field_note: "",
text_validation_type_or_show_slider_number: "",
text_validation_min: "",
text_validation_max: "",
identifier: "",
branching_logic: "",
required_field: "yes",
custom_alignment: "",
question_number: "",
matrix_group_name: "",
matrix_ranking: "",
field_annotation: "",
evaluated_logic: "",
},
{
field_name: "city",
form_name: "eligibility",
section_header: "",
field_type: "text",
field_label: "What city do you live in?",
select_choices_or_calculations: "",
field_note: "",
text_validation_type_or_show_slider_number: "",
text_validation_min: "",
text_validation_max: "",
identifier: "",
branching_logic: "",
required_field: "yes",
custom_alignment: "",
question_number: "",
matrix_group_name: "",
matrix_ranking: "",
field_annotation: "",
evaluated_logic: "",
},
{
field_name: "has_fitbit",
form_name: "eligibility",
section_header: "",
field_type: "text",
field_label: "Do you have a Fitbit?",
select_choices_or_calculations: "",
field_note: "",
text_validation_type_or_show_slider_number: "",
text_validation_min: "",
text_validation_max: "",
identifier: "",
branching_logic: "",
required_field: "yes",
custom_alignment: "",
question_number: "",
matrix_group_name: "",
matrix_ranking: "",
field_annotation: "",
evaluated_logic: "",
},
{
field_name: "is_eligible",
form_name: "eligibility",
section_header: "",
field_type: "text",
field_label: "Eligible",
select_choices_or_calculations: "",
field_note: "",
text_validation_type_or_show_slider_number: "",
text_validation_min: "",
text_validation_max: "",
identifier: "",
branching_logic: "",
required_field: "",
custom_alignment: "",
question_number: "",
matrix_group_name: "",
matrix_ranking: "",
field_annotation: "",
evaluated_logic: "",
},
]
23 changes: 23 additions & 0 deletions data/profile-questionnaire.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export const profileQuestions = [
{
field_name: "first_name",
form_name: "profile",
field_type: "text",
field_label: "First Name",
required_field: "yes",
},
{
field_name: "last_name",
form_name: "profile",
field_type: "text",
field_label: "Last Name",
required_field: "yes",
},
{
field_name: "address",
form_name: "profile",
field_type: "text",
field_label: "Address",
required_field: "yes",
},
]
29 changes: 29 additions & 0 deletions data/study-questionnaire.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
export const studyInfo = [
{
field_name: "consent",
form_name: "consent",
section_header: "",
field_type: "info",
field_label: "",
select_choices_or_calculations: [
{
label:
"This study aims to understand the effects of eating disorders. Participants will be askeed to fill out questionnaires and undergo non-invaise tests over the course of one year.",
code: "Study Overview",
},
],
field_note: "",
text_validation_type_or_show_slider_number: "",
text_validation_min: "",
text_validation_max: "",
identifier: "",
branching_logic: "",
required_field: "",
custom_alignment: "",
question_number: "",
matrix_group_name: "2MW",
matrix_ranking: "",
field_annotation: "",
evaluated_logic: "",
},
]
Loading

0 comments on commit cc6c8be

Please sign in to comment.