Giter Site home page Giter Site logo

grahamgoudeau / mcg-portal Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 4.48 MB

Networking portal for current students and alumni for MCG (http://mcgyouthandarts.org/)

License: Apache License 2.0

Dockerfile 0.70% Makefile 1.16% Python 23.01% Shell 0.81% HTML 0.34% CSS 0.68% JavaScript 71.41% PLpgSQL 1.90%

mcg-portal's People

Contributors

abigailllarson avatar cding03 avatar grahamgoudeau avatar tdq45gj avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

tdq45gj

mcg-portal's Issues

Provide suggestions when creating a resource

On the account screen, you can list a resource you're offering to the community. MCG would like some suggestions in a dropdown, with the ability to still provide a free-form answer if desired. That list is below.

I added a new component: ui/src/components/connection/ResourceSelector.js that should help with this. You can see an example usage of it on the connections page. Search for usages of ResourceSelector. You provide an onChange prop to it when you use it, and the value of that prop is some function where you use the newly-chosen value.

* Panel Speaker
* Resume Review
* Mock Interview
* Job Shadow
* Career Advising
* Education Advising
* Job/Internship
* Temporary Housing
* Project Funding
* Project Partner
* Other ___

Backend: Add more details to user profiles

We need to add OPTIONAL fields in the account table for:

  1. bio/personal blurb
  2. current role
  3. current school
  4. current company

Next, add an endpoint to the backend server:

GET /api/accounts/<int:userId>

It should return the following JSON:

{
  firstName: string,
  lastInitial: string,
  bio: string,
  currentRole: string,
  currentSchool: string,
  currentCompany: string,
  enrollmentStatus: nullableString,
}

2. Allow an admin to mark a connection request as "resolved"

Checklist, similar to #2

  • The route should be /api/connection-requests/<int:connectionRequestId>/resolved
  • It should have the following two annotations: @jwt_required and @ensureOwnerOrAdmin (to ensure only signed-in admins can perform this action)
  • Should add a method in the connection request "handler" that we created during issue #2 to handle this new "mark resolved" action
  • That should call a new method in the database class
  • That new method should run some SQL that looks like: UPDATE connection_request SET resolved = TRUE WHERE id = %s, and of course we substitute in the "connectionRequestId" parameter that we received in the first checkbox above ^

Should test with something like:

curl -XPOST -H 'Content-Type: application/json' -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1OTIzNDk1MDAsIm5iZiI6MTU5MjM0OTUwMCwianRpIjoiYjJmYzQ0YmMtYjBkNy00ZmFiLTk5OTMtZmRlZjRmYjg2MjkxIiwiZXhwIjoyNDU2MzQ5NTAwLCJpZGVudGl0eSI6MSwiZnJlc2giOmZhbHNlLCJ0eXBlIjoiYWNjZXNzIiwidXNlcl9jbGFpbXMiOnsiaXNfYWRtaW4iOnRydWV9fQ.3bCdlwmXChH4Q4RlKaP_u-tmkBqkjciQet7R0f05aes' localhost:5000/api/connection-requests/99999/resolved

but of course swap out 99999 with a real connection request ID. You can find them by running make run-psql and then:

SELECT id FROM connection_request;

Bug: User can be created with no enrollment status

Frontend bug, filing for those who want a bit of a challenge. To reproduce the bug:

  1. Visit the user creation page
  2. Fill out the form
  3. DONT change the enrollment status dropdown
  4. Click "Sign Me Up"
  5. Check in the database for the user you just created. It will have a NULL enrollment status, when it should be "Current Student"

Add filters to Request Connections page

After #43, we will have pre-set resource names that users can choose to offer. We should add filters to the browse/connections page to take advantage of this.

Should look something like the random example that I found online, attached below. Look at the "Completed Scans" section. We should have floating filter(s) over to the right on that page. Probably one for enrollment status, and one for resource name. Doesn't have to be exact, but something like this.

material-design-example

Bug: Object of type 'Resource' is not JSON serializable

To reproduce:

  1. run make run-psql
  2. in that postgres shell, run insert into resource values (default, 'test', 1, null); (this will insert a "resource" into the database that we'll try to retrieve in the next step)
  3. start the server, then run curl localhost:5000/api/accounts/1/resources

We expect the output to be the JSON representation of the resource we added. But instead we get a 500 Internal Server Error

1. Create new event

The structure of this work should pretty closely follow the checklist in #2. So view that ticket for a high-level summary of the work here.

Changes from that ticket:

  • use the event table
  • the route should be /api/events, and should be a POST request
  • in the route function you'll create in server.py, be sure to call the helper function getRequesterIdInt (get the user ID from the secure credentials they provided) to get the value for the organizer_id column. To say another way: Don't accept a user ID through the JSON body, since that isn't secure. Get the user ID from the secure credentials, which can't be faked.

Frontend: Add more details to user profiles

This depends on #42 being done. Once that data is available, there are two things we need to do:

  1. Display that info (bio/role/etc.) on a user's personal account page
  2. Add a button to the "Request Connection" card that can take you to another user's profile. That page should display the limited personal information that comes back from GET /api/accounts/<int:userId> (the new endpoint from #42)

Add "Staff" as an enrollment type

We should consider renaming "enrollment type" since "Staff" isn't an enrollment. Not a required part of this ticket, but keep it in mind in case something good comes up

IMPORTANT: This means that we also need to add logic in the createAccount function of accounts.py, to throw an error if someone attempts to create an account with enrollment type of "Staff". (We should only mark accounts as "Staff" through some other process)

1. Create a new database table to hold job postings

The table definition should go at the bottom of standUpDB.bash. Follow the pattern of other tables to whatever extent is useful. The table should have a singular name, something like "job_posting".

Be sure to include a boolean column named "pending", defaulting to TRUE. We want the workflow to be that admins have to approve before job postings are seen by others. This is so that minors don't put up job postings.

Backend: Get user account details

Path should be GET on /api/account and it should return a JSON object with the relevant user details (first/last name, email, enrollment status)

Frontend: Show account details

Take a look at Jose's wireframes in Sigma. Should show the user all their information (email, first/last name, enrollment status)

3. Allow admins to approve a pending job posting

Checklist, similar to #2

We want an admin to be able to come in and approve a job posting after they've verified whatever info they need to about the person posting it (specifically, whether or not the person is a minor, etc)

  • The route should be /api/job-postings/<int:jobPostingId>/approved
  • It should have the following two annotations: @jwt_required and @ensureOwnerOrAdmin (to ensure only signed-in admins can perform this action)
  • Should add a method in the connection request "handler"
  • That should call a new method in the database class
  • That new method should flip the value of the indicated row's pending column to TRUE.

1. Create a new connection request

See the table connection_request that we create in standUpDB.bash. We need a way for the backend to create a new connection request that an admin will review.

Requirements:

  • The route should be /api/connection-requests and it should be a POST request.
  • Create a function in server.py to receive that above route. It should be marked as @jwt_required, and @schema.validate with some schema that we think is reasonable
  • Following the pattern of handlers/accounts.py and handlers/resources.py, we should create a new "handler" called handlers/connectionRequests.py that the function in server.py calls. Imitate the pattern of the account and resources handlers here
  • That new handler will probably be pretty empty; it should just log whatever message we think might be useful, and then call a new function that you'll create in the db class (db/db.py).

Done!

Backend: Get all members with the resources they offer

This will be the endpoint that drives the connection requests page. We'll use this data to render the frontend later. It should be a GET to /api/accounts, and it should return an array of JSON data that has the following shape:

{
  "firstName" string,
  "lastInitial" string,
  "resources": array
}

and each item in the resources array looks like:

{
  "resourceName": string
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.