Git Product home page Git Product logo

townhallsubmission's Introduction

townHallSubmission

submission site for new town hall events

Contributing

Communication

Anyone who is actively contributing to this project can become a member of this GitHub group, and join our slack channel. Please contact us at [email protected]

Development Process

  • Open an issue in the repository describing the feature you intend to work on, or assign yourself to an issue.
  • In the comments of your Pull Request, point out which issue you've resolved and how.

Dev Environment

Firebase is both a real-time database and hosting platform. This project is bundled using webpack. In order to get started in the development environment be sure to follow these steps in the command line:

  • npm i
  • npm run watch (will start webpack dev server)

By default it will run on port 8080.

Our production build is generated by using:

  • npm run build
  • npm run start

By default it will run on port 3000.

Trouble Shooting Dev Environment setup

MAKE SURE YOU ARE USING NODE VERSION v10 - v12

check which version of Node is running node -v should look something like this v12.16.1 use nvm, Node Version Manager, to change to Node v12

If another version of Node is running follow directions listed here (https://github.com/nvm-sh/nvm#installing-and-updating) to install nvm

  • curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash add nvm to path
  • export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

Change to Node v12

  • nvm install 12

ENVIRONMENT CHANGE

If the development environment changes since the last time npm i was run some packages may need to be re-installed or rebuilt

  • npm install node-sass
  • npm rebuild node-sass

Introduction to Firebase

Firebase is a readtime database; so you can add listeners for child_added or child_changed. These are very useful for our case where the data is being added and changed on a pretty constant basis. We use this to read in the event data.

Reading Data

var townHallsFB = firebase.database().ref('/townHalls/').orderByChild('dateObj');
townHallsFB.on('child_added', function (snapshot) {
  //child_added iterates over every child node at the endpoint /townHalls/
  //snapshot has a key, in our case snapshot.key is the event id.
  //calling .val() on snapshot will unpack the object at this endpoint.
  var newtownhall = new TownHall (snapshot.val());
})

Alternatively, sometimes it's important to be able to ensure a function is executed only after all the data is run. This is where once is useful. To read the data at an endpoint once, we chain .ref() with .once(). This returns a promise. We can do things with the data in the resolve function of the promise.

var townHallsFB = firebase.database().ref('/townHalls/').orderByChild('dateObj');
townHallsFB.once('child_added').then(function(snapshot) {
  //once returns the data at the endpoint /townHalls/ as an array like object
  snapshot.forEach(function(ele){
    //ele here is now like the snapshot returned in the 'child_added' call.
    var newtownhall = new TownHall (ele.val());
    })
  })

Writing Data

Writing data follows a similar pattern. We chain .ref() with .update([object]) or .set(value). We do not write data from the client side very often. For more information, check out the Firebase docs.

Help

If you need help on anything, or are unsure about how something is setup, please email [email protected].

townhallsubmission's People

Watchers

 avatar  avatar  avatar  avatar  avatar

townhallsubmission's Issues

Add Notice to top of Beta form

Something to alert/remind a volunteer this is no longer the right form.

"ALERT! This is no longer the primary submission form. Please use: [correct url]"

Reduce event types available in drop-down on Submission Form

Would love to reduce the # of Event Types available for each tab.

[FEDERAL] [In-Office]

EVENT TYPE options
Town Hall
Tele-Town Hall
Empty Chair Town Hall
Campaign Town Hall
Adopt-A-District/State
D.C. Event
Office Hours
Other
No New Events

[FEDERAL] [Candidate]

EVENT TYPE options
Campaign Town Hall
Other
Ticketed Event
No New Events

[STATE] [In-Office]

EVENT TYPE options
Town Hall
Tele-Town Hall
Empty Chair Town Hall
Campaign Town Hall
Adopt-A-District/State
Hearing
Office Hours
Other
No New Events

[STATE] [Candidate]

EVENT TYPE options
Campaign Town Hall
Other
Ticketed Event
No New Events

Page Shift's Left

This is the email I got from one of our volunteers Jerry Tobe [email protected]:

I tried shift+refresh. The form still shifted left after pasting an address and clicking any where else on the form. I apologize for mis-information in my earlier e-mail. The form shifts left after entering the address (I copy and paste the address to the form.) and I click any where else on the form. I don't have to enter data in any other field. I've run several tests. The form shifts left at different points in the sequence of entering data and using the "Pg Dn" key. The result is I can't diffinitively say that the form shifts left when information is entered in different sequences. I think the form will always shift left between pasting an address, the date and time and pressing the "Pg Dn" key if the information is entered in the normal sequence. I'm unable to post events at this time.

old addresses auito-populating

If you click on the Address field and then click elsewhere, it'll auto-populate an Address from a previous submission.

old address

Create warning on Submission form for submitting past event

We do submit past events we've missed from time to time, but the vast majority of "past" events submitted are typos that need correcting.

Can we create a "Did you mean to submit an event in the past?" for past dates entered in date field?

Similarly, but less frequent, a "Did you mean to submit an event in 2020 [or any other future year]?" warning for non-2019 events?

Amend submission form for TeleTH entries

Require Address.

And, ideally, autogenerate zip code if city/state is entered. (This is taking up a lot of volunteer and staff time to look up zip codes for these)

"You've Submitted" Number Count

The number of events submitted isn't increasing after submitting an event. My number stayed at 179 after submitting 2 events.

requesting roles/campaign

when a user requests a person, they get the whole object back.
then they get buttons that are for their current role and, if it exists, any campaign,

Data Object Display on MobileView Update

Fix data object display view
-If large enough object, current drawer will cover entire site

To Reproduce:

  1. Access submission mobile site
  2. Add enough data in form so 'Data Object' covers page
  3. Select 'Data Object'
  4. No way to close Drawer showing raw data

handle recurring events better

Creating a recurring event populates all the events with the correct dates and with an end date.
Like making an event in google calendar ("recurring first sunday of every month until 2020")

Add automatic disclaimer to all in-person events

For:

Town Halls
Campaign Town Halls

"Town Hall Project is posting this event for public information. We strongly urge event hosts and constituents to adhere to local public health guidelines and prioritize personal and community safety at all times."

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.