VRMS icon indicating copy to clipboard operation
VRMS copied to clipboard

Create a Github Issue when a Non-Admin User Wants to Change a Restricted Project Field

Open drubgrubby opened this issue 3 years ago • 6 comments

Overview

This builds on the work on PR #795

Action Items

  • [x] #1129
  • [ ] When user clicks to make changes to the field a modal will open up to create an issue on the VRMS board.
    • [ ] When the user clicks a field that they cannot edit, a modal pops up with a single input with a description of the proposed change.
    • [ ] Creates an issue within VRMS and tag bonnie and other project leads, (then someone will sign off on it, and someone will go and make the change)
    • Someone from the corresponding team will make the change.
    • Post a comment on the related team's agenda indicating who requested the change and what change needs to be made. Bonnie will compile a list of issues for each agenda
    • There is a closed pr with these changes started... https://github.com/hackforla/VRMS/pull/868
  • [x] Rename team-lead-contact-info.md to project-edit-info.md ~~- [ ] Get text for .md file from Bonnie~~ ~~- [ ] Update project-edit-info.md with new text~~
  • [x] Change the link text to: "Click here to find out how to change this field" ~- [x] Make sure the link opens in a new tab~
  • [x] Delete the md file that was created previously

Once the previous items have been merged ~~- [ ] - [ ] Change the link on editableField.js to point to the new .md file~~

Resources/Instructions

To be able to post to the Github API you need to

  • send a Personal Access Token (PAT) in the Authorization header of the API call function in the editableFiels.js named requestToEdit

  • To obtain a PAT go in your Github account > Settings > Developer Settings > Personal Access Tokens > Generate New Token > enter a name for your token > Select Expiration > Select Scope (Repo) > Create Token

  • Copy your token to a variable in you .env file because you will not be shown the token again

  • Send in the API call Authorization header: token ${PAT}

Github Docs: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token

client/src/components/manageProjects/editableField.js ~~team-lead-contact-info.md~~ PR #795

  • https://docs.github.com/en/[email protected]/issues/tracking-your-work-with-issues/creating-an-issue#creating-an-issue-from-a-url-query
  • https://docs.github.com/en/rest/reference/issues#create-an-issue
  • https://api.github.com/

drubgrubby avatar Dec 16 '21 17:12 drubgrubby

Clicking on the link will direct user to open a ticket at VRMS for each kind of change.

drubgrubby avatar Jan 04 '22 03:01 drubgrubby

Progress:

  • have tested posting to API from Postman and was able to create issues
  • created modal, its open and close functionalities
  • created form inside modal to collect value from user and create object to send to the server to create Github issue

Blockers:

  • Nothing yet but I expect that although I have the values I need I might have issues to post them in the format I want them

Availability:

  • 6 hours during the weekend

ETA:

  • I need to create API call in a way I haven't attempted yet but I think it should take less than 6 hrs

Demo video: https://www.loom.com/share/cc5eba2f6f784dabad970944d4c3a24a

image

chukalicious avatar Jan 13 '22 06:01 chukalicious

Progress:

  • Was able to fix the API call and am successfully posting to the Github API
  • The body being sent has formatted headings
  • @drubgrubby I have posted many, many test issues 😵‍💫 I closed them but I was wondering it they can be deleted permanently.

Blockers:

  • I need help with creating an environment variable and importing it to the Modal component to save the Github PAT

ETA:

  • I hope that by this weekend I'm able to push a draft PR for the team to check out and advise on what else is needed. A code review would be good.

chukalicious avatar Jan 15 '22 00:01 chukalicious

Progress:

  • I moved things around and changed the type of the proposedValue from object to string and back trying to figure out why it wasn't being sent as part of the body of the issue.
  • I have moved the state of the proposedValue input up a level and I'm drilling it down as props
  • For some unexplained reason it works sometimes.
  • this is a link of an issue that was created with the proposedValue successfully inserted into the issue body: (https://github.com/hackforla/VRMS/issues/948)
  • As soon as it started working I committed and pushed. I tried it again and it doesn't work

Blocker:

  • all of that ⬆️

ETA

  • Shouldn't be much after I get unstuck

chukalicious avatar Jan 24 '22 06:01 chukalicious

I entered Github API instructions in the issue's description.

chukalicious avatar Jan 25 '22 06:01 chukalicious

Katiuska did some good work on this, but didn't finish it. There's a PR #868 that can be used as a beginning, or if you (whomever you are) would like to solve it in a different manner, feel free. I'm going to close the PR, but it's there for you to use or not use as you will.

drubgrubby avatar Mar 07 '22 23:03 drubgrubby