/reps-app

App to take location data and show districts/reps/actions etc.

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

reps-app

Homepage app for CA-StateStrong Contains functionality linking Mapping, Reps, Actions

Clone the repo:

Download and install Git.

(Optional) Download and install Github Desktop.

Clone this repository by clicking on the "Clone or Download" button above and click "Open in Desktop". After cloning the repository, navigate to the folder containing the repository.

Check that src/local_constants.js contains the following line: INJECTION_DEV_MODE = true and if you are working with the DEV site DEV_SITE_MODE = true else = false

Ask someone in ISF for the KEYS.js file and copy it into the src folder of the repository. If you received a zip file with the KEYS.js contained inside, only copy the KEYS.js itself to the src folder.

Setup:

Start your local server (you can pick Docker or Local):

Docker

Local:

  • Install Node if you don't have it already. If on Windows, you will probably have to restart your computer.

  • Open up a terminal (or command prompt on Windows) and navigate to where you cloned the repository.

  • Run npm install The install command may take several minutes and may produce several warnings. These are safe to ignore.

  • Run npm run watch Runnning this command will set up the local webserver bundle. It shouldn't produce any errors.

Inject your local code into the test website:

  • Install chrome plugin 'Custom Javascript for Websites'.

  • Go to https://0.0.0.0:9000. You should see a bad certificate error. Click on the ADVANCED link on the Chrome error page, and click "Proceed anyway".

  • Go to the CA StateStrong website test page.

  • Click on the CJS plugin's icon, copy code from src/extension_injection.js into the plugin box and check 'enable cjs for this host'.

  • Reload the page. It should now load with a working map. Any changes you make to the javascript should now automatically be injected into the page.

Style

This is just a rough guideline for style. Not all these guidelines have been followed in the past.

To Deploy to CA_SS site

check that constants.js INJECTION_DEV_MODE = false

run docker-compose run web npm run build

go to the google bucket and replace the bundle.js file with the new one.