Skip to content

Commit

Permalink
Merge pull request #1653 from Spiteless/vite
Browse files Browse the repository at this point in the history
Vite
  • Loading branch information
trillium authored Jun 3, 2024
2 parents 8a87d59 + 51e9429 commit bb1cb5f
Show file tree
Hide file tree
Showing 66 changed files with 3,939 additions and 2,227 deletions.
64 changes: 64 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: 'Bug Report'
description: 'Bug report HackforLA issue form.'

body:
- type: textarea
id: description
attributes:
label: Describe the Bug
description: Clearly state the bug
validations:
required: true
- type: dropdown
id: feature
attributes:
label: Feature
description: Select a feature related to the bug
options:
- AWS
- Brand
- Login
- Users
- Agenda
- Check in
- Database
- Dashboard
- Marketing
- Onboarding
- Repo Update
- Documentation
- GitHub Actions
- GitHub Hygiene
- Infrastructure
- Package Update
- ESLint Warnings
- Form validation
- Recurring Events
- Project Management
- Account Setup Automation
- Meeting Time Change Ticket
- Add/Remove PM access
validations:
required: true
- type: textarea
id: replicate
attributes:
label: How to Replicate
description: Clearly state how to replicate the bug
validations:
required: true
- type: dropdown
id: notification
attributes:
label: Request notification after bug squashing
description: Request notification after a bug is squashed
options:
- Yes
- No
validations:
required: true
- type: textarea
id: resource
attributes:
label: Resources/Information
description: Include any important resources/information
2 changes: 1 addition & 1 deletion .github/workflows/New-issue-create-card.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ jobs:
- name: Create or Update Project Card
uses: peter-evans/create-or-update-project-card@v2
with:
project-name: VRMS v0.4
project-name: VRMS - Active Project Board
column-name: New Issue Approval
17 changes: 17 additions & 0 deletions .github/workflows/waiting-to-merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Waiting to Merge

on:
pull_request:
types: [synchronize, opened, reopened, labeled, unlabeled]

jobs:
do-not-merge:
if: ${{ contains(github.event.*.labels.*.name, 'waiting to merge') }}
name: Prevent Merging
runs-on: ubuntu-latest
steps:
- name: Check for label
run: |
echo "Pull request is labeled as 'waiting to merge'"
echo "This workflow fails so that the pull request cannot be merged"
exit 1
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
114 changes: 58 additions & 56 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,50 +50,53 @@ These steps are manditory in order to contribute to all HackforLA projects.
## **Part 2: How to set up the development environment**

### **2.1 Fork the repository**
*A fork is a copy of the repository that will be placed on your GitHub account url.*

In https://github.com/hackforla/VRMS, look for the fork icon in the top right. Click it and create a fork of the repository.
* In https://github.com/hackforla/VRMS, look for the fork icon in the top right. Click it and create a fork of the repository.

For git beginners, a fork is a copy of the repository that will be placed on your GitHub account url.
* It should create a copy here: https://github.com/YOUR_GITHUB_USERNAME/vrms, where `YOUR_GITHUB_USERNAME` is replaced with your github username.

It should create a copy here: https://github.com/your_GitHub_user_name/vrms, where `your_GitHub_user_name` is replaced with exactly that.
> NOTE: This copy is on a remote server on the GitHub website and not on your computer yet.
Note that this copy is on a remote server on the GitHub website and not on your computer yet.

If you click the icon again, it will not create a new fork but instead give you the URL associated with your fork.
* Click the icon again, it will give you the URL associated with your forked repository and not create a new fork.

### **2.2 Clone the remote repository to your local computer**

The following process will make a copy of the fork that you just created on your local computer.

First create a new folder on your local computer that will contain `hackforla` projects.

In your shell, navigate there then run the following commands:
1. Create a new folder on your local computer that will contain `hackforla` projects.

```bash
git clone https://github.com/your_GitHub_user_name/vrms.git
```
2. In your shell (terminal), navigate to this folder then run the following commands:
```bash
git clone https://github.com/YOUR_GITHUB_USERNAME/vrms.git
```

You should now have a new folder in your `hackforla` folder called `vrms`.
You should now have a new folder in your `hackforla` folder called `vrms`.

Verify which URL your `origin` remote is pointing to:
3. Verify which URL your `origin` remote is pointing to:
```bash
git remote show origin
```
Your terminal should return:
```bash
remote origin
Fetch URL: https://github.com/YOUR_GITHUB_USERNAME/vrms.git
Push URL: https://github.com/YOUR_GITHUB_USERNAME/vrms.git
...
```

```bash
git remote show origin
```
If you accidentally cloned the `hackforla/vrms.git` then you can change your local copy to upload to your fork with the following:

If you accidentally cloned the `hackforla/vrms.git` then you can change your local copy to upload to your fork with the following:
```bash
git remote set-url origin https://github.com/YOUR_GITHUB_USERNAME/vrms.git
```

```bash
git remote set-url origin https://github.com/your_user_name/vrms.git
```
4. Add another remote called `vrms` that points to the `hackforla` version of the repository. This will allow you to incorporate changes later:
```bash
git remote add vrms https://github.com/hackforla/vrms.git
```

Add another remote called `vrms` that points to the `hackforla` version of the repository. This will allow you to incorporate changes later:

```bash
git remote add vrms https://github.com/hackforla/vrms.git
```

Note: Understanding how git remotes work will make collaborating much easier. You can learn more about remotes [here](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/configuring-a-remote-for-a-fork) and [here](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes)
Note: Understanding how git remotes work will make collaborating much easier. You can learn more about remotes [here](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/configuring-a-remote-for-a-fork) and [here](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes).


### **2.3 Get up and running**
Expand All @@ -114,20 +117,19 @@ Note: Understanding how git remotes work will make collaborating much easier. Yo

- `cd vrms/` and run `yarn install`
- `cd client` and run `yarn install`
- `cd client-mvp-04` and run `yarn install`
- `cd ../backend` and run `yarn install`

1. Add your required environment variables for the frontend and backend directories:

- `touch vrms/backend/.env`
- `touch vrms/client/.env`
- `touch vrms/client-mvp-04/.env`

Note 1: In the above example you are trying to create an empty file called `.env` in each of the listed directories: backend, client and client-mvp-04. You can use either `touch <path-to-directory> .env` or navigate to the directory and use `touch .env`
Note 1: In the above example you are trying to create an empty file called `.env` in each of the listed directories: backend and client. You can use either `touch <path-to-directory> .env` or navigate to the directory and use `touch .env`

Note 2: `touch` is a Unix/Linux or Mac command; It is not available in Windows. In Windows, use a text editor (e.g. Notepad) to create an empty file and save it in each of the locations as `.env` . (If you use Windows Explorer to create the file it will create a file called `.env.txt`, which will not work.)

- Then paste the content from the [document](https://docs.google.com/document/d/1yDF6UmyO-MPNrl3y_Mw0mkm_WaixlSkXzWbudCzHXDY/edit?usp=sharing). It is accessible for the project team members only.
- Then paste the content from the [document](https://docs.google.com/document/d/1yDF6UmyO-MPNrl3y_Mw0mkm_WaixlSkXzWbudCzHXDY/edit?usp=sharing). It is accessible for the project team members only.

- _Please note that the `ports` for the frontend and backend are set in this location_

1. Take a second to review the `app.js` and `server.js` files in the `vrms/backend` folder. These two files are a blueprint for the back end, so please familiarize yourself with it. You'll see folders for the database collection models, routes for the API, and a config file which loads the necessary environment variables.
Expand Down Expand Up @@ -186,21 +188,21 @@ Claiming an issue is a two step process:


### **3.2 Create a new branch for each issue you work on**
Create a new branch for each issue you work on. Doing all your work on feature branches leaves your repository's main branch unmodified and greatly simplifies keeping your fork in sync with the main project.


Before creating a new branch, always make sure you are currently on the `development` branch by using the command
```
git branch
```
Before creating a new branch, always pull down the latest changes from the `development` branch by using the command
```
git pull vrms development
```
Finally, create a new branch where you will work on your issue by using the command
```
git checkout -b your-branch-name
```
You will create a new branch for each issue you work on. Doing all your work on feature branches leaves your repository's main branch unmodified and greatly simplifies keeping your fork in sync with the main project.


1. Before creating a new branch, always make sure you are currently on the `development` branch by using the command
```bash
git branch
```
2. Before creating a new branch, always pull down the latest changes from the `development` branch by using the command
```bash
git pull vrms development
```
3. Finally, create a new branch where you will work on your issue by using the command:
```bash
git checkout -b your-branch-name
```

### **3.3 Work on the Issue**
Every issue will contain action items you must complete before you are ready to submit a pull request. Be sure to use the checkboxes as you complete each action item so we can track your progress!
Expand All @@ -215,19 +217,19 @@ git commit -m "your commit message"

## **Part 4: How to create pull requests**
### **4.1 Push changes to your forked repository**
Before pushing code, always pull down the latest changes from the `development` branch by using the command
```
git pull vrms development
```
Once you are satisfied with your changes, push them to the feature branch you made within your remote repository.
```
git push --set-upstream origin your-branch-name
```
1. Before pushing code, always pull down the latest changes from the `development` branch by using the command
```
git pull vrms development
```
2. Once you are satisfied with your changes, push them to the feature branch you made within your remote repository.
```
git push --set-upstream origin your-branch-name
```
### **4.2 Create a pull request on the VRMS repository**
1. Go to your fork of the VRMS repository on GitHub and click on the `Compare & pull request` button. <details><summary>See screenshot</summary> <img src="https://user-images.githubusercontent.com/73561520/220488394-09bc759e-98d9-4a09-86c6-66378cf50923.png"/></details>
2. Be sure to title your pull request by summarizing the changes you made
3. Be sure to add your issue number where the template says `Fixes #replace_this_text_with_the_issue_number`
4. Fill out the "What changes did you make and why?" section of the pull request template
5. Include before & after images with your pull request if there are visual changes to the user interface
6. Request a review from another developer on the team
7. Review another developers pull request while you are waiting for your pull request to be reviewed
7. Review another developers pull request while you are waiting for your pull request to be reviewed
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Volunteer Relationship Management System
Live Site: [https://vrms.io](https://vrms.io)
Live Site: [https://www.vrms.io](https://www.vrms.io)

VRMS is a tool used for the engagement, support, and retention of a network of volunteers.

Expand All @@ -14,7 +14,7 @@ We require all code contributors to
## Wiki Highlights
1. [Introduction](https://github.com/hackforla/VRMS/wiki/Introduction)
2. [Technology Stack](https://github.com/hackforla/VRMS/wiki/Technology)
3. [Team Meetigns](https://github.com/hackforla/VRMS/wiki/Team-Meetings)
3. [Team Meetings](https://github.com/hackforla/VRMS/wiki/Team-Meetings)

## We Love Our Stars ⭐⭐⭐

Expand Down
10 changes: 10 additions & 0 deletions backend/controllers/project.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ ProjectController.project_list = async function (req, res) {
}
};

ProjectController.pm_filtered_projects = async function(req, res) {
try {
const projectList = await Project.find({})
const projects = projectList.filter(proj => req.body.includes(proj._id.toString()))
return res.status(200).send(projects)
} catch(e) {
return res.sendStatus(400)
}
}

ProjectController.create = async function (req, res) {
const { body } = req;

Expand Down
2 changes: 1 addition & 1 deletion backend/middleware/user.middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function isAdminByEmail(req, res, next) {
return res.sendStatus(400);
} else {
const role = user.accessLevel;
if (req.get('origin').includes('3001') || role === 'admin' || user.managedProjects.length > 0) {
if (role === 'admin' || user.managedProjects.length > 0) {
next();
} else {
next(res.sendStatus(401));
Expand Down
16 changes: 8 additions & 8 deletions backend/models/project.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ Idea for the future: programmingLanguages, numberGithubContributions (pull these
*/

const projectSchema = mongoose.Schema({
name: { type: String },
description: { type: String },
githubIdentifier: { type: String },
name: { type: String, trim: true },
description: { type: String, trim: true },
githubIdentifier: { type: String, trim: true },
projectStatus: { type: String }, // Active, Completed, or Paused
location: { type: String }, // DTLA, Westside, South LA, or Remote (hacknight)
location: { type: String, trim: true }, // DTLA, Westside, South LA, or Remote (hacknight)
//teamMembers: { type: String }, // commented since we should be able to get this from Project Team Members table
createdDate: { type: Date, default: Date.now }, // date/time project was created
completedDate: { type: Date }, // only if Status = Completed, date/time completed
githubUrl: { type: String }, // link to main repo
slackUrl: { type: String }, // link to Slack channel
googleDriveUrl: { type: String },
githubUrl: { type: String, trim: true }, // link to main repo
slackUrl: { type: String, trim: true }, // link to Slack channel
googleDriveUrl: { type: String, trim: true },
googleDriveId: { type: String },
hflaWebsiteUrl: { type: String },
hflaWebsiteUrl: { type: String, trim: true },
videoConferenceLink: { type: String },
lookingDescription: { type: String }, // narrative on what the project is looking for
recruitingCategories: [{ type: String }], // same as global Skills picklist
Expand Down
6 changes: 4 additions & 2 deletions backend/models/user.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ const userSchema = mongoose.Schema({
isHflaGithubMember: { type: Boolean }, // pull from API once github handle in place?
githubPublic2FA: { type: Boolean }, // does the user have 2FA enabled on their github and membership set to public?
availability: { type: String }, // availability to meet outside of hacknight times; string for now, more structured in future
managedProjects: [{ type: String}] // Which projects managed by user.
managedProjects: [{ type: String}], // Which projects managed by user.
//currentProject: { type: String } // no longer need this as we can get it from Project Team Member table
// password: { type: String, required: true }
isActive: { type: Boolean, default: true }
});

userSchema.methods.serialize = function () {
Expand Down Expand Up @@ -65,7 +66,8 @@ userSchema.methods.serialize = function () {
isHflaGithubMember: this.isHflaGithubMember,
githubPublic2FA: this.githubPublic2FA,
availability: this.availability,
managedProjects: this.managedProjects
managedProjects: this.managedProjects,
isActive: this.isActive
};
};

Expand Down
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@babel/eslint-plugin": "^7.14.5",
"@shelf/jest-mongodb": "^1.2.3",
"concurrently": "^5.1.0",
"debug": "^4.1.1",
"debug": "^4.3.1",
"eslint": "^7.9.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-airbnb-base": "^14.2.0",
Expand Down
10 changes: 8 additions & 2 deletions backend/routers/projects.router.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@ const express = require("express");
const router = express.Router();

const { ProjectController } = require('../controllers');
const { AuthUtil } = require("../middleware");

// The base is /api/projects
router.get('/', ProjectController.project_list);

router.post('/', ProjectController.create);
// Its a put because we have to send the PM projects to be filtered here
router.put('/', ProjectController.pm_filtered_projects);

router.post('/', AuthUtil.verifyCookie, ProjectController.create);

router.get('/:ProjectId', ProjectController.project_by_id);

router.patch('/:ProjectId', ProjectController.update);
router.put('/:ProjectId', AuthUtil.verifyCookie, ProjectController.update);

router.patch('/:ProjectId', AuthUtil.verifyCookie, ProjectController.update);


module.exports = router;
Loading

0 comments on commit bb1cb5f

Please sign in to comment.