Homepage app for CA-StateStrong Contains functionality linking Mapping, Reps, Actions
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.
- Install docker
- If you added new modules to package.json, run 'docker-compose build' first
- Run
docker-compose up
-
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.
-
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.
This is just a rough guideline for style. Not all these guidelines have been followed in the past.
- One component per file
- Try to follow the presentational vs container patterns here: https://www.andrewhfarmer.com/react-ajax-best-practices/
- Also this guide: https://github.com/rwaldron/idiomatic.js
- Absolute imports: use
components/actions/ActionCard
instead of../../ActionCard
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.