From 3272bf2fadc22a98521f7f152ecd5022de313158 Mon Sep 17 00:00:00 2001 From: Will Abson Date: Tue, 12 Jul 2016 17:47:56 +0100 Subject: [PATCH] Initial process list component Refs #344 --- .../ng2-activiti-processlist/.editorconfig | 23 ++++ .../ng2-activiti-processlist/.gitignore | 13 ++ .../ng2-activiti-processlist/.travis.yml | 12 ++ .../ng2-activiti-processlist/LICENSE | 13 ++ .../ng2-activiti-processlist/README.md | 101 ++++++++++++++ .../ng2-activiti-processlist/angular-cli.json | 27 ++++ .../assets/license_header.txt | 16 +++ .../demo/.editorconfig | 10 ++ .../ng2-activiti-processlist/demo/.gitignore | 6 + .../ng2-activiti-processlist/demo/README.md | 19 +++ .../demo/browser-sync-config.js | 23 ++++ .../ng2-activiti-processlist/demo/index.html | 34 +++++ .../demo/package.json | 57 ++++++++ .../ng2-activiti-processlist/demo/src/main.ts | 33 +++++ .../demo/systemjs.config.js | 65 +++++++++ .../demo/tsconfig.json | 19 +++ .../ng2-activiti-processlist/demo/tslint.json | 124 ++++++++++++++++++ .../demo/typings.json | 7 + .../karma-test-shim.js | 88 +++++++++++++ .../ng2-activiti-processlist/karma.conf.js | 85 ++++++++++++ .../ng2-activiti-processlist.ts | 18 +++ .../ng2-activiti-processlist/package.json | 101 ++++++++++++++ ...ng2-activiti-processlist.component.spec.ts | 38 ++++++ .../src/ng2-activiti-processlist.component.ts | 31 +++++ .../ng2-activiti-processlist/tsconfig.json | 27 ++++ .../ng2-activiti-processlist/tslint.json | 121 +++++++++++++++++ .../ng2-activiti-processlist/typings.json | 7 + 27 files changed, 1118 insertions(+) create mode 100644 ng2-components/ng2-activiti-processlist/.editorconfig create mode 100644 ng2-components/ng2-activiti-processlist/.gitignore create mode 100644 ng2-components/ng2-activiti-processlist/.travis.yml create mode 100644 ng2-components/ng2-activiti-processlist/LICENSE create mode 100644 ng2-components/ng2-activiti-processlist/README.md create mode 100644 ng2-components/ng2-activiti-processlist/angular-cli.json create mode 100644 ng2-components/ng2-activiti-processlist/assets/license_header.txt create mode 100644 ng2-components/ng2-activiti-processlist/demo/.editorconfig create mode 100644 ng2-components/ng2-activiti-processlist/demo/.gitignore create mode 100644 ng2-components/ng2-activiti-processlist/demo/README.md create mode 100644 ng2-components/ng2-activiti-processlist/demo/browser-sync-config.js create mode 100644 ng2-components/ng2-activiti-processlist/demo/index.html create mode 100644 ng2-components/ng2-activiti-processlist/demo/package.json create mode 100644 ng2-components/ng2-activiti-processlist/demo/src/main.ts create mode 100644 ng2-components/ng2-activiti-processlist/demo/systemjs.config.js create mode 100644 ng2-components/ng2-activiti-processlist/demo/tsconfig.json create mode 100644 ng2-components/ng2-activiti-processlist/demo/tslint.json create mode 100644 ng2-components/ng2-activiti-processlist/demo/typings.json create mode 100644 ng2-components/ng2-activiti-processlist/karma-test-shim.js create mode 100644 ng2-components/ng2-activiti-processlist/karma.conf.js create mode 100644 ng2-components/ng2-activiti-processlist/ng2-activiti-processlist.ts create mode 100644 ng2-components/ng2-activiti-processlist/package.json create mode 100644 ng2-components/ng2-activiti-processlist/src/ng2-activiti-processlist.component.spec.ts create mode 100644 ng2-components/ng2-activiti-processlist/src/ng2-activiti-processlist.component.ts create mode 100644 ng2-components/ng2-activiti-processlist/tsconfig.json create mode 100644 ng2-components/ng2-activiti-processlist/tslint.json create mode 100644 ng2-components/ng2-activiti-processlist/typings.json diff --git a/ng2-components/ng2-activiti-processlist/.editorconfig b/ng2-components/ng2-activiti-processlist/.editorconfig new file mode 100644 index 0000000000..75a2477db7 --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/.editorconfig @@ -0,0 +1,23 @@ +# http://editorconfig.org + +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[package.json] +indent_style = space +indent_size = 2 + +[karma.conf.js] +indent_style = space +indent_size = 2 + +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/ng2-components/ng2-activiti-processlist/.gitignore b/ng2-components/ng2-activiti-processlist/.gitignore new file mode 100644 index 0000000000..3bea8a0c07 --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/.gitignore @@ -0,0 +1,13 @@ +npm-debug.log +node_modules +jspm_packages +.idea +typings +coverage +src/**/*.js +src/**/*.js.map +src/**/*.d.ts +demo/**/*.js +demo/**/*.js.map +demo/**/*.d.ts +!systemjs.config.js diff --git a/ng2-components/ng2-activiti-processlist/.travis.yml b/ng2-components/ng2-activiti-processlist/.travis.yml new file mode 100644 index 0000000000..ab817d7644 --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +node_js: + - v5 + - v4 + - '0.12' + - '0.10' +install: npm install +sudo: false +after_success: + npm run coverage +# Send coverage data to Coveralls +after_script: "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js" diff --git a/ng2-components/ng2-activiti-processlist/LICENSE b/ng2-components/ng2-activiti-processlist/LICENSE new file mode 100644 index 0000000000..7384321ba7 --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/LICENSE @@ -0,0 +1,13 @@ +Copyright 2016 Will Abson + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/ng2-components/ng2-activiti-processlist/README.md b/ng2-components/ng2-activiti-processlist/README.md new file mode 100644 index 0000000000..f4c967396b --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/README.md @@ -0,0 +1,101 @@ +# <ng-2-activiti-processlist> +[![NPM version][npm-image]][npm-url] +[![Build Status][travis-image]][travis-url] +[![Dependency Status][daviddm-image]][daviddm-url] +[![Coverage percentage][coveralls-image]][coveralls-url] +[![Style guide][style-image]][style-url] +[![Alfresco component][alfrescocomponent-image]][alfrescocomponent-url] + +## About ng-2-activiti-processlist +> Show available processes from the Activiti BPM suite + +## Installation + +```bash +npm install ng-2-activiti-processlist --save +``` + +## Example + +```html + +``` + +## Reference + +Attribute | Options | Default | Description +--- | --- | --- | --- +`foo` | *string* | `bar` | Lorem ipsum dolor. + + +Method | Parameters | Returns | Description +--- | --- | --- | --- +`methodName()` | None. | void | Lorem ipsum dolor. + +## Develop command list + + +* To test your component + + ```sh + $ npm run test + ``` + +* To run the test in the browser + + ```sh + $ npm run test-browser + ``` + +* To run the test coverage + + ```sh + $ npm run coverage + ``` + +* To build the component + + ```sh + $ npm run build + ``` + +* To build the component and keep watching the changes + + ```sh + $ npm run build:w + ``` + +* To provide a live demo + + ```sh + $ cd demo + $ npm run start + ``` + +* To clean npm_modules and typings folder + + ```sh + $ npm run clean + ``` + +## History + +For detailed changelog, check [Releases](https://github.com/Alfresco/ng-2-activiti-processlist/releases). + +## Contributors + +[Contributors](https://github.com/Alfresco/ng-2-activiti-processlist/graphs/contributors) + + +[npm-image]: https://badge.fury.io/js/ng-2-activiti-processlist.svg +[npm-url]: https://npmjs.org/package/ng-2-activiti-processlist +[travis-image]: https://travis-ci.org/Alfresco/ng-2-activiti-processlist.svg?branch=master +[travis-url]: https://travis-ci.org/Alfresco/ng-2-activiti-processlist +[daviddm-image]: https://david-dm.org/Alfresco/ng-2-activiti-processlist.svg?theme=shields.io +[daviddm-url]: https://david-dm.org/Alfresco/ng-2-activiti-processlist +[coveralls-image]: https://coveralls.io/repos/Alfresco/ng-2-activiti-processlist/badge.svg +[coveralls-url]: https://coveralls.io/r/Alfresco/ng-2-activiti-processlist +[style-url]: https://github.com/mgechev/angular2-style-guide +[style-image]: https://mgechev.github.io/angular2-style-guide/images/badge.svg +[alfrescocomponent-image]: https://img.shields.io/badge/Alfresco%20component-approved-green.svg +[alfrescocomponent-url]: https://www.alfresco.com diff --git a/ng2-components/ng2-activiti-processlist/angular-cli.json b/ng2-components/ng2-activiti-processlist/angular-cli.json new file mode 100644 index 0000000000..c6a5e72386 --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/angular-cli.json @@ -0,0 +1,27 @@ +{ + "project": { + "version": "ng2-activiti-processlist", + "name": "0.1.0" + }, + "apps": [ + { + "main": "src/ng2-activiti-processlist.component.ts", + "tsconfig": "tsconfig.json", + "mobile": false + } + ], + "addons": [], + "packages": [], + "test": { + "karma": { + "config": "karma.conf.js" + } + }, + "defaults": { + "prefix": "", + "sourceDir": "src", + "styleExt": "css", + "prefixInterfaces": false, + "lazyRoutePrefix": "+" + } +} diff --git a/ng2-components/ng2-activiti-processlist/assets/license_header.txt b/ng2-components/ng2-activiti-processlist/assets/license_header.txt new file mode 100644 index 0000000000..83fd1531a3 --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/assets/license_header.txt @@ -0,0 +1,16 @@ +/*! + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ \ No newline at end of file diff --git a/ng2-components/ng2-activiti-processlist/demo/.editorconfig b/ng2-components/ng2-activiti-processlist/demo/.editorconfig new file mode 100644 index 0000000000..8ed330c4a2 --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/demo/.editorconfig @@ -0,0 +1,10 @@ + +root = true + +[{src,scripts}/**.{ts,json,js}] +end_of_line = crlf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 4 diff --git a/ng2-components/ng2-activiti-processlist/demo/.gitignore b/ng2-components/ng2-activiti-processlist/demo/.gitignore new file mode 100644 index 0000000000..6afdbb8367 --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/demo/.gitignore @@ -0,0 +1,6 @@ +typings/ +node_modules/ +.idea +dist/ +!systemjs.config.js +!browser-sync-config.js diff --git a/ng2-components/ng2-activiti-processlist/demo/README.md b/ng2-components/ng2-activiti-processlist/demo/README.md new file mode 100644 index 0000000000..2596f9176b --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/demo/README.md @@ -0,0 +1,19 @@ +# ng2-activiti-processlist - Demo + +* To install dependencies + +```sh +$ npm install +``` + +* To provide a live demo + +```sh +$ npm run start +``` + +* To clean npm_modules and typings folder + +```sh +$ npm run clean +``` diff --git a/ng2-components/ng2-activiti-processlist/demo/browser-sync-config.js b/ng2-components/ng2-activiti-processlist/demo/browser-sync-config.js new file mode 100644 index 0000000000..2fb5e7fd5d --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/demo/browser-sync-config.js @@ -0,0 +1,23 @@ +var browserSync = require("browser-sync").create(); +var historyApiFallback = require('connect-history-api-fallback'); + +browserSync.init({ + + server: { + baseDir: './', + middleware: [ historyApiFallback() ] + }, + + files: [ + 'index.html', + 'dist/**/*.{html,htm,css,js}', + 'node_modules/ng2-alfresco-core/dist/**/*.{html,htm,css,js}', + 'node_modules/ng2-alfresco-datatable/dist/**/*.{html,htm,css,js}', + 'node_modules/ng2-alfresco-documentlist/dist/**/*.{html,htm,css,js}', + 'node_modules/ng2-alfresco-login/dist/**/*.{html,htm,css,js}', + 'node_modules/ng2-alfresco-search/dist/**/*.{html,htm,css,js}', + 'node_modules/ng2-alfresco-upload/dist/**/*.{html,htm,css,js}', + 'node_modules/ng2-alfresco-viewer/dist/**/*.{html,htm,css,js}'], + + reloadDelay: 1000 +}); diff --git a/ng2-components/ng2-activiti-processlist/demo/index.html b/ng2-components/ng2-activiti-processlist/demo/index.html new file mode 100644 index 0000000000..1fe571c84c --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/demo/index.html @@ -0,0 +1,34 @@ + + + + + ng2-activiti-processlist Angular 2 + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + diff --git a/ng2-components/ng2-activiti-processlist/demo/package.json b/ng2-components/ng2-activiti-processlist/demo/package.json new file mode 100644 index 0000000000..f6d0a092e7 --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/demo/package.json @@ -0,0 +1,57 @@ +{ + "name": "ng2-activiti-processlist-demo", + "description": "Show available processes from the Activiti BPM suite - Demo", + "version": "0.1.0", + "author": "Will Abson", + "main": "index.js", + "scripts": { + "clean": "rimraf dist node_modules typings", + "typings": "typings install", + "postinstall": "npm run typings && npm run build", + "start": "npm install && npm run typings && concurrently \"npm run build:w\" \"npm run server\" ", + "server": "node browser-sync-config.js", + "build": "npm run tslint && rimraf dist && tsc", + "build:w": "npm run tslint && rimraf dist && tsc -w", + "tslint": "npm run tslint-src && npm run tslint-root", + "tslint-src": "tslint -c tslint.json src/**/*.ts", + "tslint-root": "tslint -c tslint.json *.ts" + }, + "keywords": [ + "ng2", + "angular", + "angular2", + "alfresco", + "demo" + ], + "dependencies": { + "@angular/common": "2.0.0-rc.3", + "@angular/compiler": "2.0.0-rc.3", + "@angular/core": "2.0.0-rc.3", + "@angular/http": "2.0.0-rc.3", + "@angular/platform-browser": "2.0.0-rc.3", + "@angular/platform-browser-dynamic": "2.0.0-rc.3", + "@angular/router": "3.0.0-alpha.7", + "@angular/router-deprecated": "2.0.0-rc.2", + "@angular/upgrade": "2.0.0-rc.3", + "systemjs": "0.19.27", + "core-js": "^2.4.0", + "reflect-metadata": "^0.1.3", + "rxjs": "5.0.0-beta.6", + "zone.js": "^0.6.12", + "ng2-activiti-processlist": "file:../", + "material-design-icons": "^2.2.3", + "material-design-lite": "^1.1.3" + }, + "devDependencies": { + "browser-sync": "^2.10.0", + "connect-history-api-fallback": "^1.2.0", + "concurrently": "^2.0.0", + "rimraf": "2.5.2", + "tslint": "^3.8.1", + "typescript": "^1.8.10", + "typings": "^1.0.4" + }, + "publishConfig": { + "registry": "http://devproducts.alfresco.me:4873/" + } +} diff --git a/ng2-components/ng2-activiti-processlist/demo/src/main.ts b/ng2-components/ng2-activiti-processlist/demo/src/main.ts new file mode 100644 index 0000000000..cfd9e4f569 --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/demo/src/main.ts @@ -0,0 +1,33 @@ +/*! + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Component } from '@angular/core'; +import { bootstrap } from '@angular/platform-browser-dynamic'; +import { Ng2ActivitiProcesslistComponent } from 'ng2-activiti-processlist/dist/ng2-activiti-processlist'; + +@Component({ + selector: 'my-app', + template: ``, + directives: [Ng2ActivitiProcesslistComponent] +}) +class MyDemoApp { + constructor() { + console.log('constructor'); + } +} +bootstrap(MyDemoApp, [ + Ng2ActivitiProcesslistComponent +]); diff --git a/ng2-components/ng2-activiti-processlist/demo/systemjs.config.js b/ng2-components/ng2-activiti-processlist/demo/systemjs.config.js new file mode 100644 index 0000000000..a1e79283ef --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/demo/systemjs.config.js @@ -0,0 +1,65 @@ +/** + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +(function (global) { + + // map tells the System loader where to look for things + var map = { + 'ng2-activiti-processlist': 'node_modules/ng2-activiti-processlist', + '@angular': 'node_modules/@angular', + 'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api', + 'rxjs': 'node_modules/rxjs', + 'app': 'dist/' + }; + + // packages tells the System loader how to load when no filename and/or no extension + var packages = { + 'app': { main: 'main.js', defaultExtension: 'js' }, + 'rxjs': { defaultExtension: 'js' }, + 'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' }, + 'ng2-activiti-processlist': { main: 'index.js', defaultExtension: 'js' } + }; + + var ngPackageNames = [ + 'common', + 'compiler', + 'core', + 'http', + 'platform-browser', + 'platform-browser-dynamic', + 'router', + 'router-deprecated', + 'upgrade' + ]; + // Individual files (~300 requests): + function packIndex(pkgName) { + packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' }; + } + // Bundled (~40 requests): + function packUmd(pkgName) { + packages['@angular/'+pkgName] = { main: '/bundles/'+ pkgName + '.umd.js', defaultExtension: 'js' }; + } + // Most environments should use UMD; some (Karma) need the individual index files + var setPackageConfig = System.packageWithIndex ? packIndex : packUmd; + // Add package entries for angular packages + ngPackageNames.forEach(setPackageConfig); + var config = { + map: map, + packages: packages + }; + System.config(config); +})(this); diff --git a/ng2-components/ng2-activiti-processlist/demo/tsconfig.json b/ng2-components/ng2-activiti-processlist/demo/tsconfig.json new file mode 100644 index 0000000000..772c3a7e75 --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/demo/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "system", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "sourceMap": true, + "removeComments": true, + "declaration": true, + "outDir": "dist" + }, + "exclude": [ + "dist", + "node_modules", + "typings/main", + "typings/main.d.ts" + ] +} diff --git a/ng2-components/ng2-activiti-processlist/demo/tslint.json b/ng2-components/ng2-activiti-processlist/demo/tslint.json new file mode 100644 index 0000000000..8c48e76469 --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/demo/tslint.json @@ -0,0 +1,124 @@ +{ + "rules": { + "align": [ + true, + "parameters", + "arguments", + "statements" + ], + "ban": false, + "class-name": true, + "comment-format": [ + true, + "check-space", + "check-lowercase" + ], + "curly": true, + "eofline": true, + "forin": true, + "indent": [ + true, + "spaces" + ], + "interface-name": false, + "jsdoc-format": true, + "label-position": true, + "label-undefined": true, + "max-line-length": [ + true, + 140 + ], + "member-ordering": [ + true, + "public-before-private", + "static-before-instance", + "variables-before-functions" + ], + "no-any": false, + "no-arg": true, + "no-bitwise": true, + "no-conditional-assignment": true, + "no-consecutive-blank-lines": false, + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-construct": true, + "no-constructor-vars": false, + "no-debugger": true, + "no-duplicate-key": true, + "no-duplicate-variable": true, + "no-empty": true, + "no-eval": true, + "no-inferrable-types": false, + "no-internal-module": true, + "no-require-imports": true, + "no-shadowed-variable": true, + "no-switch-case-fall-through": true, + "no-trailing-whitespace": true, + "no-unreachable": true, + "no-unused-expression": true, + "no-unused-variable": true, + "no-use-before-declare": true, + "no-var-keyword": true, + "no-var-requires": true, + "object-literal-sort-keys": false, + "one-line": [ + true, + "check-open-brace", + "check-catch", + "check-else", + "check-whitespace" + ], + "quotemark": [ + true, + "single", + "avoid-escape" + ], + "radix": true, + "semicolon": true, + "switch-default": true, + "trailing-comma": [ + true, + { + "multiline": "never", + "singleline": "never" + } + ], + "triple-equals": [ + true, + "allow-null-check" + ], + "typedef": false, + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], + "use-strict": false, + "variable-name": [ + true, + "check-format", + "allow-leading-underscore", + "ban-keywords" + ], + "whitespace": [ + true, + "check-branch", + "check-operator", + "check-separator", + "check-type", + "check-module", + "check-decl" + ] + } +} diff --git a/ng2-components/ng2-activiti-processlist/demo/typings.json b/ng2-components/ng2-activiti-processlist/demo/typings.json new file mode 100644 index 0000000000..7e0e18568d --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/demo/typings.json @@ -0,0 +1,7 @@ +{ + "globalDependencies": { + "core-js": "registry:dt/core-js#0.0.0+20160317120654", + "jasmine": "registry:dt/jasmine#2.2.0+20160505161446", + "node": "registry:dt/node#4.0.0+20160509154515" + } +} diff --git a/ng2-components/ng2-activiti-processlist/karma-test-shim.js b/ng2-components/ng2-activiti-processlist/karma-test-shim.js new file mode 100644 index 0000000000..f69a25dfca --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/karma-test-shim.js @@ -0,0 +1,88 @@ +// Tun on full stack traces in errors to help debugging +Error.stackTraceLimit = Infinity; + +jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000; + +__karma__.loaded = function() {}; + +var map = { + 'app': 'base/dist', + 'rxjs': 'base/node_modules/rxjs', + '@angular': 'base/node_modules/@angular' +}; + +var packages = { + 'app': { main: 'main.js', defaultExtension: 'js' }, + 'rxjs': { defaultExtension: 'js' } +}; + +var packageNames = [ + '@angular/common', + '@angular/compiler', + '@angular/core', + '@angular/http', + '@angular/platform-browser', + '@angular/platform-browser-dynamic', + '@angular/router', + '@angular/router-deprecated', + '@angular/testing', + '@angular/upgrade' +]; + +packageNames.forEach(function(pkgName) { + packages[pkgName] = { main: 'index.js', defaultExtension: 'js' }; +}); + +packages['base/dist'] = { + defaultExtension: 'js', + format: 'register', + map: Object.keys(window.__karma__.files).filter(onlyAppFiles).reduce(createPathRecords, {}) +}; + +var config = { + map: map, + packages: packages +}; + +System.config(config); + +System.import('@angular/platform-browser/src/browser/browser_adapter') + .then(function(browser_adapter) { browser_adapter.BrowserDomAdapter.makeCurrent(); }) + .then(function() { return Promise.all(resolveTestFiles()); }) + .then( + function() { + __karma__.start(); + }, + function(error) { + if(typeof __karma__.error == 'function') { + __karma__.error(error.stack || error); + }else{ + console.error(error); + } + } + ); +function createPathRecords(pathsMapping, appPath) { + var pathParts = appPath.split('/'); + var moduleName = './' + pathParts.slice(Math.max(pathParts.length - 2, 1)).join('/'); + moduleName = moduleName.replace(/\.js$/, ''); + pathsMapping[moduleName] = appPath + '?' + window.__karma__.files[appPath]; + return pathsMapping; +} + +function onlyAppFiles(filePath) { + return /\/base\/dist\/(?!.*\.spec\.js$).*\.js$/.test(filePath); +} + +function onlySpecFiles(path) { + return /\.spec\.js$/.test(path); +} + +function resolveTestFiles() { + return Object.keys(window.__karma__.files) // All files served by Karma. + .filter(onlySpecFiles) + .map(function(moduleName) { + // loads all spec files via their global module names (e.g. + // 'base/dist/vg-player/vg-player.spec') + return System.import(moduleName); + }); +} diff --git a/ng2-components/ng2-activiti-processlist/karma.conf.js b/ng2-components/ng2-activiti-processlist/karma.conf.js new file mode 100644 index 0000000000..625d82b450 --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/karma.conf.js @@ -0,0 +1,85 @@ +'use strict'; + +module.exports = function (config) { + config.set({ + + basePath: '.', + + frameworks: ['jasmine'], + + files: [ + // paths loaded by Karma + {pattern: 'node_modules/angular2/bundles/angular2-polyfills.js', included: true, watched: false}, + {pattern: 'node_modules/systemjs/dist/system.src.js', included: true, watched: false}, + {pattern: 'node_modules/rxjs/bundles/Rx.js', included: true, watched: false}, + {pattern: 'node_modules/angular2/bundles/angular2.dev.js', included: true, watched: false}, + {pattern: 'node_modules/angular2/bundles/testing.dev.js', included: true, watched: false}, + {pattern: 'node_modules/angular2/bundles/http.dev.js', included: true, watched: false}, + {pattern: 'node_modules/angular2/bundles/router.dev.js', included: true, watched: false}, + {pattern: 'node_modules/alfresco-core-rest-api/bundle.js', included: true, watched: false}, + + {pattern: 'karma-test-shim.js', included: true, watched: true}, + + // paths loaded via module imports + {pattern: 'dist/**/*.js', included: false, watched: true}, + {pattern: 'dist/**/*.html', included: true, served: true, watched: true}, + {pattern: 'dist/**/*.css', included: true, served: true, watched: true}, + + // paths to support debugging with source maps in dev tools + {pattern: 'src/**/*.ts', included: false, watched: false}, + {pattern: 'dist/**/*.js.map', included: false, watched: false} + ], + + // proxied base paths + proxies: { + // required for component assets fetched by Angular's compiler + '/src/': '/base/src/' + }, + + // list of files to exclude + exclude: [ + 'node_modules/**/*spec.js' + ], + + port: 9876, + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + colors: true, + + autoWatch: true, + + browsers: ['Chrome'], + + // Karma plugins loaded + plugins: [ + 'karma-jasmine', + 'karma-coverage', + 'karma-chrome-launcher', + 'karma-mocha-reporter', + 'karma-jasmine-html-reporter' + ], + + // Coverage reporter generates the coverage + reporters: ['mocha', 'coverage', 'kjhtml'], + + // Source files that you wanna generate coverage for. + // Do not include tests or libraries (these files will be instrumented by Istanbul) + preprocessors: { + 'dist/**/!(*spec).js': ['coverage'] + }, + + coverageReporter: { + dir: 'coverage/', + subdir: 'report', + reporters: [ + {type: 'text'}, + {type: 'text-summary'}, + {type: 'json', file: 'coverage-final.json'}, + {type: 'html'} + ] + } + }) +}; diff --git a/ng2-components/ng2-activiti-processlist/ng2-activiti-processlist.ts b/ng2-components/ng2-activiti-processlist/ng2-activiti-processlist.ts new file mode 100644 index 0000000000..7fe32c45e0 --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/ng2-activiti-processlist.ts @@ -0,0 +1,18 @@ +/*! + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './src/ng2-activiti-processlist.component'; diff --git a/ng2-components/ng2-activiti-processlist/package.json b/ng2-components/ng2-activiti-processlist/package.json new file mode 100644 index 0000000000..bf4c54dfd1 --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/package.json @@ -0,0 +1,101 @@ +{ + "keywords": [ + "alfresco", + "activiti", + "angular2", + "alfresco-component" + ], + "name": "ng2-activiti-processlist", + "description": "Show active processes from the Activiti BPM suite", + "version": "0.1.0", + "author": "Will Abson", + "scripts": { + "clean": "rimraf dist node_modules typings", + "typings": "typings install", + "server": "http-server -c-1 -o -p 8875 .", + "build": "npm run tslint && typings install && rimraf dist && tsc && npm run copytemplates && license-check", + "build:w": "npm run tslint && typings install && rimraf dist && npm run watch-task", + "watch-task": "concurrently \"npm run tsc:w\" \"npm run copytemplates:w\" \"license-check\"", + "tslint": "npm run tslint-src && npm run tslint-root", + "tslint-src": "tslint -c tslint.json src/{,**/}**.ts", + "tslint-root": "tslint -c tslint.json *.ts", + "copytemplates": "npm run copy-html-css && npm run copy-i18n && npm run copy-images", + "copytemplates:w": "concurrently \"npm run copy-html-css:w\" \"npm run copy-images:w\" \"npm run copy-i18n:w\"", + "copy-html-css": "cpx \"./src/**/*.{html,css}\" ./dist/src", + "copy-html-css:w": "cpx \"./src/**/*.{html,css}\" ./dist/src -w", + "copy-i18n": "cpx \"./i18n/**/*.json\" ./dist/i18n", + "copy-i18n:w": "cpx \"./i18n/**/*.json\" ./dist/i18n -w", + "copy-images": "cpx \"./src/**/*.{png,jpg,gif,svg}\" ./dist/src", + "copy-images:w": "cpx \"./src/**/*.{png,jpg,gif,svg}\" ./dist/src -w", + "tsc": "tsc", + "tsc:w": "tsc -w", + "pretest": "npm run build", + "test": "karma start karma.conf.js --reporters mocha,coverage --single-run", + "test-browser": "npm run build && concurrently \"karma start karma.conf.js --reporters kjhtml\" \"npm run watch-task\"", + "posttest": "node_modules/.bin/remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html", + "coverage": "npm run test && http-server -c-1 -o -p 9875 ./coverage/report", + "prepublish": "npm run build" + }, + "repository": { + "type": "git", + "url": "https://github.com/Alfresco/alfresco-ng2-components" + }, + "bugs": { + "url": "https://github.com/Alfresco/alfresco-ng2-components/issues" + }, + "dependencies": { + "@angular/common": "2.0.0-rc.3", + "@angular/compiler": "2.0.0-rc.3", + "@angular/core": "2.0.0-rc.3", + "@angular/http": "2.0.0-rc.3", + "@angular/platform-browser": "2.0.0-rc.3", + "@angular/platform-browser-dynamic": "2.0.0-rc.3", + "@angular/router": "3.0.0-alpha.7", + "@angular/router-deprecated": "2.0.0-rc.2", + "@angular/upgrade": "2.0.0-rc.3", + "systemjs": "0.19.27", + "core-js": "^2.4.0", + "reflect-metadata": "^0.1.3", + "rxjs": "5.0.0-beta.6", + "zone.js": "^0.6.12" + }, + "devDependencies": { + "angular-cli": "1.0.0-beta.9", + "concurrently": "^2.1.0", + "coveralls": "^2.11.9", + "cpx": "^1.3.1", + "http-server": "0.8.5", + "jasmine-ajax": "^3.2.0", + "jasmine-core": "2.4.1", + "karma": "~0.13.22", + "karma-chrome-launcher": "~1.0.1", + "karma-coverage": "^1.0.0", + "karma-jasmine": "~1.0.2", + "karma-jasmine-ajax": "^0.1.13", + "karma-jasmine-html-reporter": "^0.2.0", + "karma-mocha-reporter": "^2.0.3", + "license-check": "^1.0.4", + "remap-istanbul": "^0.6.3", + "rimraf": "2.5.2", + "traceur": "^0.0.91", + "tslint": "^3.8.1", + "typescript": "^1.8.10", + "typings": "^1.0.4" + }, + "license-check-config": { + "src": [ + "**/*.js", + "**/*.ts", + "!/**/coverage/**/*", + "!/**/demo/**/*", + "!/**/node_modules/**/*", + "!/**/typings/**/*", + "!*.js" + ], + "path": "assets/license_header.txt", + "blocking": false, + "logInfo": false, + "logError": true + }, + "license": "Apache-2.0" +} diff --git a/ng2-components/ng2-activiti-processlist/src/ng2-activiti-processlist.component.spec.ts b/ng2-components/ng2-activiti-processlist/src/ng2-activiti-processlist.component.spec.ts new file mode 100644 index 0000000000..55a2617620 --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/src/ng2-activiti-processlist.component.spec.ts @@ -0,0 +1,38 @@ +/*! + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {describe, expect, it, inject, setBaseTestProviders} from '@angular/core/testing'; +import { TestComponentBuilder } from '@angular/compiler/testing'; +import { + TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS, + TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS +} from '@angular/platform-browser-dynamic/testing'; +import {Ng2ActivitiProcesslistComponent} from '../src/ng2-activiti-processlist.component'; + +describe('Basic Example test ng2-activiti-processlist', () => { + setBaseTestProviders(TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS, TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS); + + it('Test hello world', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => { + return tcb + .createAsync(Ng2ActivitiProcesslistComponent) + .then((fixture) => { + let element = fixture.nativeElement; + expect(element.querySelector('h1')).toBeDefined(); + expect(element.getElementsByTagName('h1')[0].innerHTML).toEqual('Hello World Angular 2 ng2-activiti-processlist'); + }); + })); +}); diff --git a/ng2-components/ng2-activiti-processlist/src/ng2-activiti-processlist.component.ts b/ng2-components/ng2-activiti-processlist/src/ng2-activiti-processlist.component.ts new file mode 100644 index 0000000000..e483c8486a --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/src/ng2-activiti-processlist.component.ts @@ -0,0 +1,31 @@ +/*! + * @license + * Copyright 2016 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Component } from '@angular/core'; + +@Component({ + selector: 'ng-2-activiti-processlist', + styles: [ + ` + :host h1 { + font-size:22px + } + ` + ], + template: `

Hello World Angular 2 ng-2-activiti-processlist

` +}) +export class Ng2ActivitiProcesslistComponent {} diff --git a/ng2-components/ng2-activiti-processlist/tsconfig.json b/ng2-components/ng2-activiti-processlist/tsconfig.json new file mode 100644 index 0000000000..e4d2ae201a --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "system", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "sourceMap": true, + "removeComments": true, + "declaration": true, + "noLib": false, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noImplicitAny": false, + "noImplicitReturns": false, + "noImplicitUseStrict": false, + "noFallthroughCasesInSwitch": true, + "outDir": "dist" + }, + "exclude": [ + "demo", + "node_modules", + "typings/main", + "typings/main.d.ts", + "dist" + ] +} diff --git a/ng2-components/ng2-activiti-processlist/tslint.json b/ng2-components/ng2-activiti-processlist/tslint.json new file mode 100644 index 0000000000..33220e5038 --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/tslint.json @@ -0,0 +1,121 @@ +{ + "rules": { + "align": [ + true, + "parameters", + "statements" + ], + "ban": false, + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "curly": true, + "eofline": true, + "forin": true, + "indent": [ + true, + "spaces" + ], + "interface-name": false, + "jsdoc-format": true, + "label-position": true, + "label-undefined": true, + "max-line-length": [ + true, + 140 + ], + "member-ordering": [ + true, + "static-before-instance", + "variables-before-functions" + ], + "no-any": false, + "no-arg": true, + "no-bitwise": false, + "no-conditional-assignment": true, + "no-consecutive-blank-lines": false, + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-construct": true, + "no-constructor-vars": false, + "no-debugger": true, + "no-duplicate-key": true, + "no-duplicate-variable": true, + "no-empty": false, + "no-eval": true, + "no-inferrable-types": false, + "no-internal-module": true, + "no-require-imports": true, + "no-shadowed-variable": true, + "no-switch-case-fall-through": true, + "no-trailing-whitespace": true, + "no-unreachable": true, + "no-unused-expression": true, + "no-unused-variable": true, + "no-use-before-declare": true, + "no-var-keyword": true, + "no-var-requires": true, + "object-literal-sort-keys": false, + "one-line": [ + true, + "check-open-brace", + "check-catch", + "check-else", + "check-whitespace" + ], + "quotemark": [ + true, + "single", + "avoid-escape" + ], + "radix": true, + "semicolon": true, + "switch-default": true, + "trailing-comma": [ + true, + { + "multiline": "never", + "singleline": "never" + } + ], + "triple-equals": [ + true, + "allow-null-check" + ], + "typedef": false, + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], + "use-strict": false, + "variable-name": [ + true, + "check-format", + "allow-leading-underscore", + "ban-keywords" + ], + "whitespace": [ + true, + "check-branch", + "check-operator", + "check-separator", + "check-type", + "check-module", + "check-decl" + ] + } +} diff --git a/ng2-components/ng2-activiti-processlist/typings.json b/ng2-components/ng2-activiti-processlist/typings.json new file mode 100644 index 0000000000..7e0e18568d --- /dev/null +++ b/ng2-components/ng2-activiti-processlist/typings.json @@ -0,0 +1,7 @@ +{ + "globalDependencies": { + "core-js": "registry:dt/core-js#0.0.0+20160317120654", + "jasmine": "registry:dt/jasmine#2.2.0+20160505161446", + "node": "registry:dt/node#4.0.0+20160509154515" + } +}