Git Product home page Git Product logo

mobile's People

Contributors

ariiah avatar chiuki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mobile's Issues

Differentiate between no contests and not processed

Since we are adding election information to Firebase gradually, how do we indicate that a division has no contests in a particular election?

Scenarios

No upcoming election node under any of the divisions

Display "We could not find any election information"

Some divisions have an upcoming election node

Display information from the election nodes found, plus "Election information not complete"

All divisions have an upcoming election node

Information is complete. Election node will have an empty list of contests if there are no contest

Example

Say a voter belongs to the following divisions:

  • ocd-division,country:us
  • ocd-division,country:us,state:ca
  • ocd-division,country:us,state:ca/place:palo_alto

If the upcoming election only has state contests, the country and place nodes will still have an election node, with empty contests. The UI will show just the state contests. However, say the place node does not have any upcoming election nodes, the warning "Election information not complete" will be added.

❓ Does Firebase allow empty lists? Or is it better to have a boolean noContests and set it to true?

Bulk import into cloud firestore

The election data needs to be imported into cloud firestore. Best will be a command-line tool that ingest csv. If that's not possible, perhaps a cloud function that syncs with Google Sheet?

Firebase keys

Firebase keys requirements:

  • UTF-8 encoded
  • Maximum of 768 bytes
  • Cannot contain ., $, #, [, ], /, or ASCII control characters 0-31 or 127.

Division ID

Google Civic Information API returns Open Civic Data Divisions (ocd).

e.g. ocd-division/country:us/state:ks/county:wyandotte/council_district:2

What is the best way to transform that into a Firebase key?

❓ It contains /, which is not allowed by Firebase
Convert / to ,? Or another separator?

❓ It is long.
Trim the ocd-division/country:us prefix and assume the civic api will always return ocd division ids in the US?

Division-Contest Pair

To map data returned from voterInfoQuery into supplementary data in Firebase, we need to look at the division (level or district), plus contest .

❓ What is a good divider between division and contest?
Is + good? e.g. administrativeArea2+Lieutenant Governor

Update iOS icon

The Android icon is generated from favicon.ico but it's not big enough for iOS since it seems to want a 1024x1024 one? I will see if I can get a vector version of the Ballot logo to make the assets for iOS.

Add thumbnails to contest page

  • Copy from candidate.dart to contest.dart to show candidate thumbnail in the ListTile
  • Remove padding from the left
  • Add placeholder when there is no photo url

Choose party for primaries

Need a drop down to pick which party to display, instead of show all the contests.

Data from Google Civic Information API
{
 "kind": "civicinfo#voterInfoResponse",
 "election": {
  "id": "4494",
  "name": "Wyoming Primary Election",
  "electionDay": "2018-08-21",
  "ocdDivisionId": "ocd-division/country:us/state:wy"
 },
 "normalizedInput": {
  "line1": "1418 Elk Street",
  "city": "Rock Springs",
  "state": "WY",
  "zip": "82901"
 },
 "contests": [
  {
   "type": "Primary",
   "primaryParty": "Democratic",
   "ballotTitle": "Democratic - United States Senator",
   "office": "United States Senator",
   "level": [
    "country"
   ],
   "district": {
    "name": "Federal District",
    "scope": "national"
   },
   "numberElected": "1",
   "numberVotingFor": "1",
   "ballotPlacement": "2",
   "candidates": [
    {
     "name": "Gary Trauner",
     "party": "Democratic"
    }
   ],
   "sources": [
    {
     "name": "Voting Information Project",
     "official": true
    }
   ]
  },
  {
   "type": "Primary",
   "primaryParty": "Republican",
   "ballotTitle": "Republican - United States Senator",
   "office": "United States Senator",
   "level": [
    "country"
   ],
   "district": {
    "name": "Federal District",
    "scope": "national"
   },
   "numberElected": "1",
   "numberVotingFor": "1",
   "ballotPlacement": "2",
   "candidates": [
    {
     "name": "JOHN BARRASSO",
     "party": "Republican"
    },
    {
     "name": "Roque De La Fuente",
     "party": "Republican"
    },
    {
     "name": "DAVID DODSON",
     "party": "Republican"
    },
    {
     "name": "CHARLES HARDY",
     "party": "Republican"
    },
    {
     "name": "JOHN HOLTZ",
     "party": "Republican"
    },
    {
     "name": "Anthony Van Risseghem",
     "party": "Republican"
    }
   ],
   "sources": [
    {
     "name": "Voting Information Project",
     "official": true
    }
   ]
  },
  {
   "type": "Primary",
   "primaryParty": "Republican",
   "ballotTitle": "Republican - United States Representative",
   "office": "United States Representative",
   "level": [
    "country"
   ],
   "district": {
    "name": "Wyoming Congressional District One",
    "scope": "congressional"
   },
   "numberElected": "1",
   "numberVotingFor": "1",
   "ballotPlacement": "3",
   "candidates": [
    {
     "name": "RODNEY MILLER",
     "party": "Republican"
    },
    {
     "name": "LIZ CHENEY",
     "party": "Republican"
    },
    {
     "name": "BLAKE STANLEY",
     "party": "Republican"
    }
   ],
   "sources": [
    {
     "name": "Voting Information Project",
     "official": true
    }
   ]
  },
  {
   "type": "Primary",
   "primaryParty": "Democratic",
   "ballotTitle": "Democratic - United States Representative",
   "office": "United States Representative",
   "level": [
    "country"
   ],
   "district": {
    "name": "Wyoming Congressional District One",
    "scope": "congressional"
   },
   "numberElected": "1",
   "numberVotingFor": "1",
   "ballotPlacement": "3",
   "candidates": [
    {
     "name": "Travis Helm",
     "party": "Democratic"
    },
    {
     "name": "GREGORY HUNTER",
     "party": "Democratic"
    }
   ],
   "sources": [
    {
     "name": "Voting Information Project",
     "official": true
    }
   ]
  },
  {
   "type": "Primary",
   "primaryParty": "Democratic",
   "ballotTitle": "Democratic - Governor",
   "office": "Governor",
   "district": {
    "name": "State of Wyoming",
    "scope": "statewide"
   },
   "numberElected": "1",
   "numberVotingFor": "1",
   "ballotPlacement": "4",
   "candidates": [
    {
     "name": "KENNETH CASNER",
     "party": "Democratic"
    },
    {
     "name": "MICHAEL GREEN",
     "party": "Democratic"
    },
    {
     "name": "MARY THRONE",
     "party": "Democratic"
    },
    {
     "name": "REX WILDE",
     "party": "Democratic"
    }
   ],
   "sources": [
    {
     "name": "Voting Information Project",
     "official": true
    }
   ]
  },
  {
   "type": "Primary",
   "primaryParty": "Republican",
   "ballotTitle": "Republican - Governor",
   "office": "Governor",
   "district": {
    "name": "State of Wyoming",
    "scope": "statewide"
   },
   "numberElected": "1",
   "numberVotingFor": "1",
   "ballotPlacement": "4",
   "candidates": [
    {
     "name": "Bill Dahlin",
     "party": "Republican"
    },
    {
     "name": "Foster Friess",
     "party": "Republican"
    },
    {
     "name": "SAM GALEOTOS",
     "party": "Republican"
    },
    {
     "name": "MARK GORDON",
     "party": "Republican"
    },
    {
     "name": "HARRIET HAGEMAN",
     "party": "Republican"
    },
    {
     "name": "Taylor Haynes",
     "party": "Republican"
    }
   ],
   "sources": [
    {
     "name": "Voting Information Project",
     "official": true
    }
   ]
  },
  {
   "type": "Primary",
   "primaryParty": "Republican",
   "ballotTitle": "Republican - Secretary of State",
   "office": "Secretary of State",
   "district": {
    "name": "State of Wyoming",
    "scope": "statewide"
   },
   "numberElected": "1",
   "numberVotingFor": "1",
   "ballotPlacement": "5",
   "candidates": [
    {
     "name": "Edward Buchanan",
     "party": "Republican"
    }
   ],
   "sources": [
    {
     "name": "Voting Information Project",
     "official": true
    }
   ]
  },
  {
   "type": "Primary",
   "primaryParty": "Democratic",
   "ballotTitle": "Democratic - Secretary of State",
   "office": "Secretary of State",
   "district": {
    "name": "State of Wyoming",
    "scope": "statewide"
   },
   "numberElected": "1",
   "numberVotingFor": "1",
   "ballotPlacement": "5",
   "candidates": [
    {
     "name": "JAMES BYRD",
     "party": "Democratic"
    }
   ],
   "sources": [
    {
     "name": "Voting Information Project",
     "official": true
    }
   ]
  },
  {
   "type": "Primary",
   "primaryParty": "Democratic",
   "ballotTitle": "Democratic - State Auditor",
   "office": "State Auditor",
   "district": {
    "name": "State of Wyoming",
    "scope": "statewide"
   },
   "numberElected": "1",
   "numberVotingFor": "1",
   "ballotPlacement": "6",
   "candidates": [
    {
     "name": "JEFFREY DOCKTER",
     "party": "Democratic"
    }
   ],
   "sources": [
    {
     "name": "Voting Information Project",
     "official": true
    }
   ]
  },
  {
   "type": "Primary",
   "primaryParty": "Republican",
   "ballotTitle": "Republican - State Auditor",
   "office": "State Auditor",
   "district": {
    "name": "State of Wyoming",
    "scope": "statewide"
   },
   "numberElected": "1",
   "numberVotingFor": "1",
   "ballotPlacement": "6",
   "candidates": [
    {
     "name": "Kristi Racines",
     "party": "Republican"
    },
    {
     "name": "NATHAN WINTERS",
     "party": "Republican"
    }
   ],
   "sources": [
    {
     "name": "Voting Information Project",
     "official": true
    }
   ]
  },
  {
   "type": "Primary",
   "primaryParty": "Republican",
   "ballotTitle": "Republican - State Treasurer",
   "office": "State Treasurer",
   "district": {
    "name": "State of Wyoming",
    "scope": "statewide"
   },
   "numberElected": "1",
   "numberVotingFor": "1",
   "ballotPlacement": "7",
   "candidates": [
    {
     "name": "CURTIS MEIER",
     "party": "Republican"
    },
    {
     "name": "LELAND CHRISTENSEN",
     "party": "Republican"
    },
    {
     "name": "RONALD REDO",
     "party": "Republican"
    }
   ],
   "sources": [
    {
     "name": "Voting Information Project",
     "official": true
    }
   ]
  },
  {
   "type": "Primary",
   "primaryParty": "Republican",
   "ballotTitle": "Republican - Superintendent of Public Instruction",
   "office": "Superintendent of Public Instruction",
   "district": {
    "name": "State of Wyoming",
    "scope": "statewide"
   },
   "numberElected": "1",
   "numberVotingFor": "1",
   "ballotPlacement": "8",
   "candidates": [
    {
     "name": "JILLIAN BALOW",
     "party": "Republican"
    }
   ],
   "sources": [
    {
     "name": "Voting Information Project",
     "official": true
    }
   ]
  },
  {
   "type": "Primary",
   "primaryParty": "Republican",
   "ballotTitle": "Republican - State Representative 48",
   "office": "State Representative 48",
   "level": [
    "administrativeArea1"
   ],
   "district": {
    "name": "House District 48",
    "scope": "stateLower",
    "id": "48"
   },
   "numberElected": "1",
   "numberVotingFor": "1",
   "ballotPlacement": "86",
   "candidates": [
    {
     "name": "Clark Stith",
     "party": "Republican"
    }
   ],
   "sources": [
    {
     "name": "Voting Information Project",
     "official": true
    }
   ]
  }
 ],
 "state": [
  {
   "name": "Wyoming",
   "electionAdministrationBody": {
    "electionInfoUrl": "http://soswy.state.wy.us/Elections/Default.aspx",
    "physicalAddress": {
     "line1": "2020 Carey Avenue",
     "city": "Cheyenne",
     "state": "WY",
     "zip": "82001"
    },
    "addressLines": [
     "State Of Wyoming",
     "2020 CAREY AVE., STE 600",
     "CHEYENNE. WY 82002"
    ],
    "electionOfficials": [
     {
      "officePhoneNumber": "307-777-5860"
     }
    ]
   },
   "local_jurisdiction": {
    "name": "Sweetwater County Clerk",
    "electionAdministrationBody": {
     "electionInfoUrl": "http://www.sweet.wy.us/index.aspx?nid=65",
     "physicalAddress": {
      "line1": "80 West Flaming Gorge Way",
      "city": "Green River",
      "state": "WY",
      "zip": "82935"
     },
     "addressLines": [
      "Sweetwater County Office",
      "80 WEST FLAMING GORGE WAY SUITE 150",
      "GREEN RIVER. WY 82935"
     ],
     "electionOfficials": [
      {
       "officePhoneNumber": "307-872-3732"
      }
     ]
    },
    "sources": [
     {
      "name": "Voting Information Project",
      "official": true
     }
    ]
   },
   "sources": [
    {
     "name": "Voting Information Project",
     "official": true
    }
   ]
  }
 ]
}

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.