beautyjoy / BJC-Teacher-Tracker

Access Portal and Dashboards for BJC Teachers
https://teachers.bjc.berkeley.edu
1 stars 8 forks source link

187384622/new email model - PR4 - Now add multi-personal-email feature #311

Closed perryzjc closed 5 months ago

perryzjc commented 5 months ago

Original PR

Pivotal Tracker Link

What this PR does:

This pull request implements the multi-personal-email feature, with main changes on the view, a few changes on the backend to simplify the email processing logic, no harm on db.

Include screenshots, videos, etc.

Updates on Create Teacher Form

Based on Michael's advice, the code would be easier to manage by removing personal email field from the original form, and make it as an individual form page. Now, even as an admin, you can't modify the personal email field in the regular form.

image

View

At the view Teacher page, now there is a new button to edit teacher's personal emails. And u can see the personal emails displayed at this view page, in multi lines.

image

Create & Updates & Delete

image

Error Vadalitions

Repeated Emails in the DB
image
Frontend Validation on Empty Values & Invalid Format
image image
Backend Validation on Invalid Format

This needs to be done by Rspec. It's essentially validated by EmailAddress Model itself, and it's covered by the test on email_addresses_controller_spec.rb

Who authored this PR?

  1. Perry (Jingchao) Zhong @perryzjc
  2. Michael Tao (@realmichaeltao )

How should this PR be tested?

Are there any complications to deploying this?

Nope

Checklist:

perryzjc commented 5 months ago

https://github.com/beautyjoy/BJC-Teacher-Tracker/pull/308#issuecomment-2071131410