AgileVentures / MetPlus_tracker

Git Repository for the Waffle issue in MetPlus project
2 stars 4 forks source link

Update company person #146

Closed amba178 closed 8 years ago

amba178 commented 8 years ago

As a user, I should be able to view and edit my profile as appropriate to my user type

amba178 commented 8 years ago

By click this link, it should render edit page view correctly to respective users. users can be js, jd, admin, agency, etc

1.. page will detect user type and display according to permissions and information (not every user has the same kind of profile)

  1. page should have tests for
    • each type of user: Job Seeker, Agency Person, Company Person
sidhene commented 8 years ago

Hey guys,

I've been digesting the revelation that #edit and _form are already claimed for AgencyPerson, and tried a couple of approaches to make up for it. I think the best approach at this point - since AgencyPerson personal profile update is currently identical to the out-of-the-box Devise functionality - is to do nothing and let AgencyPerson use the Devise profile update.

If we're going to have different levels of users, and different profile editing (from an admin doing user management and from users managing their personal preferences) the right place for these personal profile edits is probably the Users directory (currently named 'devise'). We should discuss this.

I have appointments today and tomorrow that will keep me out of scrum, but I'm around mornings and will keep you updated via Slack/Waffle/Github until I'm free again Friday.

patmbolger commented 8 years ago

Devise is great at managing user accounts (create, edit, delete) with incredible functionality OOB (email confirmation, user invitation, password resets, etc.).

Devise also is designed to accommodate more than one "user account" model - for instance, you could have a User model, an Admin model and a Guest model, all managed separately by Devise, and each customizable (views, controller actions) to its specific needs.

We have chosen to use a single Devise user model, which meets our needs and keeps things simple. However, we have, in actuality, three different types of users and thus de-facto user accounts. However, using separate user accounts in Devise for each of the three would not work for us given that these three are not entirely separate but share a common User model.

So, trying to customize Devise to differentiate the 3 types of users would not be in line with how Devise was designed, and therefore is probably not the way to go.

Also, each of the 3 types of user will have unique attributes in the future (today, all user attributes are the same across the 3 types, except for attribute 'title', which is part of the CompanyPerson model - but this will no doubt change in the future).

So, I recommend we use separate (from Devise) controllers and views to manage the profile for each such user type. Specifically, for phase 1:

This is the work that could be done for waffle #146.

Phase 2 would consist of DRY'ing out duplicate code - mostly in views, where each of the 3 views involved in profile management would contain duplicate fields for User attributes. There may also be helpers that can be shared across views.

This is the work that should be done for waffle #169.

sidhene commented 8 years ago

Originally 'edit all users' but JobSeeker is being handled by another story and Agency_Person will require a different approach since #edit and #update have been already claimed by other functions.

patmbolger commented 8 years ago

" ... Agency_Person will require a different approach since #edit and #update have been already claimed by other functions."

Note that this is also the case for CompanyPerson.

sidhene commented 8 years ago

Okay. Let's have an architectural discussion, because right now we're structuring our code with two different conventions - jobseeker vs agencyperson - and we should figure out something that will be easy for any new coders we add to understand.

sidhene commented 8 years ago

BTW just noticed: this (and all the other issues) are listed under _tracker, when they really belong under _PETS