Allow PMs to edit permitted project fields#795
Allow PMs to edit permitted project fields#795drubgrubby merged 8 commits intohackforla:developmentfrom chukalicious:feature/allow-pm-to-edit-project-fields
Conversation
…nditional renderng
…eated state for access user info and sent as props to EditProject component
… type of user can edit the field. In the editableFiled.js set up a restricted state and function that checks whether the users access level is is included in the canEdit array and thru conditional rendering the edit button is enabled/disabled
drubgrubby
left a comment
There was a problem hiding this comment.
@chukalicious => This is exactly the required functionality and very nicely done.
Additionally, you write very tidy code which is easy to read. Much appreciated.
I'm going to wait to merge this as I think Bonnie may want to change the message to something specific that tells them who to contact if they need to make a change to one of the fields that they don't have access to. We'll ask her tomorrow night.
Really nice work!
| const EditProjectInfo = ( props ) => { | ||
|
|
||
| const EditProject = (props) => { |
There was a problem hiding this comment.
Were you an English major? I love that the name of this component bothered you enough to change it here, and in all of the other places that it appears. Miriam Webster would be proud of you.
There was a problem hiding this comment.
😆 I can barely put two words of English together! But yeah, I find it confusing when the component and the file don't have the same name.
|
Per Bonnie, we should create a readme/markdown file in vrms and link to it from the error message. The message on the project edit page should read something like: "You don't have access to edit this field. Click here to find out who does". Or something better with fewer words. |
|
@drubgrubby Hi, I have created the readme file and linked it to the disabled edit button but maybe the link will need to be updated when the branch gets merged, unless you know of another way in which I can link the file without requesting a second merge. I hope that makes sense 😬 |
drubgrubby
left a comment
There was a problem hiding this comment.
In discussion with @chukalicious we have decide to merge this as is - which is working perfectly, but needing some changes to the links - and create a new issue to make those changes.
That issue is #796
Closes #701
Description:
This PR restricts the updating of specific fields in the project object, granting full access to editable fields to users with 'admin' access level, and restricted access to users with 'user' access level.
Action taken: