## Prerequisites
@@ -7,71 +38,136 @@ necessary configuration, see this [page](https://github.com/Alfresco/alfresco-ng
## Install
-```sh
-npm install --save ng2-activiti-diagrams
-```
+Follow the 3 steps below:
+1. Npm
-### Dependencies
+ ```sh
+ npm install ng2-activiti-diagrams --save
+ ```
-Add the following dependency to your index.html:
+2. Html
-```html
-
-```
+ Include these dependencies in your index.html page:
-The following component needs to be added to your `systemjs.config.js` file:
+ ```html
-- [ng2-alfresco-core](https://www.npmjs.com/package/ng2-alfresco-core)
-
-#### raphael
-
-```sh
-npm install raphael --save
-```
-
-Also make sure you include these dependencies in your `index.html` file:
-
-```html
+
-```
+
+
-#### Material Design Lite
+
+
+
+
-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 `index.html` file:
+
+
+
-```html
-
-
-
-
-```
+
+
+
+
+
+ ```
+
+3. SystemJs
+
+ Add the following components to your systemjs.config.js file:
+
+ - ng2-translat
+ - ng2-alfresco-core
+ - ng2-activiti-diagrams
+ - alfresco-js-api
+ - raphael
+
+ Please refer to the following example file: [systemjs.config.js](demo/systemjs
+ .config.js) .
## Basic usage example Activiti Diagrams
-The component shows the diagram of the input process.
+
+This component shows the diagram of a process.
+
```html
```
-#### Events
-**onSuccess**: The event is emitted when the diagrams element are loaded
+Usage example of this component :
-**onError**: The event is emitted when the an error occur during the loading
+**main.ts**
+```ts
+
+import { NgModule, Component } from '@angular/core';
+import { BrowserModule } from '@angular/platform-browser';
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+
+import { CoreModule, AlfrescoSettingsService, AlfrescoAuthenticationService } from 'ng2-alfresco-core';
+import { DiagramsModule } from 'ng2-activiti-diagrams';
+
+@Component({
+ selector: 'activiti-diagrams-demo',
+ template: ``
+})
+
+export class DiagramDemoComponent {
+
+ constructor(private authService: AlfrescoAuthenticationService, private settingsService: AlfrescoSettingsService) {
+ settingsService.bpmHost = 'http://localhost:9999';
+
+ this.authService.login('admin', 'admin').subscribe(
+ ticket => {
+ console.log(ticket);
+ },
+ error => {
+ console.log(error);
+ });
+ }
+}
+
+@NgModule({
+ imports: [
+ BrowserModule,
+ CoreModule.forRoot(),
+ DiagramsModule
+ ],
+ declarations: [ DiagramDemoComponent ],
+ bootstrap: [ DiagramDemoComponent ]
+})
+export class AppModule { }
+
+platformBrowserDynamic().bootstrapModule(AppModule);
+
+```
+
+#### Events
+
+| Name | Description |
+| --- | --- |
+| `onSuccess` | The event is emitted when the diagrams element are loaded |
+| `onError` | The event is emitted when the an error occur during the loading |
#### Options
-**metricPercentages** The array that contains the percentage of the time for each element
+
+| Name | Description |
+| --- | --- |
+| `metricPercentage` | The array that contains the percentage of the time for each element |
## Build from sources
Alternatively you can build component from sources with the following commands:
+
```sh
npm install
npm run build
@@ -83,7 +179,7 @@ npm run build
$ npm run build:w
```
-### Running unit tests
+## Running unit tests
```sh
npm test
@@ -103,3 +199,17 @@ before performing unit testing.
```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
+```
+
+## License
+
+[Apache Version 2.0](https://github.com/Alfresco/alfresco-ng2-components/blob/master/LICENSE)
\ No newline at end of file
diff --git a/ng2-components/ng2-activiti-diagrams/demo/index.html b/ng2-components/ng2-activiti-diagrams/demo/index.html
index 96d17103f3..5947d24cd0 100644
--- a/ng2-components/ng2-activiti-diagrams/demo/index.html
+++ b/ng2-components/ng2-activiti-diagrams/demo/index.html
@@ -6,23 +6,35 @@
Alfresco Angular 2 Activiti Diagrams - Demo
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+2. Html
-```
+ Include these dependencies in your index.html page:
-*If you need to have a large cross-browser compatibility make sure you include the polyfill necessary to Angular 2. More info at this
-[page](/BROWSER-SUPPORT.md) .*
+ ```html
-## Dependencies
+
+
+
+
-The following component needs to be added to your systemjs.config.js :
+
+
+
-- ng2-translate
-- ng2-alfresco-core
-- ng2-alfresco-login
+
+
+
+
-Please refer to the following example to have an idea of how your systemjs.config should look this [systemjs.config.js](demo/systemjs
-.config.js) .
+
+
+
+
+
+
+
+
+ ```
+
+3. SystemJs
+
+ Add the following components to your systemjs.config.js file:
+
+ - ng2-translate
+ - ng2-alfresco-core
+ - ng2-alfresco-login
+
+ Please refer to the following example file: [systemjs.config.js](demo/systemjs
+ .config.js) .
## Basic usage
+This component allow to authenticate to Alfresco One and Alfresco Activiti.
+
+
```html
```
-Example of an App that use Alfresco login component :
+Usage example of this component :
**main.ts**
```ts
@@ -133,17 +156,17 @@ platformBrowserDynamic().bootstrapModule(AppModule);
| `onSuccess` | The event is emitted when the login is done |
| `onError` | The event is emitted when the login fails |
-Attribute | Description |
---- | --- |
-`onSuccess` | The event is emitted when the login is done |
-`onError` | The event is emitted when the login fails |
+| Name | Description |
+| --- | --- |
+| `onSuccess` | The event is emitted when the login is done |
+| `onError` | The event is emitted when the login fails |
#### Options
-Attribute | Options | Default | Description | Mandatory
---- | --- | --- | --- | ---
-`providers` | *string* | ECM | Possible valid value are ECM, BPM or ALL. The default behaviour of this component will logged in only in the ECM . If you want log in in both system the correct value to use is ALL |
-`disableCsrf` | *boolean* | false | To prevent the CSRF Token from been submitted. Only for Activiti call |
+| Name | Options | Default | Description | Mandatory
+| --- | --- | --- | --- | ---
+| `providers` | *string* | ECM | Possible valid value are ECM, BPM or ALL. The default behaviour of this component will logged in only in the ECM . If you want log in in both system the correct value to use is ALL |
+| `disableCsrf` | *boolean* | false | To prevent the CSRF Token from been submitted. Only for Activiti call |
## Custom logo and background
diff --git a/ng2-components/ng2-alfresco-login/demo/index.html b/ng2-components/ng2-alfresco-login/demo/index.html
index d9f50e1dc4..3d4bce6e84 100644
--- a/ng2-components/ng2-alfresco-login/demo/index.html
+++ b/ng2-components/ng2-alfresco-login/demo/index.html
@@ -24,6 +24,7 @@
+
diff --git a/ng2-components/ng2-alfresco-login/demo/package.json b/ng2-components/ng2-alfresco-login/demo/package.json
index 091fdfc9cd..644004358d 100644
--- a/ng2-components/ng2-alfresco-login/demo/package.json
+++ b/ng2-components/ng2-alfresco-login/demo/package.json
@@ -45,29 +45,6 @@
"alfresco"
],
"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",
- "@types/node": "^6.0.42",
- "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",
- "md-date-time-picker": "^2.2.0",
- "moment": "2.15.1",
- "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-login": "^0.3.2"
},
"devDependencies": {
diff --git a/ng2-components/ng2-alfresco-login/demo/src/main.ts b/ng2-components/ng2-alfresco-login/demo/src/main.ts
index 8c2604d456..c070ab3bee 100644
--- a/ng2-components/ng2-alfresco-login/demo/src/main.ts
+++ b/ng2-components/ng2-alfresco-login/demo/src/main.ts
@@ -29,6 +29,7 @@ import { LoginModule } from 'ng2-alfresco-login';
ECM Host:
BPM Host: