hackforla / VRMS

Volunteer Relationship Management System: This is an ambitious project to create a system that will help us measure our human capital development, reduce repetitive tasks and processes, and improve outcomes.
GNU Affero General Public License v3.0
40 stars 79 forks source link

Create the "User Permission Search" screen #1752

Open JackHaeg opened 1 month ago

JackHaeg commented 1 month ago

Overview

Currently, there is no way for admins to see a list of other admins on the VRMS app, or a list of users with Project Management (PM) access to specific projects. We need to create a "User Permission Search" screen, which will host these features.

Requirements

Details

- [x] Design the _skeleton_ of this page: ( [See page 2 of mockups](https://docs.google.com/presentation/d/1oPP7mXDb09le3vVyaB4YUzOYYDa7sqDVCmvW5Srg30k/edit?usp=sharing) ): - Page is contained within the "Users" tab on VRMS. - "User Permission Search" title at the top of the screen, - "Admins" and "Project Leads" filter (similar to our existing "User Search" screen) - _NOTE - Although this filter component with both "Admins" and "Project Leads" can be created for design purposes, we are aiming to create only a functioning "Admins" component first, as this is highest priority._ - A search bar below the filter buttons (similar to our existing "User Search" screen), which will have different functions depending on the filter selected (i.e., user selects "Admins" or "Project Leads" and is presented with a different search experience) - _Full search bar functionality will be discussed & implemented in_ #1753 & #1754 - Depending on filter selection ("Admins" or "Project Leads"), Admins = this screen will display a list of all admin users on VRMS, "Project Leads" = a list of all Project Leads (project managers) and their linked projects (alphabetical order based on project name and then below the search bar. - List of Admins (alphabetical order based on first name of user) - List of Project Leads (alphabetical order based on first name of user) - _Default view on this screen will display the "Admins" filter as selected with a list of all VRMS admin users underneath the search bar - more on this in #1753_

Action Items

Resources/Instructions

Screenshot of User Permission Search Screen mockups

Screenshot 2024-10-07 at 8 30 51 PM

jng34 commented 4 weeks ago

@JackHaeg @trillium

Filtering Project Leads

Hey all, I was able to filter the Project Leads in alphabetical order according to their project names and then first name, as per the action item mentioned:

- Depending on filter selection ("Admins" or "Project Leads"), Admins = this screen will display a list of all admin users on VRMS, "Project Leads" = a list of all Project Leads (project managers) and their linked projects (alphabetical order based on project name and then below the search bar.

The dummy data I used was an array of users with the following structure (meant to mirror the current VRMS user object):

const user = {
     _id: 1,
     name: {
         firstName: "John",
         lastName: "Doe"
     },
     accessLevel: "projectLead", // or "admin"
     email: "johndoe@hackforla.org",
     projects: ["Home Unite Us, VRMS"] 
}
Screenshots project-leads
project-leads

I looped through all the users and for each project in projects array, push a modified user object const modifiedUser = { ...user, project: "projectName" } into a tempArray and then finally map each modified user in the frontend tempArray.map((u) => <ListItem>{u.name.firstName} {u.project}</ListItem>). The code is not exact here, so I'm not sure if this makes sense.

I was wondering if there was a more efficient way to do it, or should I continue by creating a pull request so someone can review the code? All other actionable items are complete.

vorleakyek commented 3 weeks ago

@jng34, maybe it's good to create a PR for this so that I can take a look at your code because I plan to work on #1754, which is related to your work. Thanks!

cc: @trillium, @JackHaeg

JackHaeg commented 3 weeks ago

@trillium provided guidance during Monday All Team call, @jng34 to implement recommendations and submit PR

jng34 commented 3 weeks ago

@trillium Issue has been resolved! I was able to run git pull vrms development and then continue to create the PR. I think one of those commands did the trick. Thanks!

cc: @JackHaeg @vorleakyek