Skip to content

almighty/fabric8-planner

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fabric8 Planner

Jenkins Jenkins Codecov.io Semantic Release

Fabric8 Planner is a task planner and issue tracker front-end.

It uses Fabric8 Work Item Tracker as the back-end.

Running the app

Set NODE_ENV

If you’re just trying to test the application, please use inmemory mode which will load the app with mock data for you. If you, however, want to contribute to the codebase, unset it back or to "development" (default) mode and rebuild.

$ export NODE_ENV=inmemory # (1)
$ export NODE_ENV=development # (2)
$ export NODE_ENV=production # (3)

<1> In-memory mode for trying-out the app
<2> Development mode for contributing to the source
<2> Production mode for deploying the application

Once you’re done setting the environment, you can proceed with the next step(s)

Note
If you’re directly trying to run the app in dev mode, you can skip this step, as NODE_ENV is treated as "development" by default.
Important
If you’re trying out the app "inmemory" mode, then after running the app (as explained in the next step) please don’t forget to visit this URL to load it up with mock data, including the authenticated/logged-in user.

First run

If you’re trying to run the app for the first time:

$ npm install

Then, start the app with:

$ npm start

Fresh run

If you trying to refresh your installation, you need to run:

$ npm run reinstall

Then, start the app with:

$ npm start

Testcase run

To run the linter, build validator, unit tests, and functional test use:

$ npm test

Other useful scripts

The package.json file’s scripts: section lists all the tasks we run.

Here are some of the most useful/frequently used scripts you may need to run:

Scipt Command Description

Lint

$ npm run lint

Runs the TypeScript and Angular 2 linter

Validation

$ npm run validate

Validates the webpack build

Unit Tests

$ npm run test:unit

Runs the unit tests

Functional Tests

$ npm run test:func

Runs the functional tests

Continuous Tests

$ npm run watch:test

Looks for changes in source code and runs unit tests

CI scripts

There are some other scripts for CI-environment; such as run_unit_tests.sh, run_functional_tests.sh, cico_run_tests.sh, cico_build_deploy.sh etc. They’re generally not meant to be run manually.

Building the app

Production build

To generate production build, set API URL and run build script as follows:

$ npm run build:prod

The build output will be under dist directory.

To create a docker image, run this command immediately after the production build completion:

$ docker build -t fabric8-planner-deploy -f Dockerfile.deploy .

Library Build

For production:

To build the Planner as an npm library, use:

$ npm run build

The created library will be placed in dist.

Important
You shouldn’t ever publish the build manually, instead you should let the CD pipeline do a semantic release.

For development:

To build fabric8-planner as an npm library and embed it into a webapp such as fabric8-ui, you should:

Step 1: Run npm run watch:library in the source directory

This will build fabric8-planner as a library and then set up a watch task to rebuild any ts, html and scss files you change.

Step 2: Run npm link <path to fabric8-planner>/dist-watch

In the webapp into which you are embedding. This will create a symlink from node_modules/fabric8-planner to the dist-watch directory and install that symlinked node module into your webapp.

Step 3: Run your webapp in development mode

Make sure you have a watch on node_modules/fabric8-planner enabled. You will have access to both JS and SASS sourcemaps if your webapp is properly setup.

Note
fabric8-ui is setup to do reloading and sourcemaps automatically when you run npm start.

Running with the launcher script

The above integration can be run with the provided launcher script in scripts/. See the script for details on how to run it.

CSS and SASS

fabric8-planner uses SASS for it’s stylesheets. It also uses the Angular emulation of the shadow dom, so you will normally want to place your styles in the .component.scss file next to the html and the typescript.

If you find yourself wanting to create a shared style that multiple components will use, then we recommend adding it as a mixin to src/assets/stylesheets/_planner-mixins.scss. The mixins are imported in to every .component.scss file. You can then create a real class by doing something like

.my-class {
  @include my-class;
}

We use mixins to avoid polluting components with uncessary style classes, and to avoid an explosion of shared files.

The src/assets/stylesheets/ directory includes a shared directory. These are shared global styles that we will refactor out in to a shared library at some point. Only update these styles if you are making a truly global style, and are going to synchronise your changes across all the various UI projects.

Contributing to the app

The development guide is part of the contributors' instructions. Please check it out in order to contribute to this project.

Packages

No packages published

Languages

  • HTML 83.5%
  • TypeScript 9.0%
  • JavaScript 5.9%
  • CSS 1.2%
  • Shell 0.3%
  • Ruby 0.1%