Giter Site home page Giter Site logo

opensourcefellows / amplify-front-end Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 0.0 15 MB

A 501c3 nonprofit that is creating accessibility to civic engagement for marginalized communities

Home Page: https://programequityfrontend.herokuapp.com/

License: MIT License

JavaScript 18.51% HTML 4.14% Vue 76.77% Less 0.58%
civic-hacking civic-tech vue vuejs

amplify-front-end's People

Contributors

aneelac22 avatar ankitagrawal98 avatar bryanmontalvan avatar hamdaankhalid avatar jamesmgreene avatar mahrsbar avatar manishapriya94 avatar matoval avatar mscoutermarsh avatar nawazeverlane avatar nawazkhan avatar omaciel avatar waldnzwrld avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

amplify-front-end's Issues

Error 429: Too many requests

Receiving this error as soon as I search postal code (so after you click on a campaign, and search for a postal code). This means that nothing is loading as it times me out from the api as seen in the screenshot below.
Screen Shot 2022-01-18 at 5 17 01 PM

Screen Shot 2022-01-18 at 5 44 08 PM

I think the issue is the following code as it keeps sending requests to API which then makes it time out (I could be wrong). We also need to update this to send the whole member object, not just the name.

        async handleRepClick (member) {
            try{
                this.repName = `Dear ${member.name}`;
                this.shouldRender = false;
                //from campaign id find template id and then make get request with template id
                var campaignId =this.$route.params.campaignId;

                const versions = await axios.get(
                    'https://murmuring-headland-63935.herokuapp.com/api/Letter_Versions/'+ campaignId
                    );

                let latestVersion = versions.data[versions.data.length - 1].template_id;


                const letter = await axios.get(
                    'https://murmuring-headland-63935.herokuapp.com/api/lob/templates/' + latestVersion
                    );
                this.letterBody = letter.data.versions[0].html;
                this.isStep2 = true;


            } catch(e){
                console.error(e);
            }

        },

user send message button

After customizing and adding name, send button appears and creates lob letter object

Screen Shot 2021-05-22 at 8 07 30 PM

  1. Create sendmessage.vue component in src
  2. vue-show set to false until name input added
  3. Create letter request with the following info:

Screen Shot 2021-05-22 at 8 09 33 PM

  • file: template_id (from campaign id)
  • from: format google civic info of representative name and address into Lob create letter request

Displaying the letter

Issues

FrontEnd

Backend

Architecture

QA

Working together

ย  Frontend Backend Architecture QA/Security
Verify Address based off of boolean check, display one of the screens Format address input from FrontEnd to Lob, return boolean check Make it easier for backend and database to connect testing the data passed to APIs

This function uses the filter under the address to match the letter template to display once a representative is selected

Screen Shot 2021-05-13 at 12 57 14 AM

Data tables

Fix casing in file names

Currently, file names have different cases. This needs to be fix so a standard is set to avoid errors like below

This dependency was not found:

* @/components/DonateMoney.vue in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/takeAction.vue?vue&type=script&lang=js&

To install it, you can run: npm install --save @/components/DonateMoney.vue

Send to Auth0

User Story:

  1. User has not authenticated
  2. User clicks on send letter button
  3. User Authentication is checked and returns false
  4. User is sent to universal login page to authenticate (sms passwordless)
  5. Routed back to amplify (handled by auth0

Checking User Authentication

image

checking accessToken sent by backend @teakopp can add more here?
Using an if else logic to either
(if accessToken = authenticated) route to sending the letter with user information being collected
(if accessToken = not authenticate) route to auth0 universal login

User sent to Universal login page

Screen Shot 2021-06-28 at 11 47 16 PM

@mahrsbar FrontEnd is sending the user to dev-3huf08ov.us.auth0.com/login

if we want to embed it in the app, we can look at lock

Security Consideration vs Embedded Login
Seamless CSRF protection. This helps prevent third-party impersonation or the hijacking of sessions

Advocats Onboarding

Onboarding Specs Doc

  • convert into wiki
  • components structure
  • updating links
  • update Logic model
  • implementation log

Project Issues:

  • Overall Project board within PE repo
  • Corresponding Issues in Advocats Board
  • Optimization issue template

OSS Architecture:

  • Secrets in frontend
  • Test Suite
  • Administrative Action
  • SRE?

Community

  • Onboarding Deck
  • Finish ramp issue
  • Discussion setup? (Frontend notes from standup and one for team changes?)
  • Jonathan and Manisha attend one of the bimonthly C4A?

Screen 1

Screen Shot 2021-07-01 at 4 29 50 PM

  • Have stepper buttons automatically disable and enable as user moves through the three steps

Screen 2: Preview letter

Screen Shot 2021-07-01 at 4 17 42 PM

  • Improve search functionality of postal code; currently slow and doesn't work consistently, entering 1 number displays postal codes, need some kind of postal code verification, might also be related to back-end
  • Filter by levels (#20)
  • clicking on representative displays letter, default to using "federal" not the first one listed (#19)
  • Ensure letter does not display html tags; use <span v-html="letterBody"></span>

@username getting up to speed

Hi and welcome to being one of the AdvoCats! Here is a self paced guide to get familiar with the projects stack as well as how to use available resources.

Resources:

  • Wiki for API Endpoints
  • Project Specification
  • Invision Prototypes

Week 1

  • Read Project Specification : understand app stucture
  • set up your repo: are you able to run npm?
  • pick an issue with label "good first issue"

Week 2:

  • Read Project Specifications: Vuetify
  • Drop into a pair hour

Week 3:

  • Read Project Specification: Data Structures
  • Write 2 questions that came up
  • Submit a pull request: caching input,

Week 4:

  • Read Project Specifications: Features
  • Submit an issue for optimization or bug fix
  • Submit a pull request on any of these labels: letter append, payment verification

Week 5:

  • suggest subbtask issues

Bug: Vuetify colors not showing up

All across the application, Vuetify theme colors aren't applying.
For example, <v-btn color="primary"> doesn't work.

I tried this Stack overflow solution but it didn't fix anything.

Also need to ensure that custom theme colors as found in plugins/vuetify.js are also being applied:
Screen Shot 2022-02-05 at 3 33 05 PM

Screen 3: Auth0

Screen Shot 2021-07-01 at 4 49 00 PM

  • Clicking login to send displays Auth0 in a popup format that automatically redirects user to next screen after successfully authentication (#22)

Epic: Review Letter

User Flow:

Once user has authenticated, routes are opened to review letter, send letter, and add any donations

Screen Shot 2021-09-07 at 3 27 02 PM

These backend functions use the API endpoints from Lob and Stripe. We are able to perform the folllowing functions:

  • review letter
    • letter displayed: use get function to show contents of letter
    • customizeable message: frontend caches message to append
    • append letter if there is a custom message : use append function to send new version of letter

Epic Outline: Letter Payment

To do

User Story

Screen Shot 2022-02-08 at 6 27 02 AM

- User picks a donation amount - User can choose to send letter without donation amount (need to make this more clear) - User is directed to complete transaction via stripe checkout - Once payment is successful, letter is sent

Data Structures

Stripe API

  • Send zipcode from constituent table for payment
  • donation amounts are translated as item numbers in checkout

Lob API

  • Used to post lob letter template object

Send Letter

Context

Part of the Letter Payment Epic, once the user has successfully completed payment #53, the letter can be sent out
Screen Shot 2021-10-26 at 1 07 19 AM

To do

  • check successful payment
  • create a lob post request

Successful Payment

If successful, have send message button appear
If unsuccessful, prompt them back to second accordion

Lob post request

Use the create/post function with the letter id template of the given campaign
color: false for black and white
to: representative address
from: user address
file: letter id template
Screen Shot 2021-10-26 at 1 04 28 AM

Is this
backend?
update letters sent once successful lob object is created
Throttle API

Front End: Screen 3 - Enter Address

Screen 3

User Story: After address is entered, table of representatives that can be clicked individually for a letter template.
Screen Shot 2021-01-30 at 1 45 47 AM

Display Representatives

Message Preview

Message + Button Structure

  • Creating a Grid
  • Button

Representative Filter + Relational Database

  • When user clicks on the representative, Backend to create an index by officeDiv
    • Use the message components here

Show Message

  • Reorient current amplify message box to new grid structure
  • structure for display:

Screen Shot 2021-01-30 at 12 54 32 PM

- function to populate message:

Screen Shot 2021-01-30 at 12 54 59 PM

Send Mail Button

  • Button structure

Screen Shot 2021-01-30 at 12 57 15 PM

  • BackEnd: Pass template iD + User Address

Front End: Screen 1 Gallery

Screen 1

User story: Browsing campaigns to support, clicking a card goes to screen 2 via Vue Show component transition (everything is ocourring on the same page)

Screen Shot 2021-01-25 at 9 53 53 PM

Feature breakdown

  • Amplify banner
  • purpose, approach, community container
  • grid structure gallery
  • card structure
  • hover
  • 'add a campaign' button

Resources

Building features

Campaign Card routing from backend info

Screen Shot 2021-01-25 at 11 39 34 PM

Creating the Grid - Code Reference

Screen Shot 2021-01-25 at 11 08 16 PM

Adding a campaign

Hover

  • trigger: whenever the campaign card is hovered over

    • The v-hover component is a wrapper that should contain only one child element, and can trigger an event when hovered over. In order for v-hover to work properly, either the value prop should be set to true or the wrapped element should contain v-slot="{ wrapper }".
  • display: code reference for the below

Screen Shot 2021-01-25 at 10 58 58 PM

Auth0 Implementation

Issue

Auth0 does not accept callback urls ending with a wildcard such as /campaign/* but we require users to log in from any campaign page, such as campaign/1, campaign/2, etc.

Fix

We've attempted to implement a single callback url (e.g. /campaign) that handles redirect to url with campaign id in LoginButton.vue file following the logic presented in solution one here.

Remaining

Currently, /campaign does not exist as a page in our app, only /campaign/campaignId does, so we need to create an empty page (e.g. /campaign/callback) that handles this redirect.

Display letter object with template_id

Purpose: Use Lob to retrieve html that is displayed for the letter once representative is selected

Screen Shot 2021-05-22 at 6 52 09 PM

1. This is triggered by selectRepresentative in LetterDisplay.Vue

2. Call backend for template_id (hardcode this variable until backend gives you variable:)

Screen Shot 2021-05-22 at 7 29 48 PM

3. Use GET Function from lob to retrieve the template object via template_id, use html attribute to display current letter Docs

Screen Shot 2021-05-22 at 7 25 20 PM

Review letter: User Input

Context

Part of the series of panels for sending letter OpenSourceFellows/amplify#50 . This screen comes after the user has reviewed the advocacy letter.

Screen Shot 2021-09-07 at 4 44 43 PM

To do

  • input for name: sent via lob ("from" field) and adds user name to volunteer data table
  • input fields for user address: text fields for street address, state, city, and zip. This will be verified in OpenSourceFellows/amplify#48
  • user guideline checkbox: user guidelines prohibit spam interactions, boolean in letters_sent: guidelines
  • required to transition to next screen
  • hyperlink to guidelines
  • sign up checkbox: give permission for advocacy groups to contact user. Added to letter sent boolean field: permissions
  • optional
  • add to volunteers table
  • distributed to marketing and the cause organization

Context:

User Story
As a constituent, I want to add my information to get updates and verify my identity

Data Structures

Screen Shot 2021-10-21 at 8 29 58 AM

Learn how to use with the wiki

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.