Skip to content

Ecotrust/wc-data-registry

Repository files navigation

wc-data-registry

Data Registry for the West Coast Governors Alliance

Quick Start

Install Jekyll site generator (may need to install ruby and gem first):

gem install jekyll

Install Bower package manager (may need to install node and npm first):

npm install -g bower

Install Grunt task runner:

sudo npm install -g grunt-cli

Clone this repository if you haven't already and cd into the top-level directory.

Install dev dependencies into node_modules directory:

npm install

Install frontend Javascript libraries into bower_components:

bower install

(Optionally) Run tests

To successfully run tests you must implement the following workaround fix - http://stackoverflow.com/questions/24270389/angularjs-controller-unit-test-with-jasmine. In _includes/bower_components/angular-mocks/angular-mocks.js find the function isSpecRunning and change it as follows:

function isSpecRunning() {
  //return currentSpec && (window.mocha || currentSpec.queue.running);
  return !!currentSpec;
}

Now run the test suite

grunt test

Serving The App

The following Jekyll command will compile the source code from site_raw into _site_generated, and start serving the app locally on port 4000. It will also watch for file changes in site_raw and recompile automatically.

jekyll serve

NOTE if you have a version of Jekyll newer than v.2.5.3, (and you encounter errors), you can run an earlier version of Jekyll like this:

jekyll _2.5.3_ serve

You should now be able to view the home page in your browser at http://127.0.0.1:4000

Last step. If you don't have a local instance of Geoportal and SOLR running, for example if you are running a local development version, you will need to change where this app looks to connect to them.

To change the URL that the app connects to for Geoportal change scope.geoportalUrl in:

site_raw/_includes/js/directives/Results.js

To change the URL that the app connects to for SOLR change solrUrl in:

s