OperationCode / operationcode_frontend

Front-end repository for live site. Please go to `front-end` repo to contribute instead.
https://operationcode.org
MIT License
101 stars 222 forks source link

feature/ new form for code school addition #942

Closed apex-omontgomery closed 6 years ago

apex-omontgomery commented 6 years ago

Feature

Why is this feature being added?

Asked to make this issue by the BE team for the work that's almost done. This will be a new route on pybot and a new form hosted by pybot for codeschool addition to the database.

What should your feature do?

  1. Render form with required fields
  2. Validate form before submisison
  3. Prevent spamming through timeout
  4. Get recaptcha verification token
  5. Validate image dimensions and size (maybe margin if I can figure that out client side)
  6. Post to pybot
  7. Format information and verify recaptcha token with google
  8. Post to github with formatted information.
  9. Redirect user to github link
  10. (maybe) send slack notification some group

image

Have the happy path working for 1-8 in test environment. Decisions to be made:

  1. Format posted on github/ and which user credentials posted to github?
  2. Should this be behind a subdomain of oc.org
  3. Are we going to eventually port this to FE react
  4. Should we link this up to the backend to take the data and send it to a pending addition with the admin console?
  5. How do we refer codeschools reps to the form?

I think that hiding it behind a url shorterner for the time being and getting 1 in place is a good proof of concept push. If this adds value to our FE/BE people I can do more iterations.

jjhampton commented 6 years ago

@wimo7083 re: '1. Format posted on github/ and which user credentials posted to github?' are you suggesting that the code school request information & logo would be posted as a GitHub issue by this form?

apex-omontgomery commented 6 years ago

Yes it will be posted on either FE or BE. When I asked @hpjaj he said BE would be okay.

hpjaj commented 6 years ago

@wimo7083 - I did not say it would be OK, I was clarifying what the intent of your form was. That is why I asked you to create this issue, so we could discuss:

We will shortly have the ability to do CRUD actions for code schools in the admin dashboard. And we will be able to give that level of access to OC members of our choosing.

So @jjhampton , @kylemh , @nellshamrell , @hollomancer , etc. (whomever we choose), will be able to just go the admin dashboard and create or update a code school.

Let's clarify the goal here. I assume the goal is for an OC user to be able to request the creating, updating, or deletion of a given code school. Yes?

To solve this, IMO, I would rather see a form in our FE react repo that makes a request to have a code school added/updated. This request could either:

And then an admin with the privileges I mentioned above can simply add or update the code school.

I would recommend this over the creating of a new GitHub issue. That said, I am not totally opposed to creating a new GitHub issue, but now with the admin dashboard, the issue does not need to be in the BE or FE, it just needs to get an admin's attention.

So ideally the issue would have to be created in one of the repos and assigned to one of the admins. Or something that triggers a notification to one of the admins.

jjhampton commented 6 years ago

Good questions.

I'm also assuming that the goal is for an OC user (particularly code school reps) to request the CRUD actions for a code school.

@wimo7083 : Is the form is powered by PyBot because we're assuming that code school reps (or whoever is requesting new schools) will find it easier to request this from within Slack?

@hpjaj: I also agree that a form should eventually be in the FE react repo, to trigger such a request. Might it be easier to keep it on PyBot now (for MVP) and migrate the form over to the FE repo on the second iteration of this?

I also would prefer the form not create a new GitHub issue - since creating of issues for code school updates is more or less the current way of doing things. It'd be nice not to create new GitHub issues just for content updates like this (I prefer issues be used for tracking bugs & feature requests).

Having the form request trigger a Slack message to admin users would be fine with me, so an admin could leverage the upcoming admin dashboard to add the school. :100:

apex-omontgomery commented 6 years ago

The whole point of the form is the perform data validation, and provide us with a contact with them before they submit. This is not to trigger database changes but relieve some of the pain points:

  1. Required information is missing
  2. Image has improper size and dimensions
  3. Contact information for the rep submitting so that we can verify specific items

The reason I'm using the github issue is because it provides transparency to the school representative, they know when their issue is complete. We can put this into a new github repo and have the current github notification track these issues (like github-feed).

I'm fine with MVP being pybot and transitioning over to FE/BE. If it becomes something else in the future we could turn it into a CRUD interface for the code_school rep that sends a CRUD request to BE that gets verified. But for now, I think this is a helpful iterative change.

jjhampton commented 6 years ago

@wimo7083 re: Using a new GitHub repo to provide transparency & issue tracking for code school reps: That could work, but I'm worried that it'd just be another thing that would require maintenance and oversight. I've already noticed a few of the other OC GitHub repos (not the main FE and BE ones) had stale comments/PRs that went months without replies since they weren't being monitored.

@hpjaj Would it be possible for the admin-portal back-end to send out a courtesy notification email when a new code school is added, to the school's listed email address? Upon successful form submit of this proposed form (requesting code school update), the UI could display a message to the user that an email will be sent their way once the code school is added to the DB by our admins.

apex-omontgomery commented 6 years ago

Since all y'all subscribed: http://operationcode-pyback.us-east-1.elasticbeanstalk.com/new_school

This is what is currently available. Cannot upload images yet, think it's something to do with elastic beanstalk configs .ebextensions/options.config https://forums.aws.amazon.com/thread.jspa?threadID=116772

Ashley has already suggested to switch the on values to off. Any suggestions I'd appreciate them.

jjhampton commented 6 years ago

@wimo7083 What's the status on this? Looks like it's still being served via that URL. Will we be able to go live, or give out this link to code school reps (or anyone else who wants to request code school additions?)

I think we should be able to go live w/ an MVP as long as it either posts submissions as a GitHub issue, or Slack messages people w/ admin dashboard access. We can try either idea and see how it works, and adjust later as needed.

apex-omontgomery commented 6 years ago

The form is implemented here: http://operationcode-pyback.us-east-1.elasticbeanstalk.com/new_school

The issues are sent to: https://github.com/OperationCode/operationcode_backend/issues