Web application for displaying earthquake event pages.
ehunter-usgs Merge pull request #1556 from cswilson-usgs/issue-1531
Added shake-alert-map component and pipe
Latest commit 8fb6c0c Dec 6, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
e2e updated e2e tests Oct 11, 2018
hooks update scenario hook to check for true/false after bundle is compiled Nov 14, 2018
src fixed environment Dec 4, 2018
.dockerignore Removing eslint references. Aug 20, 2018
.gitattributes Initial angular application scaffold from cli. Feb 8, 2018
.gitignore Add alt for uncertainty image Apr 4, 2018
.travis.yml fixed option Jun 13, 2018
CODE_OF_CONDUCT.md Added administrative files. Including material icons and other style … Feb 8, 2018
CONTRIBUTING.md Added administrative files. Including material icons and other style … Feb 8, 2018
DISCLAIMER.md Added administrative files. Including material icons and other style … Feb 8, 2018
Dockerfile uncommented docker file Oct 25, 2018
Jenkinsfile.groovy commented out dependencies check and publish Sep 27, 2018
LICENSE.md Added administrative files. Including material icons and other style … Feb 8, 2018
README.md Added documentation for container building/running. Mar 19, 2018
angular.json need to clean up angular.json and package.json to remove old scripts … Nov 13, 2018
code.json Update code.json Feb 28, 2018
index.ts Implement shared regionInfoOverlays pipe Mar 28, 2018
karma.conf.js upgrade to angular 6 May 23, 2018
metadata.json Using updated template. Jenkins build using new dockerfile. Cleaning … Mar 19, 2018
package-lock.json added shake-alert pin, need to double check alert icon color Dec 3, 2018
package.json updated package.json to 1.18.0 Nov 26, 2018
protractor.conf.js fix linting, add .eslintrc Feb 23, 2018
proxy.conf.js Update event kml for scenarios Nov 6, 2018
tsconfig.json Added shared and core import path aliases. Aug 20, 2018
tslint.json Linting fixes. Aug 20, 2018

README.md

Earthquake Event Pages

Build Status Quality Badge Coverage Badge

This application is currently being overhauled to an Angular framework. To view the latest working code prior to this process, please view the master-pre-angular branch.

Alternatively, please review our previous releases.

This project was generated with Angular CLI version 1.6.7.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the -prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run npm run e2e to execute the end-to-end tests via Protractor.

NOTE: this uses npm run instead of ng in order to run using a custom e2e environment, and mock selected api requests for more stable testing data.

Docker

The application may be run as a Docker container. A public image is available on Docker Hub at https://hub.docker.com/r/usgs/earthquake-eventpages this can be run most simply with:

$ docker run -p HOST_PORT:80 -d usgs/earthquake-eventpages

The HOST_PORT should be replaced with a port on your container host that is not otherwise being used. One may then access the event pages at:

http://localhost:HOST_PORT/event/EVENT_ID

The HOST_PORT should be replaced with the same value used when starting the container. The EVENT_ID should be the event id for the event you wish to view, for example "us2000ahv0".

Customization

When starting the container, there are several options from the usgs/nginx image that remain available. See https://hub.docker.com/r/usgs/nginx/ for details on these options.

Additionally, one may specify a custom BASE_HREF environment variables to have the container use a different path, for example:

$ docker run -p HOST_PORT:80 -d \
    -e BASE_HREF=some/path \
    usgs/earthquake-eventpages

It is important to note that the BASE_HREF should have neither a leading or trailing slash. Intermediate slashes are acceptable, for example:

Bad

  • /somepath
  • /some/path
  • /some/path
  • /some/path/
  • somepath/

Good

  • somepath
  • some/path

One may then access the event pages at:

http://localhost:HOST_PORT/BASE_HREF/EVENT_ID

Building

One may additionally choose to build the image from source. This is facilitated using the included Dockerfile and may be accomplished with:

$ docker build -t IMAGE_NAME:IMAGE_TAG .

One may additionally specify a default BASE_HREF as a build argument. This will cause all containers based on the generated image to use the provided BASE_HREF by default.

$ docker build --build-arg BASE_HREF=some/path

While containers will use the specified value by default, this value may still be overridden at runtime as described above.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.