The Angular frontend for fabric8 online (OpenShift.IO)
TypeScript HTML CSS JavaScript Shell Ruby Groovy
Switch branches/tags
Clone or download
invincibleJai and corinnekrych fix(codebases): adds security alert under toggle feature (#3153)
* fix(codebases): adds security alert under toggle feature

* fix(cveNotification): group codebases features
Latest commit 656d47a Jul 18, 2018
Permalink
Failed to load latest commit information.
.github chore(docs): remove a dulicate issue_template Nov 22, 2017
config fix(launcher): removes validate* functions from dependency check serv… Jul 13, 2018
design doc(feature-flag); add images for wiki page (#2734) Apr 12, 2018
environments fix(pipelines) : change in input required modal to check if jenkins i… Jun 21, 2018
gpg chore(build): include gpg keys in git repo Mar 8, 2017
openshift fix(pipelines): updates env in template for build (#3041) Jun 18, 2018
src fix(codebases): adds security alert under toggle feature (#3153) Jul 18, 2018
.codecov.yml chore(coverage.codecov): publish coverage report to codecov (#1368) May 30, 2017
.dockerignore revert: Revert "Update .dockerignore" May 30, 2018
.editorconfig update editor config Nov 15, 2016
.gitignore fix(gitignore): add generated lint folder (#2985) Jun 5, 2018
.htmlhintrc fix(htmlhint): change tagname case requirements Sep 8, 2017
.nvmrc Import of the AngularClass Start example under the MIT license. Nov 15, 2016
.stylelintignore fix(linters): Add runtime-console to stylelint checks Oct 26, 2017
.stylelintrc fix(pipelines): Fix broken animations on running pipelines (#2970) May 31, 2018
CODEOWNERS fix(codeowners): update Codeowners automation file Nov 9, 2017
Dockerfile whitespace Feb 20, 2017
Dockerfile.builder fix(build): add gcc-c++ to build Apr 27, 2018
Dockerfile.deploy Update base nginx v to include asset cache control (#2665) Mar 25, 2018
Dockerfile.deploy.rhel fix(build): Move to Quay.io (#3033) Jun 15, 2018
Jenkinsfile Revert references to pipeline library testing branch (#2821) Apr 28, 2018
LICENSE update the license to reflect the code being based on AngularClass Nov 15, 2016
README.md fix(test): update the readme to reference the e2e tests Jun 1, 2018
cico_build_deploy.sh fix(build): Move to Quay.io (#3033) Jun 15, 2018
cico_run_tests.sh fix(build): Move to Quay.io (#3033) Jun 15, 2018
docker-compose.yaml Add Docker build configs Nov 15, 2016
docker-entrypoint.sh (fix): restores files removed by previous commit for EE tests Apr 13, 2017
fix-git-repo.sh chore(build): attempt to add semantic-release Mar 5, 2017
google-chrome.repo (fix): added missing google chrome repo file Apr 13, 2017
karma.conf.js Import of the AngularClass Start example under the MIT license. Nov 15, 2016
package-lock.json fix(version): update fabric8-planner to 0.50.26 (#3159) Jul 17, 2018
package.json fix(version): update fabric8-planner to 0.50.26 (#3159) Jul 17, 2018
protractor.conf.js Import of the AngularClass Start example under the MIT license. Nov 15, 2016
protractor.config.js Use chromedriver instead of phantomjs Aug 14, 2017
protractorEE.config.js fix(tests): Part 1 URL tests May 24, 2017
release.groovy fix(pipelines) : change in input required modal to check if jenkins i… Jun 21, 2018
run_functional_tests.sh fix(tests): update tests to run on MacOS (#1998) Oct 18, 2017
run_unit_tests.sh Mostly fix tests for #129 Feb 20, 2017
template.sh fix(build): add support for templated env vars Mar 17, 2017
tsconfig-aot.json fix(tsconfig): define paths for angular and rxjs Jun 13, 2018
tsconfig-test.json chore(build): remove comments from json file Oct 13, 2017
tsconfig.json fix(tsconfig): define paths for angular and rxjs Jun 13, 2018
tslint.json fix(build): add lint rules Jan 8, 2018
typedoc.json Import of the AngularClass Start example under the MIT license. Nov 15, 2016
upload_to_codecov.sh chore(coverage.codecov): publish coverage report to codecov (#1368) May 30, 2017
version_number.js fix(build): show build version Mar 9, 2017
webpack.config.js Add a Performance config to run all performance checks. Nov 17, 2016

README.md

fabric8-ui

Build Status codecov

Development environment

Run fabric8-ui with remote backends

You need to setup your shell to point to the right cluster so that it can talk to the required back end services like KeyCloak, WIT, Forge, OpenShift etc.

We provide various sample environments out of the box which make it easier to get started. They are all located as bash scripts in environments.

The default one you should use when you want to develop on the console is to reuse openshift.io production cluster:

source environments/openshift-prod-cluster.sh

There are others too. For example if you want to try run fabric8 locally on minishift and connect fabric8-ui to it then try:

source environments/local-cluster.sh

NOTE: If you want to target a local WIT backend, check our wiki How To pages.

Build and Run

Requires node version 8.3.0 and npm 5.3.0. Consider using Node Version Manager.

Run npm install. This will download all the required dependencies to be able to start the UI.

Run npm start. This will start the UI with live reload enabled. Then navigate to http://localhost:3000.

VS Code

Run ext install EditorConfig to read the .editorconfig file

Feature flag

To learn how to toggle your work in progress development, read our wiki page on fabric8-toggles.

HTML, CSS and Less

| Code Guidelines

fabric8-ui uses HTML5 elements where appropriate, and practices practicality over purity. Use the least amount of markup with the fewest intricacies as possible.

Attribution order, syntax definitions and declaration order are an important aspect of the fabric8-ui code and should be followed according the the guidelines.

fabric8-ui uses Less for it's stylesheets. If you find yourself wanting to create a shared style that multiple components will use, then we recommend adding it to an existing .less file in the src/assets/stylesheets/shared/ directory. Only update these styles if you are making a truly global style, and are going to synchronize your changes across all of the various UI projects.

If you only want to make a change to a specific component, do so in that component's .less file, according to Angular best practices.

The file osio.less is imported into every component Less file using @import (reference), so all files inside of the /shared directory will be used by each component.

Code Quality

fabric8-ui utilizes stylelint and htmlhint to check the less and html code. As part of each linter, we include three files: .stylelintrc, .stylelintignore and .htmlhintrc.

The .stylelintrc configuration file controls our configuration for the stylelinter, which only checks folders and files that are not included in the .stylelintignore file. This allows us to exclude certain areas of the application, as needed.

The .htmlhintrc configuration file controls our HTML verification configuration. In the creation of this configuration, we have taken into account the various Angular elements that will exist in the HTML pages.

Running the code quality checks

Each linter is built into the build process, so running npm run build or npm start will display any errors, their location (file name and line number), and any error message(s). Whenever a file that is watched by the code quality checks is changed, the build (if started with npm start) will re-run, checking only the altered files.

If you would like to run either of these checks individually, without kicking off a full build, you can do so by installing stylelint and htmlhint globally:

npm install stylelint -g
npm install htmlhint -g

After installing stylelint and htmlhint globally, you can run the following commands:

  • stylelint "**/*.less"

This will run stylelint against all .less files in fabric8-ui/src, using the .stylelintrc configuration file.

  • htmlhint

This will run htmlhint against all html files in fabric8-ui/src, using the .htmlhintrc configuration file. This command will not ignore the files and folders dictated in the webpack.common.js file, leading to the possibility of errors being displayed that will not appear at build time.

Alternatively, if you would like to check a subset of folders, or a specific file, you can do so by altering your htmlhint command:

  cat src/app/layout/header/header.component.html | htmlhint stdin

Integrations

fabric8-ui uses rxjs to provide loose coupling between modules (both those in the code base and those integrated via NPM). To do this, fabric8-ui makes extensive use of the Broadcaster.

Context

Space changed

When the current space the user is viewing changes, fabric8-ui broadcasts with the key spaceChanged and the
new Space as the payload.

UI integrations

Notifications

To send a notification to the user, the module should import ngx-fabric8-wit and inject the Notifications service, and call the message() method, passing in a Notification. You can subscribe to the result of message() to observe any NotificationActions that result from the notification.

Working with multi-level depenendencies

Let's consider a scenario wher you have an NPM module 'C' which sits inside another NPM module 'B' which is included in the parent module 'A'. During development, it is very common to use npm link to create a symlink and test the changes automatically. In this case, there is a high possbility for the parent module 'A' to be totally unaware of the existence of npm module 'C' as the symlinks don't get propagated all the way up. As a result, you might end up seeing the following error in the parent module 'A':

Module not found: Error: Can't resolve 'C' in ...

To address this, we can make the parent module 'A' be aware of the existence of 'C', by making changes in

tsconfig.json

of the parent module 'A'.

Inside "compilerOptions", Add an object key, "baseUrl" which basically identifies the base of the project and all the other urls are relative to this. Add an object key, "paths" as below

{
  "compilerOptions": {
    .
    .
    .
    "baseUrl": ".",
    "paths": {
      .
      .
      .
      "C": ["node_modules/B/node_modules/C"] //relative to the base url
    }
  }
}

By doing this, parent module A now is aware of the existence of the grand child 'C'. This can be modified for n-level dependencies. If your project builds using AOT or in other words if your project uses tsconfig-aot.json or similar, same things can be handled over there as well.

Continuous Delivery & Semantic Releases

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 (documented below). 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 versioning rules.

Commit Message Format

A commit message consists of a header, body and footer. The header has a type, scope and subject:

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

The header is mandatory and the scope of the header is optional.

Any line of the commit message cannot be longer 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.

Revert

If the commit reverts a previous commit, it should begin with revert:, followed by the header of the reverted commit. In the body it should say: This reverts commit <hash>., where the hash is the SHA of the commit being reverted.

Type

If the prefix is fix, feat, or perf, it will always appear in the changelog.

Other prefixes are up to your discretion. Suggested prefixes are docs, chore, style, refactor, and test for non-changelog related tasks.

Scope

The scope could be anything specifying place of the commit change. For example $location, $browser, $compile, $rootScope, ngHref, ngClick, ngView, etc...

Subject

The subject contains succinct description of the change:

  • use the imperative, present tense: "change" not "changed" nor "changes"
  • don't capitalize first letter
  • no dot (.) at the end

Body

Just as in the subject, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.

Footer

The footer should contain any information about Breaking Changes and is also the place to reference GitHub issues that this commit Closes.

Breaking Changes should start with the word BREAKING CHANGE: with a space or two newlines. The rest of the commit message is then used for this.

A detailed explanation can be found in this document.

Based on https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit

Examples

Appears under "Features" header, pencil sub-header:

feat(pencil): add 'graphiteWidth' option

Appears under "Bug Fixes" header, graphite sub-header, with a link to issue #28:

fix(graphite): stop graphite breaking when width < 0.1

Closes #28

Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation:

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.

The following commit and commit 667ecc1 do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header.

revert: feat(pencil): add 'graphiteWidth' option

This reverts commit 667ecc1654a317a13331b17617d973392f415f02.

Commitizen - craft valid commit messages

Commitizen helps you craft correct commit messages. Install it using npm install commitizen -g. Then run git cz rather than git commit.

Running End-to-End (E2E) Tests

A set of E2E tests have been written to verify the operation of major features such as the creation of a build pipeline.

These E2E tests are configured to be run locally in a shell, locally in a docker container, and in a docker container in Centos CI. The tests can be run against a local or remote server by specifying the server's URL as a parameter to the tests.

The E2E tests are available in this repo: https://github.com/fabric8io/fabric8-test

The full set of instructions on installing and executing the E2E tests are avalable here: https://github.com/fabric8io/fabric8-test/blob/master/ee_tests/README.md