mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
remove wrong pushed folder
This commit is contained in:
@@ -1,23 +0,0 @@
|
|||||||
# 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
|
|
@@ -1,13 +0,0 @@
|
|||||||
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
|
|
@@ -1,8 +0,0 @@
|
|||||||
language: node_js
|
|
||||||
node_js:
|
|
||||||
- v5
|
|
||||||
- v4
|
|
||||||
install: npm install
|
|
||||||
sudo: false
|
|
||||||
after_success:
|
|
||||||
npm run coverage
|
|
@@ -1,13 +0,0 @@
|
|||||||
Copyright 2016 vito albano <vito.albano@alfresco.com>
|
|
||||||
|
|
||||||
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.
|
|
@@ -1,73 +0,0 @@
|
|||||||
# Alfresco User Info Component for Angular 2
|
|
||||||
This component will show the user information for ECM and BPM
|
|
||||||
|
|
||||||
|
|
||||||
## Prerequisites
|
|
||||||
|
|
||||||
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
|
|
||||||
```
|
|
||||||
## Dependencies
|
|
||||||
|
|
||||||
Add the following dependency to your index.html:
|
|
||||||
```html
|
|
||||||
<script src="node_modules/alfresco-js-api/dist/alfresco-js-api.js"></script>
|
|
||||||
```
|
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
```sh
|
|
||||||
npm install --save ng2-translate ng2-alfresco-core
|
|
||||||
```
|
|
||||||
|
|
||||||
#### 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
|
|
||||||
<!-- Google Material Design Lite -->
|
|
||||||
<link rel="stylesheet" href="node_modules/material-design-lite/material.min.css">
|
|
||||||
<script src="node_modules/material-design-lite/material.min.js"></script>
|
|
||||||
<link rel="stylesheet" href="node_modules/material-design-icons/iconfont/material-icons.css">
|
|
||||||
```
|
|
||||||
|
|
||||||
## Example
|
|
||||||
|
|
||||||
```html
|
|
||||||
<ng2-alfresco-userinfo></ng2-alfresco-userinfo>
|
|
||||||
```
|
|
||||||
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.
|
|
||||||
|
|
||||||
## NPM scripts
|
|
||||||
|
|
||||||
| 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 |
|
|
||||||
|
|
||||||
## History
|
|
||||||
|
|
||||||
For detailed changelog, check [Releases](https://github.com/alfresco/ng2-alfresco-userinfo/releases).
|
|
||||||
|
|
||||||
## Contributors
|
|
||||||
|
|
||||||
[Contributors](https://github.com/alfresco/ng2-alfresco-userinfo/graphs/contributors)
|
|
@@ -1,10 +0,0 @@
|
|||||||
|
|
||||||
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
|
|
@@ -1,5 +0,0 @@
|
|||||||
typings/
|
|
||||||
node_modules/
|
|
||||||
.idea
|
|
||||||
dist/
|
|
||||||
!systemjs.config.js
|
|
@@ -1,19 +0,0 @@
|
|||||||
# ng2-alfresco-userinfo - 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
|
|
||||||
```
|
|
@@ -1,71 +0,0 @@
|
|||||||
<!-- DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
|
|
||||||
<title>ng2-alfresco-userinfo Angular 2</title>
|
|
||||||
<base href="/">
|
|
||||||
|
|
||||||
<!-- Google Material Design Lite --
|
|
||||||
<link rel="stylesheet" href="assets/material.orange-blue.min.css">
|
|
||||||
<script src="node_modules/material-design-lite/material.min.js"></script>
|
|
||||||
<link rel="stylesheet" href="node_modules/material-design-icons/iconfont/material-icons.css">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Polyfill(s) for older browsers --
|
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
|
||||||
<script src="node_modules/zone.js/dist/zone.js"></script>
|
|
||||||
<script src="node_modules/reflect-metadata/Reflect.js"></script>
|
|
||||||
<script src="node_modules/systemjs/dist/system.src.js"></script>
|
|
||||||
|
|
||||||
<!-- Additional Alfresco libraries --
|
|
||||||
<script src="node_modules/alfresco-js-api/dist/alfresco-js-api.js"></script>
|
|
||||||
|
|
||||||
<script src="systemjs.config.js"></script>
|
|
||||||
<script>
|
|
||||||
System.import('app').catch(function(err){ console.error(err); });
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<my-app>
|
|
||||||
<div id="loader-spin" class="mdl-progress mdl-js-progress mdl-progress__indeterminate"></div>
|
|
||||||
</my-app>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html -->
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<script>document.write('<base href="' + document.location + '" />');</script>
|
|
||||||
<title>NgModule Minimal</title>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<link rel="stylesheet" href="styles.css">
|
|
||||||
|
|
||||||
<!-- Polyfill(s) for older browsers -->
|
|
||||||
<script src="https://unpkg.com/core-js/client/shim.min.js"></script>
|
|
||||||
|
|
||||||
<script src="https://unpkg.com/zone.js@0.6.25?main=browser"></script>
|
|
||||||
<script src="https://unpkg.com/reflect-metadata@0.1.3"></script>
|
|
||||||
<script src="https://unpkg.com/systemjs@0.19.27/dist/system.src.js"></script>
|
|
||||||
|
|
||||||
<script src="systemjs.config.js"></script>
|
|
||||||
<script>
|
|
||||||
System.import('app/main.0').catch(function(err){ console.error(err); });
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<my-app>Loading...</my-app>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Copyright 2016 Google Inc. All Rights Reserved.
|
|
||||||
Use of this source code is governed by an MIT-style license that
|
|
||||||
can be found in the LICENSE file at http://angular.io/license
|
|
||||||
-->
|
|
@@ -1,89 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "ng2-alfresco-userinfo-demo",
|
|
||||||
"description": "This component will show the user information for ECM and BPM - Demo",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"author": "vito albano <vito.albano@alfresco.com>",
|
|
||||||
"scripts": {
|
|
||||||
"clean": "rimraf dist node_modules",
|
|
||||||
"build": "npm run tslint && rimraf dist && tsc && npm run copy-dist",
|
|
||||||
"build:w": "npm run tslint && rimraf dist && npm run watch-task",
|
|
||||||
"watch-task": "concurrently \"npm run tsc:w\" \"npm run copy-dist:w\" ",
|
|
||||||
"start": "npm run build && concurrently \"npm run tsc:w\" \"npm run server\" ",
|
|
||||||
"server": "wsrv -o -l -s",
|
|
||||||
"tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json 'src/{,**/}**.ts'",
|
|
||||||
"copy-dist": "cpx \"./src/**/*.{html,css,json,png,jpg,gif,svg}\" ./dist/src",
|
|
||||||
"copy-dist:w": "cpx \"./src/**/*.{html,css,json,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\""
|
|
||||||
},
|
|
||||||
"main": "index.js",
|
|
||||||
"typings": "./dist/index.d.ts",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/Alfresco/alfresco-ng2-components.git"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
|
||||||
},
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"contributors": [
|
|
||||||
{
|
|
||||||
"name": "Vito Albano",
|
|
||||||
"email": "vito.albano@alfresco.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"keywords": [
|
|
||||||
"ng2",
|
|
||||||
"angular",
|
|
||||||
"angular2",
|
|
||||||
"alfresco",
|
|
||||||
"demo"
|
|
||||||
],
|
|
||||||
"dependencies": {
|
|
||||||
"@angular/common": "2.0.0",
|
|
||||||
"@angular/compiler": "2.0.0",
|
|
||||||
"@angular/core": "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",
|
|
||||||
"ng2-translate": "2.5.0",
|
|
||||||
"ng2-alfresco-core": "0.3.2",
|
|
||||||
"material-design-icons": "2.2.3",
|
|
||||||
"material-design-lite": "1.2.1",
|
|
||||||
"ng2-alfresco-userinfo": "file:../"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/core-js": "^0.9.32",
|
|
||||||
"@types/jasmine": "^2.2.33",
|
|
||||||
"concurrently": "^2.2.0",
|
|
||||||
"cpx": "1.3.1",
|
|
||||||
"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.1.5",
|
|
||||||
"remap-istanbul": "0.6.3",
|
|
||||||
"rimraf": "2.5.2",
|
|
||||||
"traceur": "0.0.91",
|
|
||||||
"tslint": "3.8.1",
|
|
||||||
"typescript": "^2.0.3",
|
|
||||||
"wsrv": "^0.1.5"
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -1,95 +0,0 @@
|
|||||||
/*
|
|
||||||
import { NgModule, Component, OnInit } from '@angular/core';
|
|
||||||
import { UserInfoComponent } from 'ng2-alfresco-userinfo';
|
|
||||||
import { BrowserModule } from '@angular/platform-browser';
|
|
||||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
||||||
import { CoreModule,
|
|
||||||
AlfrescoSettingsService,
|
|
||||||
AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'my-app',
|
|
||||||
styles: [`:host h1 { font-size:22px }`],
|
|
||||||
template: `<h1>TEST</h1>`
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
class UserInfoDemo implements OnInit {
|
|
||||||
|
|
||||||
public userToLogin: string = 'admin';
|
|
||||||
public password: string = 'admin';
|
|
||||||
public loginErrorMessage: string;
|
|
||||||
public providers: string = 'BPM';
|
|
||||||
private authenticated: boolean;
|
|
||||||
private token: any;
|
|
||||||
|
|
||||||
constructor(private authService: AlfrescoAuthenticationService,
|
|
||||||
private settingsService: AlfrescoSettingsService) {
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
this.settingsService.setProviders(this.providers);
|
|
||||||
}
|
|
||||||
|
|
||||||
attemptLogin() {
|
|
||||||
this.loginErrorMessage = '';
|
|
||||||
this.login(this.userToLogin, this.password);
|
|
||||||
}
|
|
||||||
|
|
||||||
logout() {
|
|
||||||
this.authService.logout();
|
|
||||||
}
|
|
||||||
|
|
||||||
login(user, password) {
|
|
||||||
this.settingsService.setProviders(this.providers);
|
|
||||||
this.authService.login(user, password).subscribe(
|
|
||||||
token => {
|
|
||||||
console.log(token);
|
|
||||||
this.token = token;
|
|
||||||
this.authenticated = true;
|
|
||||||
},
|
|
||||||
error => {
|
|
||||||
console.log(error);
|
|
||||||
this.authenticated = false;
|
|
||||||
this.loginErrorMessage = error;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
isLoggedIn(): boolean {
|
|
||||||
return this.authService.isLoggedIn();
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleECM(checked) {
|
|
||||||
if (checked && this.providers === 'BPM') {
|
|
||||||
this.providers = 'ALL';
|
|
||||||
} else if (checked) {
|
|
||||||
this.providers = 'ECM';
|
|
||||||
} else {
|
|
||||||
this.providers = undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleBPM(checked) {
|
|
||||||
if (checked && this.providers === 'ECM') {
|
|
||||||
this.providers = 'ALL';
|
|
||||||
} else if (checked) {
|
|
||||||
this.providers = 'BPM';
|
|
||||||
} else {
|
|
||||||
this.providers = undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [
|
|
||||||
BrowserModule,
|
|
||||||
CoreModule.forRoot(),
|
|
||||||
UserInfoComponent
|
|
||||||
],
|
|
||||||
declarations: [ UserInfoComponent ],
|
|
||||||
bootstrap: [ UserInfoComponent ]
|
|
||||||
})
|
|
||||||
export class AppModule { }
|
|
||||||
|
|
||||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
|
||||||
*/
|
|
@@ -1,56 +0,0 @@
|
|||||||
|
|
||||||
'use strict';
|
|
||||||
(function(/*global*/) {
|
|
||||||
|
|
||||||
// map tells the System loader where to look for things
|
|
||||||
var map = {
|
|
||||||
app: 'dist/',
|
|
||||||
'@angular': 'node_modules/@angular',
|
|
||||||
rxjs: 'node_modules/rxjs',
|
|
||||||
|
|
||||||
'ng2-translate': 'node_modules/ng2-translate',
|
|
||||||
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core/dist',
|
|
||||||
|
|
||||||
'ng2-alfresco-userinfo': 'node_modules/ng2-alfresco-userinfo/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' },
|
|
||||||
|
|
||||||
'ng2-translate': { defaultExtension: 'js' },
|
|
||||||
'ng2-alfresco-core': { main: 'index.js', defaultExtension: 'js' },
|
|
||||||
|
|
||||||
'ng2-alfresco-userinfo': { 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);
|
|
@@ -1,33 +0,0 @@
|
|||||||
/*{
|
|
||||||
"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"
|
|
||||||
]
|
|
||||||
} */
|
|
||||||
|
|
||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"target": "es5",
|
|
||||||
"module": "commonjs",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"sourceMap": true,
|
|
||||||
"emitDecoratorMetadata": true,
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"removeComments": false,
|
|
||||||
"noImplicitAny": true,
|
|
||||||
"suppressImplicitAnyIndexErrors": true
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,124 +0,0 @@
|
|||||||
{
|
|
||||||
"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"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,58 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @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 { NgModule, ModuleWithProviders } from '@angular/core';
|
|
||||||
import { CoreModule } from 'ng2-alfresco-core';
|
|
||||||
import { EcmUserService } from './src/services/ecm-user.service';
|
|
||||||
import { BpmUserService } from './src/services/bpm-user.service';
|
|
||||||
import { UserInfoComponent } from './src/components/user-info.component';
|
|
||||||
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
|
||||||
|
|
||||||
export * from './src/components/user-info.component';
|
|
||||||
export * from './src/services/bpm-user.service';
|
|
||||||
export * from './src/services/ecm-user.service';
|
|
||||||
|
|
||||||
export const USER_INFO_SERVICE: any[] = [
|
|
||||||
EcmUserService,
|
|
||||||
BpmUserService,
|
|
||||||
AlfrescoAuthenticationService
|
|
||||||
];
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [
|
|
||||||
CoreModule
|
|
||||||
],
|
|
||||||
declarations: [
|
|
||||||
UserInfoComponent
|
|
||||||
],
|
|
||||||
providers: [
|
|
||||||
...USER_INFO_SERVICE
|
|
||||||
],
|
|
||||||
exports: [
|
|
||||||
UserInfoComponent
|
|
||||||
]
|
|
||||||
})
|
|
||||||
export class UserInfoComponentModule {
|
|
||||||
static forRoot(): ModuleWithProviders {
|
|
||||||
return {
|
|
||||||
ngModule: UserInfoComponentModule,
|
|
||||||
providers: [
|
|
||||||
...USER_INFO_SERVICE
|
|
||||||
]
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,128 +0,0 @@
|
|||||||
// Tun on full stack traces in errors to help debugging
|
|
||||||
Error.stackTraceLimit = Infinity;
|
|
||||||
|
|
||||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000;
|
|
||||||
|
|
||||||
__karma__.loaded = function() {};
|
|
||||||
|
|
||||||
var builtPath = '/base/dist/';
|
|
||||||
|
|
||||||
function isJsFile(path) {
|
|
||||||
return path.slice(-3) == '.js';
|
|
||||||
}
|
|
||||||
|
|
||||||
function isSpecFile(path) {
|
|
||||||
return /\.spec\.(.*\.)?js$/.test(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
function isBuiltFile(path) {
|
|
||||||
return isJsFile(path) && (path.substr(0, builtPath.length) == builtPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
var allSpecFiles = Object.keys(window.__karma__.files)
|
|
||||||
.filter(isSpecFile)
|
|
||||||
.filter(isBuiltFile);
|
|
||||||
|
|
||||||
var paths = {
|
|
||||||
// paths serve as alias
|
|
||||||
'npm:': 'base/node_modules/'
|
|
||||||
};
|
|
||||||
|
|
||||||
var map = {
|
|
||||||
'app': 'base/dist',
|
|
||||||
// angular bundles
|
|
||||||
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
|
|
||||||
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
|
|
||||||
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
|
|
||||||
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
|
|
||||||
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
|
|
||||||
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
|
|
||||||
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
|
|
||||||
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
|
|
||||||
// testing
|
|
||||||
'@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js',
|
|
||||||
'@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js',
|
|
||||||
'@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js',
|
|
||||||
'@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
|
|
||||||
'@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
|
|
||||||
'@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js',
|
|
||||||
'@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js',
|
|
||||||
'@angular/forms/testing': 'npm:@angular/forms/bundles/forms-testing.umd.js',
|
|
||||||
|
|
||||||
// other libraries
|
|
||||||
'rxjs': 'npm:rxjs',
|
|
||||||
'ng2-translate': 'npm:ng2-translate',
|
|
||||||
|
|
||||||
'alfresco-js-api': 'npm:alfresco-js-api/dist',
|
|
||||||
'ng2-activiti-form': 'npm:ng2-activiti-form/dist',
|
|
||||||
'ng2-activiti-processlist': 'npm:ng2-activiti-processlist/dist',
|
|
||||||
'ng2-activiti-tasklist': 'npm:ng2-activiti-tasklist/dist',
|
|
||||||
'ng2-alfresco-core': 'npm:ng2-alfresco-core/dist',
|
|
||||||
'ng2-alfresco-datatable': 'npm:ng2-alfresco-datatable/dist',
|
|
||||||
'ng2-alfresco-documentlist': 'npm:ng2-alfresco-documentlist/dist',
|
|
||||||
'ng2-alfresco-login': 'npm:ng2-alfresco-login/dist',
|
|
||||||
'ng2-alfresco-search': 'npm:ng2-alfresco-search/dist',
|
|
||||||
'ng2-alfresco-tag': 'npm:ng2-alfresco-tag/dist',
|
|
||||||
'ng2-alfresco-upload': 'npm:ng2-alfresco-upload/dist',
|
|
||||||
'ng2-alfresco-viewer': 'npm:ng2-alfresco-viewer/dist',
|
|
||||||
'ng2-alfresco-webscript': 'npm:ng2-alfresco-webscript/dist',
|
|
||||||
'ng2-alfresco-userinfo': 'npm:ng2-alfresco-userinfo/dist'
|
|
||||||
};
|
|
||||||
|
|
||||||
var packages = {
|
|
||||||
'app': { main: 'index.js', defaultExtension: 'js', format: 'register' },
|
|
||||||
'rxjs': { defaultExtension: 'js' },
|
|
||||||
'ng2-translate': { defaultExtension: 'js' },
|
|
||||||
|
|
||||||
'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'},
|
|
||||||
'ng2-activiti-form': { main: './index.js', defaultExtension: 'js'},
|
|
||||||
'ng2-activiti-processlist': { main: './index.js', defaultExtension: 'js'},
|
|
||||||
'ng2-activiti-tasklist': { main: './index.js', defaultExtension: 'js'},
|
|
||||||
'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'},
|
|
||||||
'ng2-alfresco-datatable': { main: './index.js', defaultExtension: 'js'},
|
|
||||||
'ng2-alfresco-documentlist': { main: './index.js', defaultExtension: 'js'},
|
|
||||||
'ng2-alfresco-login': { main: './index.js', defaultExtension: 'js'},
|
|
||||||
'ng2-alfresco-search': { main: './index.js', defaultExtension: 'js'},
|
|
||||||
'ng2-alfresco-tag': { main: './index.js', defaultExtension: 'js'},
|
|
||||||
'ng2-alfresco-upload': { main: './index.js', defaultExtension: 'js'},
|
|
||||||
'ng2-alfresco-viewer': { main: './index.js', defaultExtension: 'js'},
|
|
||||||
'ng2-alfresco-webscript': { main: './index.js', defaultExtension: 'js'},
|
|
||||||
'ng2-alfresco-userinfo': { main: './index.js', defaultExtension: 'js'}
|
|
||||||
};
|
|
||||||
|
|
||||||
var config = {
|
|
||||||
paths: paths,
|
|
||||||
map: map,
|
|
||||||
packages: packages
|
|
||||||
};
|
|
||||||
|
|
||||||
System.config(config);
|
|
||||||
|
|
||||||
System.import('app')
|
|
||||||
.then(initTestBed)
|
|
||||||
.then(initTesting);
|
|
||||||
|
|
||||||
function initTestBed(){
|
|
||||||
return Promise.all([
|
|
||||||
System.import('@angular/core/testing'),
|
|
||||||
System.import('@angular/platform-browser-dynamic/testing')
|
|
||||||
])
|
|
||||||
.then(function (providers) {
|
|
||||||
var coreTesting = providers[0];
|
|
||||||
var browserTesting = providers[1];
|
|
||||||
|
|
||||||
coreTesting.TestBed.initTestEnvironment(
|
|
||||||
browserTesting.BrowserDynamicTestingModule,
|
|
||||||
browserTesting.platformBrowserDynamicTesting());
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// Import all spec files and start karma
|
|
||||||
function initTesting () {
|
|
||||||
return Promise.all(
|
|
||||||
allSpecFiles.map(function (moduleName) {
|
|
||||||
return System.import(moduleName);
|
|
||||||
})
|
|
||||||
)
|
|
||||||
.then(__karma__.start, __karma__.error);
|
|
||||||
}
|
|
@@ -1,131 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
module.exports = function (config) {
|
|
||||||
var configuration = {
|
|
||||||
basePath: '.',
|
|
||||||
|
|
||||||
frameworks: ['jasmine-ajax', 'jasmine'],
|
|
||||||
|
|
||||||
files: [
|
|
||||||
// System.js for module loading
|
|
||||||
'node_modules/systemjs/dist/system.src.js',
|
|
||||||
|
|
||||||
// Polyfills
|
|
||||||
'node_modules/core-js/client/shim.js',
|
|
||||||
'node_modules/reflect-metadata/Reflect.js',
|
|
||||||
|
|
||||||
// zone.js
|
|
||||||
'node_modules/zone.js/dist/zone.js',
|
|
||||||
'node_modules/zone.js/dist/long-stack-trace-zone.js',
|
|
||||||
'node_modules/zone.js/dist/proxy.js',
|
|
||||||
'node_modules/zone.js/dist/sync-test.js',
|
|
||||||
'node_modules/zone.js/dist/jasmine-patch.js',
|
|
||||||
'node_modules/zone.js/dist/async-test.js',
|
|
||||||
'node_modules/zone.js/dist/fake-async-test.js',
|
|
||||||
|
|
||||||
// RxJs
|
|
||||||
{ pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false },
|
|
||||||
{ pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false },
|
|
||||||
|
|
||||||
// Paths loaded via module imports:
|
|
||||||
// Angular itself
|
|
||||||
{pattern: 'node_modules/@angular/**/*.js', included: false, watched: false},
|
|
||||||
{pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false},
|
|
||||||
|
|
||||||
'node_modules/alfresco-js-api/dist/alfresco-js-api.js',
|
|
||||||
{pattern: 'node_modules/ng2-translate/**/*.js', included: false, watched: false},
|
|
||||||
{pattern: 'node_modules/ng2-translate/**/*.js.map', included: false, watched: false},
|
|
||||||
|
|
||||||
'karma-test-shim.js',
|
|
||||||
|
|
||||||
// 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},
|
|
||||||
|
|
||||||
// ng2-components
|
|
||||||
{ pattern: 'node_modules/ng2-activiti-form/dist/**/*.js', included: false, served: true, watched: false },
|
|
||||||
{ pattern: 'node_modules/ng2-activiti-processlist/dist/**/*.js', included: false, served: true, watched: false },
|
|
||||||
{ pattern: 'node_modules/ng2-activiti-tasklist/dist/**/*.js', included: false, served: true, watched: false },
|
|
||||||
{ pattern: 'node_modules/ng2-alfresco-core/dist/**/*.js', included: false, served: true, watched: false },
|
|
||||||
{ pattern: 'node_modules/ng2-alfresco-datatable/dist/**/*.js', included: false, served: true, watched: false },
|
|
||||||
{ pattern: 'node_modules/ng2-alfresco-documentlist/dist/**/*.js', included: false, served: true, watched: false },
|
|
||||||
{ pattern: 'node_modules/ng2-alfresco-login/dist/**/*.js', included: false, served: true, watched: false },
|
|
||||||
{ pattern: 'node_modules/ng2-alfresco-search/dist/**/*.js', included: false, served: true, watched: false },
|
|
||||||
{ pattern: 'node_modules/ng2-alfresco-tag/dist/**/*.js', included: false, served: true, watched: false },
|
|
||||||
{ pattern: 'node_modules/ng2-alfresco-upload/dist/**/*.js', included: false, served: true, watched: false },
|
|
||||||
{ pattern: 'node_modules/ng2-alfresco-viewer/dist/**/*.js', included: false, served: true, watched: false },
|
|
||||||
{ pattern: 'node_modules/ng2-alfresco-webscript/dist/**/*.js', included: false, served: true, watched: false },
|
|
||||||
{ pattern: 'node_modules/ng2-alfresco-userinfo/dist/**/*.js', included: false, served: true, watched: false },
|
|
||||||
|
|
||||||
// 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}
|
|
||||||
],
|
|
||||||
|
|
||||||
exclude: [
|
|
||||||
'node_modules/**/*spec.js'
|
|
||||||
],
|
|
||||||
|
|
||||||
// proxied base paths
|
|
||||||
proxies: {
|
|
||||||
// required for component assets fetched by Angular's compiler
|
|
||||||
'/src/': '/base/src/'
|
|
||||||
},
|
|
||||||
|
|
||||||
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'],
|
|
||||||
|
|
||||||
customLaunchers: {
|
|
||||||
Chrome_travis_ci: {
|
|
||||||
base: 'Chrome',
|
|
||||||
flags: ['--no-sandbox']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// Karma plugins loaded
|
|
||||||
plugins: [
|
|
||||||
'karma-jasmine',
|
|
||||||
'karma-coverage',
|
|
||||||
'karma-jasmine-ajax',
|
|
||||||
'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: 'json', file: 'coverage-final.json'},
|
|
||||||
{type: 'html'},
|
|
||||||
{type: 'lcov'}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (process.env.TRAVIS) {
|
|
||||||
configuration.browsers = ['Chrome_travis_ci'];
|
|
||||||
}
|
|
||||||
|
|
||||||
config.set(configuration)
|
|
||||||
};
|
|
@@ -1,94 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "ng2-alfresco-userinfo",
|
|
||||||
"description": "This component will show the user information for ECM and BPM",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"author": "vito albano <vito.albano@alfresco.com>",
|
|
||||||
"scripts": {
|
|
||||||
"clean": "rimraf dist node_modules",
|
|
||||||
"build": "npm run tslint && rimraf dist && tsc && npm run copy-dist",
|
|
||||||
"build:w": "npm run tslint && rimraf dist && npm run watch-task",
|
|
||||||
"watch-task": "concurrently \"npm run tsc:w\" \"npm run copy-dist:w\" \"license-check\"",
|
|
||||||
"tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json 'src/{,**/}**.ts'",
|
|
||||||
"copy-dist": "cpx \"./src/**/*.{html,css,json,png,jpg,gif,svg}\" ./dist/src",
|
|
||||||
"copy-dist:w": "cpx \"./src/**/*.{html,css,json,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": "remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json",
|
|
||||||
"coverage": "npm run test && wsrv -o -p 9875 ./coverage/report",
|
|
||||||
"travis": "npm link ng2-alfresco-core"
|
|
||||||
},
|
|
||||||
"main": "./dist/index.js",
|
|
||||||
"typings": "./dist/index.d.ts",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/Alfresco/alfresco-ng2-components.git"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
|
||||||
},
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"contributors": [
|
|
||||||
{
|
|
||||||
"name": "Vito Albano",
|
|
||||||
"email": "vito.albano@alfresco.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"keywords": [
|
|
||||||
"ng2",
|
|
||||||
"angular",
|
|
||||||
"angular2",
|
|
||||||
"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",
|
|
||||||
"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",
|
|
||||||
"ng2-translate": "2.5.0",
|
|
||||||
"ng2-alfresco-core": "0.3.2"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/core-js": "^0.9.32",
|
|
||||||
"@types/jasmine": "^2.2.33",
|
|
||||||
"concurrently": "^2.2.0",
|
|
||||||
"cpx": "1.3.1",
|
|
||||||
"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.1.5",
|
|
||||||
"remap-istanbul": "0.6.3",
|
|
||||||
"rimraf": "2.5.2",
|
|
||||||
"traceur": "0.0.91",
|
|
||||||
"tslint": "3.8.1",
|
|
||||||
"typescript": "^2.0.2",
|
|
||||||
"wsrv": "^0.1.5"
|
|
||||||
},
|
|
||||||
"license-check-config": {
|
|
||||||
"src": [
|
|
||||||
"./dist/**/*.js"
|
|
||||||
],
|
|
||||||
"path": "assets/license_header.txt",
|
|
||||||
"blocking": true,
|
|
||||||
"logInfo": false,
|
|
||||||
"logError": true
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,53 +0,0 @@
|
|||||||
.profile-image {
|
|
||||||
text-align: center;
|
|
||||||
border-radius: 90%;
|
|
||||||
width: 40px;
|
|
||||||
margin-right: 0%;
|
|
||||||
cursor: pointer;
|
|
||||||
border: 1px solid #999999;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button-profile {
|
|
||||||
display: inline-block;
|
|
||||||
border: 0px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-user-profile-list-mdl{
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.user-profile-list-mdl{
|
|
||||||
max-height: 450px;
|
|
||||||
min-width: 450px;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header-profile{
|
|
||||||
color: rgb(255,152,0);
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr.title-start {
|
|
||||||
border: 0;
|
|
||||||
height: 1px;
|
|
||||||
background: #333;
|
|
||||||
background-image: linear-gradient(to right, #ccc, #333, #ccc);
|
|
||||||
}
|
|
||||||
|
|
||||||
span.role-label-user{
|
|
||||||
font-weight: 400;
|
|
||||||
line-height: 1;
|
|
||||||
letter-spacing: 0;
|
|
||||||
color: rgba(0,0,0,.87);
|
|
||||||
}
|
|
||||||
|
|
||||||
.custom-role-style{
|
|
||||||
font-size: 14px;
|
|
||||||
color: #9e9e9e;
|
|
||||||
}
|
|
||||||
|
|
||||||
.truncate-long-names{
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
@@ -1,63 +0,0 @@
|
|||||||
<div id="img_container">
|
|
||||||
<span *ngIf="ecmUser">{{ecmUser.firstName || ecmUser.lastName}}</span>
|
|
||||||
<span *ngIf="bpmUser">
|
|
||||||
{{ formatValue(bpmUser.firstName) ||
|
|
||||||
formatValue(bpmUser.lastName) ||
|
|
||||||
formatValue(bpmUser.fullName) }}
|
|
||||||
</span>
|
|
||||||
<div class="button-profile" id="user-profile" data-automation-id="user-profile">
|
|
||||||
<img id="logged-user-img"
|
|
||||||
[src]="getUserAvatar()"
|
|
||||||
class="profile-image"/>
|
|
||||||
</div>
|
|
||||||
<div class="user-profile-list-mdl
|
|
||||||
mdl-menu mdl-menu--bottom-right
|
|
||||||
mdl-js-menu mdl-js-ripple-effect"
|
|
||||||
for="user-profile">
|
|
||||||
<ul class='detail-user-profile-list-mdl mdl-list'>
|
|
||||||
<div *ngIf="ecmUser">
|
|
||||||
<span class="header-profile"><b>ECM</b></span>
|
|
||||||
<hr class="title-start">
|
|
||||||
<li class="mdl-list__item mdl-list__item--two-line">
|
|
||||||
<span class="mdl-list__item-primary-content">
|
|
||||||
<i class="mdl-list__item-avatar">
|
|
||||||
<img id="logged-user-img"
|
|
||||||
[src]="getEcmUserDetailAvatarUrl()"
|
|
||||||
class="profile-image"/>
|
|
||||||
</i>
|
|
||||||
<span class="truncate-long-names">{{ecmUser.firstName}} {{ecmUser.lastName}}</span>
|
|
||||||
<span class="mdl-list__item-sub-title">{{ecmUser.email}}</span>
|
|
||||||
</span>
|
|
||||||
<span class="mdl-list__item-secondary-content custom-role-style">
|
|
||||||
<span class="role-label-user">Job Role</span>
|
|
||||||
{{ecmUser.jobTitle}}
|
|
||||||
</span>
|
|
||||||
</li>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div *ngIf="bpmUser">
|
|
||||||
<span class="header-profile"><b>BPM</b></span>
|
|
||||||
<hr class="title-start">
|
|
||||||
<li class="mdl-list__item mdl-list__item--two-line">
|
|
||||||
<span class="mdl-list__item-primary-content">
|
|
||||||
<i class="mdl-list__item-avatar">
|
|
||||||
<img id="logged-user-img"
|
|
||||||
[src]="getBpmUserDetailAvatarUrl()"
|
|
||||||
class="profile-image"/>
|
|
||||||
</i>
|
|
||||||
<span class="truncate-long-names">
|
|
||||||
{{formatValue(bpmUser.firstName) }} {{ formatValue(bpmUser.lastName) }}
|
|
||||||
</span>
|
|
||||||
<span class="mdl-list__item-sub-title">{{bpmUser.email}}</span>
|
|
||||||
</span>
|
|
||||||
<span class="mdl-list__item-secondary-content custom-role-style">
|
|
||||||
<span class="role-label-user">Tenant</span>
|
|
||||||
{{bpmUser.tenantName}}
|
|
||||||
</span>
|
|
||||||
</li>
|
|
||||||
</div>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
@@ -1,25 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @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 { UserInfoComponent } from '../src/userinfo.component';
|
|
||||||
|
|
||||||
describe('Basic Example test ng2-alfresco-userinfo', () => {
|
|
||||||
|
|
||||||
it('Test hello world', () => {
|
|
||||||
expect(true).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
@@ -1,93 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @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, OnInit } from '@angular/core';
|
|
||||||
import { EcmUserModel } from './../models/ecm-user.model';
|
|
||||||
import { BpmUserModel } from './../models/bpm-user.model';
|
|
||||||
import { EcmUserService } from './../services/ecm-user.service';
|
|
||||||
import { BpmUserService } from './../services/bpm-user.service';
|
|
||||||
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
|
||||||
|
|
||||||
declare let __moduleName: string;
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'ng2-alfresco-userinfo',
|
|
||||||
moduleId: __moduleName,
|
|
||||||
styleUrls: ['./userinfo.component.css'],
|
|
||||||
template: `<h1>HELLO</h1>`
|
|
||||||
})
|
|
||||||
|
|
||||||
export class UserInfoComponent implements OnInit {
|
|
||||||
|
|
||||||
private ecmUser: EcmUserModel;
|
|
||||||
private bpmUser: BpmUserModel;
|
|
||||||
private baseComponentPath = __moduleName.replace('userinfo.component.js', '');
|
|
||||||
private anonymouseImageUrl: string = this.baseComponentPath + 'img/anonymous.gif';
|
|
||||||
public bpmUserImage: any;
|
|
||||||
public ecmUserImage: any;
|
|
||||||
|
|
||||||
constructor(private ecmUserService: EcmUserService,
|
|
||||||
private bpmUserService: BpmUserService,
|
|
||||||
public authService: AlfrescoAuthenticationService) {
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
if (this.authService.getAlfrescoApi().ecmAuth.isLoggedIn()) {
|
|
||||||
this.ecmUserService.getUserInfo('-me-')
|
|
||||||
.subscribe(
|
|
||||||
(res) => {
|
|
||||||
this.ecmUser = <EcmUserModel> res;
|
|
||||||
this.getEcmUserProfileImage();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (this.authService.getAlfrescoApi().bpmAuth.isLoggedIn()) {
|
|
||||||
this.bpmUserService.getCurrentUserInfo()
|
|
||||||
.subscribe(
|
|
||||||
(res) => {
|
|
||||||
this.bpmUser = <BpmUserModel> res;
|
|
||||||
this.getBpmUserProfileImage();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private getBpmUserProfileImage() {
|
|
||||||
this.bpmUserImage = this.bpmUserService.getCurrentUserProfileImage();
|
|
||||||
}
|
|
||||||
|
|
||||||
private getEcmUserProfileImage() {
|
|
||||||
this.ecmUserImage = this.ecmUserService.getCurrentUserProfileImageUrl(this.ecmUser.avatarId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public getUserAvatar() {
|
|
||||||
return this.ecmUserImage || this.bpmUserImage || this.anonymouseImageUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public getBpmUserDetailAvatarUrl() {
|
|
||||||
return this.bpmUserImage || this.anonymouseImageUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public getEcmUserDetailAvatarUrl() {
|
|
||||||
return this.ecmUserImage || this.anonymouseImageUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public formatValue(value: string) {
|
|
||||||
return value === 'null' ? null : value;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"FILE_UPLOAD": {
|
|
||||||
"BUTTON": {
|
|
||||||
"UPLOAD_FILE": "Upload file",
|
|
||||||
"UPLOAD_FOLDER": "Upload folder",
|
|
||||||
"CANCEL": "CANCEL"
|
|
||||||
},
|
|
||||||
"MESSAGES": {
|
|
||||||
"COMPLETED": "uploads complete",
|
|
||||||
"PROGRESS": "Upload in progress...",
|
|
||||||
"FOLDER_ALREADY_EXIST": "The folder {0} already exist",
|
|
||||||
"FOLDER_NOT_SUPPORTED": "Folder upload isn't supported by your browser"
|
|
||||||
},
|
|
||||||
"FILE_INFO": {
|
|
||||||
"NAME": "File name",
|
|
||||||
"PROGRESS": "File progress",
|
|
||||||
"SIZE": "File size",
|
|
||||||
"ACTION": "Actions"
|
|
||||||
},
|
|
||||||
"ACTION": {
|
|
||||||
"UNDO": "Undo"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"FILE_UPLOAD": {
|
|
||||||
"BUTTON": {
|
|
||||||
"UPLOAD_FILE": "Carica un file",
|
|
||||||
"UPLOAD_FOLDER": "Carica una cartella",
|
|
||||||
"CANCEL": "CANCELLA"
|
|
||||||
},
|
|
||||||
"MESSAGES": {
|
|
||||||
"COMPLETED": "caricamenti completati",
|
|
||||||
"PROGRESS": "caricamento in corso...",
|
|
||||||
"FOLDER_ALREADY_EXIST": "Cartella {0} già presente",
|
|
||||||
"FOLDER_NOT_SUPPORTED": "L' upload di cartelle non é supportato dal tuo browser"
|
|
||||||
},
|
|
||||||
"FILE_INFO": {
|
|
||||||
"NAME": "Nome file",
|
|
||||||
"PROGRESS": "Percentuale caricamento",
|
|
||||||
"SIZE": "Dimensione file",
|
|
||||||
"ACTION": "Azioni"
|
|
||||||
},
|
|
||||||
"ACTION": {
|
|
||||||
"UNDO": "Annulla"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.7 KiB |
@@ -1,39 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @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 class BpmUserModel {
|
|
||||||
apps: any;
|
|
||||||
capabilities: string;
|
|
||||||
company: string;
|
|
||||||
created: string;
|
|
||||||
email: string;
|
|
||||||
externalId: string;
|
|
||||||
firstName: string;
|
|
||||||
lastName: string;
|
|
||||||
fullname: string;
|
|
||||||
groups: any;
|
|
||||||
id: string;
|
|
||||||
lastUpdate: string;
|
|
||||||
latestSyncTimeStamp: string;
|
|
||||||
password: string;
|
|
||||||
pictureId: string;
|
|
||||||
status: string;
|
|
||||||
tenantId: string;
|
|
||||||
tenantName: string;
|
|
||||||
tenantPictureId: string;
|
|
||||||
type: string;
|
|
||||||
}
|
|
@@ -1,27 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @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 class EcmCompanyModel {
|
|
||||||
organization: string;
|
|
||||||
address1: string;
|
|
||||||
address2: string;
|
|
||||||
address3: string;
|
|
||||||
postcode: string;
|
|
||||||
telephone: string;
|
|
||||||
fax: string;
|
|
||||||
email: string;
|
|
||||||
}
|
|
@@ -1,39 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @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 { EcmCompanyModel } from './ecm-company.model';
|
|
||||||
|
|
||||||
export class EcmUserModel {
|
|
||||||
id: string;
|
|
||||||
firstName: string;
|
|
||||||
lastName: string;
|
|
||||||
description: string;
|
|
||||||
avatarId: string;
|
|
||||||
email: string;
|
|
||||||
skypeId: string;
|
|
||||||
googleId: string;
|
|
||||||
instantMessageId: string;
|
|
||||||
jobTitle: string;
|
|
||||||
location: string;
|
|
||||||
company: EcmCompanyModel;
|
|
||||||
mobile: string;
|
|
||||||
telephone: string;
|
|
||||||
statusUpdatedAt: string;
|
|
||||||
userStatus: string;
|
|
||||||
enabled: boolean;
|
|
||||||
emailNotificationsEnabled: boolean;
|
|
||||||
}
|
|
@@ -1,75 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @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 { AlfrescoAuthenticationService, AlfrescoSettingsService } from 'ng2-alfresco-core';
|
|
||||||
import { Injectable } from '@angular/core';
|
|
||||||
import { Response } from '@angular/http';
|
|
||||||
import { Observable } from 'rxjs/Rx';
|
|
||||||
import { BpmUserModel } from '../models/bpm-user.model';
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* BPMUserService retrieve all the information of an Ecm user.
|
|
||||||
*
|
|
||||||
* @returns {BPMUserService} .
|
|
||||||
*/
|
|
||||||
@Injectable()
|
|
||||||
export class BpmUserService {
|
|
||||||
|
|
||||||
constructor(private authService: AlfrescoAuthenticationService,
|
|
||||||
private settingService: AlfrescoSettingsService) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get User Information via ECM
|
|
||||||
* @param userName - the user name
|
|
||||||
*/
|
|
||||||
getCurrentUserInfo(): Observable<BpmUserModel> {
|
|
||||||
if ( this.authService.getAlfrescoApi().bpmAuth.isLoggedIn() ) {
|
|
||||||
return Observable.fromPromise(this.callApiGetProfile())
|
|
||||||
.map(
|
|
||||||
(data) => <BpmUserModel> data
|
|
||||||
)
|
|
||||||
.catch(this.handleError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get User Information via ECM
|
|
||||||
* @param userName - the user name
|
|
||||||
*/
|
|
||||||
getCurrentUserProfileImage(): string {
|
|
||||||
if ( this.authService.getAlfrescoApi().bpmAuth.isLoggedIn() ) {
|
|
||||||
return this.settingService.getBPMApiBaseUrl() + '/api/enterprise/profile-picture';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private callApiGetProfile() {
|
|
||||||
return this.authService.getAlfrescoApi().activiti.profileApi.getProfile();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Throw the error
|
|
||||||
* @param error
|
|
||||||
* @returns {ErrorObservable}
|
|
||||||
*/
|
|
||||||
private handleError(error: Response) {
|
|
||||||
// in a real world app, we may send the error to some remote logging infrastructure
|
|
||||||
// instead of just logging it to the console
|
|
||||||
console.error(error);
|
|
||||||
return Observable.throw(error || 'Server error');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -1,72 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @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 { AlfrescoAuthenticationService, AlfrescoContentService } from 'ng2-alfresco-core';
|
|
||||||
import { Injectable } from '@angular/core';
|
|
||||||
import { Response } from '@angular/http';
|
|
||||||
import { Observable } from 'rxjs/Rx';
|
|
||||||
import { EcmUserModel } from '../models/ecm-user.model';
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* ECMUserService retrieve all the information of an Ecm user.
|
|
||||||
*
|
|
||||||
* @returns {ECMUserService} .
|
|
||||||
*/
|
|
||||||
@Injectable()
|
|
||||||
export class EcmUserService {
|
|
||||||
|
|
||||||
constructor(private authService: AlfrescoAuthenticationService,
|
|
||||||
private contentService: AlfrescoContentService) {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get User Information via ECM
|
|
||||||
* @param userName - the user name
|
|
||||||
*/
|
|
||||||
getUserInfo(userName: string): Observable<EcmUserModel> {
|
|
||||||
if ( this.authService.getAlfrescoApi().ecmAuth.isLoggedIn() ) {
|
|
||||||
return Observable.fromPromise(this.callApiGetPersonInfo(userName))
|
|
||||||
.map(
|
|
||||||
(data) => <EcmUserModel> data['entry']
|
|
||||||
)
|
|
||||||
.catch(this.handleError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private callApiGetPersonInfo(userName: string, opts?: any) {
|
|
||||||
return this.authService.getAlfrescoApi().core.peopleApi.getPerson(userName, opts);
|
|
||||||
}
|
|
||||||
|
|
||||||
getCurrentUserProfileImageUrl(avatarId: string) {
|
|
||||||
if ( avatarId ) {
|
|
||||||
let nodeObj = {entry: {id: avatarId}};
|
|
||||||
return this.contentService.getContentUrl(nodeObj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Throw the error
|
|
||||||
* @param error
|
|
||||||
* @returns {ErrorObservable}
|
|
||||||
*/
|
|
||||||
private handleError(error: Response) {
|
|
||||||
// in a real world app, we may send the error to some remote logging infrastructure
|
|
||||||
// instead of just logging it to the console
|
|
||||||
console.error(error);
|
|
||||||
return Observable.throw(error || 'Server error');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -1,26 +0,0 @@
|
|||||||
{
|
|
||||||
"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",
|
|
||||||
"types": ["core-js", "jasmine"]
|
|
||||||
},
|
|
||||||
"exclude": [
|
|
||||||
"demo",
|
|
||||||
"node_modules",
|
|
||||||
"dist"
|
|
||||||
]
|
|
||||||
}
|
|
@@ -1,121 +0,0 @@
|
|||||||
{
|
|
||||||
"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"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user