[ADF-973] Remove demo folder moved in https://github.com/Alfresco/adf-examples … (#2036)

* remove demo folder moved in https://github.com/Alfresco/adf-examples 1.6.1

* remove analytics demo
This commit is contained in:
Eugenio Romano 2017-07-04 09:37:36 +02:00
parent e33f6cf670
commit 6ac4edde24
263 changed files with 0 additions and 12610 deletions

View File

@ -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

View File

@ -1,6 +0,0 @@
node_modules
.idea
coverage
dist
typings
!systemjs.config.js

View File

@ -1,3 +0,0 @@
node_modules
dist
typings

View File

@ -1,13 +0,0 @@
# Activiti Analytics demo
Install:
```
npm install
```
Run the project:
```
npm start
```

View File

@ -1,10 +0,0 @@
var path = require('path');
var _root = path.resolve(__dirname, '..');
function root(args) {
args = Array.prototype.slice.call(arguments, 0);
return path.join.apply(path, [_root].concat(args));
}
exports.root = root;

View File

@ -1,127 +0,0 @@
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const helpers = require('./helpers');
const path = require('path');
const alfrescoLibs = [
'ng2-activiti-analytics',
'ng2-activiti-diagrams'
];
module.exports = {
entry: {
'polyfills': './src/polyfills.ts',
'vendor': './src/vendor.ts',
'dist': './src/main.ts'
},
module: {
rules: [
{
enforce: 'pre',
test: /\.js$/,
include: [helpers.root('src'), helpers.root('../ng2-components')],
loader: 'source-map-loader',
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
test: /\.ts$/,
include: [helpers.root('src'), helpers.root('..')],
loader: [
'ts-loader',
'angular2-template-loader'
],
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
enforce: 'pre',
test: /\.ts$/,
loader: 'tslint-loader',
include: [helpers.root('src')],
options: {
emitErrors: true
},
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
enforce: 'pre',
test: /\.ts$/,
use: 'source-map-loader',
exclude: [ /public/, /resources/, /dist/]
},
{
test: /\.html$/,
loader: 'html-loader',
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
test: /\.css$/,
exclude: [helpers.root('src'), helpers.root('../ng2-components')],
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader?sourceMap'
})
},
{
test: /\.css$/,
include: [helpers.root('src'), helpers.root('../ng2-components')],
loader: 'raw-loader'
},
{
test: /\.component.scss$/,
use: ['to-string-loader', 'raw-loader', 'sass-loader']
},
{
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
loader: 'file-loader?name=assets/[name].[hash].[ext]'
}
]
},
plugins: [
// Workaround for angular/angular#11580
new webpack.ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and Windows
/angular(\\|\/)core(\\|\/)@angular/,
helpers.root('./src'), // location of your src
{} // a map of your routes
),
new HtmlWebpackPlugin({
template: './index.html'
}),
new CopyWebpackPlugin([
... alfrescoLibs.map(lib => {
return {
context: `../ng2-components/${lib}/bundles/assets/` ,
from: '**/*',
to: `assets/`
}
}),
{
context: 'resources/i18n',
from: '**/*.json',
to: 'resources/i18n'
}
]),
new webpack.optimize.CommonsChunkPlugin({
name: ['src', 'vendor', 'polyfills']
})
],
devServer: {
contentBase: helpers.root('dist'),
compress: true,
port: 3000,
historyApiFallback: true,
host: '0.0.0.0',
inline: true
},
node: {
fs: 'empty'
}
};

View File

@ -1,37 +0,0 @@
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const commonConfig = require('./webpack.common.js');
const helpers = require('./helpers');
const path = require('path');
module.exports = webpackMerge(commonConfig, {
devtool: 'cheap-module-eval-source-map',
output: {
path: helpers.root('dist'),
filename: '[name].js',
chunkFilename: '[id].chunk.js'
},
resolve: {
alias: {
"ng2-alfresco-core$": path.resolve(__dirname, '../../ng2-alfresco-core/index.ts'),
"ng2-activiti-diagrams$": path.resolve(__dirname, '../../ng2-activiti-diagrams/index.ts'),
"ng2-activiti-analytics$": path.resolve(__dirname, '../../ng2-activiti-analytics/index.ts')
},
extensions: ['.ts', '.js'],
modules: [path.resolve(__dirname, '../node_modules')]
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new ExtractTextPlugin('[name].[hash].css'),
new webpack.LoaderOptionsPlugin({
htmlLoader: {
minimize: false // workaround for ng2
}
})
]
});

View File

@ -1,66 +0,0 @@
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const commonConfig = require('./webpack.common.js');
const helpers = require('./helpers');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
const alfrescoLibs = [
'ng2-activiti-analytics',
'ng2-activiti-diagrams'
];
module.exports = webpackMerge(commonConfig, {
devtool: 'source-map',
output: {
path: helpers.root('dist'),
publicPath: '/',
filename: '[name].[hash].js',
chunkFilename: '[id].[hash].chunk.js'
},
resolve: {
extensions: ['.ts', '.js'],
modules: [helpers.root('node_modules')]
},
plugins: [
new CopyWebpackPlugin([
... alfrescoLibs.map(lib => {
return {
context: `node_modules/${lib}/bundles/assets/` ,
from: '**/*',
to: `assets/`
}
})
]),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.optimize.UglifyJsPlugin({ // https://github.com/angular/angular/issues/10618
mangle: {
keep_fnames: true
},
compress: {
warnings: false
},
output: {
comments: false
},
sourceMap: true
}),
new ExtractTextPlugin('[name].[hash].css'),
new webpack.DefinePlugin({
'process.env': {
'ENV': JSON.stringify(ENV)
}
}),
new webpack.LoaderOptionsPlugin({
htmlLoader: {
minimize: false // workaround for ng2
}
})
]
});

View File

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Alfresco Angular 2 Activiti Analytics - Demo</title>
<base href="./">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<alfresco-app-demo></alfresco-app-demo>
</body>
</html>

View File

@ -1,79 +0,0 @@
{
"name": "ng2-activiti-analytics-demo",
"version": "0.1.0",
"lockfileVersion": 1,
"dependencies": {
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true
},
"brace-expansion": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
"integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
"dev": true
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true
},
"glob": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"dev": true
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"dev": true
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true
},
"rimraf": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz",
"integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=",
"dev": true
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true
}
}
}

View File

@ -1,118 +0,0 @@
{
"name": "ng2-activiti-analytics-demo",
"description": "Alfresco Angular2 Diagrams Component - Demo",
"version": "0.1.0",
"author": "Alfresco Software, Ltd.",
"scripts": {
"build": "rimraf dist && npm run webpack -- --config config/webpack.prod.js --progress --profile --bail",
"build:dev": "rimraf dist && npm run webpack -- --config config/webpack.dev.js --progress --profile --bail",
"start:dist": "wsrv -s dist/ -p 3000 -a 0.0.0.0",
"start": "npm run webpack-dev-server -- --config config/webpack.prod.js --progress --content-base app/",
"start:dev": "npm run webpack-dev-server -- --config config/webpack.dev.js --progress --content-base app/",
"clean": "npm run clean-build && rimraf dist node_modules typings dist",
"clean-build": "rimraf 'app/{,**/}**.js' 'app/{,**/}**.js.map' 'app/{,**/}**.d.ts'",
"webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js",
"webpack": "webpack"
},
"license": "Apache-2.0",
"contributors": [
{
"name": "Maurizio Vitale",
"email": "maurizio.vitale@alfresco.com"
}
],
"keywords": [
"ng2",
"angular",
"angular2",
"activiti",
"activiti-diagrams"
],
"dependencies": {
"@angular/animations": "4.2.5",
"@angular/common": "4.2.5",
"@angular/compiler": "4.2.5",
"@angular/core": "4.2.5",
"@angular/forms": "4.2.5",
"@angular/http": "4.2.5",
"@angular/platform-browser": "4.2.5",
"@angular/platform-browser-dynamic": "4.2.5",
"@angular/router": "4.2.5",
"@angular/material": "2.0.0-beta.1",
"alfresco-js-api": "~1.6.1",
"core-js": "2.4.1",
"hammerjs": "2.0.8",
"ng2-alfresco-core": "1.6.1",
"@ngx-translate/core": "7.0.0",
"reflect-metadata": "0.1.10",
"rxjs": "5.1.0",
"systemjs": "0.19.27",
"zone.js": "0.7.6",
"intl": "1.2.4",
"dialog-polyfill": "0.4.7",
"element.scrollintoviewifneeded-polyfill": "1.0.1",
"material-design-icons": "2.2.3",
"material-design-lite": "1.2.1",
"chart.js": "2.5.0",
"md-date-time-picker": "2.2.0",
"ng2-charts": "1.6.0",
"moment": "2.15.1",
"raphael": "2.2.6",
"ng2-activiti-diagrams": "1.6.1",
"ng2-activiti-analytics": "1.6.1"
},
"devDependencies": {
"@types/hammerjs": "2.0.34",
"@types/jasmine": "2.5.35",
"@types/node": "6.0.45",
"angular2-template-loader": "0.6.2",
"autoprefixer": "6.5.4",
"copy-webpack-plugin": "4.0.1",
"css-loader": "0.23.1",
"css-to-string-loader": "0.1.2",
"cssnano": "3.8.1",
"extract-text-webpack-plugin": "2.0.0-rc.3",
"file-loader": "0.11.1",
"html-loader": "0.4.4",
"html-webpack-plugin": "2.28.0",
"istanbul-instrumenter-loader": "0.2.0",
"jasmine-ajax": "3.2.0",
"jasmine-core": "2.4.1",
"karma": "0.13.22",
"karma-chrome-launcher": "~1.0.1",
"karma-coverage": "1.1.1",
"karma-jasmine": "~1.0.2",
"karma-jasmine-ajax": "0.1.13",
"karma-jasmine-html-reporter": "0.2.0",
"karma-mocha-reporter": "2.2.2",
"karma-remap-istanbul": "0.6.0",
"karma-sourcemap-loader": "0.3.7",
"karma-systemjs": "0.16.0",
"karma-webpack": "2.0.3",
"loader-utils": "1.1.0",
"merge-stream": "1.0.1",
"node-sass": "3.13.1",
"null-loader": "0.1.1",
"package-json-merge": "0.0.1",
"raw-loader": "0.5.1",
"remap-istanbul": "0.6.3",
"rimraf": "2.6.1",
"run-sequence": "1.2.2",
"sass-loader": "6.0.2",
"script-loader": "0.7.0",
"source-map-loader": "0.1.6",
"style-loader": "0.13.1",
"systemjs-builder": "0.15.34",
"to-string-loader": "1.1.5",
"traceur": "0.0.91",
"ts-loader": "2.2.1",
"ts-node": "1.7.0",
"tslint": "4.5.1",
"tslint-loader": "3.5.3",
"typescript": "2.1.6",
"webpack": "2.2.1",
"webpack-dev-server": "2.3.0",
"webpack-merge": "2.6.1",
"wsrv": "0.1.7"
}
}

View File

@ -1,115 +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, Component, OnInit } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { CoreModule, AlfrescoSettingsService, AlfrescoAuthenticationService, StorageService, LogService } from 'ng2-alfresco-core';
import { AnalyticsModule } from 'ng2-activiti-analytics';
@Component({
selector: 'alfresco-app-demo',
template: `
<label for="ticket"><b>Insert a valid ticket:</b></label><br>
<input id="ticket" type="text" size="48" (change)="updateTicket()" [(ngModel)]="ticket"><br>
<label for="host"><b>Insert the ip of your Activiti instance:</b></label><br>
<input id="host" type="text" size="48" (change)="updateHost()" [(ngModel)]="host"><br><br>
<div *ngIf="!authenticated" style="color:#FF2323">
Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid ticket to perform
operations.
</div>
<hr>
<div class="page-content">
<label for="appId"><b>Insert the appId:</b></label><br>
<input id="appId" size="10" type="text" [(ngModel)]="appId">
<div class="mdl-grid">
<div class="mdl-cell mdl-cell--4-col task-column mdl-shadow--2dp">
<analytics-report-list (reportClick)="onReportClick($event)"></analytics-report-list>
</div>
<div class="mdl-cell mdl-cell--8-col task-column mdl-shadow--2dp">
<activiti-analytics [appId]="appId" *ngIf="report" [reportId]="report.id"></activiti-analytics>
</div>
</div>
</div>
`
})
export class AnalyticsDemoComponent implements OnInit {
appId: number;
report: any;
authenticated: boolean;
host: string = 'http://localhost:9999';
ticket: string;
constructor(private authService: AlfrescoAuthenticationService,
private settingsService: AlfrescoSettingsService,
private storage: StorageService,
private logService: LogService) {
settingsService.bpmHost = this.host;
settingsService.setProviders('BPM');
if (this.authService.getTicketBpm()) {
this.ticket = this.authService.getTicketBpm();
}
}
onReportClick(event: any) {
this.report = event;
}
public updateTicket(): void {
this.storage.setItem('ticket-BPM', this.ticket);
}
public updateHost(): void {
this.settingsService.bpmHost = this.host;
this.login();
}
public ngOnInit(): void {
this.login();
}
login() {
this.authService.login('admin', 'admin').subscribe(
ticket => {
this.logService.log(ticket);
this.ticket = this.authService.getTicketBpm();
this.authenticated = true;
},
error => {
this.logService.error(error);
this.authenticated = false;
});
}
}
@NgModule({
imports: [
BrowserModule,
CoreModule.forRoot(),
AnalyticsModule
],
declarations: [AnalyticsDemoComponent],
bootstrap: [AnalyticsDemoComponent]
})
export class AppModule {
}
platformBrowserDynamic().bootstrapModule(AppModule);

View File

@ -1,17 +0,0 @@
import 'core-js/es6';
import 'core-js/es7/reflect';
import 'intl';
require('zone.js/dist/zone'); // IE 8-11
require('element.scrollintoviewifneeded-polyfill'); // IE/FF
if (process.env.ENV === 'production') {
// Production
} else {
// Development
Error['stackTraceLimit'] = Infinity;
require('zone.js/dist/long-stack-trace-zone');
}

View File

@ -1,30 +0,0 @@
// Angular
import '@angular/platform-browser';
import '@angular/platform-browser-dynamic';
import '@angular/core';
import '@angular/common';
import '@angular/http';
import '@angular/router';
// RxJS
import 'rxjs';
// hammerjs
import 'hammerjs';
// Alfresco
import 'alfresco-js-api';
import 'ng2-activiti-analytics';
import 'ng2-charts';
import 'chart.js';
require('script-loader!raphael/raphael.min.js');
// Google Material Design Lite
import 'material-design-lite/material.js';
import 'material-design-lite/dist/material.orange-blue.min.css';
import 'material-design-icons/iconfont/material-icons.css';
// Polyfill(s) for dialogs
require('script-loader!dialog-polyfill/dialog-polyfill');
import 'dialog-polyfill/dialog-polyfill.css';

View File

@ -1,36 +0,0 @@
{
"compilerOptions": {
"baseUrl": ".",
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"skipLibCheck": true,
"noLib": false,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noImplicitAny": false,
"noImplicitReturns": false,
"noImplicitUseStrict": false,
"noFallthroughCasesInSwitch": true,
"removeComments": true,
"declaration": true,
"outDir": "./dist",
"lib": [
"es2015",
"dom"
],
"suppressImplicitAnyIndexErrors": true
},
"exclude": [
"demo",
"node_modules",
"dist"
],
"angularCompilerOptions": {
"strictMetadataEmit": false,
"skipTemplateCodegen": true
}
}

View File

@ -1,118 +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,
"max-line-length": [
true,
180
],
"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": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-constructor-vars": false,
"no-debugger": true,
"no-duplicate-variable": true,
"no-empty": false,
"no-eval": true,
"no-inferrable-types": false,
"no-internal-module": true,
"no-require-imports": false,
"no-shadowed-variable": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"no-var-requires": false,
"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"
]
}
}

View File

@ -1 +0,0 @@
module.exports = require('./config/webpack.dev.js');

View File

@ -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

View File

@ -1,6 +0,0 @@
node_modules
.idea
coverage
dist
typings
!systemjs.config.js

View File

@ -1,3 +0,0 @@
node_modules
dist
typings

View File

@ -1,13 +0,0 @@
# Activiti Diagrams demo
Install:
```
npm install
```
Run the project:
```
npm start
```

View File

@ -1,10 +0,0 @@
var path = require('path');
var _root = path.resolve(__dirname, '..');
function root(args) {
args = Array.prototype.slice.call(arguments, 0);
return path.join.apply(path, [_root].concat(args));
}
exports.root = root;

View File

@ -1,126 +0,0 @@
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const helpers = require('./helpers');
const path = require('path');
const alfrescoLibs = [
'ng2-activiti-diagrams'
];
module.exports = {
entry: {
'polyfills': './src/polyfills.ts',
'vendor': './src/vendor.ts',
'dist': './src/main.ts'
},
module: {
rules: [
{
enforce: 'pre',
test: /\.js$/,
include: [helpers.root('src'), helpers.root('../ng2-components')],
loader: 'source-map-loader',
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
test: /\.ts$/,
include: [helpers.root('src'), helpers.root('..')],
loader: [
'ts-loader',
'angular2-template-loader'
],
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
enforce: 'pre',
test: /\.ts$/,
loader: 'tslint-loader',
include: [helpers.root('src')],
options: {
emitErrors: true
},
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
enforce: 'pre',
test: /\.ts$/,
use: 'source-map-loader',
exclude: [ /public/, /resources/, /dist/]
},
{
test: /\.html$/,
loader: 'html-loader',
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
test: /\.css$/,
exclude: [helpers.root('src'), helpers.root('../ng2-components')],
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader?sourceMap'
})
},
{
test: /\.css$/,
include: [helpers.root('src'), helpers.root('../ng2-components')],
loader: 'raw-loader'
},
{
test: /\.component.scss$/,
use: ['to-string-loader', 'raw-loader', 'sass-loader']
},
{
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
loader: 'file-loader?name=assets/[name].[hash].[ext]'
}
]
},
plugins: [
// Workaround for angular/angular#11580
new webpack.ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and Windows
/angular(\\|\/)core(\\|\/)@angular/,
helpers.root('./src'), // location of your src
{} // a map of your routes
),
new HtmlWebpackPlugin({
template: './index.html'
}),
new CopyWebpackPlugin([
... alfrescoLibs.map(lib => {
return {
context: `../ng2-components/${lib}/bundles/assets/` ,
from: '**/*',
to: `assets/`
}
}),
{
context: 'resources/i18n',
from: '**/*.json',
to: 'resources/i18n'
}
]),
new webpack.optimize.CommonsChunkPlugin({
name: ['src', 'vendor', 'polyfills']
})
],
devServer: {
contentBase: helpers.root('dist'),
compress: true,
port: 3000,
historyApiFallback: true,
host: '0.0.0.0',
inline: true
},
node: {
fs: 'empty'
}
};

View File

@ -1,36 +0,0 @@
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const commonConfig = require('./webpack.common.js');
const helpers = require('./helpers');
const path = require('path');
module.exports = webpackMerge(commonConfig, {
devtool: 'cheap-module-eval-source-map',
output: {
path: helpers.root('dist'),
filename: '[name].js',
chunkFilename: '[id].chunk.js'
},
resolve: {
alias: {
"ng2-alfresco-core$": path.resolve(__dirname, '../../ng2-alfresco-core/index.ts'),
"ng2-activiti-diagrams$": path.resolve(__dirname, '../../ng2-activiti-diagrams/index.ts')
},
extensions: ['.ts', '.js'],
modules: [path.resolve(__dirname, '../node_modules')]
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new ExtractTextPlugin('[name].[hash].css'),
new webpack.LoaderOptionsPlugin({
htmlLoader: {
minimize: false // workaround for ng2
}
})
]
});

View File

@ -1,65 +0,0 @@
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const commonConfig = require('./webpack.common.js');
const helpers = require('./helpers');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
const alfrescoLibs = [
'ng2-activiti-diagrams'
];
module.exports = webpackMerge(commonConfig, {
devtool: 'source-map',
output: {
path: helpers.root('dist'),
publicPath: '/',
filename: '[name].[hash].js',
chunkFilename: '[id].[hash].chunk.js'
},
resolve: {
extensions: ['.ts', '.js'],
modules: [helpers.root('node_modules')]
},
plugins: [
new CopyWebpackPlugin([
... alfrescoLibs.map(lib => {
return {
context: `node_modules/${lib}/bundles/assets/` ,
from: '**/*',
to: `assets/`
}
})
]),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.optimize.UglifyJsPlugin({ // https://github.com/angular/angular/issues/10618
mangle: {
keep_fnames: true
},
compress: {
warnings: false
},
output: {
comments: false
},
sourceMap: true
}),
new ExtractTextPlugin('[name].[hash].css'),
new webpack.DefinePlugin({
'process.env': {
'ENV': JSON.stringify(ENV)
}
}),
new webpack.LoaderOptionsPlugin({
htmlLoader: {
minimize: false // workaround for ng2
}
})
]
});

View File

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Alfresco Angular 2 Activiti Diagrams - Demo</title>
<base href="./">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<alfresco-app-demo></alfresco-app-demo>
</body>
</html>

View File

@ -1,79 +0,0 @@
{
"name": "ng2-activiti-diagrams-demo",
"version": "0.1.0",
"lockfileVersion": 1,
"dependencies": {
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true
},
"brace-expansion": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
"integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
"dev": true
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true
},
"glob": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"dev": true
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"dev": true
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true
},
"rimraf": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz",
"integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=",
"dev": true
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true
}
}
}

View File

@ -1,113 +0,0 @@
{
"name": "ng2-activiti-diagrams-demo",
"description": "Alfresco Angular2 Diagrams Component - Demo",
"version": "0.1.0",
"author": "Alfresco Software, Ltd.",
"scripts": {
"build": "rimraf dist && npm run webpack -- --config config/webpack.prod.js --progress --profile --bail",
"build:dev": "rimraf dist && npm run webpack -- --config config/webpack.dev.js --progress --profile --bail",
"start:dist": "wsrv -s dist/ -p 3000 -a 0.0.0.0",
"start": "npm run webpack-dev-server -- --config config/webpack.prod.js --progress --content-base app/",
"start:dev": "npm run webpack-dev-server -- --config config/webpack.dev.js --progress --content-base app/",
"clean": "npm run clean-build && rimraf dist node_modules typings dist",
"clean-build": "rimraf 'app/{,**/}**.js' 'app/{,**/}**.js.map' 'app/{,**/}**.d.ts'",
"webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js",
"webpack": "webpack"
},
"license": "Apache-2.0",
"contributors": [
{
"name": "Maurizio Vitale",
"email": "maurizio.vitale@alfresco.com"
}
],
"keywords": [
"ng2",
"angular",
"angular2",
"activiti",
"activiti-diagrams"
],
"dependencies": {
"@angular/animations": "4.2.5",
"@angular/common": "4.2.5",
"@angular/compiler": "4.2.5",
"@angular/core": "4.2.5",
"@angular/forms": "4.2.5",
"@angular/http": "4.2.5",
"@angular/platform-browser": "4.2.5",
"@angular/platform-browser-dynamic": "4.2.5",
"@angular/router": "4.2.5",
"@angular/material": "2.0.0-beta.1",
"alfresco-js-api": "~1.6.1",
"core-js": "2.4.1",
"hammerjs": "2.0.8",
"ng2-alfresco-core": "1.6.1",
"@ngx-translate/core": "7.0.0",
"reflect-metadata": "0.1.10",
"rxjs": "5.1.0",
"systemjs": "0.19.27",
"zone.js": "0.7.6",
"dialog-polyfill": "0.4.7",
"element.scrollintoviewifneeded-polyfill": "1.0.1",
"intl": "1.2.4",
"material-design-icons": "2.2.3",
"material-design-lite": "1.2.1",
"ng2-activiti-diagrams": "1.6.1",
"raphael": "2.2.6"
},
"devDependencies": {
"@types/hammerjs": "2.0.34",
"@types/jasmine": "2.5.35",
"@types/node": "6.0.45",
"angular2-template-loader": "0.6.2",
"autoprefixer": "6.5.4",
"copy-webpack-plugin": "4.0.1",
"css-loader": "0.23.1",
"css-to-string-loader": "0.1.2",
"cssnano": "3.8.1",
"extract-text-webpack-plugin": "2.0.0-rc.3",
"file-loader": "0.11.1",
"html-loader": "0.4.4",
"html-webpack-plugin": "2.28.0",
"istanbul-instrumenter-loader": "0.2.0",
"jasmine-ajax": "3.2.0",
"jasmine-core": "2.4.1",
"karma": "0.13.22",
"karma-chrome-launcher": "~1.0.1",
"karma-coverage": "1.1.1",
"karma-jasmine": "~1.0.2",
"karma-jasmine-ajax": "0.1.13",
"karma-jasmine-html-reporter": "0.2.0",
"karma-mocha-reporter": "2.2.2",
"karma-remap-istanbul": "0.6.0",
"karma-sourcemap-loader": "0.3.7",
"karma-systemjs": "0.16.0",
"karma-webpack": "2.0.3",
"loader-utils": "1.1.0",
"merge-stream": "1.0.1",
"node-sass": "3.13.1",
"null-loader": "0.1.1",
"package-json-merge": "0.0.1",
"raw-loader": "0.5.1",
"remap-istanbul": "0.6.3",
"rimraf": "2.6.1",
"run-sequence": "1.2.2",
"sass-loader": "6.0.2",
"script-loader": "0.7.0",
"source-map-loader": "0.1.6",
"style-loader": "0.13.1",
"systemjs-builder": "0.15.34",
"to-string-loader": "1.1.5",
"traceur": "0.0.91",
"ts-loader": "2.2.1",
"ts-node": "1.7.0",
"tslint": "4.5.1",
"tslint-loader": "3.5.3",
"typescript": "2.1.6",
"webpack": "2.2.1",
"webpack-dev-server": "2.3.0",
"webpack-merge": "2.6.1",
"wsrv": "0.1.7"
}
}

View File

@ -1,101 +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, Component } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { CoreModule, AlfrescoSettingsService, AlfrescoAuthenticationService, StorageService, LogService } from 'ng2-alfresco-core';
import { DiagramsModule } from 'ng2-activiti-diagrams';
@Component({
selector: 'alfresco-app-demo',
template: `
<label for="ticket"><b>Insert a valid ticket:</b></label><br>
<input id="ticket" type="text" size="48" (change)="updateTicket()" [(ngModel)]="ticket"><br>
<label for="host"><b>Insert the ip of your Activiti instance:</b></label><br>
<input id="host" type="text" size="48" (change)="updateHost()" [(ngModel)]="host"><br><br>
<div *ngIf="!authenticated" style="color:#FF2323">
Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid ticket to perform
operations.
</div>
<hr>
<label for="processDefinitionId"><b>Insert the ProcessDefinitionId:</b></label><br>
<input id="processDefinitionId" size="70" type="text" [(ngModel)]="processDefinitionId">
<activiti-diagram [processDefinitionId]="processDefinitionId"></activiti-diagram>
`
})
export class DiagramDemoComponent {
processDefinitionId: string = 'ThirdProcess:1:15053';
authenticated: boolean;
host: string = 'http://localhost:9999';
ticket: string;
constructor(private authService: AlfrescoAuthenticationService,
private settingsService: AlfrescoSettingsService,
private storage: StorageService,
private logService: LogService) {
settingsService.bpmHost = this.host;
settingsService.setProviders('BPM');
if (this.authService.getTicketBpm()) {
this.ticket = this.authService.getTicketBpm();
}
}
public updateTicket(): void {
this.storage.setItem('ticket-BPM', this.ticket);
}
public updateHost(): void {
this.settingsService.bpmHost = this.host;
this.login();
}
public ngOnInit(): void {
this.login();
}
login() {
this.authService.login('admin', 'admin').subscribe(
ticket => {
this.logService.info(`Logged in with ticket ${ticket}`);
this.ticket = this.authService.getTicketBpm();
this.authenticated = true;
},
error => {
this.logService.error(error);
this.authenticated = false;
});
}
}
@NgModule({
imports: [
BrowserModule,
CoreModule.forRoot(),
DiagramsModule
],
declarations: [ DiagramDemoComponent ],
bootstrap: [ DiagramDemoComponent ]
})
export class AppModule { }
platformBrowserDynamic().bootstrapModule(AppModule);

View File

@ -1,17 +0,0 @@
import 'core-js/es6';
import 'core-js/es7/reflect';
import 'intl';
require('zone.js/dist/zone'); // IE 8-11
require('element.scrollintoviewifneeded-polyfill'); // IE/FF
if (process.env.ENV === 'production') {
// Production
} else {
// Development
Error['stackTraceLimit'] = Infinity;
require('zone.js/dist/long-stack-trace-zone');
}

View File

@ -1,30 +0,0 @@
// Angular
import '@angular/platform-browser';
import '@angular/platform-browser-dynamic';
import '@angular/core';
import '@angular/common';
import '@angular/http';
import '@angular/router';
// RxJS
import 'rxjs';
// hammerjs
import 'hammerjs';
// Alfresco
import 'alfresco-js-api';
import 'ng2-activiti-diagrams';
// Google Material Design Lite
import 'material-design-lite/material.js';
import 'material-design-lite/dist/material.orange-blue.min.css';
import 'material-design-icons/iconfont/material-icons.css';
import 'ng2-charts';
import 'chart.js';
require('script-loader!raphael/raphael.min.js');
// Polyfill(s) for dialogs
require('script-loader!dialog-polyfill/dialog-polyfill');
import 'dialog-polyfill/dialog-polyfill.css';

View File

@ -1,36 +0,0 @@
{
"compilerOptions": {
"baseUrl": ".",
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"skipLibCheck": true,
"noLib": false,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noImplicitAny": false,
"noImplicitReturns": false,
"noImplicitUseStrict": false,
"noFallthroughCasesInSwitch": true,
"removeComments": true,
"declaration": true,
"outDir": "./dist",
"lib": [
"es2015",
"dom"
],
"suppressImplicitAnyIndexErrors": true
},
"exclude": [
"demo",
"node_modules",
"dist"
],
"angularCompilerOptions": {
"strictMetadataEmit": false,
"skipTemplateCodegen": true
}
}

View File

@ -1,118 +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,
"max-line-length": [
true,
180
],
"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": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-constructor-vars": false,
"no-debugger": true,
"no-duplicate-variable": true,
"no-empty": false,
"no-eval": true,
"no-inferrable-types": false,
"no-internal-module": true,
"no-require-imports": false,
"no-shadowed-variable": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"no-var-requires": false,
"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"
]
}
}

View File

@ -1 +0,0 @@
module.exports = require('./config/webpack.dev.js');

View File

@ -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

View File

@ -1,6 +0,0 @@
node_modules
.idea
coverage
dist
typings
!systemjs.config.js

View File

@ -1,3 +0,0 @@
node_modules
dist
typings

View File

@ -1,13 +0,0 @@
# Activiti Form demo
Install:
```
npm install
```
Run the project:
```
npm start
```

View File

@ -1,10 +0,0 @@
var path = require('path');
var _root = path.resolve(__dirname, '..');
function root(args) {
args = Array.prototype.slice.call(arguments, 0);
return path.join.apply(path, [_root].concat(args));
}
exports.root = root;

View File

@ -1,126 +0,0 @@
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const helpers = require('./helpers');
const path = require('path');
const alfrescoLibs = [
'ng2-activiti-form'
];
module.exports = {
entry: {
'polyfills': './src/polyfills.ts',
'vendor': './src/vendor.ts',
'dist': './src/main.ts'
},
module: {
rules: [
{
enforce: 'pre',
test: /\.js$/,
include: [helpers.root('src'), helpers.root('../ng2-components')],
loader: 'source-map-loader',
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
test: /\.ts$/,
include: [helpers.root('src'), helpers.root('..')],
loader: [
'ts-loader',
'angular2-template-loader'
],
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
enforce: 'pre',
test: /\.ts$/,
loader: 'tslint-loader',
include: [helpers.root('src')],
options: {
emitErrors: true
},
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
enforce: 'pre',
test: /\.ts$/,
use: 'source-map-loader',
exclude: [ /public/, /resources/, /dist/]
},
{
test: /\.html$/,
loader: 'html-loader',
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
test: /\.css$/,
exclude: [helpers.root('src'), helpers.root('../ng2-components')],
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader?sourceMap'
})
},
{
test: /\.css$/,
include: [helpers.root('src'), helpers.root('../ng2-components')],
loader: 'raw-loader'
},
{
test: /\.component.scss$/,
use: ['to-string-loader', 'raw-loader', 'sass-loader']
},
{
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
loader: 'file-loader?name=assets/[name].[hash].[ext]'
}
]
},
plugins: [
// Workaround for angular/angular#11580
new webpack.ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and Windows
/angular(\\|\/)core(\\|\/)@angular/,
helpers.root('./src'), // location of your src
{} // a map of your routes
),
new HtmlWebpackPlugin({
template: './index.html'
}),
new CopyWebpackPlugin([
... alfrescoLibs.map(lib => {
return {
context: `../ng2-components/${lib}/bundles/assets/` ,
from: '**/*',
to: `assets/`
}
}),
{
context: 'resources/i18n',
from: '**/*.json',
to: 'resources/i18n'
}
]),
new webpack.optimize.CommonsChunkPlugin({
name: ['src', 'vendor', 'polyfills']
})
],
devServer: {
contentBase: helpers.root('dist'),
compress: true,
port: 3000,
historyApiFallback: true,
host: '0.0.0.0',
inline: true
},
node: {
fs: 'empty'
}
};

View File

@ -1,36 +0,0 @@
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const commonConfig = require('./webpack.common.js');
const helpers = require('./helpers');
const path = require('path');
module.exports = webpackMerge(commonConfig, {
devtool: 'cheap-module-eval-source-map',
output: {
path: helpers.root('dist'),
filename: '[name].js',
chunkFilename: '[id].chunk.js'
},
resolve: {
alias: {
"ng2-alfresco-core$": path.resolve(__dirname, '../../ng2-alfresco-core/index.ts'),
"ng2-activiti-form$": path.resolve(__dirname, '../../ng2-activiti-form/index.ts')
},
extensions: ['.ts', '.js'],
modules: [path.resolve(__dirname, '../node_modules')]
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new ExtractTextPlugin('[name].[hash].css'),
new webpack.LoaderOptionsPlugin({
htmlLoader: {
minimize: false // workaround for ng2
}
})
]
});

View File

@ -1,65 +0,0 @@
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const commonConfig = require('./webpack.common.js');
const helpers = require('./helpers');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
const alfrescoLibs = [
'ng2-activiti-form'
];
module.exports = webpackMerge(commonConfig, {
devtool: 'source-map',
output: {
path: helpers.root('dist'),
publicPath: '/',
filename: '[name].[hash].js',
chunkFilename: '[id].[hash].chunk.js'
},
resolve: {
extensions: ['.ts', '.js'],
modules: [helpers.root('node_modules')]
},
plugins: [
new CopyWebpackPlugin([
... alfrescoLibs.map(lib => {
return {
context: `node_modules/${lib}/bundles/assets/` ,
from: '**/*',
to: `assets/`
}
})
]),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.optimize.UglifyJsPlugin({ // https://github.com/angular/angular/issues/10618
mangle: {
keep_fnames: true
},
compress: {
warnings: false
},
output: {
comments: false
},
sourceMap: true
}),
new ExtractTextPlugin('[name].[hash].css'),
new webpack.DefinePlugin({
'process.env': {
'ENV': JSON.stringify(ENV)
}
}),
new webpack.LoaderOptionsPlugin({
htmlLoader: {
minimize: false // workaround for ng2
}
})
]
});

View File

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Alfresco Angular 2 Activiti Form - Demo</title>
<base href="./">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<alfresco-app-demo></alfresco-app-demo>
</body>
</html>

View File

@ -1,79 +0,0 @@
{
"name": "ng2-activiti-form-demo",
"version": "0.1.0",
"lockfileVersion": 1,
"dependencies": {
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true
},
"brace-expansion": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
"integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
"dev": true
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true
},
"glob": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"dev": true
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"dev": true
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true
},
"rimraf": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz",
"integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=",
"dev": true
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true
}
}
}

View File

@ -1,114 +0,0 @@
{
"name": "ng2-activiti-form-demo",
"description": "Alfresco Activiti Form Component - Demo",
"version": "0.1.0",
"author": "Alfresco Software, Ltd.",
"scripts": {
"build": "rimraf dist && npm run webpack -- --config config/webpack.prod.js --progress --profile --bail",
"build:dev": "rimraf dist && npm run webpack -- --config config/webpack.dev.js --progress --profile --bail",
"start:dist": "wsrv -s dist/ -p 3000 -a 0.0.0.0",
"start": "npm run webpack-dev-server -- --config config/webpack.prod.js --progress --content-base app/",
"start:dev": "npm run webpack-dev-server -- --config config/webpack.dev.js --progress --content-base app/",
"clean": "npm run clean-build && rimraf dist node_modules typings dist",
"clean-build": "rimraf 'app/{,**/}**.js' 'app/{,**/}**.js.map' 'app/{,**/}**.d.ts'",
"webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js",
"webpack": "webpack"
},
"license": "Apache-2.0",
"contributors": [
{
"name": "Mario Romano",
"email": "mario.romano@alfresco.com"
}
],
"keywords": [
"ng2",
"angular",
"angular2",
"activiti",
"activiti-form"
],
"dependencies": {
"@angular/animations": "4.2.5",
"@angular/common": "4.2.5",
"@angular/compiler": "4.2.5",
"@angular/core": "4.2.5",
"@angular/forms": "4.2.5",
"@angular/http": "4.2.5",
"@angular/platform-browser": "4.2.5",
"@angular/platform-browser-dynamic": "4.2.5",
"@angular/router": "4.2.5",
"@angular/material": "2.0.0-beta.1",
"alfresco-js-api": "~1.6.1",
"core-js": "2.4.1",
"hammerjs": "2.0.8",
"ng2-alfresco-core": "1.6.1",
"@ngx-translate/core": "7.0.0",
"reflect-metadata": "0.1.10",
"rxjs": "5.1.0",
"systemjs": "0.19.27",
"zone.js": "0.7.6",
"intl": "1.2.4",
"dialog-polyfill": "0.4.7",
"element.scrollintoviewifneeded-polyfill": "1.0.1",
"material-design-icons": "2.2.3",
"material-design-lite": "1.2.1",
"moment": "2.15.1",
"md-date-time-picker": "2.2.0",
"ng2-activiti-form": "1.6.1"
},
"devDependencies": {
"@types/hammerjs": "2.0.34",
"@types/jasmine": "2.5.35",
"@types/node": "6.0.45",
"angular2-template-loader": "0.6.2",
"autoprefixer": "6.5.4",
"copy-webpack-plugin": "4.0.1",
"css-loader": "0.23.1",
"css-to-string-loader": "0.1.2",
"cssnano": "3.8.1",
"extract-text-webpack-plugin": "2.0.0-rc.3",
"file-loader": "0.11.1",
"html-loader": "0.4.4",
"html-webpack-plugin": "2.28.0",
"istanbul-instrumenter-loader": "0.2.0",
"jasmine-ajax": "3.2.0",
"jasmine-core": "2.4.1",
"karma": "0.13.22",
"karma-chrome-launcher": "~1.0.1",
"karma-coverage": "1.1.1",
"karma-jasmine": "~1.0.2",
"karma-jasmine-ajax": "0.1.13",
"karma-jasmine-html-reporter": "0.2.0",
"karma-mocha-reporter": "2.2.2",
"karma-remap-istanbul": "0.6.0",
"karma-sourcemap-loader": "0.3.7",
"karma-systemjs": "0.16.0",
"karma-webpack": "2.0.3",
"loader-utils": "1.1.0",
"merge-stream": "1.0.1",
"node-sass": "3.13.1",
"null-loader": "0.1.1",
"package-json-merge": "0.0.1",
"raw-loader": "0.5.1",
"remap-istanbul": "0.6.3",
"rimraf": "2.6.1",
"run-sequence": "1.2.2",
"sass-loader": "6.0.2",
"script-loader": "0.7.0",
"source-map-loader": "0.1.6",
"style-loader": "0.13.1",
"systemjs-builder": "0.15.34",
"to-string-loader": "1.1.5",
"traceur": "0.0.91",
"ts-loader": "2.2.1",
"ts-node": "1.7.0",
"tslint": "4.5.1",
"tslint-loader": "3.5.3",
"typescript": "2.1.6",
"webpack": "2.2.1",
"webpack-dev-server": "2.3.0",
"webpack-merge": "2.6.1",
"wsrv": "0.1.7"
}
}

View File

@ -1,101 +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, Component, OnInit } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { CoreModule, AlfrescoSettingsService, AlfrescoAuthenticationService, StorageService, LogService } from 'ng2-alfresco-core';
import { ActivitiFormModule } from 'ng2-activiti-form';
@Component({
selector: 'alfresco-app-demo',
template: `
<label for="ticket"><b>Insert a valid ticket:</b></label><br>
<input id="ticket" type="text" size="48" (change)="updateTicket()" [(ngModel)]="ticket"><br>
<label for="host"><b>Insert the ip of your Activiti instance:</b></label><br>
<input id="host" type="text" size="48" (change)="updateHost()" [(ngModel)]="host"><br><br>
<div *ngIf="!authenticated" style="color:#FF2323">
Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid ticket to perform
operations.
</div>
<hr>
<label for="taskId"><b>Insert the taskId:</b></label><br>
<input id="taskId" size="10" type="text" [(ngModel)]="taskId">
<activiti-form [taskId]="taskId"></activiti-form>
`
})
export class FormDemoComponent implements OnInit {
taskId: number;
authenticated: boolean;
host: string = 'http://localhost:9999';
ticket: string;
constructor(private authService: AlfrescoAuthenticationService,
private settingsService: AlfrescoSettingsService,
private storage: StorageService,
private logService: LogService) {
settingsService.bpmHost = this.host;
settingsService.setProviders('BPM');
if (this.authService.getTicketBpm()) {
this.ticket = this.authService.getTicketBpm();
}
}
public updateTicket(): void {
this.storage.setItem('ticket-BPM', this.ticket);
}
public updateHost(): void {
this.settingsService.bpmHost = this.host;
this.login();
}
public ngOnInit(): void {
this.login();
}
login() {
this.authService.login('admin', 'admin').subscribe(
ticket => {
this.logService.info(`Logged in with ticket ${ticket}`);
this.ticket = this.authService.getTicketBpm();
this.authenticated = true;
},
error => {
this.logService.error(error);
this.authenticated = false;
});
}
}
@NgModule({
imports: [
BrowserModule,
CoreModule.forRoot(),
ActivitiFormModule.forRoot()
],
declarations: [FormDemoComponent],
bootstrap: [FormDemoComponent]
})
export class AppModule {
}
platformBrowserDynamic().bootstrapModule(AppModule);

View File

@ -1,17 +0,0 @@
import 'core-js/es6';
import 'core-js/es7/reflect';
import 'intl';
require('zone.js/dist/zone'); // IE 8-11
require('element.scrollintoviewifneeded-polyfill'); // IE/FF
if (process.env.ENV === 'production') {
// Production
} else {
// Development
Error['stackTraceLimit'] = Infinity;
require('zone.js/dist/long-stack-trace-zone');
}

View File

@ -1,26 +0,0 @@
// Angular
import '@angular/platform-browser';
import '@angular/platform-browser-dynamic';
import '@angular/core';
import '@angular/common';
import '@angular/http';
import '@angular/router';
// RxJS
import 'rxjs';
// hammerjs
import 'hammerjs';
// Alfresco
import 'alfresco-js-api';
import 'ng2-activiti-form';
// Google Material Design Lite
import 'material-design-lite/material.js';
import 'material-design-lite/dist/material.orange-blue.min.css';
import 'material-design-icons/iconfont/material-icons.css';
// Polyfill(s) for dialogs
require('script-loader!dialog-polyfill/dialog-polyfill');
import 'dialog-polyfill/dialog-polyfill.css';

View File

@ -1,36 +0,0 @@
{
"compilerOptions": {
"baseUrl": ".",
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"skipLibCheck": true,
"noLib": false,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noImplicitAny": false,
"noImplicitReturns": false,
"noImplicitUseStrict": false,
"noFallthroughCasesInSwitch": true,
"removeComments": true,
"declaration": true,
"outDir": "./dist",
"lib": [
"es2015",
"dom"
],
"suppressImplicitAnyIndexErrors": true
},
"exclude": [
"demo",
"node_modules",
"dist"
],
"angularCompilerOptions": {
"strictMetadataEmit": false,
"skipTemplateCodegen": true
}
}

View File

@ -1,118 +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,
"max-line-length": [
true,
180
],
"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": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-constructor-vars": false,
"no-debugger": true,
"no-duplicate-variable": true,
"no-empty": false,
"no-eval": true,
"no-inferrable-types": false,
"no-internal-module": true,
"no-require-imports": false,
"no-shadowed-variable": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"no-var-requires": false,
"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"
]
}
}

View File

@ -1 +0,0 @@
module.exports = require('./config/webpack.dev.js');

View File

@ -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

View File

@ -1,6 +0,0 @@
typings/
node_modules/
.idea
dist/
!systemjs.config.js
!browser-sync-config.js

View File

@ -1,19 +0,0 @@
# 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
```

View File

@ -1,10 +0,0 @@
var path = require('path');
var _root = path.resolve(__dirname, '..');
function root(args) {
args = Array.prototype.slice.call(arguments, 0);
return path.join.apply(path, [_root].concat(args));
}
exports.root = root;

View File

@ -1,129 +0,0 @@
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const helpers = require('./helpers');
const path = require('path');
const alfrescoLibs = [
'ng2-activiti-processlist',
'ng2-activiti-tasklist',
'ng2-alfresco-core',
'ng2-alfresco-datatable'
];
module.exports = {
entry: {
'polyfills': './src/polyfills.ts',
'vendor': './src/vendor.ts',
'dist': './src/main.ts'
},
module: {
rules: [
{
enforce: 'pre',
test: /\.js$/,
include: [helpers.root('src'), helpers.root('../ng2-components')],
loader: 'source-map-loader',
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
test: /\.ts$/,
include: [helpers.root('src'), helpers.root('..')],
loader: [
'ts-loader',
'angular2-template-loader'
],
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
enforce: 'pre',
test: /\.ts$/,
loader: 'tslint-loader',
include: [helpers.root('src')],
options: {
emitErrors: true
},
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
enforce: 'pre',
test: /\.ts$/,
use: 'source-map-loader',
exclude: [ /public/, /resources/, /dist/]
},
{
test: /\.html$/,
loader: 'html-loader',
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
test: /\.css$/,
exclude: [helpers.root('src'), helpers.root('../ng2-components')],
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader?sourceMap'
})
},
{
test: /\.css$/,
include: [helpers.root('src'), helpers.root('../ng2-components')],
loader: 'raw-loader'
},
{
test: /\.component.scss$/,
use: ['to-string-loader', 'raw-loader', 'sass-loader']
},
{
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
loader: 'file-loader?name=assets/[name].[hash].[ext]'
}
]
},
plugins: [
// Workaround for angular/angular#11580
new webpack.ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and Windows
/angular(\\|\/)core(\\|\/)@angular/,
helpers.root('./src'), // location of your src
{} // a map of your routes
),
new HtmlWebpackPlugin({
template: './index.html'
}),
new CopyWebpackPlugin([
... alfrescoLibs.map(lib => {
return {
context: `../ng2-components/${lib}/bundles/assets/` ,
from: '**/*',
to: `assets/`
}
}),
{
context: 'resources/i18n',
from: '**/*.json',
to: 'resources/i18n'
}
]),
new webpack.optimize.CommonsChunkPlugin({
name: ['src', 'vendor', 'polyfills']
})
],
devServer: {
contentBase: helpers.root('dist'),
compress: true,
port: 3000,
historyApiFallback: true,
host: '0.0.0.0',
inline: true
},
node: {
fs: 'empty'
}
};

View File

@ -1,38 +0,0 @@
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const commonConfig = require('./webpack.common.js');
const helpers = require('./helpers');
const path = require('path');
module.exports = webpackMerge(commonConfig, {
devtool: 'cheap-module-eval-source-map',
output: {
path: helpers.root('dist'),
filename: '[name].js',
chunkFilename: '[id].chunk.js'
},
resolve: {
alias: {
"ng2-alfresco-core$": path.resolve(__dirname, '../../ng2-alfresco-core/index.ts'),
"ng2-alfresco-datatable$": path.resolve(__dirname, '../../ng2-alfresco-datatable/index.ts'),
"ng2-activiti-processlist$": path.resolve(__dirname, '../../ng2-activiti-processlist/index.ts'),
"ng2-activiti-tasklist$": path.resolve(__dirname, '../../ng2-activiti-tasklist/index.ts')
},
extensions: ['.ts', '.js'],
modules: [path.resolve(__dirname, '../node_modules')]
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new ExtractTextPlugin('[name].[hash].css'),
new webpack.LoaderOptionsPlugin({
htmlLoader: {
minimize: false // workaround for ng2
}
})
]
});

View File

@ -1,68 +0,0 @@
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const commonConfig = require('./webpack.common.js');
const helpers = require('./helpers');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
const alfrescoLibs = [
'ng2-activiti-processlist',
'ng2-activiti-tasklist',
'ng2-alfresco-core',
'ng2-alfresco-datatable'
];
module.exports = webpackMerge(commonConfig, {
devtool: 'source-map',
output: {
path: helpers.root('dist'),
publicPath: '/',
filename: '[name].[hash].js',
chunkFilename: '[id].[hash].chunk.js'
},
resolve: {
extensions: ['.ts', '.js'],
modules: [helpers.root('node_modules')]
},
plugins: [
new CopyWebpackPlugin([
... alfrescoLibs.map(lib => {
return {
context: `node_modules/${lib}/bundles/assets/` ,
from: '**/*',
to: `assets/`
}
})
]),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.optimize.UglifyJsPlugin({ // https://github.com/angular/angular/issues/10618
mangle: {
keep_fnames: true
},
compress: {
warnings: false
},
output: {
comments: false
},
sourceMap: true
}),
new ExtractTextPlugin('[name].[hash].css'),
new webpack.DefinePlugin({
'process.env': {
'ENV': JSON.stringify(ENV)
}
}),
new webpack.LoaderOptionsPlugin({
htmlLoader: {
minimize: false // workaround for ng2
}
})
]
});

View File

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Alfresco Angular 2 Activiti Process - Demo</title>
<base href="./">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<alfresco-app-demo></alfresco-app-demo>
</body>
</html>

View File

@ -1,79 +0,0 @@
{
"name": "ng2-activiti-processlist-demo",
"version": "0.1.0",
"lockfileVersion": 1,
"dependencies": {
"balanced-match": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true
},
"brace-expansion": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
"integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
"dev": true
},
"concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true
},
"glob": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"dev": true
},
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"dev": true
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true
},
"rimraf": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz",
"integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=",
"dev": true
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true
}
}
}

View File

@ -1,109 +0,0 @@
{
"name": "ng2-activiti-processlist-demo",
"description": "Show available processes from the Activiti Process Services suite - Demo",
"version": "0.1.0",
"author": "Will Abson",
"scripts": {
"build": "rimraf dist && npm run webpack -- --config config/webpack.prod.js --progress --profile --bail",
"build:dev": "rimraf dist && npm run webpack -- --config config/webpack.dev.js --progress --profile --bail",
"start:dist": "wsrv -s dist/ -p 3000 -a 0.0.0.0",
"start": "npm run webpack-dev-server -- --config config/webpack.prod.js --progress --content-base app/",
"start:dev": "npm run webpack-dev-server -- --config config/webpack.dev.js --progress --content-base app/",
"clean": "npm run clean-build && rimraf dist node_modules typings dist",
"clean-build": "rimraf 'app/{,**/}**.js' 'app/{,**/}**.js.map' 'app/{,**/}**.d.ts'",
"webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js",
"webpack": "webpack"
},
"keywords": [
"ng2",
"angular",
"angular2",
"alfresco",
"demo"
],
"dependencies": {
"@angular/animations": "4.2.5",
"@angular/common": "4.2.5",
"@angular/compiler": "4.2.5",
"@angular/core": "4.2.5",
"@angular/forms": "4.2.5",
"@angular/http": "4.2.5",
"@angular/platform-browser": "4.2.5",
"@angular/platform-browser-dynamic": "4.2.5",
"@angular/router": "4.2.5",
"@angular/material": "2.0.0-beta.1",
"alfresco-js-api": "~1.6.1",
"core-js": "2.4.1",
"hammerjs": "2.0.8",
"ng2-alfresco-core": "1.6.1",
"@ngx-translate/core": "7.0.0",
"reflect-metadata": "0.1.10",
"rxjs": "5.1.0",
"systemjs": "0.19.27",
"zone.js": "0.7.6",
"intl": "1.2.4",
"dialog-polyfill": "0.4.7",
"element.scrollintoviewifneeded-polyfill": "1.0.1",
"material-design-icons": "2.2.3",
"material-design-lite": "1.2.1",
"moment": "2.15.1",
"md-date-time-picker": "2.2.0",
"ng2-activiti-tasklist": "1.6.1",
"ng2-alfresco-datatable": "1.6.1",
"ng2-activiti-processlist": "1.6.1"
},
"devDependencies": {
"@types/hammerjs": "2.0.34",
"@types/jasmine": "2.5.35",
"@types/node": "6.0.45",
"angular2-template-loader": "0.6.2",
"autoprefixer": "6.5.4",
"copy-webpack-plugin": "4.0.1",
"css-loader": "0.23.1",
"css-to-string-loader": "0.1.2",
"cssnano": "3.8.1",
"extract-text-webpack-plugin": "2.0.0-rc.3",
"file-loader": "0.11.1",
"html-loader": "0.4.4",
"html-webpack-plugin": "2.28.0",
"istanbul-instrumenter-loader": "0.2.0",
"jasmine-ajax": "3.2.0",
"jasmine-core": "2.4.1",
"karma": "0.13.22",
"karma-chrome-launcher": "~1.0.1",
"karma-coverage": "1.1.1",
"karma-jasmine": "~1.0.2",
"karma-jasmine-ajax": "0.1.13",
"karma-jasmine-html-reporter": "0.2.0",
"karma-mocha-reporter": "2.2.2",
"karma-remap-istanbul": "0.6.0",
"karma-sourcemap-loader": "0.3.7",
"karma-systemjs": "0.16.0",
"karma-webpack": "2.0.3",
"loader-utils": "1.1.0",
"merge-stream": "1.0.1",
"node-sass": "3.13.1",
"null-loader": "0.1.1",
"package-json-merge": "0.0.1",
"raw-loader": "0.5.1",
"remap-istanbul": "0.6.3",
"rimraf": "2.6.1",
"run-sequence": "1.2.2",
"sass-loader": "6.0.2",
"script-loader": "0.7.0",
"source-map-loader": "0.1.6",
"style-loader": "0.13.1",
"systemjs-builder": "0.15.34",
"to-string-loader": "1.1.5",
"traceur": "0.0.91",
"ts-loader": "2.2.1",
"ts-node": "1.7.0",
"tslint": "4.5.1",
"tslint-loader": "3.5.3",
"typescript": "2.1.6",
"webpack": "2.2.1",
"webpack-dev-server": "2.3.0",
"webpack-merge": "2.6.1",
"wsrv": "0.1.7"
}
}

View File

@ -1,275 +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 { DebugElement, Input, NgModule, Component, OnInit, ViewChild } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppDefinitionRepresentationModel, ActivitiTaskListModule } from 'ng2-activiti-tasklist';
import { CoreModule, LogService } from 'ng2-alfresco-core';
import {
ActivitiProcessListModule,
ActivitiProcessFilters,
ActivitiProcessInstanceDetails,
ActivitiProcessInstanceListComponent,
ActivitiStartProcessInstance,
ProcessInstance
} from 'ng2-activiti-processlist';
import { AlfrescoAuthenticationService, AlfrescoSettingsService, StorageService } from 'ng2-alfresco-core';
import { ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
const currentProcessIdNew = '__NEW__';
@Component({
selector: 'alfresco-app-demo',
template: `
<label for="ticket"><b>Insert a valid ticket:</b></label><br>
<input id="ticket" type="text" size="48" (change)="updateTicket()" [(ngModel)]="ticket"><br>
<label for="host"><b>Insert the ip of your Activiti instance:</b></label><br>
<input id="host" type="text" size="48" (change)="updateHost()" [(ngModel)]="host"><br><br>
<div *ngIf="!authenticated" style="color:#FF2323">
Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid ticket to perform
operations.
</div>
<hr>
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header">
<!-- TABS -->
<div class="mdl-layout__tab-bar mdl-js-ripple-effect" #tabheader>
<a id="apps-header" href="#apps" class="mdl-layout__tab is-active">APPS</a>
<a id="processes-header" href="#processes" class="mdl-layout__tab">PROCESS LIST</a>
</div>
</header>
<main class="mdl-layout__content activiti" #tabmain>
<!-- APPPS COMPONENT -->
<section class="mdl-layout__tab-panel is-active" id="apps">
<div class="page-content">
<activiti-apps [layoutType]="'GRID'" (appClick)="onAppClick($event)" #activitiapps></activiti-apps>
</div>
</section>
<!-- PROCESS COMPONENT -->
<section class="mdl-layout__tab-panel" id="processes">
<div class="page-content">
<div class="mdl-grid">
<div class="mdl-cell mdl-cell--2-col task-column">
<h2>Process Filters</h2>
<button type="button" (click)="navigateStartProcess()"
class="mdl-button" data-automation-id="btn-start-process">Start Process</button>
<activiti-process-instance-filters
[appId]="appId"
(filterClick)="onProcessFilterClick($event)"
(onSuccess)="onSuccessProcessFilterList($event)"></activiti-process-instance-filters>
</div>
<div class="mdl-cell mdl-cell--3-col task-column">
<h2>Process List</h2>
<activiti-process-instance-list *ngIf="processFilter?.hasFilter()" [appId]="processFilter.appId"
[processDefinitionKey]="processFilter.filter.processDefinitionKey"
[name]="processFilter.filter.name"
[state]="processFilter.filter.state"
[sort]="processFilter.filter.sort"
[data]="dataProcesses"
(rowClick)="onProcessRowClick($event)"
(onSuccess)="onSuccessProcessList($event)"></activiti-process-instance-list>
</div>
<div class="mdl-cell mdl-cell--7-col task-column" *ngIf="!isStartProcessMode()">
<h2>Process Details</h2>
<activiti-process-instance-details
[processInstanceId]="currentProcessInstanceId"
(taskFormCompleted)="taskFormCompleted()"
(processCancelled)="processCancelled()"></activiti-process-instance-details>
<h2>Process Variables</h2>
<activiti-process-instance-variables
[processInstanceId]="currentProcessInstanceId"></activiti-process-instance-variables>
</div>
<div class="mdl-cell mdl-cell--7-col task-column" *ngIf="isStartProcessMode()">
<h2>Start Process</h2>
<activiti-start-process [appId]="appId" (start)="onStartProcessInstance($event)"></activiti-start-process>
</div>
</div>
</div>
</section>
</main>
</div>
`,
styles: [`
header {
min-height: 48px;
}
h2 {
font-size: 14px;
line-height: 20px;
margin: 10px 0;
}
`]
})
class MyDemoApp implements OnInit {
authenticated: boolean;
host: string = 'http://localhost:9999';
ticket: string;
@ViewChild('tabmain')
tabMain: DebugElement;
@ViewChild('tabheader')
tabHeader: DebugElement;
@ViewChild(ActivitiProcessFilters)
activitiprocessfilter: ActivitiProcessFilters;
@ViewChild(ActivitiProcessInstanceListComponent)
activitiprocesslist: ActivitiProcessInstanceListComponent;
@ViewChild(ActivitiProcessInstanceDetails)
activitiprocessdetails: ActivitiProcessInstanceDetails;
@ViewChild(ActivitiStartProcessInstance)
activitiStartProcess: ActivitiStartProcessInstance;
@Input()
appId: number;
processFilter: any;
currentProcessInstanceId: string;
dataProcesses: ObjectDataTableAdapter;
constructor(private authService: AlfrescoAuthenticationService,
private settingsService: AlfrescoSettingsService,
private storage: StorageService,
private logService: LogService) {
settingsService.bpmHost = this.host;
settingsService.setProviders('BPM');
if (this.authService.getTicketBpm()) {
this.ticket = this.authService.getTicketBpm();
}
this.dataProcesses = new ObjectDataTableAdapter(
[],
[
{type: 'text', key: 'name', title: 'Name', cssClass: 'full-width name-column', sortable: true},
{type: 'text', key: 'started', title: 'Started', sortable: true, cssClass: 'hidden'}
]
);
}
public updateTicket(): void {
this.storage.setItem('ticket-BPM', this.ticket);
}
public updateHost(): void {
this.settingsService.bpmHost = this.host;
this.login();
}
public ngOnInit(): void {
this.login();
}
login() {
this.authService.login('admin', 'admin').subscribe(
ticket => {
this.logService.log(ticket);
this.ticket = this.authService.getTicketBpm();
this.authenticated = true;
},
error => {
this.logService.error(error);
this.authenticated = false;
});
}
onAppClick(app: AppDefinitionRepresentationModel) {
this.appId = app.id;
this.processFilter = null;
this.currentProcessInstanceId = null;
this.changeTab('apps', 'processes');
}
navigateStartProcess() {
this.currentProcessInstanceId = currentProcessIdNew;
}
onStartProcessInstance(instance: ProcessInstance) {
this.currentProcessInstanceId = instance.id;
this.activitiStartProcess.reset();
}
isStartProcessMode() {
return this.currentProcessInstanceId === currentProcessIdNew;
}
onProcessFilterClick(event: any) {
this.processFilter = event;
}
onSuccessProcessFilterList(event: any) {
this.processFilter = this.activitiprocessfilter.getCurrentFilter();
}
onSuccessProcessList(event: any) {
this.currentProcessInstanceId = this.activitiprocesslist.getCurrentId();
}
onProcessRowClick(processInstanceId) {
this.currentProcessInstanceId = processInstanceId;
}
processCancelled(data: any) {
this.currentProcessInstanceId = null;
this.activitiprocesslist.reload();
}
changeTab(origin: string, destination: string) {
this.tabMain.nativeElement.children[origin].classList.remove('is-active');
this.tabMain.nativeElement.children[destination].classList.add('is-active');
this.tabHeader.nativeElement.children[`${origin}-header`].classList.remove('is-active');
this.tabHeader.nativeElement.children[`${destination}-header`].classList.add('is-active');
}
}
@NgModule({
imports: [
BrowserModule,
CoreModule.forRoot(),
ActivitiProcessListModule,
ActivitiTaskListModule.forRoot()
],
declarations: [MyDemoApp],
bootstrap: [MyDemoApp]
})
export class AppModule {
}
platformBrowserDynamic().bootstrapModule(AppModule);

View File

@ -1,17 +0,0 @@
import 'core-js/es6';
import 'core-js/es7/reflect';
import 'intl';
require('zone.js/dist/zone'); // IE 8-11
require('element.scrollintoviewifneeded-polyfill'); // IE/FF
if (process.env.ENV === 'production') {
// Production
} else {
// Development
Error['stackTraceLimit'] = Infinity;
require('zone.js/dist/long-stack-trace-zone');
}

View File

@ -1,26 +0,0 @@
// Angular
import '@angular/platform-browser';
import '@angular/platform-browser-dynamic';
import '@angular/core';
import '@angular/common';
import '@angular/http';
import '@angular/router';
// RxJS
import 'rxjs';
// hammerjs
import 'hammerjs';
// Alfresco
import 'alfresco-js-api';
import 'ng2-activiti-processlist';
// Google Material Design Lite
import 'material-design-lite/material.js';
import 'material-design-lite/dist/material.orange-blue.min.css';
import 'material-design-icons/iconfont/material-icons.css';
// Polyfill(s) for dialogs
require('script-loader!dialog-polyfill/dialog-polyfill');
import 'dialog-polyfill/dialog-polyfill.css';

View File

@ -1,36 +0,0 @@
{
"compilerOptions": {
"baseUrl": ".",
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"skipLibCheck": true,
"noLib": false,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noImplicitAny": false,
"noImplicitReturns": false,
"noImplicitUseStrict": false,
"noFallthroughCasesInSwitch": true,
"removeComments": true,
"declaration": true,
"outDir": "./dist",
"lib": [
"es2015",
"dom"
],
"suppressImplicitAnyIndexErrors": true
},
"exclude": [
"demo",
"node_modules",
"dist"
],
"angularCompilerOptions": {
"strictMetadataEmit": false,
"skipTemplateCodegen": true
}
}

View File

@ -1,118 +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,
"max-line-length": [
true,
180
],
"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": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-constructor-vars": false,
"no-debugger": true,
"no-duplicate-variable": true,
"no-empty": false,
"no-eval": true,
"no-inferrable-types": false,
"no-internal-module": true,
"no-require-imports": false,
"no-shadowed-variable": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"no-var-requires": false,
"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"
]
}
}

View File

@ -1 +0,0 @@
module.exports = require('./config/webpack.dev.js');

View File

@ -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

View File

@ -1,6 +0,0 @@
node_modules
.idea
coverage
dist
typings
!systemjs.config.js

View File

@ -1,3 +0,0 @@
node_modules
dist
typings

View File

@ -1,13 +0,0 @@
# TasK list demo
Install:
```
npm install
```
Run the project:
```
npm start
```

View File

@ -1,10 +0,0 @@
var path = require('path');
var _root = path.resolve(__dirname, '..');
function root(args) {
args = Array.prototype.slice.call(arguments, 0);
return path.join.apply(path, [_root].concat(args));
}
exports.root = root;

View File

@ -1,127 +0,0 @@
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const helpers = require('./helpers');
const path = require('path');
const alfrescoLibs = [
'ng2-activiti-tasklist',
'ng2-alfresco-datatable'
];
module.exports = {
entry: {
'polyfills': './src/polyfills.ts',
'vendor': './src/vendor.ts',
'dist': './src/main.ts'
},
module: {
rules: [
{
enforce: 'pre',
test: /\.js$/,
include: [helpers.root('src'), helpers.root('../ng2-components')],
loader: 'source-map-loader',
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
test: /\.ts$/,
include: [helpers.root('src'), helpers.root('..')],
loader: [
'ts-loader',
'angular2-template-loader'
],
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
enforce: 'pre',
test: /\.ts$/,
loader: 'tslint-loader',
include: [helpers.root('src')],
options: {
emitErrors: true
},
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
enforce: 'pre',
test: /\.ts$/,
use: 'source-map-loader',
exclude: [ /public/, /resources/, /dist/]
},
{
test: /\.html$/,
loader: 'html-loader',
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
test: /\.css$/,
exclude: [helpers.root('src'), helpers.root('../ng2-components')],
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader?sourceMap'
})
},
{
test: /\.css$/,
include: [helpers.root('src'), helpers.root('../ng2-components')],
loader: 'raw-loader'
},
{
test: /\.component.scss$/,
use: ['to-string-loader', 'raw-loader', 'sass-loader']
},
{
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
loader: 'file-loader?name=assets/[name].[hash].[ext]'
}
]
},
plugins: [
// Workaround for angular/angular#11580
new webpack.ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and Windows
/angular(\\|\/)core(\\|\/)@angular/,
helpers.root('./src'), // location of your src
{} // a map of your routes
),
new HtmlWebpackPlugin({
template: './index.html'
}),
new CopyWebpackPlugin([
... alfrescoLibs.map(lib => {
return {
context: `../ng2-components/${lib}/bundles/assets/` ,
from: '**/*',
to: `assets/`
}
}),
{
context: 'resources/i18n',
from: '**/*.json',
to: 'resources/i18n'
}
]),
new webpack.optimize.CommonsChunkPlugin({
name: ['src', 'vendor', 'polyfills']
})
],
devServer: {
contentBase: helpers.root('dist'),
compress: true,
port: 3000,
historyApiFallback: true,
host: '0.0.0.0',
inline: true
},
node: {
fs: 'empty'
}
};

View File

@ -1,37 +0,0 @@
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const commonConfig = require('./webpack.common.js');
const helpers = require('./helpers');
const path = require('path');
module.exports = webpackMerge(commonConfig, {
devtool: 'cheap-module-eval-source-map',
output: {
path: helpers.root('dist'),
filename: '[name].js',
chunkFilename: '[id].chunk.js'
},
resolve: {
alias: {
"ng2-alfresco-core$": path.resolve(__dirname, '../../ng2-alfresco-core/index.ts'),
"ng2-alfresco-datatable$": path.resolve(__dirname, '../../ng2-alfresco-datatable/index.ts'),
"ng2-activiti-tasklist$": path.resolve(__dirname, '../../ng2-activiti-tasklist/index.ts')
},
extensions: ['.ts', '.js'],
modules: [path.resolve(__dirname, '../node_modules')]
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new ExtractTextPlugin('[name].[hash].css'),
new webpack.LoaderOptionsPlugin({
htmlLoader: {
minimize: false // workaround for ng2
}
})
]
});

View File

@ -1,65 +0,0 @@
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const commonConfig = require('./webpack.common.js');
const helpers = require('./helpers');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
const alfrescoLibs = [
'ng2-activiti-tasklist'
];
module.exports = webpackMerge(commonConfig, {
devtool: 'source-map',
output: {
path: helpers.root('dist'),
publicPath: '/',
filename: '[name].[hash].js',
chunkFilename: '[id].[hash].chunk.js'
},
resolve: {
extensions: ['.ts', '.js'],
modules: [helpers.root('node_modules')]
},
plugins: [
new CopyWebpackPlugin([
... alfrescoLibs.map(lib => {
return {
context: `node_modules/${lib}/bundles/assets/` ,
from: '**/*',
to: `assets/`
}
})
]),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.optimize.UglifyJsPlugin({ // https://github.com/angular/angular/issues/10618
mangle: {
keep_fnames: true
},
compress: {
warnings: false
},
output: {
comments: false
},
sourceMap: true
}),
new ExtractTextPlugin('[name].[hash].css'),
new webpack.DefinePlugin({
'process.env': {
'ENV': JSON.stringify(ENV)
}
}),
new webpack.LoaderOptionsPlugin({
htmlLoader: {
minimize: false // workaround for ng2
}
})
]
});

View File

@ -1,16 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Alfresco Angular 2 Activiti Tasks - Demo</title>
<base href="./">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<alfresco-app-demo></alfresco-app-demo>
</body>
</html>

View File

@ -1,118 +0,0 @@
{
"name": "ng2-activiti-tasklist-demo",
"description": "Alfresco Angular2 Task List Component - Demo",
"version": "0.1.0",
"author": "Alfresco Software, Ltd.",
"scripts": {
"build": "rimraf dist && npm run webpack -- --config config/webpack.prod.js --progress --profile --bail",
"build:dev": "rimraf dist && npm run webpack -- --config config/webpack.dev.js --progress --profile --bail",
"start:dist": "wsrv -s dist/ -p 3000 -a 0.0.0.0",
"start": "npm run webpack-dev-server -- --config config/webpack.prod.js --progress --content-base app/",
"start:dev": "npm run webpack-dev-server -- --config config/webpack.dev.js --progress --content-base app/",
"clean": "npm run clean-build && rimraf dist node_modules typings dist",
"clean-build": "rimraf 'app/{,**/}**.js' 'app/{,**/}**.js.map' 'app/{,**/}**.d.ts'",
"webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js",
"webpack": "webpack"
},
"license": "Apache-2.0",
"dependencies": {
"@angular/animations": "4.2.5",
"@angular/common": "4.2.5",
"@angular/compiler": "4.2.5",
"@angular/core": "4.2.5",
"@angular/forms": "4.2.5",
"@angular/http": "4.2.5",
"@angular/platform-browser": "4.2.5",
"@angular/platform-browser-dynamic": "4.2.5",
"@angular/router": "4.2.5",
"@angular/material": "2.0.0-beta.1",
"alfresco-js-api": "~1.6.1",
"core-js": "2.4.1",
"hammerjs": "2.0.8",
"ng2-alfresco-core": "1.6.1",
"@ngx-translate/core": "7.0.0",
"reflect-metadata": "0.1.10",
"rxjs": "5.1.0",
"systemjs": "0.19.27",
"zone.js": "0.7.6",
"intl": "1.2.4",
"dialog-polyfill": "0.4.7",
"element.scrollintoviewifneeded-polyfill": "1.0.1",
"material-design-icons": "2.2.3",
"material-design-lite": "1.2.1",
"moment": "2.15.1",
"md-date-time-picker": "2.2.0",
"ng2-alfresco-datatable": "1.6.1",
"ng2-activiti-tasklist": "1.6.1"
},
"devDependencies": {
"@types/hammerjs": "2.0.34",
"@types/jasmine": "2.5.35",
"@types/node": "6.0.45",
"angular2-template-loader": "0.6.2",
"autoprefixer": "6.5.4",
"copy-webpack-plugin": "4.0.1",
"css-loader": "0.23.1",
"css-to-string-loader": "0.1.2",
"cssnano": "3.8.1",
"extract-text-webpack-plugin": "2.0.0-rc.3",
"file-loader": "0.11.1",
"html-loader": "0.4.4",
"html-webpack-plugin": "2.28.0",
"istanbul-instrumenter-loader": "0.2.0",
"jasmine-ajax": "3.2.0",
"jasmine-core": "2.4.1",
"karma": "0.13.22",
"karma-chrome-launcher": "~1.0.1",
"karma-coverage": "1.1.1",
"karma-jasmine": "~1.0.2",
"karma-jasmine-ajax": "0.1.13",
"karma-jasmine-html-reporter": "0.2.0",
"karma-mocha-reporter": "2.2.2",
"karma-remap-istanbul": "0.6.0",
"karma-sourcemap-loader": "0.3.7",
"karma-systemjs": "0.16.0",
"karma-webpack": "2.0.3",
"loader-utils": "1.1.0",
"merge-stream": "1.0.1",
"null-loader": "0.1.1",
"package-json-merge": "0.0.1",
"raw-loader": "0.5.1",
"remap-istanbul": "0.6.3",
"rimraf": "2.5.4",
"run-sequence": "1.2.2",
"script-loader": "0.7.0",
"source-map-loader": "0.1.6",
"style-loader": "0.13.1",
"systemjs-builder": "0.15.34",
"to-string-loader": "1.1.5",
"traceur": "0.0.91",
"ts-loader": "2.2.1",
"ts-node": "1.7.0",
"tslint": "4.5.1",
"tslint-loader": "3.5.3",
"typescript": "2.1.6",
"webpack": "2.2.1",
"webpack-dev-server": "2.3.0",
"webpack-merge": "2.6.1",
"wsrv": "0.1.7",
"node-sass": "3.13.1",
"sass-loader": "6.0.2"
},
"keywords": [
"angular2",
"typescript"
],
"contributors": [
{
"name": "Maurizio Vitale",
"email": "maurizio.vitale84@gmail.com"
},
{
"name": "Eugenio Romano",
"email": "eugenio.romano@alfresco.com"
}
]
}

View File

@ -1,246 +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 { Input, NgModule, Component, OnInit, ViewChild } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import {
ActivitiTaskListModule,
AppDefinitionRepresentationModel,
FilterRepresentationModel,
ActivitiApps,
ActivitiTaskList
} from 'ng2-activiti-tasklist';
import { CoreModule, LogService } from 'ng2-alfresco-core';
import { AlfrescoAuthenticationService, AlfrescoSettingsService, StorageService } from 'ng2-alfresco-core';
import { ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
@Component({
selector: 'alfresco-app-demo',
template: `
<label for="ticket"><b>Insert a valid ticket:</b></label><br>
<input id="ticket" type="text" size="48" (change)="updateTicket()" [(ngModel)]="ticket"><br>
<label for="host"><b>Insert the ip of your Activiti instance:</b></label><br>
<input id="host" type="text" size="48" (change)="updateHost()" [(ngModel)]="host"><br><br>
<div *ngIf="!authenticated" style="color:#FF2323">
Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid ticket to perform
operations.
</div>
<hr>
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header">
<!-- TABS -->
<div class="mdl-layout__tab-bar mdl-js-ripple-effect" #tabheader>
<a id="apps-header" href="#apps" class="mdl-layout__tab is-active">APPS</a>
<a id="tasks-header" href="#tasks" class="mdl-layout__tab">TASKS LIST</a>
</div>
</header>
<main class="mdl-layout__content activiti" #tabmain>
<!-- APPPS COMPONENT -->
<section class="mdl-layout__tab-panel is-active" id="apps">
<div class="page-content">
<activiti-apps [layoutType]="'GRID'" (appClick)="onAppClick($event)" #activitiapps></activiti-apps>
</div>
</section>
<!-- TASKS COMPONENT -->
<section class="mdl-layout__tab-panel" id="tasks">
<div class="page-content">
<div class="mdl-grid">
<div class="mdl-cell mdl-cell--2-col task-column mdl-shadow--2dp">
<span>Task Filters</span>
<activiti-start-task [appId]="appId"
(onSuccess)="onStartTaskSuccess($event)"></activiti-start-task>
<activiti-filters [appId]="appId"
(filterClick)="onTaskFilterClick($event)"
(onSuccess)="onSuccessTaskFilterList($event)"
#activitifilter></activiti-filters>
</div>
<div class="mdl-cell mdl-cell--3-col task-column mdl-shadow--2dp">
<span>Task List</span>
<activiti-tasklist *ngIf="taskFilter?.hasFilter()" [appId]="taskFilter.appId"
[processDefinitionKey]="taskFilter.filter.processDefinitionKey"
[name]="taskFilter.filter.name"
[assignment]="taskFilter.filter.assignment"
[state]="taskFilter.filter.state"
[sort]="taskFilter.filter.sort"
[data]="dataTasks"
(rowClick)="onTaskRowClick($event)"
(onSuccess)="onSuccessTaskList($event)"
#activititasklist></activiti-tasklist>
</div>
<div class="mdl-cell mdl-cell--7-col task-column mdl-shadow--2dp">
<span>Task Details</span>
<activiti-task-details [taskId]="currentTaskId"
(formCompleted)="onFormCompleted($event)"
#activitidetails></activiti-task-details>
</div>
</div>
</div>
</section>
</main>
</div>
`
})
class MyDemoApp implements OnInit {
authenticated: boolean;
host: string = 'http://localhost:9999';
ticket: string;
@ViewChild('activitiapps')
activitiapps: ActivitiApps;
@ViewChild('tabmain')
tabMain: any;
@ViewChild('tabheader')
tabHeader: any;
@ViewChild('activitifilter')
activitifilter: any;
@ViewChild('activitidetails')
activitidetails: any;
@ViewChild('activititasklist')
activititasklist: ActivitiTaskList;
@Input()
appId: number;
layoutType: string;
currentTaskId: string;
taskSchemaColumns: any [] = [];
taskFilter: any;
dataTasks: ObjectDataTableAdapter;
constructor(private authService: AlfrescoAuthenticationService,
private settingsService: AlfrescoSettingsService,
private storage: StorageService,
private logService: LogService) {
settingsService.bpmHost = this.host;
settingsService.setProviders('BPM');
if (this.authService.getTicketBpm()) {
this.ticket = this.authService.getTicketBpm();
}
this.dataTasks = new ObjectDataTableAdapter(
[],
[
{type: 'text', key: 'name', title: 'Name', cssClass: 'full-width name-column', sortable: true},
{type: 'text', key: 'started', title: 'Started', cssClass: 'hidden', sortable: true}
]
);
}
public updateTicket(): void {
this.storage.setItem('ticket-BPM', this.ticket);
}
public updateHost(): void {
this.settingsService.bpmHost = this.host;
this.login();
}
public ngOnInit(): void {
this.login();
}
login() {
this.authService.login('admin', 'admin').subscribe(
ticket => {
this.logService.info(ticket);
this.ticket = this.authService.getTicketBpm();
this.authenticated = true;
},
error => {
this.logService.error(error);
this.authenticated = false;
});
}
onAppClick(app: AppDefinitionRepresentationModel) {
this.appId = app.id;
this.changeTab('apps', 'tasks');
}
onTaskFilterClick(event: FilterRepresentationModel) {
this.taskFilter = event;
}
onSuccessTaskFilterList(event: any) {
this.taskFilter = this.activitifilter.getCurrentFilter();
}
onStartTaskSuccess(event: any) {
this.activititasklist.reload();
}
onSuccessTaskList(event: FilterRepresentationModel) {
this.currentTaskId = this.activititasklist.getCurrentId();
}
onTaskRowClick(taskId) {
this.currentTaskId = taskId;
}
onFormCompleted(form) {
this.activititasklist.reload();
this.currentTaskId = null;
}
changeTab(origin: string, destination: string) {
this.tabMain.nativeElement.children[origin].classList.remove('is-active');
this.tabMain.nativeElement.children[destination].classList.add('is-active');
this.tabHeader.nativeElement.children[`${origin}-header`].classList.remove('is-active');
this.tabHeader.nativeElement.children[`${destination}-header`].classList.add('is-active');
}
}
@NgModule({
imports: [
BrowserModule,
CoreModule.forRoot(),
ActivitiTaskListModule.forRoot()
],
declarations: [MyDemoApp],
bootstrap: [MyDemoApp]
})
export class AppModule {
}
platformBrowserDynamic().bootstrapModule(AppModule);

View File

@ -1,17 +0,0 @@
import 'core-js/es6';
import 'core-js/es7/reflect';
import 'intl';
require('zone.js/dist/zone'); // IE 8-11
require('element.scrollintoviewifneeded-polyfill'); // IE/FF
if (process.env.ENV === 'production') {
// Production
} else {
// Development
Error['stackTraceLimit'] = Infinity;
require('zone.js/dist/long-stack-trace-zone');
}

View File

@ -1,26 +0,0 @@
// Angular
import '@angular/platform-browser';
import '@angular/platform-browser-dynamic';
import '@angular/core';
import '@angular/common';
import '@angular/http';
import '@angular/router';
// RxJS
import 'rxjs';
// hammerjs
import 'hammerjs';
// Alfresco
import 'alfresco-js-api';
import 'ng2-activiti-tasklist';
// Google Material Design Lite
import 'material-design-lite/material.js';
import 'material-design-lite/dist/material.orange-blue.min.css';
import 'material-design-icons/iconfont/material-icons.css';
// Polyfill(s) for dialogs
require('script-loader!dialog-polyfill/dialog-polyfill');
import 'dialog-polyfill/dialog-polyfill.css';

View File

@ -1,36 +0,0 @@
{
"compilerOptions": {
"baseUrl": ".",
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"skipLibCheck": true,
"noLib": false,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noImplicitAny": false,
"noImplicitReturns": false,
"noImplicitUseStrict": false,
"noFallthroughCasesInSwitch": true,
"removeComments": true,
"declaration": true,
"outDir": "./dist",
"lib": [
"es2015",
"dom"
],
"suppressImplicitAnyIndexErrors": true
},
"exclude": [
"demo",
"node_modules",
"dist"
],
"angularCompilerOptions": {
"strictMetadataEmit": false,
"skipTemplateCodegen": true
}
}

View File

@ -1,118 +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,
"max-line-length": [
true,
180
],
"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": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-constructor-vars": false,
"no-debugger": true,
"no-duplicate-variable": true,
"no-empty": false,
"no-eval": true,
"no-inferrable-types": false,
"no-internal-module": true,
"no-require-imports": false,
"no-shadowed-variable": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"no-var-requires": false,
"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"
]
}
}

View File

@ -1 +0,0 @@
module.exports = require('./config/webpack.dev.js');

View File

@ -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

View File

@ -1,6 +0,0 @@
node_modules
.idea
coverage
dist
typings
!systemjs.config.js

View File

@ -1,3 +0,0 @@
node_modules
dist
typings

View File

@ -1,13 +0,0 @@
# DataTable demo
Install:
```
npm install
```
Run the project:
```
npm start
```

View File

@ -1,10 +0,0 @@
var path = require('path');
var _root = path.resolve(__dirname, '..');
function root(args) {
args = Array.prototype.slice.call(arguments, 0);
return path.join.apply(path, [_root].concat(args));
}
exports.root = root;

View File

@ -1,126 +0,0 @@
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const helpers = require('./helpers');
const path = require('path');
const alfrescoLibs = [
'ng2-alfresco-datatable'
];
module.exports = {
entry: {
'polyfills': './src/polyfills.ts',
'vendor': './src/vendor.ts',
'dist': './src/main.ts'
},
module: {
rules: [
{
enforce: 'pre',
test: /\.js$/,
include: [helpers.root('src'), helpers.root('../ng2-components')],
loader: 'source-map-loader',
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
test: /\.ts$/,
include: [helpers.root('src'), helpers.root('..')],
loader: [
'ts-loader',
'angular2-template-loader'
],
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
enforce: 'pre',
test: /\.ts$/,
loader: 'tslint-loader',
include: [helpers.root('src')],
options: {
emitErrors: true
},
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
enforce: 'pre',
test: /\.ts$/,
use: 'source-map-loader',
exclude: [ /public/, /resources/, /dist/]
},
{
test: /\.html$/,
loader: 'html-loader',
exclude: [ /node_modules/, /public/, /resources/, /dist/]
},
{
test: /\.css$/,
exclude: [helpers.root('src'), helpers.root('../ng2-components')],
loader: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader?sourceMap'
})
},
{
test: /\.css$/,
include: [helpers.root('src'), helpers.root('../ng2-components')],
loader: 'raw-loader'
},
{
test: /\.component.scss$/,
use: ['to-string-loader', 'raw-loader', 'sass-loader']
},
{
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
loader: 'file-loader?name=assets/[name].[hash].[ext]'
}
]
},
plugins: [
// Workaround for angular/angular#11580
new webpack.ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and Windows
/angular(\\|\/)core(\\|\/)@angular/,
helpers.root('./src'), // location of your src
{} // a map of your routes
),
new HtmlWebpackPlugin({
template: './index.html'
}),
new CopyWebpackPlugin([
... alfrescoLibs.map(lib => {
return {
context: `../ng2-components/${lib}/bundles/assets/` ,
from: '**/*',
to: `assets/`
}
}),
{
context: 'resources/i18n',
from: '**/*.json',
to: 'resources/i18n'
}
]),
new webpack.optimize.CommonsChunkPlugin({
name: ['src', 'vendor', 'polyfills']
})
],
devServer: {
contentBase: helpers.root('dist'),
compress: true,
port: 3000,
historyApiFallback: true,
host: '0.0.0.0',
inline: true
},
node: {
fs: 'empty'
}
};

View File

@ -1,36 +0,0 @@
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const commonConfig = require('./webpack.common.js');
const helpers = require('./helpers');
const path = require('path');
module.exports = webpackMerge(commonConfig, {
devtool: 'cheap-module-eval-source-map',
output: {
path: helpers.root('dist'),
filename: '[name].js',
chunkFilename: '[id].chunk.js'
},
resolve: {
alias: {
"ng2-alfresco-core$": path.resolve(__dirname, '../../ng2-alfresco-core/index.ts'),
"ng2-alfresco-datatable$": path.resolve(__dirname, '../../ng2-alfresco-datatable/index.ts')
},
extensions: ['.ts', '.js'],
modules: [path.resolve(__dirname, '../node_modules')]
},
plugins: [
new webpack.NoEmitOnErrorsPlugin(),
new ExtractTextPlugin('[name].[hash].css'),
new webpack.LoaderOptionsPlugin({
htmlLoader: {
minimize: false // workaround for ng2
}
})
]
});

View File

@ -1,65 +0,0 @@
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const commonConfig = require('./webpack.common.js');
const helpers = require('./helpers');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
const alfrescoLibs = [
'ng2-alfresco-datatable'
];
module.exports = webpackMerge(commonConfig, {
devtool: 'source-map',
output: {
path: helpers.root('dist'),
publicPath: '/',
filename: '[name].[hash].js',
chunkFilename: '[id].[hash].chunk.js'
},
resolve: {
extensions: ['.ts', '.js'],
modules: [helpers.root('node_modules')]
},
plugins: [
new CopyWebpackPlugin([
... alfrescoLibs.map(lib => {
return {
context: `node_modules/${lib}/bundles/assets/` ,
from: '**/*',
to: `assets/`
}
})
]),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.optimize.UglifyJsPlugin({ // https://github.com/angular/angular/issues/10618
mangle: {
keep_fnames: true
},
compress: {
warnings: false
},
output: {
comments: false
},
sourceMap: true
}),
new ExtractTextPlugin('[name].[hash].css'),
new webpack.DefinePlugin({
'process.env': {
'ENV': JSON.stringify(ENV)
}
}),
new webpack.LoaderOptionsPlugin({
htmlLoader: {
minimize: false // workaround for ng2
}
})
]
});

View File

@ -1,15 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Angular 2 DataTable - Demo</title>
<base href="./">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<alfresco-app-demo></alfresco-app-demo>
</body>
</html>

View File

@ -1,112 +0,0 @@
{
"name": "ng2-alfresco-datatable-demo",
"description": "Alfresco Angular2 DataTable Component - Demo",
"version": "0.1.0",
"author": "Alfresco Software, Ltd.",
"scripts": {
"build": "rimraf dist && npm run webpack -- --config config/webpack.prod.js --progress --profile --bail",
"build:dev": "rimraf dist && npm run webpack -- --config config/webpack.dev.js --progress --profile --bail",
"start:dist": "wsrv -s dist/ -p 3000 -a 0.0.0.0",
"start": "npm run webpack-dev-server -- --config config/webpack.prod.js --progress --content-base app/",
"start:dev": "npm run webpack-dev-server -- --config config/webpack.dev.js --progress --content-base app/",
"clean": "npm run clean-build && rimraf dist node_modules typings dist",
"clean-build": "rimraf 'app/{,**/}**.js' 'app/{,**/}**.js.map' 'app/{,**/}**.d.ts'",
"webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js",
"webpack": "webpack"
},
"license": "Apache-2.0",
"contributors": [
{
"name": "Denys Vuika",
"email": "denis.vuyka@gmail.com"
}
],
"dependencies": {
"@angular/animations": "4.2.5",
"@angular/common": "4.2.5",
"@angular/compiler": "4.2.5",
"@angular/core": "4.2.5",
"@angular/forms": "4.2.5",
"@angular/http": "4.2.5",
"@angular/platform-browser": "4.2.5",
"@angular/platform-browser-dynamic": "4.2.5",
"@angular/router": "4.2.5",
"@angular/material": "2.0.0-beta.1",
"alfresco-js-api": "~1.6.1",
"core-js": "2.4.1",
"hammerjs": "2.0.8",
"ng2-alfresco-core": "1.6.1",
"@ngx-translate/core": "7.0.0",
"reflect-metadata": "0.1.10",
"rxjs": "5.1.0",
"systemjs": "0.19.27",
"zone.js": "0.7.6",
"@angular/upgrade": "2.4.7",
"intl": "1.2.4",
"dialog-polyfill": "0.4.7",
"element.scrollintoviewifneeded-polyfill": "1.0.1",
"material-design-icons": "2.2.3",
"material-design-lite": "1.2.1",
"ng2-alfresco-datatable": "1.6.1"
},
"devDependencies": {
"@types/hammerjs": "2.0.34",
"@types/jasmine": "2.5.35",
"@types/node": "6.0.45",
"angular2-template-loader": "0.6.2",
"autoprefixer": "6.5.4",
"copy-webpack-plugin": "4.0.1",
"css-loader": "0.23.1",
"css-to-string-loader": "0.1.2",
"cssnano": "3.8.1",
"extract-text-webpack-plugin": "2.0.0-rc.3",
"file-loader": "0.11.1",
"html-loader": "0.4.4",
"html-webpack-plugin": "2.28.0",
"istanbul-instrumenter-loader": "0.2.0",
"jasmine-ajax": "3.2.0",
"jasmine-core": "2.4.1",
"karma": "0.13.22",
"karma-chrome-launcher": "~1.0.1",
"karma-coverage": "1.1.1",
"karma-jasmine": "~1.0.2",
"karma-jasmine-ajax": "0.1.13",
"karma-jasmine-html-reporter": "0.2.0",
"karma-mocha-reporter": "2.2.2",
"karma-remap-istanbul": "0.6.0",
"karma-sourcemap-loader": "0.3.7",
"karma-systemjs": "0.16.0",
"karma-webpack": "2.0.3",
"loader-utils": "1.1.0",
"merge-stream": "1.0.1",
"null-loader": "0.1.1",
"package-json-merge": "0.0.1",
"raw-loader": "0.5.1",
"remap-istanbul": "0.6.3",
"rimraf": "2.5.4",
"run-sequence": "1.2.2",
"script-loader": "0.7.0",
"source-map-loader": "0.1.6",
"style-loader": "0.13.1",
"systemjs-builder": "0.15.34",
"to-string-loader": "1.1.5",
"traceur": "0.0.91",
"ts-loader": "2.2.1",
"ts-node": "1.7.0",
"tslint": "4.5.1",
"tslint-loader": "3.5.3",
"typescript": "2.1.6",
"webpack": "2.2.1",
"webpack-dev-server": "2.3.0",
"webpack-merge": "2.6.1",
"wsrv": "0.1.7",
"node-sass": "3.13.1",
"sass-loader": "6.0.2"
},
"keywords": [
"angular2",
"typescript"
]
}

View File

@ -1,152 +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, Component } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { CoreModule } from 'ng2-alfresco-core';
import { DataTableModule } from 'ng2-alfresco-datatable';
import {
ObjectDataTableAdapter,
DataSorting,
ObjectDataRow,
ObjectDataColumn
} from 'ng2-alfresco-datatable';
@Component({
selector: 'alfresco-app-demo',
template: `
<div class="container">
<div class="p-10">
<alfresco-datatable [data]="data" [multiselect]="multiselect"></alfresco-datatable>
</div>
<div class="p-10">
<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="checkbox-1">
<input type="checkbox" id="checkbox-1" class="mdl-checkbox__input" [(ngModel)]="multiselect">
<span class="mdl-checkbox__label">Multiselect</span>
</label>
</div>
<div class="p-10">
<button
class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect"
(click)="reset()">
Reset to default
</button>
<button
class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect"
(click)="addRow()">
Add row
</button>
<button
class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect"
(click)="replaceRows()">
Replace rows
</button>
<button
class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect"
(click)="replaceColumns()">
Replace columns
</button>
</div>
</div>
`,
styles: [
':host > .container {padding: 10px}',
'.p-10 { padding: 10px; }'
]
})
class DataTableDemo {
multiselect: boolean = false;
data: ObjectDataTableAdapter;
private _imageUrl: string = 'http://placehold.it/140x100';
private _createdBy: any = {
name: 'Denys Vuika',
email: 'denys.vuika@alfresco.com'
};
constructor() {
this.reset();
}
reset() {
this.data = new ObjectDataTableAdapter(
[
{id: 1, name: 'Name 1', createdBy: this._createdBy, icon: 'material-icons://folder_open'},
{id: 2, name: 'Name 2', createdBy: this._createdBy, icon: 'material-icons://accessibility'},
{id: 3, name: 'Name 3', createdBy: this._createdBy, icon: 'material-icons://alarm'},
{id: 4, name: 'Image 1', createdBy: this._createdBy, icon: this._imageUrl}
],
[
{type: 'image', key: 'icon', title: '', srTitle: 'Thumbnail'},
{type: 'text', key: 'id', title: 'Id', sortable: true},
{type: 'text', key: 'name', title: 'Name', cssClass: 'full-width name-column', sortable: true},
{type: 'text', key: 'createdBy.name', title: 'Created By', sortable: true}
]
);
this.data.setSorting(new DataSorting('id', 'asc'));
}
addRow() {
let id = this.data.getRows().length + 1;
let row = new ObjectDataRow({
id: id,
name: 'Name ' + id,
icon: 'material-icons://extension',
createdBy: this._createdBy
});
this.data.getRows().push(row);
this.data.sort();
}
replaceRows() {
let objects = [
{id: 10, name: 'Name 10', createdBy: this._createdBy, icon: 'material-icons://face'},
{id: 11, name: 'Name 11', createdBy: this._createdBy, icon: 'material-icons://language'},
{id: 12, name: 'Name 12', createdBy: this._createdBy, icon: 'material-icons://pets'},
{id: 13, name: 'Image 13', createdBy: this._createdBy, icon: this._imageUrl}
];
let rows = objects.map(obj => new ObjectDataRow(obj));
this.data.setRows(rows);
}
replaceColumns() {
let schema = [
{ type: 'text', key: 'id', title: 'Id', sortable: true },
{ type: 'text', key: 'name', title: 'Name', sortable: true, cssClass: 'full-width name-column' }
];
let columns = schema.map(col => new ObjectDataColumn(col));
this.data.setColumns(columns);
}
}
@NgModule({
imports: [
BrowserModule,
CoreModule.forRoot(),
DataTableModule
],
declarations: [ DataTableDemo ],
bootstrap: [ DataTableDemo ]
})
export class AppModule { }
platformBrowserDynamic().bootstrapModule(AppModule);

View File

@ -1,17 +0,0 @@
import 'core-js/es6';
import 'core-js/es7/reflect';
import 'intl';
require('zone.js/dist/zone'); // IE 8-11
require('element.scrollintoviewifneeded-polyfill'); // IE/FF
if (process.env.ENV === 'production') {
// Production
} else {
// Development
Error['stackTraceLimit'] = Infinity;
require('zone.js/dist/long-stack-trace-zone');
}

View File

@ -1,26 +0,0 @@
// Angular
import '@angular/platform-browser';
import '@angular/platform-browser-dynamic';
import '@angular/core';
import '@angular/common';
import '@angular/http';
import '@angular/router';
// RxJS
import 'rxjs';
// hammerjs
import 'hammerjs';
// Alfresco
import 'alfresco-js-api';
import 'ng2-alfresco-datatable';
// Google Material Design Lite
import 'material-design-lite/material.js';
import 'material-design-lite/dist/material.orange-blue.min.css';
import 'material-design-icons/iconfont/material-icons.css';
// Polyfill(s) for dialogs
require('script-loader!dialog-polyfill/dialog-polyfill');
import 'dialog-polyfill/dialog-polyfill.css';

View File

@ -1,36 +0,0 @@
{
"compilerOptions": {
"baseUrl": ".",
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"skipLibCheck": true,
"noLib": false,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"noImplicitAny": false,
"noImplicitReturns": false,
"noImplicitUseStrict": false,
"noFallthroughCasesInSwitch": true,
"removeComments": true,
"declaration": true,
"outDir": "./dist",
"lib": [
"es2015",
"dom"
],
"suppressImplicitAnyIndexErrors": true
},
"exclude": [
"demo",
"node_modules",
"dist"
],
"angularCompilerOptions": {
"strictMetadataEmit": false,
"skipTemplateCodegen": true
}
}

View File

@ -1,118 +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,
"max-line-length": [
true,
180
],
"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": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-constructor-vars": false,
"no-debugger": true,
"no-duplicate-variable": true,
"no-empty": false,
"no-eval": true,
"no-inferrable-types": false,
"no-internal-module": true,
"no-require-imports": false,
"no-shadowed-variable": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"no-var-requires": false,
"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"
]
}
}

View File

@ -1 +0,0 @@
module.exports = require('./config/webpack.dev.js');

View File

@ -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

Some files were not shown because too many files have changed in this diff Show More