Filtered permissions data comp
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/adminand/users/permission-search/projectscorresponding to each search tab - By default,
Adminswill be filtered alphabetically by first name andProject Leadswill 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
Visuals after changes are applied
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
@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
Per @trillium recommend leaving values discussed above as-is, and making necessary adjustments in: https://github.com/hackforla/VRMS/issues/1801
@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
PR has been added to user_permissions_search feature branch!