Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Develop onto Main #1141

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
### Issue link / number:
### Resolves #enter-issue-number

### What changes did you make?
### What changes did you make and why did you make them?

### Why did you make the changes?
### Did you run tests? Share screenshot of results:

### Did you run tests?
### How did you find us? (GitHub, Google search, social media, etc.):

<!---IMPORTANT NOTE ABOUT RUNNING TESTS: ->
<!---ABOUT RUNNING TESTS :->
- Directions for running tests are in the README.md.
- Tests are not required to pass.
- Run unit tests
- Run Cypress tests if required for contribution.
- Some tests may require multiple runs before success.
- Some test failures may not be due to your contribution and can be ignored.
- If tests fail without resolution, please let us know here.
- Directions for running tests are in the README.md
- Some test failures may not be due to your contribution and can be ignored. We are always upgrading testing performance.

<!--- PR CHECKLIST: PLEASE REMOVE BEFORE SUBMITTING —>
<!--- PR CHECKLIST: —>
Before submitting, check that you have completed the following tasks:
- [ ] Answered the questions above.
- [ ] Read Chayn's Contributing Guidelines in the CONTRIBUTING.md file.
- [ ] Enabled "Allow edits and access to secrets by maintainers" on this PR.
- [ ] If applicable, include images in the description.
After submitting, please be available for discussion. Thank you!
72 changes: 40 additions & 32 deletions BLOOM_USERS.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,65 @@
# Guide to setting up bloom users
# Local Bloom User Set-Up Guide

## Setting up a public user
Creating local Bloom users is required for testing full functionality of Bloom and running local Cypress tests. Here are the types of Bloom users:

- Go to the home page of bloom and sign up with the general user sign up flow
- Public User (default)
- Super Admin (public user with enhanced permissions)
- Partner Admin (partner user with enhanced permissions)
- Partner User (public user created through one of our partner programs)

## How to set up a super admin
### Prerequisites

**Assumptions for this to work:**
- Backend is running, and database populated with test data.
- Frontend is runnning.
- You have manual access to your database, either through the postgres command line or database manager, like [PGAdmin](https://www.pgadmin.org/).

- You have imported the DB dump above into your database and you have a partner entry in your partner table in your database
- You have manual access to your database through the command line or through PG Admin
## Create Public User:

**Steps**
Run the app locally, from the home "/" page, navigate to "Getting Started with Bloom" to sign up as a new user.

- Create an account that you have access to (or use one you already have)
- Go into the database and make that user a super admin. You do this by changing the isSuperAdmin column to `true` on that user. You can do this with a statement such as
You can verify this user was created in the database by running a query such as:

```
SELECT * from public."user" users where users."email" = '[insert email]'
```

## Create Super Admin:

- Create a public user account (or use one you already have).
- Go into the database and grant super admin permissions. You do this by changing the isSuperAdmin column to `true` on that user. You can do this with a query statement such as

```
UPDATE public."user" users SET "isSuperAdmin" = true WHERE users."email"='[insert email here]'
```

## How to set up a partner admin
## Create Partner Admin:

**Assumptions for this to work:**
**Prerequisites**

- you have access to a super admin user account
- Existing super admin user account.

**Steps**

- Log into bloom with the super admin account
- Go to /admin/dashboard
- You should see a form where you can create a partner admin. You can create a partner admin account by typing a new email and selecting a partner in the drop down . Note that you can use the same email as before but just type in (+1) on the end. For example my email is test[@chayn.co](mailto:[email protected]), so I will make a new account with the same email and call it test[[email protected]](mailto:[email protected]).
- Once you have created the new partner admin, sign in as that partner admin. You will need to reset the password so you will need access to the email account. Note that if you used [email protected], it will send the email to [email protected].
- Navigate to /admin/dashboard
- Create partner users using the form:
- **Important:** Make sure the emails are aliases of your own email. You need access to this email to create partner admin passwords. For example, if my email was '[email protected]', I need to make accounts with emails `[email protected]`, `[email protected]`. You will need to reset the password through the UI as Firebase provides a random password for you.
- Set password:
- Reset the passwords for both partner admin accounts. Navigate to `localhost:3000/auth/login` in the frontend UI. Click on the password reset button and reset both passwords by following the email instructions.

## How to set up a partner user
## Create Partner User:

**Assumptions for this to work:**
**Method 1. Use a partner admin**

- For method 1: you have manual access to the database
- For method 2: you have access to a partner admin user account
- Go to Navigate to `/partner-admin/create-access-code`
- Create an access code - you need to select the level of access. For example, select therapy if you want the user who receives this code to have access to therapy
- Save this access code to use later.
- Create a new account e.g. [email protected].
- In the top right corner you should see a profile icon. Click on it and you should see the option to “apply a code”.
- Proceed to apply to code to your account.
- If you have therapy access on that code, you should be able to see “Therapy” option in the nav bar

**Method 1: Manual entry into the database (recommended)**
**Method 2: Manual entry into the database**

- Create a generic public user by going to the homepage and creating an account. You can re-use an existing public user if you have one already.
- Get the userId of the user by going into the database.
Expand All @@ -64,14 +83,3 @@ VALUES ('[insert user id]', null, '[insert partner id]', true, true, 6, 0, true,
```

- Log in as that user and see if “Therapy” is available in the nav bar.

**Method 2. Use a partner admin**

- Create a partner admin (see How to create a partner admin below)
- Go to /partner-admin/create-access-code
- Create an access code - you need to select the level of access. For example, select therapy if you want the user who receives this code to have access to therapy
- Save this access code to use later.
- Create a new account e.g. [email protected].
- In the top right corner you should see a profile icon. Click on it and you should see the option to “apply a code”.
- Proceed to apply to code to your account.
- If you have therapy access on that code, you should be able to see “Therapy” option in the nav bar
Loading
Loading