+# Alfresco User Info Component for Angular 2
+This component will show the user information for ECM and BPM
-### Node
-To correctly use this component check that on your machine is running Node version 5.0.0 or higher.
-## Install
+## Prerequisites
-```sh
-npm install --save ng2-alfresco-tag
+Before you start using this development framework, make sure you have installed all required software and done all the
+necessary configuration, see this [page](https://github.com/Alfresco/alfresco-ng2-components/blob/master/PREREQUISITES.md).
+
+## Installation
+
+```bash
+npm install ng2-alfresco-userinfo --save
```
-
-Components included:
-
-* Alfresco Tag Component
-
-#### Dependencies
+## Dependencies
Add the following dependency to your index.html:
-
```html
```
+
+You must separately install the following libraries for your application:
+
+- [ng2-translate](https://github.com/ocombe/ng2-translate)
+- [ng2-alfresco-core](https://www.npmjs.com/package/ng2-alfresco-core)
-The following component needs to be added to your systemjs.config:
+```sh
+npm install --save ng2-translate ng2-alfresco-core
+```
+
+#### Material Design Lite
-- ng2-translate
-- ng2-alfresco-core
-
-Please refer to the following example to have an idea of how your systemjs.config should look like :
-
-https://github.com/Alfresco/alfresco-ng2-components/blob/master/ng2-components/ng2-alfresco-tag/demo/systemjs.config.js
-
-#### Style
-The style of this component is based on material design, so if you want to visualize it correctly you have to add the material
+The style of this component is based on [material design](https://getmdl.io/), so if you want to visualize it correctly you have to add the material
design dependency to your project:
```sh
npm install --save material-design-icons material-design-lite
```
-Also make sure you include these dependencies in your .html page:
+Also make sure you include these dependencies in your `index.html` file:
```html
@@ -77,293 +45,29 @@ Also make sure you include these dependencies in your .html page:
```
-
-#### Basic usage
-
-In this component are present three different tags :
-
-* alfresco-tag-node-actions-list
-* alfresco-tag-list
-* alfresco-tag-node-list
-
-## alfresco-tag-node-actions-list
+
+## Example
```html
-
-```
-
-```ts
-import { Component, OnInit, Input } from '@angular/core';
-import { bootstrap } from '@angular/platform-browser-dynamic';
-import { HTTP_PROVIDERS } from '@angular/http';
-import {
- ALFRESCO_CORE_PROVIDERS,
- AlfrescoSettingsService,
- AlfrescoAuthenticationService
-} from 'ng2-alfresco-core';
-import { TAGCOMPONENT, TAGSERVICES } from 'ng2-alfresco-tag';
-
-@Component({
- selector: 'alfresco-tag-demo',
- template: `
-
- `,
- directives: [TAGCOMPONENT],
- providers: [TAGSERVICES]
-})
-class TagDemo implements OnInit {
-
- authenticated: boolean;
-
- ecmHost: string = 'http://127.0.0.1:8080';
-
- constructor(private authService: AlfrescoAuthenticationService,
- private settingsService: AlfrescoSettingsService) {
- settingsService.ecmHost = this.ecmHost;
- settingsService.setProviders('ECM');
- }
-
- ngOnInit() {
- this.login();
- }
-
- login() {
- this.authService.login('admin', 'admin').subscribe(
- ticket => {
- this.authenticated = true;
- },
- error => {
- this.authenticated = false;
- });
- }
-
- public updateHost(): void {
- this.settingsService.ecmHost = this.ecmHost;
- this.login();
- }
-
- logData(data) {
- console.log(data);
- }
-}
-bootstrap(TagDemo, [
- HTTP_PROVIDERS,
- ALFRESCO_CORE_PROVIDERS
-]);
-```
-
-
-
-
-## Build from sources
-Alternatively you can build component from sources with the following commands:
-
-
-```sh
-npm install
-npm run build
+
```
+This will show a round icon with user and on click some user information are showed.
+If user is logged in with ECM and BPM the ECM image will be showed.
-##Build the files and keep watching for changes
+## NPM scripts
-```sh
-npm run build:w
-```
-
-## Running unit tests
+| Command | Description |
+| --- | --- |
+| npm run build | Build component |
+| npm run build:w | Build component and keep watching the changes |
+| npm run test | Run unit tests in the console |
+| npm run test-browser | Run unit tests in the browser
+| npm run coverage | Run unit tests and display code coverage report |
-```sh
-npm test
-```
+## History
-## Running unit tests in browser
+For detailed changelog, check [Releases](https://github.com/alfresco/ng2-alfresco-userinfo/releases).
-```sh
-npm test-browser
-```
-
-This task rebuilds all the code, runs tslint, license checks and other quality check tools
-before performing unit testing.
-
-## Code coverage
-
-```sh
-npm run coverage
-```
-
-## Demo
-
-If you want have a demo of how the component works, please check the demo folder :
-
-```sh
-cd demo
-npm install
-npm start
-```
+## Contributors
+[Contributors](https://github.com/alfresco/ng2-alfresco-userinfo/graphs/contributors)
\ No newline at end of file
diff --git a/ng2-components/ng2-alfresco-userinfo/demo/.editorconfig b/ng2-components/ng2-alfresco-userinfo/demo/.editorconfig
new file mode 100644
index 0000000000..8ed330c4a2
--- /dev/null
+++ b/ng2-components/ng2-alfresco-userinfo/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-alfresco-userinfo/demo/.gitignore b/ng2-components/ng2-alfresco-userinfo/demo/.gitignore
index 6afdbb8367..25beca4c27 100644
--- a/ng2-components/ng2-alfresco-userinfo/demo/.gitignore
+++ b/ng2-components/ng2-alfresco-userinfo/demo/.gitignore
@@ -1,6 +1,6 @@
-typings/
-node_modules/
+node_modules
.idea
-dist/
+coverage
+dist
+typings
!systemjs.config.js
-!browser-sync-config.js
diff --git a/ng2-components/ng2-alfresco-userinfo/demo/.npmignore b/ng2-components/ng2-alfresco-userinfo/demo/.npmignore
new file mode 100644
index 0000000000..c51c008259
--- /dev/null
+++ b/ng2-components/ng2-alfresco-userinfo/demo/.npmignore
@@ -0,0 +1,3 @@
+node_modules
+dist
+typings
\ No newline at end of file
diff --git a/ng2-components/ng2-alfresco-userinfo/demo/README.md b/ng2-components/ng2-alfresco-userinfo/demo/README.md
index 8d399e6fef..14f9e8502c 100644
--- a/ng2-components/ng2-alfresco-userinfo/demo/README.md
+++ b/ng2-components/ng2-alfresco-userinfo/demo/README.md
@@ -1,19 +1,13 @@
-# ng2-alfresco-tag - Demo
+# User info demo
-* To install dependencies
+Install:
-```sh
-$ npm install
+```
+npm install
```
-* To provide a live demo
+Run the project:
-```sh
-$ npm run start
-```
-
-* To clean npm_modules and typings folder
-
-```sh
-$ npm run clean
```
+npm start
+```
\ No newline at end of file
diff --git a/ng2-components/ng2-alfresco-userinfo/demo/index.html b/ng2-components/ng2-alfresco-userinfo/demo/index.html
index ee97252ec1..b73b46517f 100644
--- a/ng2-components/ng2-alfresco-userinfo/demo/index.html
+++ b/ng2-components/ng2-alfresco-userinfo/demo/index.html
@@ -2,38 +2,33 @@
- Alfresco Angular 2 Tag - Demo
+ Angular 2 TaskList - Demo
-
+
-
-
-
+
diff --git a/ng2-components/ng2-alfresco-userinfo/demo/package.json b/ng2-components/ng2-alfresco-userinfo/demo/package.json
new file mode 100644
index 0000000000..368099bb09
--- /dev/null
+++ b/ng2-components/ng2-alfresco-userinfo/demo/package.json
@@ -0,0 +1,77 @@
+{
+ "name": "ng2-activiti-tasklist-demo",
+ "description": "Alfresco Angular2 Task List Component - Demo",
+ "version": "0.1.0",
+ "author": "Alfresco Software, Ltd.",
+ "main": "index.js",
+ "scripts": {
+ "clean": "rimraf dist node_modules",
+ "postinstall": "npm run build",
+ "start": "npm run build && concurrently \"npm run tsc:w\" \"npm run server\" ",
+ "server": "wsrv -o -s -l",
+ "build": "npm run tslint && rimraf dist && npm run tsc",
+ "tsc": "tsc",
+ "tsc:w": "tsc -w",
+ "tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json src/{,**/}**.ts"
+ },
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@angular/common": "2.0.0",
+ "@angular/compiler": "2.0.0",
+ "@angular/core": "2.0.0",
+ "@angular/forms": "2.0.0",
+ "@angular/http": "2.0.0",
+ "@angular/platform-browser": "2.0.0",
+ "@angular/platform-browser-dynamic": "2.0.0",
+ "@angular/router": "3.0.0",
+ "@angular/upgrade": "2.0.0",
+ "core-js": "^2.4.1",
+ "reflect-metadata": "^0.1.3",
+ "rxjs": "5.0.0-beta.12",
+ "systemjs": "0.19.27",
+ "zone.js": "^0.6.23",
+
+ "material-design-icons": "2.2.3",
+ "material-design-lite": "1.2.1",
+ "ng2-translate": "2.5.0",
+
+ "alfresco-js-api": "^0.3.0",
+ "ng2-alfresco-core": "^0.3.0",
+ "ng2-alfresco-userinfo": "0.3.2"
+ },
+ "devDependencies": {
+ "@types/core-js": "^0.9.32",
+ "@types/jasmine": "^2.2.33",
+ "concurrently": "^2.2.0",
+ "rimraf": "2.5.2",
+ "tslint": "3.8.1",
+ "license-check": "1.1.5",
+ "typescript": "^2.0.2",
+ "wsrv": "^0.1.5"
+ },
+ "keywords": [
+ "angular2",
+ "typescript"
+ ],
+ "license-check-config": {
+ "src": [
+ "**/*.js",
+ "**/*.ts",
+ "!/**/coverage/**/*",
+ "!/**/demo/**/*",
+ "!/**/node_modules/**/*",
+ "!/**/typings/**/*",
+ "!*.js"
+ ],
+ "contributors": [
+ {
+ "name": "Vito Albano",
+ "email": "vito.albano@alfresco.com"
+ }
+ ],
+ "path": "assets/license_header.txt",
+ "blocking": true,
+ "logInfo": false,
+ "logError": true
+ }
+}
diff --git a/ng2-components/ng2-alfresco-userinfo/demo/src/main.ts b/ng2-components/ng2-alfresco-userinfo/demo/src/main.ts
index 8af97cc33a..98ef59e2a1 100644
--- a/ng2-components/ng2-alfresco-userinfo/demo/src/main.ts
+++ b/ng2-components/ng2-alfresco-userinfo/demo/src/main.ts
@@ -15,100 +15,130 @@
* limitations under the License.
*/
-import { NgModule, Component, Input, OnInit } from '@angular/core';
+import { NgModule, Component } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+import { UserInfoComponentModule } from 'ng2-alfresco-userinfo';
+import { CoreModule, MDL } from 'ng2-alfresco-core';
-import { CoreModule, AlfrescoSettingsService, AlfrescoAuthenticationService } from 'ng2-alfresco-core';
-import { TagModule } from 'ng2-alfresco-tag';
+import { AlfrescoAuthenticationService, AlfrescoSettingsService } from 'ng2-alfresco-core';
@Component({
- selector: 'alfresco-tag-demo',
- template: `
-
-
-
-
-
- Authentication failed to ip {{ ecmHost }} with user: admin, admin, you can still try to add a valid ticket to perform
- operations.
+ selector: 'alfresco-userinfo-demo',
+ template: `