Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

fabric8-ui/ngx-fabric8-wit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ngx-fabric8-wit

Common services for working with the Fabric8 Work Item Tracker

The work item tracker is located here. You can see how it is used in the front-end here.

The system we build is composed of several components existing in separate repos but still needing access to common information, like who is logged. These services were extracted to provide a shared set of services.

Getting started:

This library does not run on it's own. It must be imported.

npm install ngx-fabric8-wit

There are several services and a couple of models used by them available.

Space Service

You must provide the URL to API to do the login. To do this, you must provide a string with an OpaqueToken WIT_API_URL from ngx-fabric8-wit. We suggest using a factory provider for this. For example:

import { ApiLocatorService } from './api-locator.service';
import { WIT_API_URL } from 'ngx-fabric8-wit';

let authApiUrlFactory = (api: ApiLocatorService) => {
  return api.witApiUrl;
};

export let witApiUrlProvider = {
  provide: WIT_API_URL,
  useFactory: witApiUrlFactory,
  deps: [ApiLocatorService]
};

NOTE: ApiLocatorService is a service that we use to construct API URLs using patterns determined by our application architecture, you can implement this part however you like.

Finally you need to register witApiUrlProvider with a module or a component.

Building it

Install the dependencies:

npm install

If you need to update the dependencies you can reinstall:

npm run reinstall

Run the tests:

npm test

Build the library:

npm run build

Try it out locally.

We found that npm link doesn't fully work. You have to reference the library via file:. But you still need to create the link.

  • Start by running:

    npm link dist

  • Change this:

    "ngx-fabric8-wit": "X.X.X"

  • to this:

    "ngx-fabric8-wit": "file:/[LOCATION-TO-NODE-MODULES]/.nvm/versions/node/v6.9.1/lib/node_modules/ngx-fabric8-wit"

Continuous Delivery & Semantic Relases

In ngx-fabric8-wit we use the semantic-release plugin. That means that all you have to do is use the AngularJS Commit Message Conventions and send a pull request. Once the PR is merged, a new release will be automatically published to npmjs.com and a release tag created on github. The version will be updated following semantic versionning rules.

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject (full explanation):

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

You can simplify using this convention for yourself and contributors by using commitizen and validate-commit-msg.

Patch Release

fix(pencil): stop graphite breaking when too much pressure applied

Minor Feature Release

feat(pencil): add 'graphiteWidth' option

Major Breaking Release

perf(pencil): remove graphiteWidth option

BREAKING CHANGE: The graphiteWidth option has been removed. The default graphite width of 10mm is always used for performance reason.