Scale UI provides a graphical interface to interact with the Scale framework via its REST API. This project was generated with the Angular CLI and has been set up as an Angular workspace to allow for future expansion. The base UI project is named "developer".
Run npm run dev to start a development server for the developer project. Navigate to http://localhost:8080/. The app will automatically reload if you change any of the source files.
Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.
The contributing guide has detailed instructions for how to submit PR's, merging, tagging releases, and issue reporting.
Change "apiPrefix" in src/assets/appConfig.json to point to one of these proxies (defined in proxy.conf.json):
/mocks: built-in development server above with mock data/local: a locally installed Scale server/alphaand/oarfish: the live test clusters
A dynamic config file is loaded when the web app first starts, using values in assets/appConfig.json. Each key in this file will be camel-cased and injected into the Angular environments. JSON decoding is attempted for each value, allowing true/false or numerical values.
The defaults provided in this file are used for local development. Override them during deployment (mainly the API and auth sections).
When using the Docker image, any environment variable prefixed with SCALEUI_ is injected into the appConfig.json file. Environment variables are stripped of the prefix and lowercased, then injected into appConfig.json.
For example:
SCALEUI_MY_CONFIG_VALUE=trueis set when running the Docker image- On startup, the Docker image converts this to
"my_config_value": "true"and places it inappConfig.json - When the webapp is loaded in the browser,
"my_config_value"is converted tomyConfigValueand the value is converted from"true"totrue - A component or service then uses
environment.myConfigValue
These are the keys in appConfig.json / their environment variable equivalents (the default values) - and a description:
apiDefaultVersion/SCALEUI_API_DEFAULT_VERSION("v6") - the API version for building URL endpointsapiPrefix/SCALEUI_API_PREFIX("/mocks") - the prefix endpoint for building URL endpoints (defaults to mock API server for local dev)apiVersions/SCALEUI_API_VERSIONS([])authEnabled/SCALEUI_AUTH_ENABLED(false) - boolean for whether or not the auth is enabled for the backend (turned off for local dev against mock API)authSchemeType/SCALEUI_AUTH_SCHEME_TYPE("external") - how authentication is handled, eitherexternal,form, orgeoaxisauthSchemeUrl/SCALEUI_AUTH_SCHEME_URL("/api/login/") - the URL endpoint for the login route of the authentication backenddateFormat/SCALEUI_DATE_FORMAT("YYYY-MM-DD HH:mm:ss[Z]") - the Moment.JS format string for formatting all datesdefaultTheme/SCALEUI_DEFAULT_THEME("light") - the theme to default new users to, eitherlightordarkdocumentation/SCALEUI_DOCUMENTATION("http://ngageoint.github.io/scale/docs/index.html") - the full external link to documentation (used in the footer)siloUrl/SCALEUI_SILO_URL("/mocks/silo") - the full endpoint to SilothemeKey/SCALEUI_THEME_KEY("scale.theme") - the key for retrieving user-specified themes from their localStorageprimaryColor/SCALEUI_PRIMARY_COLOR("#017cce") - primary color in the theme (links, menus, etc), any rgba or hex valuesecondaryLightColor/SCALEUI_SECONDARY_LIGHT_COLOR("#5c97bf")secondaryDarkColor/SCALEUI_SECONDARY_DARK_COLOR("#24567f")logoImageCss/SCALEUI_LOGO_IMAGE_CSS("") - any styles applied directly to the logo elementlogoImage/SCALEUI_LOGO_IMAGE("") - any URL or data URL for the logo at the top, defaults to the standard Scale logobannerMessage/SCALEUI_BANNER_MESSAGE("") - informational banner to show at launchbannerType/SCALEUI_BANNER_TYPE("info") - type of banner message; select frominfo(default),success,warning, ordanger
Any URL to a direct image can be used, as well as any data URL. Using a data URL allows the entire logo to reside in an environment variable or the appConfig.json, without having to host it externally. An image should be base64-encoded, and SVG images can be used directly, as long as they are properly escaped.
Run ng test developer to execute the unit tests via Karma.
Run npm run builddev:prod to build the project. The build artifacts will be stored in the dist/ directory. The build artifacts are needed prior to creating a Docker image.
To get more help on the Angular CLI use ng help or go check out the Angular CLI README.