# ba-glass-client [![Build Status](https://hyc-waca-pipe-jenkins.swg-devops.com/buildStatus/icon?job=ba-glass-client)](https://hyc-waca-pipe-jenkins.swg-devops.com/blue/organizations/jenkins/BusinessAnalytics%2Fba-glass-client/branches/) ## Description Glass is an application framework that provides strong separation of concerns between components and a fully extensible UI at runtime. An example of this is [glass-foundation](https://github.ibm.com/BusinessAnalytics/glass-foundation), which implements Glass to provide the foundation for the IBM Cognos Analytics product. ba-glass-client is the repository which contains the client code for the Glass framework. Specifically, the primary purpose of ba-glass-client is to build a corresponding UI given a specification returned by the `perspectives/{perspectiveName}` endpoint of ba-glass-server. ## Usage ba-glass-client can be utilized by specifying it as an npm dependency i.e. `@waca/baglass: x.x.x`. ba-glass-client ships with bundled and unbundled source code, as well as a third party dependency bundle which contains all third party dependencies required by glass. ba-glass-client intends to work immediately out of the box while also allowing more advanced users full control to customize as required. ## Development ba-glass-client currently runs on node `v10.16.2` ### Build To build glass locally, run the following commands in the root directory after cloning the ba-glass-client repository: ``` npm install npm run build ``` ### Test ba-glass-client currently runs a combination of Intern [Intern](https://theintern.io/) and [Jest](https://jestjs.io/) tests. To run the intern tests, you will need to install [Selenium](https://www.seleniumhq.org/) as well as this [ChromeDriver](https://code.google.com/p/selenium/wiki/ChromeDriver). To run the tests, execute the following command: ``` npm run test ``` ### Pipeline ba-glass-client runs on the ASAP pipeline, whose build can be found [here](https://hyc-waca-pipe-jenkins.swg-devops.com/blue/organizations/jenkins/BusinessAnalytics%2Fba-glass-client/branches/). Artifacts are published to [this location](https://na.artifactory.swg-devops.com/artifactory/webapp/#/artifacts/browse/tree/General/hyc-ba-npm-virtual), and are automatically made available via npm. Travis is utilized to gate PRs, which in turn builds ba-glass-client and ensures all tests and linting rules are correct. ### Translations We are currently taking advantage of the new globalization pipeline to do our translations [pipeline-wiki](https://github.ibm.com/BusinessAnalytics/gp-helper/wiki) In order to run translations locally, you will need the following credentials: ``` # ~/gpCred.json this file in your home directory will need a pipeline credential one can be provided by team members or from the ca-glob-support slack channel ``` The following in your bash profile: ``` export GIT_TOKEN="your git token" export W3_USERNAME="your.email@ibm.com" export W3_PASSWORD="yourW3Password" ``` To run translations you will need to execute the following commands: ``` npm run translate-files ``` This will download machine translated files and request human translations. When human translations are ready, they can be downloaded by running: ``` npm run download-human-translations ``` In the case you receive a warning that the translation bundles are missing (they shouldn't be), you can run the following: ``` npm run create-translation-bundle ``` ### Sonar The sonar report for ba-glass-client can be found [here](http://ba-sonarqube.canlab.ibm.com:9000/dashboard?id=ba-glass-client).