VRMS icon indicating copy to clipboard operation
VRMS copied to clipboard

Filtered permissions data comp

Open jng34 opened this issue 1 year ago • 1 comments

Fixes #1752

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

  • Created "User Permission Search" page to replace "User Management" page
  • Created new permission search feature allowing users to search for Admins or Project Leads
  • Created two new slugs /users/permission-search/admin and /users/permission-search/projects corresponding to each search tab
  • By default, Admins will be filtered alphabetically by first name and Project Leads will be filtered alphabetically by Project name and by then first name
  • WHY: As per the overview in #1752, there is no way for admins to see a list of other admins on the VRMS app, or a list of users with Project Managment (PM) access to specific projects.

Screenshots of Proposed Changes Of The Website

Visuals before changes are applied unchanged image
Visuals after changes are applied Screenshot 2024-10-23 111629 Screenshot 2024-10-23 211005 Screenshot 2024-10-24 230502

jng34 avatar Oct 29 '24 03:10 jng34

Want to review this pull request? Take a look at this documentation for a step by step guide!

From your project repository, check out a new branch and test the changes.

git checkout -b jng34-filteredPermissionsDataComp development
git pull https://github.com/jng34/VRMS.git filteredPermissionsDataComp

github-actions[bot] avatar Oct 29 '24 03:10 github-actions[bot]

@trillium, can you confirm that the accessLevel in the dummy data object should be "admin" or "projectLead"?

const user = {
     _id: 1,
     name: {
         firstName: "John",
         lastName: "Doe"
     },
     accessLevel: "projectLead", // or "admin"
     email: "[email protected]",
     projects: ["Home Unite Us, VRMS"] 
}

From the user.model.js, the value "projectLead" is not in the enum.

accessLevel: { 
    type: String, 
    enum: ["user", "admin", "superadmin"], // restricts values to "user", "admin" and "superadmin"
    default: "user" 
  },

It looks like we have this roleOnProject property under the ProjectTeamMemberSchema.

const projectTeamMemberSchema = mongoose.Schema({
    userId: { type: String },                       // id of the user
    projectId: { type: String },                    // id of the project
    teamMemberStatus: { type: String },             // Active or Inactive
    vrmsProjectAdmin: { type: Boolean },            // does this team member have admin rights to the project in VRMS?
    roleOnProject: { type: String },                // Developer, Project Manager, UX, Data Science
...}) 

cc: @jng34, @JackHaeg

vorleakyek avatar Nov 04 '24 05:11 vorleakyek

Per @trillium recommend leaving values discussed above as-is, and making necessary adjustments in: https://github.com/hackforla/VRMS/issues/1801

JackHaeg avatar Nov 05 '24 03:11 JackHaeg

image

@trillium, can you confirm this is okay, or should this PR include the changes in #1798? It should link to "/users". But, for the purpose of testing without the changes in the other PR, it uses "/users/permission-search" instead.

cc: @JackHaeg, @jng34

vorleakyek avatar Nov 11 '24 05:11 vorleakyek

PR has been added to user_permissions_search feature branch!

trillium avatar Jan 21 '25 19:01 trillium