civictechindex / CTI-website-frontend

Join a worldwide movement to catalog 
every open source 
civic tech project.
https://civictechindex.org
MIT License
30 stars 30 forks source link

Contact us form - Alert PM. #1009

Open DrIffathsultana opened 2 years ago

DrIffathsultana commented 2 years ago

Overview

When a user submits the 'Contact us form', a new alert / GitHub action / Github issue should be created to notify the PM for review and approval. The issue should have the label "Contact us" and be in the "New Issue Approval" column.

Action Items

Resources/Instructions

Figma page contact us page on CTI site reference issue #2353 from hackforla website project storing secrets for apps scripts - issue #1980 from hackforla website project Google App Script doc GitHub API

ExperimentsInHonesty commented 2 years ago

@DrIffathsultana is this

ExperimentsInHonesty commented 2 years ago

If this issue is for the google form/ spreadsheet then please connect with @macho-catt or @jbubar or @Aveline-art to understand how the google form on the wins page on the hackforla.org website ends up delivering an issue like this: https://github.com/hackforla/website/issues/2336 to the repo

ExperimentsInHonesty commented 2 years ago

My prioritization of this issue is dependent on it being for the Google form. If it is not for the google form, another issue will have to be made or edited and that should be prioritized at milestone 5

fyliu commented 2 years ago

Progress: I have a copy of the form with a working script that creates new github issues from the responses. I still need to add the ability to create project cards from issues and also apply the contact us label.

Problem: When the end user goes back to edit the responses after submitting the first time, a new issue is created rather than the old one modified. This is because there's no apparent way to know which response is edited. When a form is edited, only the data fields that were updated will be passed to the script, so the new issue would look incomplete as well.

Solution: disable the ability to edit responses after the form is submitted for the first time. I have confirmed with Matthew Cacho mentioned above to verify that this is also what he does to avoid running into this issue.

Here's what the settings option looks like.

click triangle to expand ![2021-11-18 19 36 19 docs google com 33ab9451b3cd](https://user-images.githubusercontent.com/1160105/142560746-13aeaead-03e2-4883-8b12-3d12f0076b7b.png)
fyliu commented 2 years ago
  1. Progress - Same as before, but I have a better understanding and some things to discuss.
  2. Blockers
    1. I need a format for the contents of the new issue generated. Or this could be a separate issue.
    2. I was thinking about how to secure secrets in google apps script and was referred to this issue by Matthew Cacho from above https://github.com/hackforla/website/issues/1980 This should probably be a separate issue so we can research the current best method, with the solution in the issue as backup if there's no better way.
  3. Availability - maybe next Monday
  4. ETA - an hour or 2 for the barebones version of just putting the data fields into the issue as plain text and creating a project card with it.
fyliu commented 2 years ago
  1. Progress - Got the script working to create issue and put it in the right column, but in my fork for testing
  2. Blockers
    • need review before copying code from test to production form and using main project board
    • Need to hide github token in the script. Right now, I'm using my token. There should be one that's set by admin and hidden. Reference issue from other team https://github.com/hackforla/website/issues/1980
  3. Availability - a few hours
  4. ETA - moving the script should take less than an hour
fyliu commented 2 years ago
fyliu commented 2 years ago

Next steps

fyliu commented 2 years ago
  1. Progress - I didn't get a chance to work on it since last meeting
  2. Blockers -
  3. Availability - should be able to spend a few hours before the next meeting
  4. ETA - I'm thinking next Thursday or the following Monday
kevindphan commented 2 years ago

Two-factor authentication problem when trying to create the github account, consult with Bonnie. Or create a separate account specifically for this purpose.

ladissi commented 2 years ago

@emecas please provide update

  1. Progress
  2. Blockers
  3. Availability
  4. ETA
fyliu commented 2 years ago

I was able to create the github account using the civictechindex@hackforla.org email.

Can a repo admin add this user to the repo? It needs write access in order to create project cards. https://github.com/cti-serv

The user name can be changed if something else is better. I tried these that are already taken cti-bot, cti-service.

kevindphan commented 2 years ago

Have reached out to admin to add the provided user to the repo. Still waiting for a response.

fyliu commented 2 years ago

I started working on this again and I expect to be done by next week.

I made a copy of the form and spreadsheet to my own drive and will go through the steps to securing the api key from there before trying to do the same in the project drive.

After it's working. I will need someone with admin access to the project drive to copy the wrapper code to a private folder that's not viewable by developers. The idea is that the API key shouldn't be viewable by developers or other normal users of the drive. To do that, the wrapper code that has visibility of the key needs to be restricted as well, so that only the wrapper's functionality is exposed.

fyliu commented 2 years ago
  1. Progress - Started separating github api functionality from script in preparation for moving it into a wrapper that will have sole access to the github token
  2. Blockers - none
  3. Availability - 4 hours
  4. ETA - next week's meeting
smsada commented 2 years ago

Need to make a way to store the Github Token with restricted permissions on CTI Google Drive. Talk to Bonnie about setting this up.

Edit: Refer to comment below

fyliu commented 2 years ago
  1. Progress - Separated secret(github token), wrapper library that has sole access to secret, and script that calls the library. It works in my personal google drive, but needs to be copied/moved to right place in the shared drive.
  2. Blockers - Need to find out how the shared drive can have a restricted folder that's admin access only. The secret and maybe wrapper library should be in there while the google form/results sheet with the apps script should live outside and call the library's exposed API without knowledge of the secret.
  3. Availability - 4 hours
  4. ETA - Could be very soon
smsada commented 2 years ago

New drive made to store Keys & Tokens. I will be adding the necessary people to the drive during Thursday's Stand-up

fyliu commented 2 years ago

Can I work with an admin on this? Or maybe temporarily give the civictechindex user more access. I would need to make sure the secret is not accessible to a developer account like mine but I can still call the library that does have access to the secret. I'm not too sure how to do that exactly, but I know what the end result behavior should be.

fyliu commented 2 years ago

We can try this again.

I created the set of linked documents and scripts at https://drive.google.com/drive/u/1/folders/1_bARUvskj4AyaRtroJ5EoZkF2EO391Yv?ths=true They start with either Secret or Not secret. The Secret files need to be place into the secured drive. There may be permissions that need to be granted.

I added a check function in each script to check the connection to the linked document or script. Those can be run in the script editor to verify. I can show how to do that and I also need to document it.