mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
@@ -3,6 +3,7 @@ node_modules
|
||||
workspace.xml
|
||||
.idea/
|
||||
dist/
|
||||
ng2-components/coverage/
|
||||
!systemjs.config.js
|
||||
demo-shell-ng2/app/components/router/
|
||||
ng2-components/ng2-alfresco-userinfo-old/demo/src/app/
|
||||
@@ -10,3 +11,6 @@ ng2-components/ng2-alfresco-userinfo-old/src/services/bpm-user.service.spec.ts
|
||||
ng2-components/ng2-alfresco-userinfo-old/src/services/ecm-user.service.spec.ts
|
||||
src/environments/
|
||||
/ng2-components/ng2-example-webpack/
|
||||
/ng2-components/config/coverage/
|
||||
*.npmrc
|
||||
/demo-shell-ng2/ng2-components/
|
||||
|
||||
+29
-57
@@ -2,7 +2,7 @@ language: node_js
|
||||
dist: trusty
|
||||
sudo: false
|
||||
node_js:
|
||||
- "5"
|
||||
- "6"
|
||||
|
||||
before_install:
|
||||
- "export DISPLAY=:99.0"
|
||||
@@ -10,48 +10,34 @@ before_install:
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- MODULE=ng2-alfresco-core
|
||||
- MODULE=ng2-alfresco-datatable
|
||||
- MODULE=ng2-alfresco-documentlist
|
||||
- MODULE=ng2-alfresco-login
|
||||
- MODULE=ng2-alfresco-search
|
||||
- MODULE=ng2-alfresco-upload
|
||||
- MODULE=ng2-alfresco-viewer
|
||||
- MODULE=ng2-alfresco-webscript
|
||||
- MODULE=ng2-alfresco-tag
|
||||
- MODULE=ng2-activiti-form
|
||||
- MODULE=ng2-activiti-tasklist
|
||||
- MODULE=ng2-activiti-processlist
|
||||
- MODULE=ng2-activiti-diagrams
|
||||
- MODULE=ng2-activiti-analytics
|
||||
- MODULE=ng2-alfresco-userinfo
|
||||
- MODULE=ng2-alfresco-social
|
||||
- MODULE=ng2-components-alfresco
|
||||
- MODULE=ng2-components-activiti
|
||||
- MODULE=ng2-demo-shell
|
||||
|
||||
install:
|
||||
- if ([ "$MODULE" == "ng2-components-alfresco" -o "$MODULE" == "ng2-components-activiti" ]); then
|
||||
if ([ "$TRAVIS_BRANCH" = "master" ]); then
|
||||
(./scripts/npm-build-all.sh || exit 1;);
|
||||
else
|
||||
(./scripts/npm-build-all.sh -gitjsapi development || exit 1;);
|
||||
fi
|
||||
fi
|
||||
|
||||
script:
|
||||
- if ([ "$MODULE" == "ng2-components-activiti" ]); then
|
||||
(./scripts/npm-build-all.sh -si -sb -t "ng2-activiti*" || exit 1;);
|
||||
fi
|
||||
- if ([ "$MODULE" == "ng2-components-alfresco" ]); then
|
||||
(./scripts/npm-build-all.sh -si -sb -t "ng2-alfresco*" || exit 1;);
|
||||
fi
|
||||
- if ([ "$MODULE" == "ng2-demo-shell" ]); then
|
||||
if ([ "$TRAVIS_BRANCH" = "master" ]); then
|
||||
(./scripts/start.sh -t -ss || exit 1;);
|
||||
else
|
||||
(./scripts/start.sh -dev -t -ss -gitjsapi development || exit 1;);
|
||||
fi
|
||||
fi
|
||||
|
||||
before_script:
|
||||
- if ([ "$MODULE" != "ng2-alfresco-core" ]); then
|
||||
(cd ng2-components/ng2-alfresco-core; if [ ! -d "bundles" ]; then npm install && npm run build && npm link; fi);
|
||||
fi
|
||||
- if ([ "$MODULE" == "ng2-alfresco-documentlist" ] || [ "$MODULE" == "ng2-alfresco-webscript" ] || [ "$MODULE" == "ng2-activiti-processlist" ] || [ "$MODULE" == "ng2-activiti-tasklist" ]); then
|
||||
(cd ng2-components/ng2-alfresco-datatable; npm link ng2-alfresco-core; if [ ! -d "bundles" ]; then npm install && npm run build && npm link; fi);
|
||||
fi
|
||||
- if ([ "$MODULE" == "ng2-activiti-tasklist" ] || [ "$MODULE" == "ng2-activiti-processlist" ]); then
|
||||
(cd ng2-components/ng2-alfresco-datatable; npm link ng2-alfresco-core; if [ ! -d "bundles" ]; then npm install && npm run build && npm link; fi);
|
||||
(cd ng2-components/ng2-activiti-form; npm link ng2-alfresco-core; if [ ! -d "bundles" ]; then npm install && npm run build && npm link; fi);
|
||||
fi
|
||||
- if ([ "$MODULE" == "ng2-activiti-processlist" ]); then
|
||||
(cd ng2-components/ng2-alfresco-datatable; npm link ng2-alfresco-core; if [ ! -d "bundles" ]; then npm install && npm run build && npm link; fi);
|
||||
(cd ng2-components/ng2-activiti-form; npm link ng2-alfresco-core; if [ ! -d "bundles" ]; then npm install && npm run build && npm link; fi);
|
||||
(cd ng2-components/ng2-activiti-tasklist; npm link ng2-alfresco-core; npm link ng2-alfresco-datatable; npm link ng2-activiti-form; if [ ! -d "bundles" ]; then npm install && npm run build && npm link; fi);
|
||||
fi
|
||||
- if ([ "$MODULE" == "ng2-activiti-analytics" ]); then
|
||||
(cd ng2-components/ng2-activiti-diagrams; npm link ng2-alfresco-core; if [ ! -d "bundles" ]; then npm install && npm run build && npm link; fi);
|
||||
fi
|
||||
- if ([ "$MODULE" == "ng2-alfresco-search" ]); then
|
||||
(cd ng2-components/ng2-alfresco-datatable; npm link ng2-alfresco-core; if [ ! -d "bundles" ]; then npm install && npm run build && npm link; fi);
|
||||
(cd ng2-components/ng2-alfresco-documentlist; npm link ng2-alfresco-core; npm link ng2-alfresco-datatable; if [ ! -d "bundles" ]; then npm install && npm run build && npm link; fi);
|
||||
fi
|
||||
- cd ng2-components/$MODULE;
|
||||
script: npm install && npm run travis && npm run test
|
||||
# Send coverage data to Coveralls
|
||||
after_success:
|
||||
bash <(curl -s https://codecov.io/bash) -X gcov
|
||||
@@ -61,18 +47,4 @@ cache:
|
||||
- ./node_modules/material-design-lite
|
||||
- ./node_modules/material-design-icons
|
||||
- demo-shell-ng2/node_modules
|
||||
- ng2-components/ng2-activiti-form/node_modules
|
||||
- ng2-components/ng2-activiti-processlist/node_modules
|
||||
- ng2-components/ng2-activiti-tasklist/node_modules
|
||||
- ng2-components/ng2-alfresco-core/node_modules
|
||||
- ng2-components/ng2-alfresco-datatable/node_modules
|
||||
- ng2-components/ng2-alfresco-documentlist/node_modules
|
||||
- ng2-components/ng2-alfresco-login/node_modules
|
||||
- ng2-components/ng2-alfresco-search/node_modules
|
||||
- ng2-components/ng2-alfresco-upload/node_modules
|
||||
- ng2-components/ng2-alfresco-viewer/node_modules
|
||||
- ng2-components/ng2-alfresco-webscript/node_modules
|
||||
- ng2-components/ng2-alfresco-tag/node_modules
|
||||
- ng2-components/ng2-activiti-analytics/node_modules
|
||||
- ng2-components/ng2-alfresco-userinfo/node_modules
|
||||
- ng2-components/ng2-activiti-diagrams/node_modules
|
||||
- ng2-components/node_modules
|
||||
|
||||
Vendored
+3
-2
@@ -6,9 +6,10 @@
|
||||
"**/.hg": true,
|
||||
"**/.DS_Store": true,
|
||||
"**/*.js": { "when": "$(basename).ts"},
|
||||
"**/*.js.map": { "when": "$(basename)"},
|
||||
"**/*.js.map": { "when": "$(basename).ts"},
|
||||
"**/*.d.ts": { "when": "$(basename).ts"},
|
||||
"**/coverage": true
|
||||
},
|
||||
"editor.renderIndentGuides": true
|
||||
"editor.renderIndentGuides": true,
|
||||
"tslint.configFile": "ng2-components/config/assets/tslint.json"
|
||||
}
|
||||
|
||||
+22
-39
@@ -6,53 +6,36 @@ branches:
|
||||
- dev-build-test
|
||||
|
||||
environment:
|
||||
nodejs_version: "5"
|
||||
nodejs_version: "6"
|
||||
|
||||
matrix:
|
||||
- COMPONENT_NAME: ng2-alfresco-core
|
||||
- COMPONENT_NAME: ng2-alfresco-datatable
|
||||
- COMPONENT_NAME: ng2-alfresco-documentlist
|
||||
- COMPONENT_NAME: ng2-alfresco-login
|
||||
- COMPONENT_NAME: ng2-alfresco-search
|
||||
- COMPONENT_NAME: ng2-alfresco-upload
|
||||
- COMPONENT_NAME: ng2-alfresco-viewer
|
||||
- COMPONENT_NAME: ng2-alfresco-tag
|
||||
- COMPONENT_NAME: ng2-alfresco-webscript
|
||||
- COMPONENT_NAME: ng2-activiti-form
|
||||
- COMPONENT_NAME: ng2-activiti-tasklist
|
||||
- COMPONENT_NAME: ng2-activiti-processlist
|
||||
- COMPONENT_NAME: ng2-activiti-diagrams
|
||||
- COMPONENT_NAME: ng2-activiti-analytics
|
||||
- COMPONENT_NAME: ng2-alfresco-userinfo
|
||||
- COMPONENT_NAME: ng2-alfresco-social
|
||||
- COMPONENT_NAME: ng2-components-activiti
|
||||
- COMPONENT_NAME: ng2-components-alfresco
|
||||
- COMPONENT_NAME: ng2-demo-shell
|
||||
|
||||
# Install scripts. (runs after repo cloning)
|
||||
install:
|
||||
# Get the latest stable version of Node.js or io.js
|
||||
- ps: Install-Product node $env:nodejs_version
|
||||
# install module
|
||||
- IF %COMPONENT_NAME% NEQ ng2-alfresco-core (cd ng2-components/ng2-alfresco-core && npm link && npm install && npm run build && cd ../../)
|
||||
- IF %COMPONENT_NAME% EQU ng2-alfresco-documentlist (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm link && npm install && npm run build && cd ../../)
|
||||
- IF %COMPONENT_NAME% EQU ng2-alfresco-search (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm link && npm install && npm run build && cd ../../)
|
||||
- IF %COMPONENT_NAME% EQU ng2-alfresco-search (cd ng2-components/ng2-alfresco-documentlist && npm link ng2-alfresco-core && npm link ng2-alfresco-datatable && npm link && npm install && npm run build && cd ../../)
|
||||
- IF %COMPONENT_NAME% EQU ng2-activiti-processlist (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm link && npm install && npm run build && cd ../../)
|
||||
- IF %COMPONENT_NAME% EQU ng2-activiti-processlist (cd ng2-components/ng2-activiti-form && npm link ng2-alfresco-core && npm link && npm install && npm run build && cd ../../)
|
||||
- IF %COMPONENT_NAME% EQU ng2-activiti-processlist (cd ng2-components/ng2-activiti-tasklist && npm link ng2-alfresco-core && npm link ng2-alfresco-datatable && npm link ng2-activiti-form && npm link && npm install && npm run build && cd ../../)
|
||||
- IF %COMPONENT_NAME% EQU ng2-activiti-tasklist (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm link && npm install && npm run build && cd ../../)
|
||||
- IF %COMPONENT_NAME% EQU ng2-activiti-tasklist (cd ng2-components/ng2-activiti-form && npm link ng2-alfresco-core && npm link && npm install && npm run build && cd ../../)
|
||||
- IF %COMPONENT_NAME% EQU ng2-alfresco-webscript (cd ng2-components/ng2-alfresco-datatable && npm link ng2-alfresco-core && npm link && npm install && npm run build && cd ../../)
|
||||
- IF %COMPONENT_NAME% EQU ng2-activiti-analytics (cd ng2-components/ng2-activiti-diagrams && npm link link ng2-alfresco-core && npm link && npm install && npm run build && cd ../../)
|
||||
- cd ng2-components/%COMPONENT_NAME%
|
||||
- npm run travis
|
||||
|
||||
# Post-install test scripts.
|
||||
test_script:
|
||||
- npm install
|
||||
# Output useful info for debugging.
|
||||
- node --version
|
||||
- npm --version
|
||||
# run tests
|
||||
- npm test
|
||||
- if %COMPONENT_NAME% EQU ng2-components-activiti (
|
||||
if %APPVEYOR_REPO_BRANCH EQU master
|
||||
(cd scripts && sh npm-build-all.sh -t "ng2-activiti*" || exit 1)
|
||||
else
|
||||
(cd scripts && sh npm-build-all.sh -t "ng2-activiti*" -gitjsapi development|| exit 1)
|
||||
)
|
||||
- if %COMPONENT_NAME% EQU ng2-components-alfresco (
|
||||
if %APPVEYOR_REPO_BRANCH EQU master
|
||||
(cd scripts && sh npm-build-all.sh -t "ng2-alfresco*" || exit 1)
|
||||
else
|
||||
(cd scripts && sh npm-build-all.sh -t "ng2-alfresco*" -gitjsapi development|| exit 1)
|
||||
)
|
||||
- if %COMPONENT_NAME% EQU ng2-demo-shell (
|
||||
if %APPVEYOR_REPO_BRANCH EQU master
|
||||
(cd scripts && sh start.sh -t -ss || exit 1)
|
||||
else
|
||||
(cd scripts && sh start.sh -dev -t -ss -gitjsapi development|| exit 1)
|
||||
)
|
||||
|
||||
# Don't actually build.
|
||||
build: off
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
typings/
|
||||
node_modules/
|
||||
bower_components/
|
||||
ng2-components/
|
||||
app/**/*.js
|
||||
app/**/*.js.map
|
||||
app/**/*.d.ts
|
||||
|
||||
!app/js/Polyline.js
|
||||
.idea
|
||||
versions.json
|
||||
|
||||
@@ -35,7 +35,7 @@ export class AboutComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.http.get('/versions.json').subscribe(response => {
|
||||
let regexp = new RegExp('^(ng2-activiti|ng2-alfresco|alfresco-)', 'g');
|
||||
let regexp = new RegExp('^(ng2-activiti|ng2-alfresco|alfresco-)');
|
||||
|
||||
let alfrescoPackages = Object.keys(response.json().dependencies).filter((val) => {
|
||||
this.logService.log(val);
|
||||
|
||||
@@ -70,6 +70,12 @@
|
||||
(taskCreated)="onTaskCreated($event)"
|
||||
(taskDeleted)="onTaskDeleted($event)">
|
||||
</activiti-task-details>
|
||||
<hr>
|
||||
<h5>Attachments</h5>
|
||||
<adf-task-attachment-list *ngIf="currentTaskId"
|
||||
[taskId]="currentTaskId"
|
||||
(attachmentClick)="onAttachmentClick($event)">
|
||||
</adf-task-attachment-list>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -149,6 +155,7 @@
|
||||
<hr>
|
||||
<analytics-report-list
|
||||
[appId]="appId"
|
||||
[selectFirst]="selectFirstReport"
|
||||
(reportClick)="onReportClick($event)"
|
||||
#analyticsreportlist>
|
||||
</analytics-report-list>
|
||||
|
||||
@@ -79,6 +79,7 @@ export class ActivitiDemoComponent implements AfterViewInit {
|
||||
appId: number = null;
|
||||
|
||||
fileShowed: boolean = false;
|
||||
selectFirstReport: boolean = false;
|
||||
|
||||
content: Blob;
|
||||
contentName: string;
|
||||
@@ -213,14 +214,8 @@ export class ActivitiDemoComponent implements AfterViewInit {
|
||||
}
|
||||
|
||||
onReportDeleted() {
|
||||
this.selectFirstReport = true;
|
||||
this.analyticsreportlist.reload();
|
||||
this.selectFirstElementInReportList();
|
||||
}
|
||||
|
||||
selectFirstElementInReportList() {
|
||||
if (!this.analyticsreportlist.isReportsEmpty()) {
|
||||
this.analyticsreportlist.selectReport(this.analyticsreportlist.reports[0]);
|
||||
}
|
||||
}
|
||||
|
||||
navigateStartProcess() {
|
||||
@@ -259,6 +254,12 @@ export class ActivitiDemoComponent implements AfterViewInit {
|
||||
this.contentName = content.name;
|
||||
}
|
||||
|
||||
onAttachmentClick(content: any) {
|
||||
this.fileShowed = true;
|
||||
this.content = content.contentBlob;
|
||||
this.contentName = content.name;
|
||||
}
|
||||
|
||||
onTaskCreated(data: any) {
|
||||
this.currentTaskId = data.parentTaskId;
|
||||
this.taskList.reload();
|
||||
|
||||
@@ -15,3 +15,7 @@
|
||||
.error-message--text {
|
||||
color: #d50000;
|
||||
}
|
||||
|
||||
.adf-not-overlay-viewer {
|
||||
height:900px;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
[contextMenuActions]="true"
|
||||
[contentActions]="true"
|
||||
[allowDropFiles]="true"
|
||||
[sorting]="['name', 'desc']"
|
||||
(error)="onNavigationError($event)"
|
||||
(success)="resetError()"
|
||||
(preview)="showFile($event)"
|
||||
@@ -44,6 +45,8 @@
|
||||
-->
|
||||
|
||||
</data-column>
|
||||
<!-- Notes: has performance problems due to multiple files/folders causing separate HTTP calls to get tags -->
|
||||
<!--
|
||||
<data-column
|
||||
title="{{'DOCUMENT_LIST.COLUMNS.TAG' | translate}}"
|
||||
key="id"
|
||||
@@ -52,6 +55,7 @@
|
||||
<alfresco-tag-node-list [nodeId]="entry.data.getValue(entry.row, entry.col)"></alfresco-tag-node-list>
|
||||
</template>
|
||||
</data-column>
|
||||
-->
|
||||
<data-column
|
||||
title="{{'DOCUMENT_LIST.COLUMNS.CREATED_BY' | translate}}"
|
||||
key="createdByUser.displayName"
|
||||
@@ -140,7 +144,7 @@
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<md-slide-toggle [(ngModel)]="disableWithNoPermission">Disable when user has no permissions</md-slide-toggle>
|
||||
<md-slide-toggle [(ngModel)]="disableWithNoPermission">Disable upload button when user has no permissions</md-slide-toggle>
|
||||
</section>
|
||||
|
||||
<h5>Upload</h5>
|
||||
@@ -195,5 +199,15 @@
|
||||
</extension-viewer>
|
||||
|
||||
</alfresco-viewer>
|
||||
|
||||
<!-- Comment the viewer above and uncomment that one below if you want test the overlay false viewer-->
|
||||
|
||||
<!--<div *ngIf="fileShowed" class="adf-not-overlay-viewer">-->
|
||||
<!--<alfresco-viewer [(showViewer)]="fileShowed"-->
|
||||
<!--[fileNodeId]="fileNodeId"-->
|
||||
<!--[overlayMode]="false">-->
|
||||
<!--</alfresco-viewer>-->
|
||||
<!--</div>-->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.setting-card.mdl-card {
|
||||
width: 320px;
|
||||
height: 320px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.setting-card > .mdl-card__title {
|
||||
@@ -30,6 +30,6 @@
|
||||
display: table-row;
|
||||
}
|
||||
|
||||
.adf-setting-input-padding{
|
||||
.adf-setting-input-padding {
|
||||
padding-top: 0px !important;
|
||||
}
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
import 'core-js/es6';
|
||||
import 'core-js/es7/reflect';
|
||||
import 'intl';
|
||||
|
||||
// IE 8-11
|
||||
require('zone.js/dist/zone');
|
||||
require('zone.js/dist/zone'); // IE 8-11
|
||||
require('element.scrollintoviewifneeded-polyfill'); // IE/FF
|
||||
|
||||
if (process.env.ENV === 'production') {
|
||||
// Production
|
||||
// Production
|
||||
|
||||
} else {
|
||||
// Development
|
||||
// Development
|
||||
|
||||
Error['stackTraceLimit'] = Infinity;
|
||||
Error['stackTraceLimit'] = Infinity;
|
||||
|
||||
require('zone.js/dist/long-stack-trace-zone');
|
||||
require('zone.js/dist/long-stack-trace-zone');
|
||||
}
|
||||
|
||||
@@ -32,39 +32,44 @@ import 'ng2-alfresco-webscript';
|
||||
import 'ng2-alfresco-userinfo';
|
||||
|
||||
// Polyfill(s) for dialogs
|
||||
require('script!dialog-polyfill/dialog-polyfill');
|
||||
require('script-loader!dialog-polyfill/dialog-polyfill');
|
||||
import 'dialog-polyfill/dialog-polyfill.css';
|
||||
|
||||
// Flags
|
||||
import 'flag-icon-css/css/flag-icon.min.css';
|
||||
|
||||
import '../public/css/app.css';
|
||||
import '../public/css/muli-font.css';
|
||||
|
||||
// Load the Angular Material 2 stylesheet
|
||||
import '../public/css/angular-material.css';
|
||||
|
||||
// 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 '../public/css/app.css';
|
||||
import '../public/css/muli-font.css';
|
||||
|
||||
import 'ng2-activiti-form/stencils/runtime.ng1';
|
||||
import 'ng2-activiti-form/stencils/runtime.adf';
|
||||
|
||||
import 'ng2-charts';
|
||||
import 'chart.js';
|
||||
require('script!raphael/raphael.min.js');
|
||||
require('script-loader!raphael/raphael.min.js');
|
||||
|
||||
require('script!moment/min/moment.min.js');
|
||||
require('script-loader!moment/min/moment.min.js');
|
||||
|
||||
import 'md-date-time-picker/dist/css/mdDateTimePicker.css';
|
||||
require('script!md-date-time-picker/dist/js/mdDateTimePicker.min.js');
|
||||
require('script!md-date-time-picker/dist/js/draggabilly.pkgd.min.js');
|
||||
require('script-loader!md-date-time-picker/dist/js/mdDateTimePicker.min.js');
|
||||
require('script-loader!md-date-time-picker/dist/js/draggabilly.pkgd.min.js');
|
||||
|
||||
require('pdfjs-dist/web/compatibility.js');
|
||||
|
||||
// Setting worker path to worker bundle.
|
||||
let pdfjsLib = require('pdfjs-dist');
|
||||
if (process.env.ENV === 'production') {
|
||||
pdfjsLib.PDFJS.workerSrc = './pdf.worker.js';
|
||||
pdfjsLib.PDFJS.workerSrc = './pdf.worker.js';
|
||||
} else {
|
||||
pdfjsLib.PDFJS.workerSrc = '../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
||||
pdfjsLib.PDFJS.workerSrc = '../../node_modules/pdfjs-dist/build/pdf.worker.js';
|
||||
}
|
||||
|
||||
require('pdfjs-dist/web/pdf_viewer.js');
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
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;
|
||||
|
||||
@@ -1,37 +1,73 @@
|
||||
var webpackConfig = require('./webpack.test');
|
||||
|
||||
module.exports = function (config) {
|
||||
var _config = {
|
||||
basePath: '',
|
||||
var _config = {
|
||||
basePath: '',
|
||||
|
||||
frameworks: ['jasmine'],
|
||||
frameworks: ['jasmine'],
|
||||
|
||||
files: [
|
||||
{ pattern: './config/karma-test-shim.js', watched: false }
|
||||
],
|
||||
files: [
|
||||
'./node_modules/hammerjs/hammer.js',
|
||||
|
||||
preprocessors: {
|
||||
'./config/karma-test-shim.js': ['webpack', 'sourcemap']
|
||||
},
|
||||
{ pattern: './config/karma-test-shim.js', watched: false }
|
||||
],
|
||||
|
||||
webpack: webpackConfig,
|
||||
preprocessors: {
|
||||
'./config/karma-test-shim.js': ['webpack', 'sourcemap']
|
||||
},
|
||||
|
||||
webpackMiddleware: {
|
||||
stats: 'errors-only'
|
||||
},
|
||||
webpack: webpackConfig,
|
||||
|
||||
webpackServer: {
|
||||
noInfo: true
|
||||
},
|
||||
webpackMiddleware: {
|
||||
stats: 'errors-only'
|
||||
},
|
||||
|
||||
reporters: ['mocha'],
|
||||
port: 9876,
|
||||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
autoWatch: false,
|
||||
browsers: ['Chrome'],
|
||||
singleRun: true
|
||||
};
|
||||
port: 9876,
|
||||
|
||||
config.set(_config);
|
||||
// level of logging
|
||||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
||||
logLevel: config.LOG_INFO,
|
||||
|
||||
colors: true,
|
||||
|
||||
autoWatch: true,
|
||||
|
||||
captureTimeout: 180000,
|
||||
browserDisconnectTimeout: 180000,
|
||||
browserDisconnectTolerance: 3,
|
||||
browserNoActivityTimeout: 300000,
|
||||
|
||||
browsers: ['Chrome'],
|
||||
|
||||
customLaunchers: {
|
||||
Chrome_travis_ci: {
|
||||
base: 'Chrome',
|
||||
flags: ['--no-sandbox']
|
||||
}
|
||||
},
|
||||
|
||||
// Karma plugins loaded
|
||||
plugins: [
|
||||
require('../node_modules/karma-jasmine'),
|
||||
require('../node_modules/karma-coverage'),
|
||||
require('../node_modules/karma-sourcemap-loader'),
|
||||
require('../node_modules/karma-chrome-launcher'),
|
||||
require('../node_modules/karma-mocha-reporter'),
|
||||
require('../node_modules/karma-webpack'),
|
||||
require('../node_modules/karma-jasmine-html-reporter')
|
||||
],
|
||||
|
||||
webpackServer: {
|
||||
noInfo: true
|
||||
},
|
||||
|
||||
reporters: ['mocha']
|
||||
|
||||
};
|
||||
|
||||
if (process.env.TRAVIS) {
|
||||
config.browsers = ['Chrome_travis_ci'];
|
||||
}
|
||||
|
||||
config.set(_config);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
var path = require('path');
|
||||
var loaderUtils = require('loader-utils');
|
||||
var fs = require('fs');
|
||||
|
||||
var licenseFileUtf8Store = undefined;
|
||||
|
||||
function readLicenseHeaderFile(licenseFilePath) {
|
||||
if (licenseFileUtf8Store) {
|
||||
return licenseFileUtf8Store;
|
||||
}
|
||||
|
||||
if (fs.existsSync(licenseFilePath)) {
|
||||
licenseFileUtf8Store = fs.readFileSync(licenseFilePath, 'utf8').split(/\r?\n/);
|
||||
return licenseFileUtf8Store;
|
||||
}
|
||||
|
||||
throw new Error('The license header file path is wrong ' + licenseFilePath);
|
||||
}
|
||||
|
||||
function isFileEmpty(fileContents) {
|
||||
return fileContents.toString('utf8').trim() === '';
|
||||
}
|
||||
|
||||
function readCurrentFile(fileContent) {
|
||||
return fileContent.toString('utf8').split(/\r?\n/);
|
||||
}
|
||||
|
||||
function isLicenseHeaderPresent(currentFileContent, licenseFilePath) {
|
||||
if (!isFileEmpty(currentFileContent)) {
|
||||
var currentFileUtf8 = readCurrentFile(currentFileContent),
|
||||
licenseFileUtf8 = readLicenseHeaderFile(licenseFilePath);
|
||||
skipStrict = 0;
|
||||
|
||||
if(currentFileUtf8[0] === '"use strict";' ) {
|
||||
skipStrict = 1;
|
||||
}
|
||||
|
||||
for (var i = skipStrict; i < licenseFileUtf8.length; i++) {
|
||||
if (currentFileUtf8[i + skipStrict] !== licenseFileUtf8[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function report(hasHeader, emitter, filename) {
|
||||
if (hasHeader) return;
|
||||
emitter('Missing license header file : ' + filename);
|
||||
}
|
||||
|
||||
function licenseCheck(webpackInstance, input, options) {
|
||||
var isLicensePresent = isLicenseHeaderPresent(input, options.licenseFile);
|
||||
|
||||
var emitter = options.emitErrors ? webpackInstance.emitError : webpackInstance.emitWarning;
|
||||
|
||||
report(isLicensePresent, emitter, webpackInstance.resourcePath);
|
||||
}
|
||||
|
||||
module.exports = function(input, map) {
|
||||
this.cacheable && this.cacheable();
|
||||
var callback = this.async();
|
||||
|
||||
var options = loaderUtils.getOptions(this);
|
||||
licenseCheck(this, input, options);
|
||||
callback(null, input, map);
|
||||
};
|
||||
@@ -1,22 +1,27 @@
|
||||
var webpack = require('webpack');
|
||||
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
var helpers = require('./helpers');
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var glob = require('glob');
|
||||
var CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
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 rootPath = helpers.root('node_modules');
|
||||
|
||||
var pattern = '+(alfresco-js-api|ng2-alfresco|ng2-activiti)*';
|
||||
var options = {
|
||||
cwd: rootPath,
|
||||
realpath: true
|
||||
};
|
||||
|
||||
var alfrescoLibs = glob.sync(pattern, options);
|
||||
// console.dir(alfrescoLibs);
|
||||
const alfrescoLibs = [
|
||||
'ng2-activiti-analytics',
|
||||
'ng2-activiti-diagrams',
|
||||
'ng2-activiti-form',
|
||||
'ng2-activiti-processlist',
|
||||
'ng2-activiti-tasklist',
|
||||
'ng2-alfresco-core',
|
||||
'ng2-alfresco-datatable',
|
||||
'ng2-alfresco-documentlist',
|
||||
'ng2-alfresco-login',
|
||||
'ng2-alfresco-search',
|
||||
'ng2-alfresco-tag',
|
||||
'ng2-alfresco-upload',
|
||||
'ng2-alfresco-userinfo',
|
||||
'ng2-alfresco-viewer',
|
||||
'ng2-alfresco-webscript'
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
@@ -25,162 +30,146 @@ module.exports = {
|
||||
'app': './app/main.ts'
|
||||
},
|
||||
|
||||
resolve: {
|
||||
extensions: ['', '.ts', '.js'],
|
||||
modules: [
|
||||
helpers.root('app'),
|
||||
helpers.root('node_modules')
|
||||
],
|
||||
root: rootPath,
|
||||
fallback: rootPath
|
||||
},
|
||||
|
||||
resolveLoader: {
|
||||
alias: {
|
||||
'systemjs-loader': helpers.root('config', 'loaders', 'system.js'),
|
||||
'debug-loader': helpers.root('config', 'loaders', 'debug.js')
|
||||
},
|
||||
fallback: rootPath
|
||||
"license-check": path.resolve(__dirname, "./loaders/license-check")
|
||||
}
|
||||
},
|
||||
|
||||
module: {
|
||||
preLoaders: [
|
||||
rules: [
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.js$/,
|
||||
include: [
|
||||
...alfrescoLibs
|
||||
],
|
||||
loader: 'source-map-loader'
|
||||
}
|
||||
],
|
||||
loaders: [
|
||||
include: [helpers.root('app'), helpers.root('../ng2-components')],
|
||||
loader: 'source-map-loader',
|
||||
exclude: [ /node_modules/, /public/, /resources/, /dist/]
|
||||
},
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.ts$/,
|
||||
loader: 'tslint-loader',
|
||||
include: [helpers.root('app')],
|
||||
options: {
|
||||
emitErrors: true
|
||||
},
|
||||
exclude: [ /node_modules/, /public/, /resources/, /dist/]
|
||||
},
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.ts$/,
|
||||
use: 'source-map-loader',
|
||||
exclude: [ /public/, /resources/, /dist/]
|
||||
},
|
||||
{
|
||||
test: /\.ts$/,
|
||||
loaders: ['awesome-typescript-loader', 'angular2-template-loader', 'systemjs-loader'],
|
||||
exclude: ['node_modules','public']
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
include: [
|
||||
...alfrescoLibs
|
||||
include: [helpers.root('app'), helpers.root('../ng2-components')],
|
||||
loader: [
|
||||
'ts-loader',
|
||||
'angular2-template-loader'
|
||||
],
|
||||
loaders: ['angular2-template-loader', 'source-map-loader', 'systemjs-loader']
|
||||
exclude: [ /node_modules/, /public/, /resources/, /dist/]
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
exclude: alfrescoLibs,
|
||||
loader: 'html'
|
||||
loader: 'html-loader',
|
||||
exclude: [ /node_modules/, /public/, /resources/, /dist/]
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
include: alfrescoLibs,
|
||||
loader: 'html',
|
||||
query: {
|
||||
interpolate: true
|
||||
}
|
||||
test: /\.css$/,
|
||||
exclude: [helpers.root('app'), helpers.root('../ng2-components')],
|
||||
loader: ExtractTextPlugin.extract({
|
||||
fallback: 'style-loader',
|
||||
use: 'css-loader?sourceMap'
|
||||
})
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
include: [helpers.root('app'), helpers.root('../ng2-components')],
|
||||
loader: 'raw-loader'
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
|
||||
loader: 'file?name=assets/[name].[hash].[ext]'
|
||||
loader: 'file-loader?name=assets/[name].[hash].[ext]'
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
exclude: [
|
||||
helpers.root('app'),
|
||||
...alfrescoLibs
|
||||
],
|
||||
loader: ExtractTextPlugin.extract('style', 'css?sourceMap')
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
include: [
|
||||
helpers.root('app'),
|
||||
...alfrescoLibs
|
||||
],
|
||||
loader: 'raw'
|
||||
enforce: 'pre',
|
||||
test: /\.ts$/,
|
||||
loader: 'license-check',
|
||||
include: helpers.root('app'),
|
||||
options: {
|
||||
emitErrors: true,
|
||||
licenseFile: path.resolve(__dirname, '../assets/license_header.txt')
|
||||
},
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/],
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
plugins: [
|
||||
|
||||
new webpack.WatchIgnorePlugin([ new RegExp('^((?!(ng2-activiti|ng2-alfresco|demo-shell-ng2)).)((?!(src|app)).)*$')]),
|
||||
// Workaround for angular/angular#11580
|
||||
new webpack.ContextReplacementPlugin(
|
||||
// The (\\|\/) piece accounts for path separators in *nix and Windows
|
||||
/angular(\\|\/)core(\\|\/)@angular/,
|
||||
helpers.root('./app'), // 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'
|
||||
},
|
||||
... alfrescoLibs.map(lib => {
|
||||
return {
|
||||
context: 'node_modules',
|
||||
from: `${lib}/src/i18n/*.json`,
|
||||
to: 'node_modules'
|
||||
}
|
||||
}),
|
||||
{
|
||||
from: 'favicon-96x96.png'
|
||||
},
|
||||
{
|
||||
from: 'node_modules/pdfjs-dist/build/pdf.worker.js',
|
||||
to: 'pdf.worker.js'
|
||||
},
|
||||
{
|
||||
from: 'versions.json'
|
||||
},{
|
||||
context: 'node_modules',
|
||||
from: 'element.scrollintoviewifneeded-polyfill/index.js',
|
||||
to: 'js/element.scrollintoviewifneeded-polyfill.js',
|
||||
flatten: true
|
||||
},{
|
||||
context: 'node_modules',
|
||||
from: 'classlist-polyfill/src/index.js',
|
||||
to: 'js/classlist-polyfill.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'intl/dist/Intl.min.js',
|
||||
to: 'js/Intl.min.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'web-animations-js/web-animations.min.js',
|
||||
to: 'js/web-animations.min.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'core-js/client/shim.min.js',
|
||||
to: 'js/shim.min.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'es6-shim/es6-shim.min.js',
|
||||
to: 'js/es6-shim.min.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'es5-shim/es5-shim.min.js',
|
||||
to: 'js/es5-shim.min.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'systemjs/dist/system-polyfills.js',
|
||||
to: 'js/system-polyfills.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'material-design-lite/material.min.js',
|
||||
to: 'js/material.min.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'material-design-lite/material.min.js',
|
||||
to: 'js/material.min.js',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'node_modules',
|
||||
from: 'material-design-icons/iconfont/',
|
||||
to: 'css/iconfont/',
|
||||
flatten: true
|
||||
}, {
|
||||
context: 'public',
|
||||
from: '',
|
||||
to: ''
|
||||
},
|
||||
{
|
||||
from: 'versions.json'
|
||||
}
|
||||
]),
|
||||
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: ['app', 'vendor', 'polyfills']
|
||||
}),
|
||||
|
||||
new HtmlWebpackPlugin({
|
||||
template: 'index.html'
|
||||
})
|
||||
],
|
||||
|
||||
devServer: {
|
||||
contentBase: helpers.root('dist'),
|
||||
compress: true,
|
||||
port: 3000,
|
||||
historyApiFallback: true,
|
||||
host: '0.0.0.0',
|
||||
inline: true
|
||||
},
|
||||
|
||||
node: {
|
||||
fs: 'empty',
|
||||
module: false
|
||||
fs: 'empty'
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
var webpackMerge = require('webpack-merge');
|
||||
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
var commonConfig = require('./webpack.common.js');
|
||||
var helpers = require('./helpers');
|
||||
var CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
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, {
|
||||
|
||||
@@ -14,55 +15,38 @@ module.exports = webpackMerge(commonConfig, {
|
||||
chunkFilename: '[id].chunk.js'
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new ExtractTextPlugin('[name].css'),
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: 'favicon-96x96.png'
|
||||
},
|
||||
{
|
||||
from: 'node_modules/pdfjs-dist/build/pdf.worker.js',
|
||||
to: 'pdf.worker.js'
|
||||
},
|
||||
{
|
||||
context: 'resources/i18n',
|
||||
from: '**/*.json',
|
||||
to: 'resources/i18n'
|
||||
},
|
||||
// Copy i18n folders for all modules with ng2-alfresco- prefix
|
||||
{
|
||||
context: 'node_modules',
|
||||
from: 'ng2-alfresco-*/src/i18n/*.json',
|
||||
to: 'node_modules'
|
||||
},
|
||||
// Copy i18n folders for all modules with ng2-activiti- prefix
|
||||
{
|
||||
context: 'node_modules',
|
||||
from: 'ng2-activiti-*/src/i18n/*.json',
|
||||
to: 'node_modules'
|
||||
},
|
||||
// Copy asstes folders for all modules with ng2-activiti- prefix
|
||||
{
|
||||
context: 'node_modules',
|
||||
from: 'ng2-activiti-*/src/assets/images/*.*',
|
||||
to: 'assets/images',
|
||||
flatten: true
|
||||
},
|
||||
// Copy asstes folders for all modules with ng2-alfresco- prefix
|
||||
{
|
||||
context: 'node_modules',
|
||||
from: 'ng2-alfresco-*/src/assets/images/*.*',
|
||||
to: 'assets/images',
|
||||
flatten: true
|
||||
}
|
||||
])
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
"ng2-alfresco-core$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-core/index.ts'),
|
||||
"ng2-alfresco-datatable$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-datatable/index.ts'),
|
||||
"ng2-activiti-form/stencils/runtime.ng1$": path.resolve(__dirname, '../../ng2-components/ng2-activiti-form/stencils/runtime.ng1'),
|
||||
"ng2-activiti-form/stencils/runtime.adf$": path.resolve(__dirname, '../../ng2-components/ng2-activiti-form/stencils/runtime.adf'),
|
||||
"ng2-activiti-diagrams$": path.resolve(__dirname, '../../ng2-components/ng2-activiti-diagrams/index.ts'),
|
||||
"ng2-activiti-analytics$": path.resolve(__dirname, '../../ng2-components/ng2-activiti-analytics/index.ts'),
|
||||
"ng2-activiti-form$": path.resolve(__dirname, '../../ng2-components/ng2-activiti-form/index.ts'),
|
||||
"ng2-activiti-tasklist$": path.resolve(__dirname, '../../ng2-components/ng2-activiti-tasklist/index.ts'),
|
||||
"ng2-activiti-processlist$": path.resolve(__dirname, '../../ng2-components/ng2-activiti-processlist/index.ts'),
|
||||
"ng2-alfresco-documentlist$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-documentlist/index.ts'),
|
||||
"ng2-alfresco-login$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-login/index.ts'),
|
||||
"ng2-alfresco-search$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-search/index.ts'),
|
||||
"ng2-alfresco-social$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-social/index.ts'),
|
||||
"ng2-alfresco-tag$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-tag/index.ts'),
|
||||
"ng2-alfresco-upload$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-upload/index.ts'),
|
||||
"ng2-alfresco-viewer$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-viewer/index.ts'),
|
||||
"ng2-alfresco-webscript$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-webscript/index.ts'),
|
||||
"ng2-alfresco-userinfo$": path.resolve(__dirname, '../../ng2-components/ng2-alfresco-userinfo/index.ts')
|
||||
},
|
||||
extensions: ['.ts', '.js'],
|
||||
modules: [path.resolve(__dirname, '../node_modules')]
|
||||
},
|
||||
|
||||
devServer: {
|
||||
host: '0.0.0.0',
|
||||
port: 3000,
|
||||
inline: true,
|
||||
historyApiFallback: true,
|
||||
stats: 'minimal'
|
||||
}
|
||||
plugins: [
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
new ExtractTextPlugin('[name].[hash].css'),
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
htmlLoader: {
|
||||
minimize: false // workaround for ng2
|
||||
}
|
||||
})
|
||||
]
|
||||
});
|
||||
|
||||
@@ -1,104 +1,79 @@
|
||||
var webpack = require('webpack');
|
||||
var webpackMerge = require('webpack-merge');
|
||||
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
var CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||
var commonConfig = require('./webpack.common.js');
|
||||
var helpers = require('./helpers');
|
||||
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',
|
||||
'ng2-activiti-form',
|
||||
'ng2-activiti-processlist',
|
||||
'ng2-activiti-tasklist',
|
||||
'ng2-alfresco-core',
|
||||
'ng2-alfresco-datatable',
|
||||
'ng2-alfresco-documentlist',
|
||||
'ng2-alfresco-login',
|
||||
'ng2-alfresco-search',
|
||||
'ng2-alfresco-tag',
|
||||
'ng2-alfresco-upload',
|
||||
'ng2-alfresco-userinfo',
|
||||
'ng2-alfresco-viewer',
|
||||
'ng2-alfresco-webscript'
|
||||
];
|
||||
|
||||
module.exports = webpackMerge(commonConfig, {
|
||||
devtool: 'source-map',
|
||||
|
||||
output: {
|
||||
path: helpers.root('dist'),
|
||||
publicPath: '/',
|
||||
filename: '[name].[hash].js',
|
||||
chunkFilename: '[id].[hash].chunk.js'
|
||||
},
|
||||
devtool: 'source-map',
|
||||
|
||||
htmlLoader: {
|
||||
minimize: false // workaround for ng2
|
||||
},
|
||||
output: {
|
||||
path: helpers.root('dist'),
|
||||
publicPath: '/',
|
||||
filename: '[name].[hash].js',
|
||||
chunkFilename: '[id].[hash].chunk.js'
|
||||
},
|
||||
|
||||
plugins: [
|
||||
// Define env variables to help with builds
|
||||
// Reference: https://webpack.github.io/docs/list-of-plugins.html#defineplugin
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
'ENV': JSON.stringify(ENV)
|
||||
}
|
||||
}),
|
||||
resolve: {
|
||||
extensions: ['.ts', '.js'],
|
||||
modules: [helpers.root('node_modules')]
|
||||
},
|
||||
|
||||
// Reference: http://webpack.github.io/docs/list-of-plugins.html#noerrorsplugin
|
||||
// Only emit files when there are no errors
|
||||
new webpack.NoErrorsPlugin(),
|
||||
|
||||
// Reference: http://webpack.github.io/docs/list-of-plugins.html#dedupeplugin
|
||||
// Dedupe modules in the output
|
||||
new webpack.optimize.DedupePlugin(),
|
||||
|
||||
// Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin
|
||||
// Minify all javascript, switch loaders to minimizing mode
|
||||
new webpack.optimize.UglifyJsPlugin({
|
||||
output:{
|
||||
comments: false
|
||||
},
|
||||
mangle: {
|
||||
keep_fnames: true
|
||||
},
|
||||
compressor: {
|
||||
screw_ie8: true,
|
||||
warnings: false
|
||||
}
|
||||
}),
|
||||
|
||||
// Extract css files
|
||||
// Reference: https://github.com/webpack/extract-text-webpack-plugin
|
||||
// Disabled when in test mode or not in build mode
|
||||
new ExtractTextPlugin('[name].[hash].css'),
|
||||
|
||||
// Copy assets from the public folder
|
||||
// Reference: https://github.com/kevlened/copy-webpack-plugin
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: 'favicon-96x96.png'
|
||||
},
|
||||
{
|
||||
from: 'node_modules/pdfjs-dist/build/pdf.worker.js',
|
||||
to: 'pdf.worker.js'
|
||||
},
|
||||
{
|
||||
context: 'resources/i18n',
|
||||
from: '**/*.json',
|
||||
to: 'resources/i18n'
|
||||
},
|
||||
// Copy i18n folders for all modules with ng2-alfresco- prefix
|
||||
{
|
||||
context: 'node_modules',
|
||||
from: 'ng2-alfresco-*/src/i18n/*.json',
|
||||
to: 'node_modules'
|
||||
},
|
||||
// Copy i18n folders for all modules with ng2-activiti- prefix
|
||||
{
|
||||
context: 'node_modules',
|
||||
from: 'ng2-activiti-*/src/i18n/*.json',
|
||||
to: 'node_modules'
|
||||
},
|
||||
// Copy asstes folders for all modules with ng2-activiti- prefix
|
||||
{
|
||||
context: 'node_modules',
|
||||
from: 'ng2-activiti-*/src/assets/images/*.*',
|
||||
to: 'assets/images',
|
||||
flatten : true
|
||||
},
|
||||
// Copy asstes folders for all modules with ng2-alfresco- prefix
|
||||
{
|
||||
context: 'node_modules',
|
||||
from: 'ng2-alfresco-*/src/assets/images/*.*',
|
||||
to: 'assets/images',
|
||||
flatten : true
|
||||
}
|
||||
])
|
||||
]
|
||||
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
|
||||
}
|
||||
})
|
||||
]
|
||||
});
|
||||
|
||||
@@ -1,78 +1,46 @@
|
||||
var helpers = require('./helpers');
|
||||
var fs = require('fs');
|
||||
var glob = require('glob');
|
||||
|
||||
const rootPath = helpers.root('node_modules');
|
||||
|
||||
var pattern = '+(alfresco-js-api|ng2-alfresco|ng2-activiti)*';
|
||||
var options = {
|
||||
cwd: rootPath,
|
||||
realpath: true
|
||||
};
|
||||
|
||||
var alfrescoLibs = glob.sync(pattern, options);
|
||||
const webpack = require('webpack');
|
||||
const helpers = require('./helpers');
|
||||
|
||||
module.exports = {
|
||||
devtool: 'inline-source-map',
|
||||
|
||||
resolve: {
|
||||
extensions: ['', '.ts', '.js'],
|
||||
modules: [
|
||||
helpers.root('app'),
|
||||
helpers.root('node_modules')
|
||||
],
|
||||
root: rootPath,
|
||||
fallback: rootPath
|
||||
},
|
||||
devtool: 'inline-source-map',
|
||||
|
||||
resolveLoader: {
|
||||
alias: {
|
||||
'systemjs-loader': helpers.root('config', 'loaders', 'system.js')
|
||||
},
|
||||
fallback: rootPath
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.ts', '.js'],
|
||||
modules: [helpers.root('../ng2-components'), helpers.root('node_modules')]
|
||||
},
|
||||
|
||||
module: {
|
||||
preLoaders: [
|
||||
{
|
||||
test: /\.js$/,
|
||||
include: [
|
||||
...alfrescoLibs
|
||||
],
|
||||
loader: 'source-map-loader'
|
||||
}
|
||||
],
|
||||
loaders: [
|
||||
{
|
||||
test: /\.ts$/,
|
||||
loaders: ['awesome-typescript-loader', 'angular2-template-loader', 'systemjs-loader'],
|
||||
exclude: ['node_modules','public']
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
include: [
|
||||
...alfrescoLibs
|
||||
],
|
||||
loaders: ['angular2-template-loader', 'source-map-loader', 'systemjs-loader']
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
loader: 'html'
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.ts$/,
|
||||
loaders: ['ts-loader', 'angular2-template-loader'],
|
||||
exclude: [ /public/, /resources/, /dist/]
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
loader: 'html-loader',
|
||||
exclude: [ /public/, /resources/, /dist/]
|
||||
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
|
||||
loader: 'null'
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
loader: 'raw'
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
|
||||
loader: 'null-loader'
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
loader: ['to-string-loader', 'css-loader'],
|
||||
exclude: [ /public/, /resources/, /dist/]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new webpack.ContextReplacementPlugin(
|
||||
// The (\\|\/) piece accounts for path separators in *nix and Windows
|
||||
/angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
|
||||
helpers.root('./src'), // location of your src
|
||||
{} // a map of your routes
|
||||
)
|
||||
]
|
||||
},
|
||||
|
||||
node: {
|
||||
fs: 'empty',
|
||||
module: false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,6 @@
|
||||
|
||||
<link rel="icon" type="image/png" href="favicon-96x96.png" sizes="96x96">
|
||||
|
||||
<!-- 1. Load libraries -->
|
||||
<!-- Polyfill(s) for Safari (pre-10.x) -->
|
||||
<script src=js/Intl.min.js></script>
|
||||
|
||||
<!-- IE/FF -->
|
||||
<script src=js/element.scrollintoviewifneeded-polyfill.js></script>
|
||||
|
||||
<!--[if IE]>
|
||||
<script src=js/shim.min.js></script>
|
||||
<script src=//cdnjs.cloudflare.com/ajax/libs/dom4/1.8.3/dom4.js></script>
|
||||
@@ -28,11 +21,6 @@
|
||||
<script src=js/system-polyfills.js></script>
|
||||
<![endif]-->
|
||||
|
||||
<!-- Google Material Design Lite -->
|
||||
<link href="css/material.orange-blue.min.css" rel="stylesheet">
|
||||
<script src="js/material.min.js"></script>
|
||||
<link href="css/iconfont/material-icons.css" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
.loader-container {
|
||||
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
|
||||
|
||||
+78
-88
@@ -1,19 +1,21 @@
|
||||
{
|
||||
"name": "Alfresco-Angular2-Demo",
|
||||
"description": "Demo shell for Alfresco Angular2 components",
|
||||
"version": "1.4.0",
|
||||
"version": "1.5.0",
|
||||
"author": "Alfresco Software, Ltd.",
|
||||
"scripts": {
|
||||
"clean": "npm install rimraf && npm run clean-build && rimraf dist node_modules typings dist",
|
||||
"start": "npm run tslint && npm run server-versions && webpack-dev-server --progress --max_old_space_size=4096 --max_new_space_size=4096",
|
||||
"start:dist": "wsrv -s dist/ -p 3000 -a 0.0.0.0",
|
||||
"build": "npm run server-versions && rimraf dist && npm run webpack -- --config config/webpack.prod.js --progress --profile --bail",
|
||||
"build:dev": "npm run server-versions && rimraf dist && npm run webpack -- --config config/webpack.dev.js --progress --profile --bail",
|
||||
"start:dist": "npm run server-versions && wsrv -s dist/ -p 3000 -a 0.0.0.0",
|
||||
"start": "npm run server-versions && npm run webpack-dev-server -- --config config/webpack.prod.js --progress --content-base app/",
|
||||
"start:dev": "npm run server-versions && npm run webpack-dev-server -- --config config/webpack.dev.js --progress --content-base app/",
|
||||
"test": "rimraf coverage && karma start --single-run",
|
||||
"clean": "npm run clean-build && rimraf dist node_modules typings dist",
|
||||
"clean-build": "rimraf 'app/{,**/}**.js' 'app/{,**/}**.js.map' 'app/{,**/}**.d.ts'",
|
||||
"test": "karma start",
|
||||
"build": "npm run tslint && npm run server-versions && rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail",
|
||||
"server-versions": "rimraf versions.json && npm list --depth=0 --json=true --prod=true > versions.json || exit 0",
|
||||
"aws": "node app.js",
|
||||
"tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json 'app/{,**/}**.ts' -e 'app/vendor.ts' -e 'app/polyfills.ts' ",
|
||||
"licensecheck": "license-check"
|
||||
"webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js",
|
||||
"webpack": "node node_modules/webpack/bin/webpack.js",
|
||||
"aws": "node app.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -52,101 +54,89 @@
|
||||
"alfresco"
|
||||
],
|
||||
"dependencies": {
|
||||
"@angular/common": "2.2.2",
|
||||
"@angular/compiler": "2.2.2",
|
||||
"@angular/compiler-cli": "2.2.2",
|
||||
"@angular/core": "2.2.2",
|
||||
"@angular/forms": "2.2.2",
|
||||
"@angular/http": "2.2.2",
|
||||
"@angular/animations": "~4.0.0",
|
||||
"@angular/common": "~4.0.0",
|
||||
"@angular/compiler": "~4.0.0",
|
||||
"@angular/core": "~4.0.0",
|
||||
"@angular/forms": "~4.0.0",
|
||||
"@angular/http": "~4.0.0",
|
||||
"@angular/platform-browser": "~4.0.0",
|
||||
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||
"@angular/router": "~4.0.0",
|
||||
"@angular/compiler-cli": "~4.0.0",
|
||||
"@angular/material": "2.0.0-beta.1",
|
||||
"@angular/platform-browser": "2.2.2",
|
||||
"@angular/platform-browser-dynamic": "2.2.2",
|
||||
"@angular/router": "3.2.2",
|
||||
"@angular/upgrade": "2.2.2",
|
||||
"alfresco-js-api": "~1.4.0",
|
||||
"chart.js": "2.5.0",
|
||||
"core-js": "2.4.1",
|
||||
"dialog-polyfill": "0.4.7",
|
||||
"element.scrollintoviewifneeded-polyfill": "1.0.1",
|
||||
"flag-icon-css": "2.3.0",
|
||||
"hammerjs": "2.0.8",
|
||||
"reflect-metadata": "0.1.9",
|
||||
"rxjs": "5.1.0",
|
||||
"zone.js": "0.8.11",
|
||||
"dialog-polyfill": "^0.4.7",
|
||||
"material-design-icons": "2.2.3",
|
||||
"material-design-lite": "1.2.1",
|
||||
"md-date-time-picker": "2.2.0",
|
||||
"moment": "2.15.1",
|
||||
"ng2-3d-editor": "0.0.15",
|
||||
"ng2-activiti-analytics": "1.4.0",
|
||||
"ng2-activiti-form": "1.4.0",
|
||||
"ng2-activiti-processlist": "1.4.0",
|
||||
"ng2-activiti-tasklist": "1.4.0",
|
||||
"ng2-alfresco-core": "1.4.0",
|
||||
"ng2-alfresco-datatable": "1.4.0",
|
||||
"ng2-alfresco-documentlist": "1.4.0",
|
||||
"ng2-alfresco-login": "1.4.0",
|
||||
"ng2-alfresco-search": "1.4.0",
|
||||
"ng2-alfresco-tag": "1.4.0",
|
||||
"ng2-alfresco-social": "1.4.0",
|
||||
"ng2-alfresco-upload": "1.4.0",
|
||||
"ng2-alfresco-userinfo": "1.4.0",
|
||||
"ng2-alfresco-viewer": "1.4.0",
|
||||
"ng2-alfresco-webscript": "1.4.0",
|
||||
"ng2-charts": "1.5.0",
|
||||
"ng2-translate": "2.5.0",
|
||||
"ng2-translate": "5.0.0",
|
||||
"pdfjs-dist": "1.5.404",
|
||||
"flag-icon-css": "2.3.0",
|
||||
"moment": "2.15.1",
|
||||
"chart.js": "2.5.0",
|
||||
"ng2-charts": "1.5.0",
|
||||
"raphael": "2.2.7",
|
||||
"reflect-metadata": "0.1.10",
|
||||
"rxjs": "5.0.0-beta.12",
|
||||
"systemjs": "0.19.27",
|
||||
"zone.js": "0.6.26"
|
||||
"md-date-time-picker": "2.2.0",
|
||||
"element.scrollintoviewifneeded-polyfill": "^1.0.1",
|
||||
"ng2-3d-editor": "0.0.15",
|
||||
"alfresco-js-api": "~1.5.0",
|
||||
"ng2-activiti-analytics": "1.5.0",
|
||||
"ng2-activiti-diagrams": "1.5.0",
|
||||
"ng2-activiti-form": "1.5.0",
|
||||
"ng2-activiti-processlist": "1.5.0",
|
||||
"ng2-activiti-tasklist": "1.5.0",
|
||||
"ng2-alfresco-core": "1.5.0",
|
||||
"ng2-alfresco-datatable": "1.5.0",
|
||||
"ng2-alfresco-documentlist": "1.5.0",
|
||||
"ng2-alfresco-login": "1.5.0",
|
||||
"ng2-alfresco-search": "1.5.0",
|
||||
"ng2-alfresco-tag": "1.5.0",
|
||||
"ng2-alfresco-social": "1.5.0",
|
||||
"ng2-alfresco-upload": "1.5.0",
|
||||
"ng2-alfresco-userinfo": "1.5.0",
|
||||
"ng2-alfresco-viewer": "1.5.0",
|
||||
"ng2-alfresco-webscript": "1.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/hammerjs": "^2.0.34",
|
||||
"@types/jasmine": "2.5.35",
|
||||
"@types/node": "6.0.45",
|
||||
"angular2-template-loader": "^0.6.0",
|
||||
"awesome-typescript-loader": "^2.2.4",
|
||||
"classlist-polyfill": "^1.0.3",
|
||||
"angular2-template-loader": "^0.6.2",
|
||||
"copy-webpack-plugin": "^4.0.1",
|
||||
"css-loader": "^0.23.1",
|
||||
"es5-shim": "^4.5.9",
|
||||
"es6-shim": "^0.35.2",
|
||||
"extract-text-webpack-plugin": "^1.0.1",
|
||||
"file-loader": "^0.8.5",
|
||||
"glob": "^7.1.1",
|
||||
"html-loader": "^0.4.3",
|
||||
"html-webpack-plugin": "^2.15.0",
|
||||
"intl": "^1.2.5",
|
||||
"jasmine-core": "^2.4.1",
|
||||
"karma": "^1.2.0",
|
||||
"css-loader": "0.26.1",
|
||||
"extract-text-webpack-plugin": "^2.0.0-rc.3",
|
||||
"file-loader": "^0.10.0",
|
||||
"html-loader": "^0.4.4",
|
||||
"html-webpack-plugin": "^2.28.0",
|
||||
"jasmine-core": "^2.5.2",
|
||||
"karma": "^1.4.1",
|
||||
"karma-chrome-launcher": "2.0.0",
|
||||
"karma-jasmine": "^1.0.2",
|
||||
"karma-mocha-reporter": "^2.2.1",
|
||||
"karma-coverage": "^1.1.1",
|
||||
"karma-jasmine": "^1.1.0",
|
||||
"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-webpack": "^1.8.0",
|
||||
"license-check": "1.1.5",
|
||||
"mime": "^1.3.4",
|
||||
"karma-webpack": "^2.0.2",
|
||||
"null-loader": "^0.1.1",
|
||||
"raw-loader": "^0.5.1",
|
||||
"rimraf": "^2.5.2",
|
||||
"script-loader": "^0.7.0",
|
||||
"source-map-loader": "^0.1.5",
|
||||
"style-loader": "^0.13.1",
|
||||
"tslint": "3.15.1",
|
||||
"typescript": "2.0.3",
|
||||
"web-animations-js": "^2.2.2",
|
||||
"webpack": "^1.13.0",
|
||||
"webpack-dev-server": "^1.14.1",
|
||||
"webpack-merge": "^0.14.0",
|
||||
"rimraf": "^2.5.4",
|
||||
"script-loader": "0.7.0",
|
||||
"source-map-loader": "^0.1.6",
|
||||
"sourcemap-istanbul-instrumenter-loader": "^0.2.0",
|
||||
"style-loader": "0.13.1",
|
||||
"to-string-loader": "^1.1.4",
|
||||
"ts-loader": "^2.0.0",
|
||||
"tslint": "^4.4.2",
|
||||
"tslint-loader": "^3.3.0",
|
||||
"typescript": "^2.1.6",
|
||||
"webpack": "^2.2.1",
|
||||
"webpack-dev-server": "^2.3.0",
|
||||
"webpack-merge": "^2.6.1",
|
||||
"wsrv": "^0.1.6"
|
||||
},
|
||||
"license-check-config": {
|
||||
"src": [
|
||||
"./app/**/*.js",
|
||||
"!./app/js/*.js"
|
||||
],
|
||||
"path": "assets/license_header.txt",
|
||||
"blocking": true,
|
||||
"logInfo": false,
|
||||
"logError": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,54 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"sourceMap": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"lib": ["es2015", "dom"],
|
||||
"noImplicitAny": false,
|
||||
"suppressImplicitAnyIndexErrors": true,
|
||||
"noResolve": true
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
"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"
|
||||
],
|
||||
"paths": {
|
||||
"ng2-alfresco-core": ["../ng2-components/ng2-alfresco-core/"],
|
||||
"ng2-alfresco-datatable": ["../ng2-components/ng2-alfresco-datatable/"],
|
||||
"ng2-activiti-diagrams": ["../ng2-components/ng2-activiti-diagrams/"],
|
||||
"ng2-activiti-analytics":["../ng2-components/ng2-activiti-analytics/"],
|
||||
"ng2-activiti-form":["../ng2-components/ng2-activiti-form/"],
|
||||
"ng2-activiti-tasklist": ["../ng2-components/ng2-activiti-tasklist/"],
|
||||
"ng2-activiti-processlist": ["../ng2-components/ng2-activiti-processlist/"],
|
||||
"ng2-alfresco-documentlist": ["../ng2-components/ng2-alfresco-documentlist/"],
|
||||
"ng2-alfresco-login": ["../ng2-components/ng2-alfresco-login/"],
|
||||
"ng2-alfresco-search": ["../ng2-components/ng2-alfresco-search/"],
|
||||
"ng2-alfresco-social": ["../ng2-components/ng2-alfresco-social/"],
|
||||
"ng2-alfresco-tag": ["../ng2-components/ng2-alfresco-tag/"],
|
||||
"ng2-alfresco-upload": ["../ng2-components/ng2-alfresco-upload/"],
|
||||
"ng2-alfresco-viewer": ["../ng2-components/ng2-alfresco-viewer/"],
|
||||
"ng2-alfresco-webscript": ["../ng2-components/ng2-alfresco-webscript/"],
|
||||
"ng2-alfresco-userinfo": ["../ng2-components/ng2-alfresco-userinfo/"]
|
||||
},
|
||||
"suppressImplicitAnyIndexErrors": true
|
||||
},
|
||||
"exclude": [
|
||||
"demo",
|
||||
"node_modules",
|
||||
"dist"
|
||||
],
|
||||
"angularCompilerOptions": {
|
||||
"strictMetadataEmit": false,
|
||||
"skipTemplateCodegen": true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
"interface-name": false,
|
||||
"jsdoc-format": true,
|
||||
"label-position": true,
|
||||
"label-undefined": true,
|
||||
"max-line-length": [
|
||||
true,
|
||||
180
|
||||
@@ -47,7 +46,6 @@
|
||||
"no-construct": true,
|
||||
"no-constructor-vars": false,
|
||||
"no-debugger": true,
|
||||
"no-duplicate-key": true,
|
||||
"no-duplicate-variable": true,
|
||||
"no-empty": false,
|
||||
"no-eval": true,
|
||||
@@ -57,12 +55,11 @@
|
||||
"no-shadowed-variable": true,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-trailing-whitespace": true,
|
||||
"no-unreachable": true,
|
||||
"no-unused-expression": true,
|
||||
"no-unused-variable": true,
|
||||
"no-use-before-declare": true,
|
||||
"no-var-keyword": true,
|
||||
"no-var-requires": true,
|
||||
"no-var-requires": false,
|
||||
"object-literal-sort-keys": false,
|
||||
"one-line": [
|
||||
true,
|
||||
|
||||
+48
-10
@@ -32,24 +32,62 @@
|
||||
## Base components
|
||||
|
||||
- [Core library](ng2-alfresco-core/README.md)
|
||||
- [alfresco-viewer](ng2-alfresco-viewer/README.md)
|
||||
- [adf-accordion-group](ng2-alfresco-core/README.md)
|
||||
- [adf-accordion](ng2-alfresco-core/README.md)
|
||||
- [context-menu](ng2-alfresco-core/README.md)
|
||||
* Material Design elements
|
||||
* Context Menu component
|
||||
|
||||
## ECM components
|
||||
|
||||
- [DataTable](ng2-alfresco-datatable/README.md)
|
||||
- [DocumentList](ng2-alfresco-documentlist/README.md)
|
||||
- [Viewer](ng2-alfresco-viewer/README.md)
|
||||
- [Login](ng2-alfresco-login/README.md)
|
||||
- [Upload](ng2-alfresco-upload/README.md)
|
||||
- [Webscript Viewer](ng2-alfresco-webscript/README.md)
|
||||
- [Tag list and controls](ng2-alfresco-tag/README.md)
|
||||
- [alfresco-webscript-get](ng2-alfresco-webscript/README.md)
|
||||
- [alfresco-pagination](ng2-alfresco-datatable/README.md)
|
||||
- [alfresco-datatable](ng2-alfresco-datatable/README.md)
|
||||
- [alfresco-login](ng2-alfresco-login/README.md)
|
||||
- [alfresco-tag-node-actions-list](ng2-alfresco-tag/README.md)
|
||||
- [alfresco-tag-list](ng2-alfresco-tag/README.md)
|
||||
- [alfresco-tag-node-list](ng2-alfresco-tag/README.md)
|
||||
- [alfresco-document-list](ng2-alfresco-documentlist/README.md)
|
||||
- [alfresco-document-menu-action](ng2-alfresco-documentlist/README.md)
|
||||
- [alfresco-document-list-breadcrumb](ng2-alfresco-documentlist/README.md)
|
||||
- [adf-rating](ng2-alfresco-social/README.md)
|
||||
- [adf-like](ng2-alfresco-social/README.md)
|
||||
- [alfresco-upload-drag-area](ng2-alfresco-upload/README.md)
|
||||
- [alfresco-upload-button](ng2-alfresco-upload/README.md)
|
||||
- [alfresco-file-uploading-list](ng2-alfresco-upload/README.md)
|
||||
- [alfresco-search](ng2-alfresco-search/README.md)
|
||||
- [alfresco-search-control](ng2-alfresco-search/README.md)
|
||||
- [alfresco-search-autocomplete](ng2-alfresco-search/README.md)
|
||||
- [ng2-alfresco-userinfo](ng2-alfresco-userinfo/README.md)
|
||||
|
||||
## BPM components
|
||||
|
||||
- [TaskList](ng2-activiti-tasklist/README.md)
|
||||
- [ProcessList](ng2-activiti-processlist/README.md)
|
||||
- [Form](ng2-activiti-form/README.md)
|
||||
- [activiti-analytics](ng2-activiti-analytics/README.md)
|
||||
- [activiti-analytics-generator](ng2-activiti-analytics/README.md)
|
||||
- [activiti-form](ng2-activiti-form/README.md)
|
||||
- [activiti-content](ng2-activiti-form/README.md)
|
||||
- [activiti-start-form](ng2-activiti-form/README.md)
|
||||
- [activiti-process-instance-filters](ng2-activiti-processlist/README.md)
|
||||
- [activiti-process-instance-list](ng2-activiti-processlist/README.md)
|
||||
- [activiti-process-instance-details](ng2-activiti-processlist/README.md)
|
||||
- [activiti-start-process](ng2-activiti-processlist/README.md)
|
||||
- [activiti-apps](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-tasklist](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-checklist](ng2-activiti-tasklist/README.md)
|
||||
- [adf-task-attachment-list](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-people](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-comments](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-task-header](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-task-details](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-start-task](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-filters](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-people-search](ng2-activiti-tasklist/README.md)
|
||||
- [activiti-process-instance-header](ng2-activiti-processlist/README.md)
|
||||
- [activiti-process-instance-tasks](ng2-activiti-processlist/README.md)
|
||||
- [activiti-process-instance-comments](ng2-activiti-processlist/README.md)
|
||||
- [activiti-process-instance-variables](ng2-activiti-processlist/README.md)
|
||||
- [activiti-diagram](ng2-activiti-diagrams/README.md)
|
||||
|
||||
You can browse all the components at the following address:
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
@@ -0,0 +1,14 @@
|
||||
@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.
|
||||
-3
@@ -21,7 +21,6 @@
|
||||
"interface-name": false,
|
||||
"jsdoc-format": true,
|
||||
"label-position": true,
|
||||
"label-undefined": true,
|
||||
"max-line-length": [
|
||||
true,
|
||||
180
|
||||
@@ -47,7 +46,6 @@
|
||||
"no-construct": true,
|
||||
"no-constructor-vars": false,
|
||||
"no-debugger": true,
|
||||
"no-duplicate-key": true,
|
||||
"no-duplicate-variable": true,
|
||||
"no-empty": false,
|
||||
"no-eval": true,
|
||||
@@ -57,7 +55,6 @@
|
||||
"no-shadowed-variable": true,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-trailing-whitespace": true,
|
||||
"no-unreachable": true,
|
||||
"no-unused-expression": true,
|
||||
"no-unused-variable": true,
|
||||
"no-use-before-declare": true,
|
||||
@@ -0,0 +1,70 @@
|
||||
var path = require('path');
|
||||
var loaderUtils = require('loader-utils');
|
||||
|
||||
module.exports = function(content) {
|
||||
this.cacheable && this.cacheable();
|
||||
if(!this.emitFile) throw new Error('emitFile is required from module system');
|
||||
|
||||
var query = loaderUtils.getOptions(this) || {};
|
||||
var configKey = query.config || 'multiFileLoader';
|
||||
var options = this.options[configKey] || {};
|
||||
var config = {
|
||||
publicPath: false,
|
||||
useRelativePath: false,
|
||||
name: '[hash].[ext]'
|
||||
};
|
||||
|
||||
// options takes precedence over config
|
||||
Object.keys(options).forEach(function(attr) {
|
||||
config[attr] = options[attr];
|
||||
});
|
||||
|
||||
// query takes precedence over config and options
|
||||
Object.keys(query).forEach(function(attr) {
|
||||
config[attr] = query[attr];
|
||||
});
|
||||
|
||||
var context = config.context || this.options.context;
|
||||
var url = loaderUtils.interpolateName(this, config.name, {
|
||||
context: context,
|
||||
content: content,
|
||||
regExp: config.regExp
|
||||
});
|
||||
var path = loaderUtils.interpolateName(this, '[path]', {
|
||||
context: context,
|
||||
content: content,
|
||||
regExp: config.regExp
|
||||
});
|
||||
|
||||
var outputPath = '';
|
||||
|
||||
if (config.outputPath) {
|
||||
outputPath = (
|
||||
typeof config.outputPath === 'function'
|
||||
? config.outputPath(url, path)
|
||||
: config.outputPath + url
|
||||
);
|
||||
} else {
|
||||
outputPath = url;
|
||||
}
|
||||
|
||||
var publicPath = JSON.stringify(url);
|
||||
|
||||
if (config.publicPath) {
|
||||
publicPath = JSON.stringify(
|
||||
typeof config.publicPath === 'function'
|
||||
? config.publicPath(url, path)
|
||||
: config.publicPath + url
|
||||
);
|
||||
}
|
||||
|
||||
publicPath = '__webpack_public_path__ + ' + publicPath;
|
||||
|
||||
if (query.emitFile === undefined || query.emitFile) {
|
||||
this.emitFile(outputPath, content);
|
||||
}
|
||||
|
||||
return 'module.exports = ' + publicPath + ';';
|
||||
};
|
||||
|
||||
module.exports.raw = true;
|
||||
@@ -0,0 +1,67 @@
|
||||
var path = require('path');
|
||||
var loaderUtils = require('loader-utils');
|
||||
var fs = require('fs');
|
||||
|
||||
var licenseFileUtf8Store = undefined;
|
||||
|
||||
function readLicenseHeaderFile(licenseFilePath) {
|
||||
if (licenseFileUtf8Store) {
|
||||
return licenseFileUtf8Store;
|
||||
}
|
||||
|
||||
if (fs.existsSync(licenseFilePath)) {
|
||||
licenseFileUtf8Store = fs.readFileSync(licenseFilePath, 'utf8').split(/\r?\n/);
|
||||
return licenseFileUtf8Store;
|
||||
}
|
||||
|
||||
throw new Error('The license header file path is wrong ' + licenseFilePath);
|
||||
}
|
||||
|
||||
function isFileEmpty(fileContents) {
|
||||
return fileContents.toString('utf8').trim() === '';
|
||||
}
|
||||
|
||||
function readCurrentFile(fileContent) {
|
||||
return fileContent.toString('utf8').split(/\r?\n/);
|
||||
}
|
||||
|
||||
function isLicenseHeaderPresent(currentFileContent, licenseFilePath) {
|
||||
if (!isFileEmpty(currentFileContent)) {
|
||||
var currentFileUtf8 = readCurrentFile(currentFileContent),
|
||||
licenseFileUtf8 = readLicenseHeaderFile(licenseFilePath);
|
||||
skipStrict = 0;
|
||||
|
||||
if(currentFileUtf8[0] === '"use strict";' ) {
|
||||
skipStrict = 1;
|
||||
}
|
||||
|
||||
for (var i = skipStrict; i < licenseFileUtf8.length; i++) {
|
||||
if (currentFileUtf8[i + skipStrict] !== licenseFileUtf8[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function report(hasHeader, emitter, filename) {
|
||||
if (hasHeader) return;
|
||||
emitter('Missing license header file : ' + filename);
|
||||
}
|
||||
|
||||
function licenseCheck(webpackInstance, input, options) {
|
||||
var isLicensePresent = isLicenseHeaderPresent(input, options.licenseFile);
|
||||
|
||||
var emitter = options.emitErrors ? webpackInstance.emitError : webpackInstance.emitWarning;
|
||||
|
||||
report(isLicensePresent, emitter, webpackInstance.resourcePath);
|
||||
}
|
||||
|
||||
module.exports = function(input, map) {
|
||||
this.cacheable && this.cacheable();
|
||||
var callback = this.async();
|
||||
|
||||
var options = loaderUtils.getOptions(this);
|
||||
licenseCheck(this, input, options);
|
||||
callback(null, input, map);
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
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;
|
||||
@@ -0,0 +1,108 @@
|
||||
var webpackConfig = require('./webpack.test');
|
||||
|
||||
module.exports = function (config) {
|
||||
var _config = {
|
||||
basePath: '../ng2-components',
|
||||
|
||||
frameworks: ['jasmine-ajax', 'jasmine'],
|
||||
|
||||
files: [
|
||||
{pattern: './node_modules/hammerjs/hammer.min.js', included: true, watched: false},
|
||||
|
||||
//diagrams
|
||||
{pattern: './node_modules/chart.js/dist/Chart.js', included: true, watched: false},
|
||||
{pattern: './node_modules/alfresco-js-api/dist/alfresco-js-api.min.js', included: true, watched: false},
|
||||
{pattern: './node_modules/raphael/raphael.min.js', included: true, watched: false},
|
||||
{pattern: './node_modules/moment/min/moment.min.js', included: true, watched: false},
|
||||
{pattern: './node_modules/md-date-time-picker/dist/js/mdDateTimePicker.min.js', included: true, watched: false},
|
||||
|
||||
{pattern: './node_modules/ng2-translate/ng2-translate.js', included: false, watched: false},
|
||||
{pattern: './node_modules/ng2-charts/bundles/ng2-charts.umd.js', included: false, served: true, watched: false},
|
||||
|
||||
// pdf-js
|
||||
{pattern: './node_modules/pdfjs-dist/build/pdf.js', included: true, watched: false},
|
||||
{pattern: './node_modules/pdfjs-dist/build/pdf.worker.js', included: true, watched: false},
|
||||
{pattern: './node_modules/pdfjs-dist/web/pdf_viewer.js', included: true, watched: false},
|
||||
|
||||
{pattern: config.component +'/karma-test-shim.js', watched: false},
|
||||
{pattern: './ng2-**/src/assets/**/*.*', included: false, served: true, watched: false},
|
||||
{pattern: './ng2-**/src/**/*.ts', included: false, served: true, watched: false}
|
||||
],
|
||||
|
||||
webpack: webpackConfig,
|
||||
|
||||
webpackMiddleware: {
|
||||
noInfo: true,
|
||||
stats: {
|
||||
chunks: false
|
||||
}
|
||||
},
|
||||
|
||||
port: 9876,
|
||||
|
||||
// level of logging
|
||||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
||||
logLevel: config.LOG_INFO,
|
||||
|
||||
colors: true,
|
||||
|
||||
autoWatch: false,
|
||||
|
||||
captureTimeout: 1800000,
|
||||
browserDisconnectTimeout: 1800000,
|
||||
browserDisconnectTolerance: 10,
|
||||
browserNoActivityTimeout: 3000000,
|
||||
|
||||
browsers: ['Chrome'],
|
||||
|
||||
customLaunchers: {
|
||||
Chrome_travis_ci: {
|
||||
base: 'Chrome',
|
||||
flags: ['--no-sandbox']
|
||||
}
|
||||
},
|
||||
|
||||
// Karma plugins loaded
|
||||
plugins: [
|
||||
require('../node_modules/karma-jasmine'),
|
||||
require('../node_modules/karma-coverage'),
|
||||
require('../node_modules/karma-sourcemap-loader'),
|
||||
require('../node_modules/karma-jasmine-ajax'),
|
||||
require('../node_modules/karma-chrome-launcher'),
|
||||
require('../node_modules/karma-mocha-reporter'),
|
||||
require('../node_modules/karma-webpack'),
|
||||
require('../node_modules/karma-jasmine-html-reporter')
|
||||
],
|
||||
|
||||
webpackServer: {
|
||||
noInfo: true
|
||||
},
|
||||
|
||||
// Coverage reporter generates the coverage
|
||||
reporters: ['mocha', 'coverage', 'kjhtml'],
|
||||
|
||||
preprocessors: {
|
||||
'**/karma-test-shim.js': ['webpack'],
|
||||
'(ng2-alfresco|ng2-activiti)/src/**/!(*spec|index|*mock|*model|*event).js': 'coverage'
|
||||
},
|
||||
|
||||
coverageReporter: {
|
||||
includeAllSources: true,
|
||||
dir: './coverage/',
|
||||
subdir: 'report',
|
||||
reporters: [
|
||||
{type: 'text'},
|
||||
{type: 'text-summary'},
|
||||
{type: 'json', file: 'coverage-final.json'},
|
||||
{type: 'html'},
|
||||
{type: 'lcov'}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
if (process.env.TRAVIS) {
|
||||
config.browsers = ['Chrome_travis_ci'];
|
||||
}
|
||||
|
||||
config.set(_config);
|
||||
};
|
||||
@@ -0,0 +1,49 @@
|
||||
const webpack = require('webpack');
|
||||
const webpackMerge = require('webpack-merge');
|
||||
const commonConfig = require('./webpack.common.js');
|
||||
|
||||
module.exports = webpackMerge(commonConfig, {
|
||||
|
||||
output: {
|
||||
filename: '[name]/bundles/[name].js',
|
||||
library: '[name]',
|
||||
libraryTarget: 'umd',
|
||||
chunkFilename: '[id].chunk.js'
|
||||
},
|
||||
|
||||
entry: {
|
||||
"ng2-alfresco-core": "./ng2-alfresco-core/index.ts",
|
||||
"ng2-alfresco-datatable": "./ng2-alfresco-datatable/index.ts",
|
||||
"ng2-activiti-diagrams": "./ng2-activiti-diagrams/index.ts",
|
||||
"ng2-activiti-analytics": "./ng2-activiti-analytics/index.ts",
|
||||
"ng2-activiti-form": "./ng2-activiti-form/index.ts",
|
||||
"ng2-activiti-tasklist": "./ng2-activiti-tasklist/index.ts",
|
||||
"ng2-activiti-processlist": "./ng2-activiti-processlist/index.ts",
|
||||
"ng2-alfresco-documentlist": "./ng2-alfresco-documentlist/index.ts",
|
||||
"ng2-alfresco-login": "./ng2-alfresco-login/index.ts",
|
||||
"ng2-alfresco-search": "./ng2-alfresco-search/index.ts",
|
||||
"ng2-alfresco-social": "./ng2-alfresco-social/index.ts",
|
||||
"ng2-alfresco-tag": "./ng2-alfresco-tag/index.ts",
|
||||
"ng2-alfresco-upload": "./ng2-alfresco-upload/index.ts",
|
||||
"ng2-alfresco-viewer": "./ng2-alfresco-viewer/index.ts",
|
||||
"ng2-alfresco-webscript": "./ng2-alfresco-webscript/index.ts",
|
||||
"ng2-alfresco-userinfo": "./ng2-alfresco-userinfo/index.ts"
|
||||
},
|
||||
|
||||
plugins: [
|
||||
|
||||
//new webpack.optimize.UglifyJsPlugin({
|
||||
// mangle: {
|
||||
// keep_fnames: true
|
||||
// },
|
||||
// compress: {
|
||||
// warnings: false
|
||||
// },
|
||||
// output: {
|
||||
// comments: false
|
||||
// },
|
||||
// sourceMap: true
|
||||
//})
|
||||
|
||||
]
|
||||
});
|
||||
@@ -0,0 +1,144 @@
|
||||
const webpack = require('webpack');
|
||||
const helpers = require('./helpers');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
|
||||
devtool: 'cheap-module-source-map',
|
||||
|
||||
resolveLoader: {
|
||||
alias: {
|
||||
"file-multi-loader": path.resolve(__dirname, "./custom-loaders/file-loader-multi"),
|
||||
"license-check": path.resolve(__dirname, "./custom-loaders/license-check")
|
||||
}
|
||||
},
|
||||
|
||||
// require those dependencies but don't bundle them
|
||||
externals: [
|
||||
/^\@angular\//,
|
||||
/^rxjs\//,
|
||||
'moment',
|
||||
'raphael',
|
||||
'ng2-charts',
|
||||
'alfresco-js-api',
|
||||
'ng2-alfresco-core',
|
||||
'ng2-alfresco-datatable',
|
||||
'ng2-activiti-analytics',
|
||||
'ng2-activiti-diagrams',
|
||||
'ng2-activiti-form',
|
||||
"ng2-activiti-tasklist",
|
||||
'ng2-alfresco-documentlist'
|
||||
],
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.js$/,
|
||||
loader: 'source-map-loader',
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.ts$/,
|
||||
use: 'source-map-loader',
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.ts$/,
|
||||
loader: 'tslint-loader',
|
||||
options: {
|
||||
emitErrors: true,
|
||||
configFile: path.resolve(__dirname, './assets/tslint.json')
|
||||
},
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.ts$/,
|
||||
use: ['ts-loader?' + JSON.stringify({
|
||||
"compilerOptions": {
|
||||
"typeRoots": [
|
||||
"../node_modules/@types"
|
||||
]}
|
||||
}), 'angular2-template-loader'],
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
loader: 'html-loader',
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
loader: ['to-string-loader', 'css-loader'],
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
}, {
|
||||
enforce: 'pre',
|
||||
test: /\.ts$/,
|
||||
loader: 'license-check',
|
||||
options: {
|
||||
emitErrors: true,
|
||||
licenseFile: path.resolve(__dirname, './assets/license_header.txt')
|
||||
},
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/, /rendering-queue.services.ts/],
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
|
||||
loader: 'file-multi-loader',
|
||||
query: {
|
||||
name: '[name].[hash].[ext]',
|
||||
outputPath: (url, resourcePath)=> {
|
||||
return resourcePath.replace('src', 'bundles') + url;
|
||||
},
|
||||
publicPath: (url, resourcePath)=> {
|
||||
var component = resourcePath.substring(0, resourcePath.indexOf('src'));
|
||||
var path = resourcePath.replace(component, '').replace('src/', '');
|
||||
return path + url;
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
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-diagrams": path.resolve(__dirname, '../ng2-activiti-diagrams/index.ts'),
|
||||
"ng2-activiti-analytics":path.resolve(__dirname, '../ng2-activiti-analytics/index.ts'),
|
||||
"ng2-activiti-form":path.resolve(__dirname, '../ng2-activiti-form/index.ts'),
|
||||
"ng2-activiti-tasklist": path.resolve(__dirname, '../ng2-activiti-tasklist/index.ts'),
|
||||
"ng2-activiti-processlist": path.resolve(__dirname, '../ng2-activiti-processlist/index.ts'),
|
||||
"ng2-alfresco-documentlist": path.resolve(__dirname, '../ng2-alfresco-documentlist/index.ts'),
|
||||
"ng2-alfresco-login": path.resolve(__dirname, '../ng2-alfresco-login/index.ts'),
|
||||
"ng2-alfresco-search": path.resolve(__dirname, '../ng2-alfresco-search/index.ts'),
|
||||
"ng2-alfresco-social": path.resolve(__dirname, '../ng2-alfresco-social/index.ts'),
|
||||
"ng2-alfresco-tag": path.resolve(__dirname, '../ng2-alfresco-tag/index.ts'),
|
||||
"ng2-alfresco-upload": path.resolve(__dirname, '../ng2-alfresco-upload/index.ts'),
|
||||
"ng2-alfresco-viewer": path.resolve(__dirname, '../ng2-alfresco-viewer/index.ts'),
|
||||
"ng2-alfresco-webscript": path.resolve(__dirname, '../ng2-alfresco-webscript/index.ts'),
|
||||
"ng2-alfresco-userinfo": path.resolve(__dirname, '../ng2-alfresco-userinfo/index.ts')
|
||||
},
|
||||
extensions: ['.ts', '.js'],
|
||||
modules: [helpers.root('node_modules')]
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
|
||||
new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')),
|
||||
|
||||
new webpack.ContextReplacementPlugin(
|
||||
/angular(\\|\/)core(\\|\/)@angular/,
|
||||
helpers.root('./src'),
|
||||
{}
|
||||
)
|
||||
],
|
||||
|
||||
node: {
|
||||
fs: 'empty',
|
||||
module: false
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,85 @@
|
||||
const webpack = require('webpack');
|
||||
const helpers = require('./helpers');
|
||||
|
||||
const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
|
||||
|
||||
module.exports = {
|
||||
|
||||
devtool: 'inline-source-map',
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.js$/,
|
||||
loader: 'source-map-loader',
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.ts$/,
|
||||
loaders: ['ts-loader?' + JSON.stringify({ transpileOnly: true}), 'angular2-template-loader'],
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
loader: 'html-loader',
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
loader: ['to-string-loader', 'css-loader'],
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico|pdf)$/,
|
||||
loader: 'file-loader',
|
||||
query: {
|
||||
name: '[path][name].[ext]',
|
||||
outputPath: (url)=> {
|
||||
return url.replace('src', 'dist');
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
enforce: 'post',
|
||||
test: /\.ts$/,
|
||||
loader: 'istanbul-instrumenter-loader',
|
||||
exclude: [
|
||||
/node_modules/,
|
||||
/test/
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
resolve: {
|
||||
extensions: ['.ts', '.js'],
|
||||
symlinks: false,
|
||||
modules: [helpers.root('../ng2-components'), helpers.root('node_modules')]
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
|
||||
new webpack.ContextReplacementPlugin(
|
||||
/angular(\\|\/)core(\\|\/)@angular/,
|
||||
helpers.root('./src'),
|
||||
{}
|
||||
),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
'ENV': JSON.stringify(ENV)
|
||||
}
|
||||
}),
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
htmlLoader: {
|
||||
minimize: false // workaround for ng2
|
||||
}
|
||||
})
|
||||
],
|
||||
|
||||
node: {
|
||||
fs: 'empty',
|
||||
module: false
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
Error.stackTraceLimit = Infinity;
|
||||
|
||||
require('core-js/es6');
|
||||
require('core-js/es7/reflect');
|
||||
|
||||
require('zone.js/dist/zone');
|
||||
require('zone.js/dist/long-stack-trace-zone');
|
||||
require('zone.js/dist/proxy');
|
||||
require('zone.js/dist/sync-test');
|
||||
require('zone.js/dist/jasmine-patch');
|
||||
require('zone.js/dist/async-test');
|
||||
require('zone.js/dist/fake-async-test');
|
||||
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
|
||||
|
||||
var appContext = require.context('./', true, /^(?=.*(ng2-))(?!.*node_modules).*(.([^\/]*\/[^\/]*)src)((\\\\|\/)[a-zA-Z0-9_. \-]+)+\.spec.ts/);
|
||||
appContext.keys().forEach(appContext);
|
||||
|
||||
var testing = require('@angular/core/testing');
|
||||
var browser = require('@angular/platform-browser-dynamic/testing');
|
||||
|
||||
testing.TestBed.initTestEnvironment(browser.BrowserDynamicTestingModule, browser.platformBrowserDynamicTesting());
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = require('./config/karma.conf-all.js');
|
||||
@@ -1,6 +1,7 @@
|
||||
npm-debug.log
|
||||
node_modules
|
||||
.idea
|
||||
.npmrc
|
||||
typings
|
||||
coverage
|
||||
dist
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
npm-debug.log
|
||||
.idea
|
||||
.npmrc
|
||||
|
||||
coverage/
|
||||
demo/
|
||||
|
||||
@@ -178,9 +178,11 @@ platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
|
||||
#### Options
|
||||
|
||||
| Name | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
| `layoutType` | {string} | required | Define the layout of the apps. There are two possible values: GRID or LIST. LIST is the default value|
|
||||
| Name | Type | Required | Default | Description |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| `appId` | {string} | optional | | The application id |
|
||||
| `layoutType` | {string} | required | | Define the layout of the apps. There are two possible values: GRID or LIST. LIST is the default value|
|
||||
| `selectFirst` | {boolean} | optional | false | Change the value to true if you want select the first item in the list as default|
|
||||
|
||||
## Basic usage example Activiti Analytics
|
||||
|
||||
@@ -345,7 +347,6 @@ npm start
|
||||
| Command | Description |
|
||||
| --- | --- |
|
||||
| npm run build | Build component |
|
||||
| npm run build:w | Build component and keep watching the changes |
|
||||
| npm run test | Run unit tests in the console |
|
||||
| npm run test-browser | Run unit tests in the browser
|
||||
| npm run coverage | Run unit tests and display code coverage report |
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
@@ -0,0 +1,14 @@
|
||||
@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.
|
||||
-3
@@ -21,7 +21,6 @@
|
||||
"interface-name": false,
|
||||
"jsdoc-format": true,
|
||||
"label-position": true,
|
||||
"label-undefined": true,
|
||||
"max-line-length": [
|
||||
true,
|
||||
180
|
||||
@@ -47,7 +46,6 @@
|
||||
"no-construct": true,
|
||||
"no-constructor-vars": false,
|
||||
"no-debugger": true,
|
||||
"no-duplicate-key": true,
|
||||
"no-duplicate-variable": true,
|
||||
"no-empty": false,
|
||||
"no-eval": true,
|
||||
@@ -57,7 +55,6 @@
|
||||
"no-shadowed-variable": true,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-trailing-whitespace": true,
|
||||
"no-unreachable": true,
|
||||
"no-unused-expression": true,
|
||||
"no-unused-variable": true,
|
||||
"no-use-before-declare": true,
|
||||
@@ -0,0 +1,70 @@
|
||||
var path = require('path');
|
||||
var loaderUtils = require('loader-utils');
|
||||
|
||||
module.exports = function(content) {
|
||||
this.cacheable && this.cacheable();
|
||||
if(!this.emitFile) throw new Error('emitFile is required from module system');
|
||||
|
||||
var query = loaderUtils.getOptions(this) || {};
|
||||
var configKey = query.config || 'multiFileLoader';
|
||||
var options = this.options[configKey] || {};
|
||||
var config = {
|
||||
publicPath: false,
|
||||
useRelativePath: false,
|
||||
name: '[hash].[ext]'
|
||||
};
|
||||
|
||||
// options takes precedence over config
|
||||
Object.keys(options).forEach(function(attr) {
|
||||
config[attr] = options[attr];
|
||||
});
|
||||
|
||||
// query takes precedence over config and options
|
||||
Object.keys(query).forEach(function(attr) {
|
||||
config[attr] = query[attr];
|
||||
});
|
||||
|
||||
var context = config.context || this.options.context;
|
||||
var url = loaderUtils.interpolateName(this, config.name, {
|
||||
context: context,
|
||||
content: content,
|
||||
regExp: config.regExp
|
||||
});
|
||||
var path = loaderUtils.interpolateName(this, '[path]', {
|
||||
context: context,
|
||||
content: content,
|
||||
regExp: config.regExp
|
||||
});
|
||||
|
||||
var outputPath = '';
|
||||
|
||||
if (config.outputPath) {
|
||||
outputPath = (
|
||||
typeof config.outputPath === 'function'
|
||||
? config.outputPath(url, path)
|
||||
: config.outputPath + url
|
||||
);
|
||||
} else {
|
||||
outputPath = url;
|
||||
}
|
||||
|
||||
var publicPath = JSON.stringify(url);
|
||||
|
||||
if (config.publicPath) {
|
||||
publicPath = JSON.stringify(
|
||||
typeof config.publicPath === 'function'
|
||||
? config.publicPath(url, path)
|
||||
: config.publicPath + url
|
||||
);
|
||||
}
|
||||
|
||||
publicPath = '__webpack_public_path__ + ' + publicPath;
|
||||
|
||||
if (query.emitFile === undefined || query.emitFile) {
|
||||
this.emitFile(outputPath, content);
|
||||
}
|
||||
|
||||
return 'module.exports = ' + publicPath + ';';
|
||||
};
|
||||
|
||||
module.exports.raw = true;
|
||||
@@ -0,0 +1,67 @@
|
||||
var path = require('path');
|
||||
var loaderUtils = require('loader-utils');
|
||||
var fs = require('fs');
|
||||
|
||||
var licenseFileUtf8Store = undefined;
|
||||
|
||||
function readLicenseHeaderFile(licenseFilePath) {
|
||||
if (licenseFileUtf8Store) {
|
||||
return licenseFileUtf8Store;
|
||||
}
|
||||
|
||||
if (fs.existsSync(licenseFilePath)) {
|
||||
licenseFileUtf8Store = fs.readFileSync(licenseFilePath, 'utf8').split(/\r?\n/);
|
||||
return licenseFileUtf8Store;
|
||||
}
|
||||
|
||||
throw new Error('The license header file path is wrong ' + licenseFilePath);
|
||||
}
|
||||
|
||||
function isFileEmpty(fileContents) {
|
||||
return fileContents.toString('utf8').trim() === '';
|
||||
}
|
||||
|
||||
function readCurrentFile(fileContent) {
|
||||
return fileContent.toString('utf8').split(/\r?\n/);
|
||||
}
|
||||
|
||||
function isLicenseHeaderPresent(currentFileContent, licenseFilePath) {
|
||||
if (!isFileEmpty(currentFileContent)) {
|
||||
var currentFileUtf8 = readCurrentFile(currentFileContent),
|
||||
licenseFileUtf8 = readLicenseHeaderFile(licenseFilePath);
|
||||
skipStrict = 0;
|
||||
|
||||
if(currentFileUtf8[0] === '"use strict";' ) {
|
||||
skipStrict = 1;
|
||||
}
|
||||
|
||||
for (var i = skipStrict; i < licenseFileUtf8.length; i++) {
|
||||
if (currentFileUtf8[i + skipStrict] !== licenseFileUtf8[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function report(hasHeader, emitter, filename) {
|
||||
if (hasHeader) return;
|
||||
emitter('Missing license header file : ' + filename);
|
||||
}
|
||||
|
||||
function licenseCheck(webpackInstance, input, options) {
|
||||
var isLicensePresent = isLicenseHeaderPresent(input, options.licenseFile);
|
||||
|
||||
var emitter = options.emitErrors ? webpackInstance.emitError : webpackInstance.emitWarning;
|
||||
|
||||
report(isLicensePresent, emitter, webpackInstance.resourcePath);
|
||||
}
|
||||
|
||||
module.exports = function(input, map) {
|
||||
this.cacheable && this.cacheable();
|
||||
var callback = this.async();
|
||||
|
||||
var options = loaderUtils.getOptions(this);
|
||||
licenseCheck(this, input, options);
|
||||
callback(null, input, map);
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
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;
|
||||
@@ -0,0 +1,124 @@
|
||||
const webpack = require('webpack');
|
||||
const helpers = require('./helpers');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
|
||||
resolveLoader: {
|
||||
alias: {
|
||||
"file-multi-loader": path.resolve(__dirname, "./custom-loaders/file-loader-multi"),
|
||||
"license-check": path.resolve(__dirname, "./custom-loaders/license-check")
|
||||
}
|
||||
},
|
||||
|
||||
// require those dependencies but don't bundle them
|
||||
externals: [
|
||||
/^\@angular\//,
|
||||
/^rxjs\//,
|
||||
'moment',
|
||||
'raphael',
|
||||
'ng2-charts',
|
||||
'alfresco-js-api',
|
||||
'ng2-alfresco-core',
|
||||
'ng2-alfresco-datatable',
|
||||
'ng2-activiti-analytics',
|
||||
'ng2-activiti-diagrams',
|
||||
'ng2-activiti-form',
|
||||
"ng2-activiti-tasklist",
|
||||
'ng2-alfresco-documentlist'
|
||||
],
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.js$/,
|
||||
loader: 'source-map-loader',
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.ts$/,
|
||||
use: 'source-map-loader',
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.ts$/,
|
||||
loader: 'tslint-loader',
|
||||
options: {
|
||||
emitErrors: true,
|
||||
configFile: path.resolve(__dirname, './assets/tslint.json')
|
||||
},
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.ts$/,
|
||||
use: ['ts-loader', 'angular2-template-loader'],
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
loader: 'html-loader',
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
loader: ['to-string-loader', 'css-loader'],
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},{
|
||||
enforce: 'pre',
|
||||
test: /\.ts$/,
|
||||
loader: 'license-check',
|
||||
options: {
|
||||
emitErrors: true,
|
||||
licenseFile: path.resolve(__dirname, './assets/license_header.txt')
|
||||
},
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/, /rendering-queue.services.ts/ ],
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
|
||||
loader: 'file-multi-loader',
|
||||
query: {
|
||||
name: '[name].[hash].[ext]',
|
||||
outputPath: (url, resourcePath)=> {
|
||||
return resourcePath.replace('src', 'bundles') + url;
|
||||
},
|
||||
publicPath: (url, resourcePath)=> {
|
||||
var component = resourcePath.substring(0, resourcePath.indexOf('src'));
|
||||
var path = resourcePath.replace(component, '').replace('src/', '');
|
||||
return path + url;
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
resolve: {
|
||||
extensions: ['.ts', '.js'],
|
||||
symlinks: false,
|
||||
modules: [
|
||||
'../ng2-components', 'node_modules'
|
||||
]
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
|
||||
new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')),
|
||||
|
||||
new webpack.ContextReplacementPlugin(
|
||||
/angular(\\|\/)core(\\|\/)@angular/,
|
||||
helpers.root('./src'),
|
||||
{}
|
||||
)
|
||||
],
|
||||
|
||||
devtool: 'cheap-module-source-map',
|
||||
|
||||
node: {
|
||||
fs: 'empty',
|
||||
module: false
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,85 @@
|
||||
const webpack = require('webpack');
|
||||
const helpers = require('./helpers');
|
||||
|
||||
const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
|
||||
|
||||
module.exports = {
|
||||
|
||||
devtool: 'inline-source-map',
|
||||
|
||||
resolve: {
|
||||
extensions: ['.ts', '.js'],
|
||||
symlinks: false,
|
||||
modules: [helpers.root('../ng2-components'), helpers.root('node_modules')]
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.js$/,
|
||||
loader: 'source-map-loader',
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.ts$/,
|
||||
loaders: ['ts-loader?' + JSON.stringify({ transpileOnly: true}), 'angular2-template-loader'],
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
loader: 'html-loader',
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
loader: ['to-string-loader', 'css-loader'],
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico|pdf)$/,
|
||||
loader: 'file-loader',
|
||||
query: {
|
||||
name: '[path][name].[ext]',
|
||||
outputPath: (url)=> {
|
||||
return url.replace('src', 'dist');
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
enforce: 'post',
|
||||
test: /\.ts$/,
|
||||
loader: 'istanbul-instrumenter-loader',
|
||||
exclude: [
|
||||
/node_modules/,
|
||||
/test/
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
|
||||
new webpack.ContextReplacementPlugin(
|
||||
/angular(\\|\/)core(\\|\/)@angular/,
|
||||
helpers.root('./src'),
|
||||
{}
|
||||
),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
'ENV': JSON.stringify(ENV)
|
||||
}
|
||||
}),
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
htmlLoader: {
|
||||
minimize: false // workaround for ng2
|
||||
}
|
||||
})
|
||||
],
|
||||
|
||||
node: {
|
||||
fs: 'empty',
|
||||
module: false
|
||||
}
|
||||
};
|
||||
@@ -1,18 +1,18 @@
|
||||
{
|
||||
"name": "ng2-activiti-diagrams-demo",
|
||||
"name": "ng2-activiti-analytics-demo",
|
||||
"description": "Alfresco Angular2 Diagrams Component - Demo",
|
||||
"version": "0.1.0",
|
||||
"author": "Alfresco Software, Ltd.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"clean": "npm install rimraf && npm run clean-build && rimraf dist node_modules typings dist",
|
||||
"clean": "npm run clean-build && rimraf dist node_modules typings dist",
|
||||
"clean-build" : "rimraf 'src/{,**/}**.js' 'src/{,**/}**.js.map' 'src/{,**/}**.d.ts'",
|
||||
"postinstall": "npm run build",
|
||||
"start": "npm run build && concurrently \"npm run tsc:w\" \"npm run server\" ",
|
||||
"server": "wsrv -o -s -l",
|
||||
"build": "npm run tslint && npm run clean-build && npm run tsc",
|
||||
"build:w": "npm run tslint && rimraf dist && npm run tsc:w",
|
||||
"travis": "npm link ng2-alfresco-core ng2-activiti-diagrams",
|
||||
"travis": "npm link ng2-alfresco-core ng2-activiti-diagrams ng2-activiti-analytics",
|
||||
"tsc": "tsc",
|
||||
"tsc:w": "tsc -w",
|
||||
"tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json src/{,**/}**.ts -e '{,**/}**.d.ts'"
|
||||
@@ -32,22 +32,28 @@
|
||||
"activiti-diagrams"
|
||||
],
|
||||
"dependencies": {
|
||||
"@angular/common": "2.2.2",
|
||||
"@angular/compiler": "2.2.2",
|
||||
"@angular/compiler-cli": "2.2.2",
|
||||
"@angular/core": "2.2.2",
|
||||
"@angular/forms": "2.2.2",
|
||||
"@angular/http": "2.2.2",
|
||||
"@angular/platform-browser": "2.2.2",
|
||||
"@angular/platform-browser-dynamic": "2.2.2",
|
||||
"@angular/animations": "~4.0.0",
|
||||
"@angular/common": "~4.0.0",
|
||||
"@angular/compiler": "~4.0.0",
|
||||
"@angular/core": "~4.0.0",
|
||||
"@angular/forms": "~4.0.0",
|
||||
"@angular/http": "~4.0.0",
|
||||
"@angular/platform-browser": "~4.0.0",
|
||||
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||
"@angular/router": "~4.0.0",
|
||||
|
||||
"@angular/material": "2.0.0-beta.1",
|
||||
"@angular/router": "3.2.2",
|
||||
"@angular/upgrade": "2.2.2",
|
||||
"alfresco-js-api": "~1.5.0",
|
||||
"core-js": "2.4.1",
|
||||
"hammerjs": "2.0.8",
|
||||
"ng2-alfresco-core": "1.5.0",
|
||||
"ng2-translate": "5.0.0",
|
||||
"reflect-metadata": "0.1.10",
|
||||
"rxjs": "5.0.0-beta.12",
|
||||
"rxjs": "5.1.0",
|
||||
"systemjs": "0.19.27",
|
||||
"zone.js": "0.6.26",
|
||||
"zone.js": "0.7.6",
|
||||
|
||||
|
||||
"intl": "1.2.4",
|
||||
"dialog-polyfill": "0.4.7",
|
||||
"element.scrollintoviewifneeded-polyfill": "1.0.1",
|
||||
@@ -55,18 +61,16 @@
|
||||
"material-design-lite": "1.2.1",
|
||||
"chart.js": "2.5.0",
|
||||
"md-date-time-picker": "2.2.0",
|
||||
"ng2-charts": "1.1.0",
|
||||
"ng2-charts": "1.5.0",
|
||||
"moment": "2.15.1",
|
||||
"raphael": "^2.2.6",
|
||||
"ng2-translate": "2.5.0",
|
||||
"alfresco-js-api": "~1.4.0",
|
||||
"ng2-alfresco-core": "1.4.0",
|
||||
"ng2-activiti-diagrams": "1.4.0",
|
||||
"ng2-activiti-analytics": "1.4.0"
|
||||
"ng2-activiti-diagrams": "1.5.0",
|
||||
"ng2-activiti-analytics": "1.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jasmine": "^2.2.33",
|
||||
"@types/node": "^6.0.42",
|
||||
"@types/hammerjs": "^2.0.34",
|
||||
"@types/jasmine": "2.5.35",
|
||||
"@types/node": "6.0.45",
|
||||
"concurrently": "^2.2.0",
|
||||
"rimraf": "2.5.2",
|
||||
"tslint": "^3.8.1",
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
|
||||
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
|
||||
'@angular/material': 'npm:@angular/material/bundles/material.umd.js',
|
||||
'@angular/animations': 'npm:@angular/animations/bundles/animations.umd.min.js',
|
||||
'@angular/animations/browser':'npm:@angular/animations/bundles/animations-browser.umd.js',
|
||||
'@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js',
|
||||
|
||||
// other libraries
|
||||
'rxjs': 'npm:rxjs',
|
||||
@@ -44,11 +47,11 @@
|
||||
},
|
||||
'moment': 'npm:moment/min/moment.min.js',
|
||||
'ng2-translate': { defaultExtension: 'js' },
|
||||
'ng2-charts': { main: 'ng2-charts.js', defaultExtension: 'js'},
|
||||
'ng2-charts': { main: './bundles/ng2-charts.umd.js', defaultExtension: 'js'},
|
||||
'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'},
|
||||
'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'},
|
||||
'ng2-activiti-diagrams': { main: './index.js', defaultExtension: 'js'},
|
||||
'ng2-activiti-analytics': { main: './index.js', defaultExtension: 'js'}
|
||||
'ng2-alfresco-core': { main: './bundles/ng2-alfresco-core.js', defaultExtension: 'js'},
|
||||
'ng2-activiti-diagrams': { main: './bundles/ng2-activiti-diagrams.js', defaultExtension: 'js'},
|
||||
'ng2-activiti-analytics': { main: './bundles/ng2-activiti-analytics.js', defaultExtension: 'js'}
|
||||
}
|
||||
});
|
||||
})(this);
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
],
|
||||
"no-any": false,
|
||||
"no-arg": true,
|
||||
"no-bitwise": true,
|
||||
"no-bitwise": false,
|
||||
"no-conditional-assignment": true,
|
||||
"no-consecutive-blank-lines": true,
|
||||
"no-console": [
|
||||
@@ -52,11 +52,11 @@
|
||||
"no-debugger": true,
|
||||
"no-duplicate-key": true,
|
||||
"no-duplicate-variable": true,
|
||||
"no-empty": true,
|
||||
"no-empty": false,
|
||||
"no-eval": true,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": true,
|
||||
"no-require-imports": true,
|
||||
"no-require-imports": false,
|
||||
"no-shadowed-variable": true,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-trailing-whitespace": true,
|
||||
|
||||
@@ -1,311 +0,0 @@
|
||||
import * as gulp from 'gulp';
|
||||
import * as util from 'gulp-util';
|
||||
import * as runSequence from 'run-sequence';
|
||||
import * as gulpLoadPlugins from 'gulp-load-plugins';
|
||||
import * as merge from 'merge-stream';
|
||||
import * as rimraf from 'rimraf';
|
||||
import { join } from 'path';
|
||||
import * as Builder from 'systemjs-builder';
|
||||
var autoprefixer = require('autoprefixer');
|
||||
import * as cssnano from 'cssnano';
|
||||
import * as filter from 'gulp-filter';
|
||||
import * as sourcemaps from 'gulp-sourcemaps';
|
||||
|
||||
var APP_SRC = `.`;
|
||||
var CSS_PROD_BUNDLE = 'main.css';
|
||||
var JS_PROD_SHIMS_BUNDLE = 'shims.js';
|
||||
var NG_FACTORY_FILE = 'main-prod';
|
||||
|
||||
const BUILD_TYPES = {
|
||||
DEVELOPMENT: 'dev',
|
||||
PRODUCTION: 'prod'
|
||||
};
|
||||
|
||||
function normalizeDependencies(deps) {
|
||||
deps
|
||||
.filter((d) => !/\*/.test(d.src)) // Skip globs
|
||||
.forEach((d) => d.src = require.resolve(d.src));
|
||||
return deps;
|
||||
}
|
||||
|
||||
function filterDependency(type: string, d): boolean {
|
||||
const t = d.buildType || d.env;
|
||||
d.buildType = t;
|
||||
if (!t) {
|
||||
d.buildType = Object.keys(BUILD_TYPES).map(k => BUILD_TYPES[k]);
|
||||
}
|
||||
if (!(d.buildType instanceof Array)) {
|
||||
(<any>d).env = [d.buildType];
|
||||
}
|
||||
return d.buildType.indexOf(type) >= 0;
|
||||
}
|
||||
|
||||
function getInjectableDependency() {
|
||||
var APP_ASSETS = [
|
||||
{src: `src/css/main.css`, inject: true, vendor: false},
|
||||
];
|
||||
|
||||
var NPM_DEPENDENCIES = [
|
||||
{src: 'zone.js/dist/zone.js', inject: 'libs'},
|
||||
{src: 'core-js/client/shim.min.js', inject: 'shims'},
|
||||
{src: 'systemjs/dist/system.src.js', inject: 'shims', buildType:'dev'}
|
||||
];
|
||||
|
||||
return normalizeDependencies(NPM_DEPENDENCIES.filter(filterDependency.bind(null, 'dev')))
|
||||
.concat(APP_ASSETS.filter(filterDependency.bind(null, 'dev')));
|
||||
}
|
||||
|
||||
const plugins = <any>gulpLoadPlugins();
|
||||
|
||||
let tsProjects: any = {};
|
||||
|
||||
function makeTsProject(options: Object = {}) {
|
||||
let optionsHash = JSON.stringify(options);
|
||||
if (!tsProjects[optionsHash]) {
|
||||
let config = Object.assign({
|
||||
typescript: require('typescript')
|
||||
}, options);
|
||||
tsProjects[optionsHash] =
|
||||
plugins.typescript.createProject('tsconfig.json', config);
|
||||
}
|
||||
return tsProjects[optionsHash];
|
||||
}
|
||||
|
||||
gulp.task('build.html_css', () => {
|
||||
const gulpConcatCssConfig = {
|
||||
targetFile: CSS_PROD_BUNDLE,
|
||||
options: {
|
||||
rebaseUrls: false
|
||||
}
|
||||
};
|
||||
|
||||
const processors = [
|
||||
autoprefixer({
|
||||
browsers: [
|
||||
'ie >= 10',
|
||||
'ie_mob >= 10',
|
||||
'ff >= 30',
|
||||
'chrome >= 34',
|
||||
'safari >= 7',
|
||||
'opera >= 23',
|
||||
'ios >= 7',
|
||||
'android >= 4.4',
|
||||
'bb >= 10'
|
||||
]
|
||||
})
|
||||
];
|
||||
|
||||
const reportPostCssError = (e: any) => util.log(util.colors.red(e.message));
|
||||
|
||||
processors.push(
|
||||
cssnano({
|
||||
discardComments: {removeAll: true},
|
||||
discardUnused: false, // unsafe, see http://goo.gl/RtrzwF
|
||||
zindex: false, // unsafe, see http://goo.gl/vZ4gbQ
|
||||
reduceIdents: false // unsafe, see http://goo.gl/tNOPv0
|
||||
})
|
||||
);
|
||||
|
||||
/**
|
||||
* Processes the CSS files within `src/client` excluding those in `src/client/assets` using `postcss` with the
|
||||
* configured processors
|
||||
* Execute the appropriate component-stylesheet processing method based on user stylesheet preference.
|
||||
*/
|
||||
function processComponentStylesheets() {
|
||||
return gulp.src(join('src/**', '*.css'))
|
||||
.pipe(plugins.cached('process-component-css'))
|
||||
.pipe(plugins.postcss(processors))
|
||||
.on('error', reportPostCssError);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a stream of external css files for subsequent processing.
|
||||
*/
|
||||
function getExternalCssStream() {
|
||||
return gulp.src(getExternalCss())
|
||||
.pipe(plugins.cached('process-external-css'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array of filenames referring to all external css stylesheets.
|
||||
*/
|
||||
function getExternalCss() {
|
||||
return getInjectableDependency().filter(dep => /\.css$/.test(dep.src)).map(dep => dep.src);
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the external CSS files using `postcss` with the configured processors.
|
||||
*/
|
||||
function processExternalCss() {
|
||||
return getExternalCssStream()
|
||||
.pipe(plugins.postcss(processors))
|
||||
.pipe(plugins.concatCss(gulpConcatCssConfig.targetFile, gulpConcatCssConfig.options))
|
||||
.on('error', reportPostCssError);
|
||||
}
|
||||
|
||||
return merge(processComponentStylesheets(), processExternalCss());
|
||||
|
||||
});
|
||||
|
||||
gulp.task('build.bundles.app', (done) => {
|
||||
var BUNDLER_OPTIONS = {
|
||||
format: 'umd',
|
||||
minify: false,
|
||||
mangle: false,
|
||||
sourceMaps: true
|
||||
};
|
||||
var CONFIG_TYPESCRIPT = {
|
||||
baseURL: '.',
|
||||
transpiler: 'typescript',
|
||||
typescriptOptions: {
|
||||
module: 'cjs'
|
||||
},
|
||||
map: {
|
||||
typescript: 'node_modules/typescript/lib/typescript.js',
|
||||
'@angular': 'node_modules/@angular',
|
||||
rxjs: 'node_modules/rxjs',
|
||||
'ng2-translate': 'node_modules/ng2-translate',
|
||||
'alfresco-js-api': 'node_modules/alfresco-js-api/dist/alfresco-js-api',
|
||||
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core/',
|
||||
'ng2-activiti-diagrams': 'node_modules/ng2-activiti-diagrams/',
|
||||
'ng2-activiti-analytics': 'node_modules/ng2-activiti-analytics/',
|
||||
'ng2-alfresco-datatable': 'node_modules/ng2-alfresco-datatable/',
|
||||
'ng2-alfresco-documentlist': 'node_modules/ng2-alfresco-documentlist/',
|
||||
'ng2-activiti-form': 'node_modules/ng2-activiti-form/',
|
||||
'ng2-alfresco-login': 'node_modules/ng2-alfresco-login/',
|
||||
'ng2-activiti-processlist': 'node_modules/ng2-activiti-processlist/',
|
||||
'ng2-alfresco-search': 'node_modules/ng2-alfresco-search/',
|
||||
'ng2-activiti-tasklist': 'node_modules/ng2-activiti-tasklist/',
|
||||
'ng2-alfresco-tag': 'node_modules/ng2-alfresco-tag/',
|
||||
'ng2-alfresco-upload': 'node_modules/ng2-alfresco-upload/',
|
||||
'ng2-alfresco-userinfo': 'node_modules/ng2-alfresco-userinfo/',
|
||||
'ng2-alfresco-viewer': 'node_modules/ng2-alfresco-viewer/',
|
||||
'ng2-alfresco-webscript': 'node_modules/ng2-alfresco-webscript/',
|
||||
'ng2-charts': 'node_modules/ng2-charts/bundles/ng2-charts.umd',
|
||||
'moment': 'node_modules/moment/min/moment.min'
|
||||
|
||||
},
|
||||
paths: {
|
||||
'*': '*.js'
|
||||
},
|
||||
meta: {
|
||||
'node_modules/@angular/*': {build: false},
|
||||
'node_modules/rxjs/*': {build: false},
|
||||
'node_modules/ng2-translate/*': {build: false},
|
||||
'node_modules/ng2-charts/*': {build: false},
|
||||
'node_modules/ng2-alfresco-core/*': {build: false},
|
||||
'node_modules/ng2-activiti-diagrams/*': {build: false},
|
||||
'node_modules/ng2-activiti-analytics/*': {build: false},
|
||||
'node_modules/ng2-alfresco-datatable/*': {build: false},
|
||||
'node_modules/ng2-alfresco-documentlist/*': {build: false},
|
||||
'node_modules/ng2-activiti-form/*': {build: false},
|
||||
'node_modules/ng2-alfresco-login/*': {build: false},
|
||||
'node_modules/ng2-activiti-processlist/*': {build: false},
|
||||
'node_modules/ng2-alfresco-search/*': {build: false},
|
||||
'node_modules/ng2-activiti-tasklist/*': {build: false},
|
||||
'node_modules/ng2-alfresco-tag/*': {build: false},
|
||||
'node_modules/ng2-alfresco-upload/*': {build: false},
|
||||
'node_modules/ng2-alfresco-userinfo/*': {build: false},
|
||||
'node_modules/ng2-alfresco-viewer/*': {build: false},
|
||||
'node_modules/ng2-alfresco-webscript/*': {build: false}
|
||||
}
|
||||
};
|
||||
|
||||
var pkg = require('./package.json');
|
||||
var namePkg = pkg.name;
|
||||
|
||||
var builder = new Builder(CONFIG_TYPESCRIPT);
|
||||
builder
|
||||
.buildStatic(APP_SRC + "/index", 'bundles/' + namePkg + '.js', BUNDLER_OPTIONS)
|
||||
.then(function () {
|
||||
return done();
|
||||
})
|
||||
.catch(function (err) {
|
||||
return done(err);
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('build.assets.prod', () => {
|
||||
return gulp.src([
|
||||
join('src/**', '*.ts'),
|
||||
'index.ts',
|
||||
join('src/**', '*.css'),
|
||||
join('src/**', '*.html'),
|
||||
'!'+join('*/**', '*.d.ts'),
|
||||
'!'+join('*/**', '*.spec.ts'),
|
||||
'!gulpfile.ts'])
|
||||
|
||||
});
|
||||
|
||||
gulp.task('build.bundles', () => {
|
||||
merge(bundleShims());
|
||||
|
||||
/**
|
||||
* Returns the shim files to be injected.
|
||||
*/
|
||||
function getShims() {
|
||||
let libs = getInjectableDependency()
|
||||
.filter(d => /\.js$/.test(d.src));
|
||||
|
||||
return libs.filter(l => l.inject === 'shims')
|
||||
.concat(libs.filter(l => l.inject === 'libs'))
|
||||
.concat(libs.filter(l => l.inject === true))
|
||||
.map(l => l.src);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bundles the shim files.
|
||||
*/
|
||||
function bundleShims() {
|
||||
return gulp.src(getShims())
|
||||
.pipe(plugins.concat(JS_PROD_SHIMS_BUNDLE))
|
||||
// Strip the first (global) 'use strict' added by reflect-metadata, but don't strip any others to avoid unintended scope leaks.
|
||||
.pipe(plugins.replace(/('|")use strict\1;var Reflect;/, 'var Reflect;'))
|
||||
.pipe(gulp.dest('bundles'));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
gulp.task('build.js.prod', () => {
|
||||
const INLINE_OPTIONS = {
|
||||
base: APP_SRC,
|
||||
target: 'es5',
|
||||
useRelativePaths: true,
|
||||
removeLineBreaks: true
|
||||
};
|
||||
|
||||
let tsProject = makeTsProject();
|
||||
let src = [
|
||||
join('src/**/*.ts'),
|
||||
join('!src/**/*.d.ts'),
|
||||
join('!src/**/*.spec.ts'),
|
||||
`!src/**/${NG_FACTORY_FILE}.ts`
|
||||
];
|
||||
|
||||
let result = gulp.src(src)
|
||||
.pipe(plugins.plumber())
|
||||
.pipe(plugins.inlineNg2Template(INLINE_OPTIONS))
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(tsProject())
|
||||
.once('error', function (e: any) {
|
||||
this.once('finish', () => process.exit(1));
|
||||
});
|
||||
|
||||
return result.js
|
||||
.pipe(plugins.template())
|
||||
.pipe(sourcemaps.write())
|
||||
.pipe(gulp.dest('src'))
|
||||
.on('error', (e: any) => {
|
||||
console.log(e);
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('build.prod', (done: any) =>
|
||||
runSequence(
|
||||
'build.assets.prod',
|
||||
'build.html_css',
|
||||
'build.js.prod',
|
||||
'build.bundles',
|
||||
'build.bundles.app',
|
||||
done));
|
||||
@@ -1,122 +1,25 @@
|
||||
// Tun on full stack traces in errors to help debugging
|
||||
Error.stackTraceLimit = Infinity;
|
||||
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 100000;
|
||||
require('core-js/es6');
|
||||
require('core-js/es7/reflect');
|
||||
|
||||
window.componentHandler = {
|
||||
upgradeAllRegistered: function () {
|
||||
},
|
||||
upgradeElement: function () {
|
||||
}
|
||||
};
|
||||
require('zone.js/dist/zone');
|
||||
require('zone.js/dist/long-stack-trace-zone');
|
||||
require('zone.js/dist/proxy');
|
||||
require('zone.js/dist/sync-test');
|
||||
require('zone.js/dist/jasmine-patch');
|
||||
require('zone.js/dist/async-test');
|
||||
require('zone.js/dist/fake-async-test');
|
||||
|
||||
__karma__.loaded = function() {};
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
|
||||
|
||||
var builtPath = '/base/src/';
|
||||
var appContext = require.context('./src', true, /\.spec\.ts/);
|
||||
appContext.keys().forEach(appContext);
|
||||
|
||||
function isJsFile(path) {
|
||||
return path.slice(-3) == '.js';
|
||||
}
|
||||
|
||||
function isSpecFile(path) {
|
||||
return /\.spec\.(.*\.)?js$/.test(path);
|
||||
}
|
||||
var testing = require('@angular/core/testing');
|
||||
var browser = require('@angular/platform-browser-dynamic/testing');
|
||||
|
||||
function isBuiltFile(path) {
|
||||
return isJsFile(path) && (path.substr(0, builtPath.length) == builtPath);
|
||||
}
|
||||
testing.TestBed.initTestEnvironment(browser.BrowserDynamicTestingModule, browser.platformBrowserDynamicTesting());
|
||||
|
||||
var allSpecFiles = Object.keys(window.__karma__.files)
|
||||
.filter(isSpecFile)
|
||||
.filter(isBuiltFile);
|
||||
|
||||
var paths = {
|
||||
// paths serve as alias
|
||||
'npm:': 'base/node_modules/'
|
||||
};
|
||||
|
||||
var map = {
|
||||
'app': 'base/src',
|
||||
// angular bundles
|
||||
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
|
||||
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
|
||||
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
|
||||
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
|
||||
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
|
||||
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
|
||||
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
|
||||
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
|
||||
'@angular/material': 'npm:@angular/material/bundles/material.umd.js',
|
||||
|
||||
// testing
|
||||
'@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js',
|
||||
'@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js',
|
||||
'@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js',
|
||||
'@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
|
||||
'@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
|
||||
'@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js',
|
||||
'@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js',
|
||||
'@angular/forms/testing': 'npm:@angular/forms/bundles/forms-testing.umd.js',
|
||||
|
||||
// other libraries
|
||||
'rxjs': 'npm:rxjs',
|
||||
'ng2-translate': 'npm:ng2-translate',
|
||||
'ng2-charts': 'npm:ng2-charts/bundles/ng2-charts.umd.js',
|
||||
'md-date-time-picker' : 'npm:md-date-time-picker',
|
||||
'moment' : 'npm:moment/min/moment.min.js',
|
||||
'hammerjs': 'npm:hammerjs',
|
||||
|
||||
'alfresco-js-api': 'npm:alfresco-js-api/dist',
|
||||
'ng2-activiti-diagrams': 'npm:ng2-activiti-diagrams',
|
||||
'ng2-alfresco-core': 'npm:ng2-alfresco-core'
|
||||
};
|
||||
|
||||
var packages = {
|
||||
'app': { main: 'main.js', defaultExtension: 'js' },
|
||||
'rxjs': { defaultExtension: 'js' },
|
||||
'ng2-translate': { defaultExtension: 'js' },
|
||||
'md-date-time-picker': { defaultExtension: 'js' },
|
||||
'moment': { defaultExtension: 'js' },
|
||||
'hammerjs': {main: './hammerjs.js', defaultExtension: 'js'},
|
||||
|
||||
'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'},
|
||||
'ng2-activiti-diagrams': { main: './index.js', defaultExtension: 'js'},
|
||||
'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'}
|
||||
};
|
||||
|
||||
var config = {
|
||||
paths: paths,
|
||||
map: map,
|
||||
packages: packages
|
||||
};
|
||||
|
||||
System.config(config);
|
||||
|
||||
System.import('@angular/core/testing')
|
||||
.then(initTestBed)
|
||||
.then(initTesting);
|
||||
|
||||
function initTestBed(){
|
||||
return Promise.all([
|
||||
System.import('@angular/core/testing'),
|
||||
System.import('@angular/platform-browser-dynamic/testing')
|
||||
])
|
||||
.then(function (providers) {
|
||||
var coreTesting = providers[0];
|
||||
var browserTesting = providers[1];
|
||||
|
||||
coreTesting.TestBed.initTestEnvironment(
|
||||
browserTesting.BrowserDynamicTestingModule,
|
||||
browserTesting.platformBrowserDynamicTesting());
|
||||
})
|
||||
}
|
||||
|
||||
// Import all spec files and start karma
|
||||
function initTesting () {
|
||||
return Promise.all(
|
||||
allSpecFiles.map(function (moduleName) {
|
||||
return System.import(moduleName);
|
||||
})
|
||||
)
|
||||
.then(__karma__.start, __karma__.error);
|
||||
}
|
||||
|
||||
@@ -1,76 +1,36 @@
|
||||
'use strict';
|
||||
var webpackConfig = require('./webpack.test');
|
||||
|
||||
module.exports = function (config) {
|
||||
var configuration = {
|
||||
var _config = {
|
||||
basePath: '.',
|
||||
|
||||
frameworks: ['jasmine-ajax', 'jasmine'],
|
||||
|
||||
files: [
|
||||
// System.js for module loading
|
||||
'node_modules/systemjs/dist/system.src.js',
|
||||
'./node_modules/hammerjs/hammer.js',
|
||||
|
||||
// Polyfills
|
||||
'node_modules/core-js/client/shim.js',
|
||||
'node_modules/reflect-metadata/Reflect.js',
|
||||
//diagrams
|
||||
'./node_modules/chart.js/dist/Chart.js',
|
||||
'./node_modules/alfresco-js-api/dist/alfresco-js-api.js',
|
||||
'./node_modules/raphael/raphael.js',
|
||||
'./node_modules/moment/min/moment.min.js',
|
||||
'./node_modules/md-date-time-picker/dist/js/mdDateTimePicker.js',
|
||||
|
||||
// zone.js
|
||||
'node_modules/zone.js/dist/zone.js',
|
||||
'node_modules/zone.js/dist/long-stack-trace-zone.js',
|
||||
'node_modules/zone.js/dist/proxy.js',
|
||||
'node_modules/zone.js/dist/sync-test.js',
|
||||
'node_modules/zone.js/dist/jasmine-patch.js',
|
||||
'node_modules/zone.js/dist/async-test.js',
|
||||
'node_modules/zone.js/dist/fake-async-test.js',
|
||||
'node_modules/hammerjs/hammer.js',
|
||||
{pattern: './node_modules/ng2-translate/**/*.js', included: false, watched: false},
|
||||
{pattern: './node_modules/ng2-charts/**/*.js', included: false, served: true, watched: false},
|
||||
{pattern: './node_modules/md-date-time-picker/**/*.js', included: false, served: true, watched: false},
|
||||
{pattern: './node_modules/moment/**/*.js', included: false, served: true, watched: false},
|
||||
|
||||
// RxJs
|
||||
{ pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false },
|
||||
{ pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false },
|
||||
|
||||
// Paths loaded via module imports:
|
||||
// Angular itself
|
||||
{pattern: 'node_modules/@angular/**/*.js', included: false, watched: false},
|
||||
{pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false},
|
||||
|
||||
'node_modules/alfresco-js-api/dist/alfresco-js-api.js',
|
||||
'node_modules/moment/min/moment.min.js',
|
||||
'node_modules/md-date-time-picker/dist/js/mdDateTimePicker.js',
|
||||
'node_modules/chart.js/dist/Chart.bundle.min.js',
|
||||
{pattern: 'node_modules/ng2-translate/**/*.js', included: false, watched: false},
|
||||
|
||||
'karma-test-shim.js',
|
||||
|
||||
// paths loaded via module imports
|
||||
{pattern: 'src/**/*.js', included: false, watched: true},
|
||||
{pattern: 'src/**/*.html', included: true, served: true, watched: true},
|
||||
{pattern: 'src/**/*.css', included: true, served: true, watched: true},
|
||||
|
||||
// ng2-components
|
||||
{ pattern: 'node_modules/ng2-alfresco-core/src/**/*.*', included: false, served: true, watched: false },
|
||||
{ pattern: 'node_modules/ng2-alfresco-core/index.js', included: false, served: true, watched: false },
|
||||
|
||||
{ pattern: 'node_modules/ng2-activiti-diagrams/src/**/*.*', included: false, served: true, watched: false },
|
||||
{ pattern: 'node_modules/ng2-activiti-diagrams/index.js', included: false, served: true, watched: false },
|
||||
|
||||
{ pattern: 'node_modules/ng2-charts/**/*.js', included: false, served: true, watched: false },
|
||||
{ pattern: 'node_modules/md-date-time-picker/**/*.js', included: false, served: true, watched: false },
|
||||
{ pattern: 'node_modules/moment/**/*.js', included: false, served: true, watched: false },
|
||||
|
||||
// paths to support debugging with source maps in dev tools
|
||||
{pattern: 'src/**/*.ts', included: false, watched: false},
|
||||
{pattern: 'src/**/*.js.map', included: false, watched: false},
|
||||
{pattern: 'src/**/*.json', included: false, watched: false}
|
||||
{pattern: 'karma-test-shim.js', watched: false},
|
||||
{pattern: './src/assets/**/*.*', included: false, served: true, watched: false},
|
||||
{pattern: './src/i18n/**/*.*', included: false, served: true, watched: false},
|
||||
{pattern: './src/**/*.ts', included: false, served: true, watched: false}
|
||||
],
|
||||
|
||||
exclude: [
|
||||
'node_modules/**/*spec.js'
|
||||
],
|
||||
webpack: webpackConfig,
|
||||
|
||||
// proxied base paths
|
||||
proxies: {
|
||||
// required for component assets fetched by Angular's compiler
|
||||
'/src/': '/base/src/'
|
||||
webpackMiddleware: {
|
||||
stats: 'errors-only'
|
||||
},
|
||||
|
||||
port: 9876,
|
||||
@@ -87,6 +47,7 @@ module.exports = function (config) {
|
||||
browserDisconnectTimeout: 180000,
|
||||
browserDisconnectTolerance: 3,
|
||||
browserNoActivityTimeout: 300000,
|
||||
|
||||
browsers: ['Chrome'],
|
||||
|
||||
customLaunchers: {
|
||||
@@ -98,29 +59,35 @@ module.exports = function (config) {
|
||||
|
||||
// Karma plugins loaded
|
||||
plugins: [
|
||||
'karma-jasmine',
|
||||
'karma-coverage',
|
||||
'karma-jasmine-ajax',
|
||||
'karma-chrome-launcher',
|
||||
'karma-mocha-reporter',
|
||||
'karma-jasmine-html-reporter'
|
||||
require('./node_modules/karma-jasmine'),
|
||||
require('./node_modules/karma-coverage'),
|
||||
require('./node_modules/karma-sourcemap-loader'),
|
||||
require('./node_modules/karma-jasmine-ajax'),
|
||||
require('./node_modules/karma-chrome-launcher'),
|
||||
require('./node_modules/karma-mocha-reporter'),
|
||||
require('./node_modules/karma-webpack'),
|
||||
require('./node_modules/karma-jasmine-html-reporter')
|
||||
],
|
||||
|
||||
webpackServer: {
|
||||
noInfo: true
|
||||
},
|
||||
|
||||
// Coverage reporter generates the coverage
|
||||
reporters: ['mocha', 'coverage', 'kjhtml'],
|
||||
|
||||
// Source files that you wanna generate coverage for.
|
||||
// Do not include tests or libraries (these files will be instrumented by Istanbul)
|
||||
preprocessors: {
|
||||
'src/**/!(*spec|index|*mock|*model|*event).js': 'coverage'
|
||||
'karma-test-shim.js': ['webpack', 'sourcemap'],
|
||||
'./src/**/!(*spec|index|*mock|*model|*event).js': 'coverage'
|
||||
},
|
||||
|
||||
coverageReporter: {
|
||||
includeAllSources: true,
|
||||
dir: 'coverage/',
|
||||
dir: 'coverage',
|
||||
subdir: 'report',
|
||||
reporters: [
|
||||
{type: 'text'},
|
||||
{type: 'text-summary'},
|
||||
{type: 'json', file: 'coverage-final.json'},
|
||||
{type: 'html'},
|
||||
{type: 'lcov'}
|
||||
@@ -129,8 +96,8 @@ module.exports = function (config) {
|
||||
};
|
||||
|
||||
if (process.env.TRAVIS) {
|
||||
configuration.browsers = ['Chrome_travis_ci'];
|
||||
config.browsers = ['Chrome_travis_ci'];
|
||||
}
|
||||
|
||||
config.set(configuration)
|
||||
config.set(_config);
|
||||
};
|
||||
|
||||
@@ -1,30 +1,18 @@
|
||||
{
|
||||
"name": "ng2-activiti-analytics",
|
||||
"description": "Activiti Angular2 Analytics Component",
|
||||
"version": "1.4.0",
|
||||
"version": "1.5.0",
|
||||
"author": "Alfresco Software, Ltd.",
|
||||
"scripts": {
|
||||
"clean": "npm install rimraf && npm run clean-build && rimraf dist node_modules typings",
|
||||
"clean-build": "rimraf index.js index.js.map index.d.ts 'src/{,**/}**.js' 'src/{,**/}**.js.map' 'src/{,**/}**.d.ts' bundles",
|
||||
"build": "npm run clean-build && npm run tslint && tsc && license-check && npm run build.umd",
|
||||
"build:w": "npm run clean-build && npm run tslint && npm run tsc:w && license-check && npm run build.umd",
|
||||
"tslint": "tslint -c tslint.json 'src/{,**/}**.ts' 'index.ts' -e '{,**/}**.d.ts' -e './gulpfile.ts'",
|
||||
"tsc": "tsc",
|
||||
"tsc:w": "tsc -w",
|
||||
"pretest": "npm run build",
|
||||
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run",
|
||||
"test-browser": "npm run build && concurrently \"karma start karma.conf.js --reporters kjhtml\" \"npm run watch-task\"",
|
||||
"posttest": "remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json",
|
||||
"clean": "rimraf dist node_modules typings bundles coverage .npmrc",
|
||||
"rimraf": "rimraf",
|
||||
"build": "webpack --config webpack.build.js --progress --profile --bail",
|
||||
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run --component",
|
||||
"test-browser": "karma start karma.conf.js --reporters kjhtml --component",
|
||||
"coverage": "npm run test && wsrv -o -p 9875 ./coverage/report",
|
||||
"publish:prod": "npm run test && npm publish",
|
||||
"travis": "npm link ng2-alfresco-core ng2-activiti-diagrams",
|
||||
"gulp": "gulp",
|
||||
"build.umd": "gulp build.prod --color --env-config prod --build-type prod",
|
||||
"reinstall": "npm cache clean && npm install"
|
||||
"prepublish" : "npm run build"
|
||||
},
|
||||
"main": "./index.js",
|
||||
"module": "./index.js",
|
||||
"typings": "./index.d.ts",
|
||||
"main": "bundles/ng2-activiti-analytics.js",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Mario Romano",
|
||||
@@ -43,87 +31,88 @@
|
||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular/common": "2.2.2",
|
||||
"@angular/compiler": "2.2.2",
|
||||
"@angular/core": "2.2.2",
|
||||
"@angular/forms": "2.2.2",
|
||||
"@angular/http": "2.2.2",
|
||||
"@angular/animations": "~4.0.0",
|
||||
"@angular/common": "~4.0.0",
|
||||
"@angular/compiler": "~4.0.0",
|
||||
"@angular/core": "~4.0.0",
|
||||
"@angular/forms": "~4.0.0",
|
||||
"@angular/http": "~4.0.0",
|
||||
"@angular/platform-browser": "~4.0.0",
|
||||
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||
"@angular/router": "~4.0.0",
|
||||
|
||||
"@angular/material": "2.0.0-beta.1",
|
||||
"@angular/platform-browser": "2.2.2",
|
||||
"@angular/platform-browser-dynamic": "2.2.2",
|
||||
"@angular/router": "3.2.2",
|
||||
"alfresco-js-api": "~1.4.0",
|
||||
"alfresco-js-api": "~1.5.0",
|
||||
"chart.js": "2.5.0",
|
||||
"core-js": "2.4.1",
|
||||
"hammerjs": "2.0.8",
|
||||
"md-date-time-picker": "2.2.0",
|
||||
"moment": "2.15.1",
|
||||
"ng2-activiti-diagrams": "1.4.0",
|
||||
"ng2-alfresco-core": "1.4.0",
|
||||
"ng2-activiti-diagrams": "1.5.0",
|
||||
"ng2-alfresco-core": "1.5.0",
|
||||
"ng2-charts": "1.5.0",
|
||||
"ng2-translate": "2.5.0",
|
||||
"ng2-translate": "5.0.0",
|
||||
"raphael": "2.2.7",
|
||||
"reflect-metadata": "0.1.10",
|
||||
"rxjs": "5.0.0-beta.12",
|
||||
"rxjs": "5.1.0",
|
||||
"systemjs": "0.19.27",
|
||||
"zone.js": "0.6.26"
|
||||
"zone.js": "0.8.4"
|
||||
},
|
||||
"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",
|
||||
"concurrently": "^2.2.0",
|
||||
"cpx": "1.3.1",
|
||||
"copy-webpack-plugin": "^4.0.1",
|
||||
"css-loader": "^0.23.1",
|
||||
"css-to-string-loader": "^0.1.2",
|
||||
"cssnano": "^3.8.1",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-autoprefixer": "^3.1.1",
|
||||
"gulp-cached": "^1.1.1",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-concat-css": "^2.3.0",
|
||||
"gulp-filter": "^4.0.0",
|
||||
"gulp-inline-ng2-template": "^4.0.0",
|
||||
"gulp-load-plugins": "^1.4.0",
|
||||
"gulp-plumber": "^1.1.0",
|
||||
"gulp-postcss": "^6.2.0",
|
||||
"gulp-replace": "^0.5.4",
|
||||
"gulp-sourcemaps": "^1.9.1",
|
||||
"gulp-template": "^4.0.0",
|
||||
"gulp-typescript": "^3.1.3",
|
||||
"gulp-uglify": "^2.0.0",
|
||||
"gulp-util": "^3.0.7",
|
||||
"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.0.0",
|
||||
"karma-jasmine": "1.0.2",
|
||||
"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.0.3",
|
||||
"license-check": "1.1.5",
|
||||
"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.2",
|
||||
"loader-utils": "^1.1.0",
|
||||
"merge-stream": "^1.0.1",
|
||||
"remap-istanbul": "0.6.3",
|
||||
"rimraf": "2.5.2",
|
||||
"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",
|
||||
"traceur": "0.0.91",
|
||||
"to-string-loader": "^1.1.4",
|
||||
"traceur": "^0.0.91",
|
||||
"ts-loader": "^2.0.0",
|
||||
"ts-node": "^1.7.0",
|
||||
"tslint": "3.15.1",
|
||||
"typescript": "^2.0.3",
|
||||
"wsrv": "^0.1.5"
|
||||
"tslint": "^4.4.2",
|
||||
"tslint-loader": "^3.3.0",
|
||||
"typescript": "^2.1.6",
|
||||
"webpack": "^2.2.1",
|
||||
"webpack-dev-server": "^2.3.0",
|
||||
"webpack-merge": "2.6.1",
|
||||
"wsrv": "^0.1.7"
|
||||
},
|
||||
"keywords": [
|
||||
"tag",
|
||||
"alfresco-component"
|
||||
],
|
||||
"license-check-config": {
|
||||
"src": [
|
||||
"./src/**/*.js"
|
||||
],
|
||||
"path": "assets/license_header.txt",
|
||||
"blocking": true,
|
||||
"logInfo": false,
|
||||
"logError": true
|
||||
},
|
||||
"license": "Apache-2.0"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export let fakeReportList = [
|
||||
{
|
||||
id: '1',
|
||||
name: 'Fake Report 1'
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: 'Fake Report 2'
|
||||
}
|
||||
];
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export var chartProcessDefOverview = {
|
||||
export let chartProcessDefOverview = {
|
||||
'elements': [{
|
||||
'id': 'id1585876275153',
|
||||
'type': 'table',
|
||||
@@ -62,7 +62,7 @@ export var chartProcessDefOverview = {
|
||||
}]
|
||||
};
|
||||
|
||||
export var chartTaskOverview = {
|
||||
export let chartTaskOverview = {
|
||||
'elements': [{
|
||||
'id': 'id792351752194',
|
||||
'type': 'barChart',
|
||||
|
||||
+14
-14
@@ -17,14 +17,14 @@
|
||||
|
||||
import { ReportParameterDetailsModel } from '../models/report.model';
|
||||
|
||||
export var reportDefParamStatus = {
|
||||
export let reportDefParamStatus = {
|
||||
'id': 2005,
|
||||
'name': 'Fake Task overview status',
|
||||
'created': '2016-10-05T15:39:40.222+0000',
|
||||
'definition': '{ "parameters" :[{"id":"status","name":null,"nameKey":null,"type":"status","value":null,"dependsOn":null}]}'
|
||||
};
|
||||
|
||||
export var reportDefParamNumber = {
|
||||
export let reportDefParamNumber = {
|
||||
'id': 2005,
|
||||
'name': 'Fake Process instances overview',
|
||||
'created': '2016-10-05T15:39:40.222+0000',
|
||||
@@ -32,7 +32,7 @@ export var reportDefParamNumber = {
|
||||
' :[{"id":"slowProcessInstanceInteger","name":null,"nameKey":null,"type":"integer","value":10,"dependsOn":null}]}'
|
||||
};
|
||||
|
||||
export var reportDefParamDuration = {
|
||||
export let reportDefParamDuration = {
|
||||
'id': 2005,
|
||||
'name': 'Fake Task service level agreement',
|
||||
'created': '2016-10-05T15:39:40.222+0000',
|
||||
@@ -40,7 +40,7 @@ export var reportDefParamDuration = {
|
||||
' :[{"id":"duration","name":null,"nameKey":null,"type":"duration","value":null,"dependsOn":null}]}'
|
||||
};
|
||||
|
||||
export var reportDefParamCheck = {
|
||||
export let reportDefParamCheck = {
|
||||
'id': 2005,
|
||||
'name': 'Fake Task service level agreement',
|
||||
'created': '2016-10-05T15:39:40.222+0000',
|
||||
@@ -48,28 +48,28 @@ export var reportDefParamCheck = {
|
||||
' :[{"id":"typeFiltering","name":null,"nameKey":null,"type":"boolean","value":true,"dependsOn":null}]}'
|
||||
};
|
||||
|
||||
export var reportDefParamDateRange = {
|
||||
export let reportDefParamDateRange = {
|
||||
'id': 2005,
|
||||
'name': 'Fake Process instances overview',
|
||||
'created': '2016-10-05T15:39:40.222+0000',
|
||||
'definition': '{ "parameters" :[{"id":"dateRange","name":null,"nameKey":null,"type":"dateRange","value":null,"dependsOn":null}]}'
|
||||
};
|
||||
|
||||
export var reportDefParamRangeInterval = {
|
||||
export let reportDefParamRangeInterval = {
|
||||
'id': 2006,
|
||||
'name': 'Fake Task overview RangeInterval',
|
||||
'created': '2016-10-05T15:39:40.222+0000',
|
||||
'definition': '{ "parameters" :[{"id":"dateRangeInterval","name":null,"nameKey":null,"type":"dateInterval","value":null,"dependsOn":null}]}'
|
||||
};
|
||||
|
||||
export var reportDefParamProcessDef = {
|
||||
export let reportDefParamProcessDef = {
|
||||
'id': 2006,
|
||||
'name': 'Fake Task overview ProcessDefinition',
|
||||
'created': '2016-10-05T15:39:40.222+0000',
|
||||
'definition': '{ "parameters" :[{"id":"processDefinitionId","name":null,"nameKey":null,"type":"processDefinition","value":null,"dependsOn":null}]}'
|
||||
};
|
||||
|
||||
export var reportDefParamProcessDefOptionsNoApp = [
|
||||
export let reportDefParamProcessDefOptionsNoApp = [
|
||||
{
|
||||
'id': 'FakeProcessTest 1:1:1',
|
||||
'name': 'Fake Process Test 1 Name ',
|
||||
@@ -92,7 +92,7 @@ export var reportDefParamProcessDefOptionsNoApp = [
|
||||
}
|
||||
];
|
||||
|
||||
export var reportDefParamProcessDefOptions = {
|
||||
export let reportDefParamProcessDefOptions = {
|
||||
'size': 4, 'total': 4, 'start': 0, 'data': [
|
||||
{
|
||||
'id': 'FakeProcessTest 1:1:1',
|
||||
@@ -117,7 +117,7 @@ export var reportDefParamProcessDefOptions = {
|
||||
]
|
||||
};
|
||||
|
||||
export var reportDefParamProcessDefOptionsApp = {
|
||||
export let reportDefParamProcessDefOptionsApp = {
|
||||
'size': 2, 'total': 2, 'start': 2, 'data': [
|
||||
{
|
||||
'id': 'FakeProcessTest 1:1:1',
|
||||
@@ -132,23 +132,23 @@ export var reportDefParamProcessDefOptionsApp = {
|
||||
]
|
||||
};
|
||||
|
||||
export var reportDefParamTask = {
|
||||
export let reportDefParamTask = {
|
||||
'id': 2006,
|
||||
'name': 'Fake Task service level agreement',
|
||||
'created': '2016-10-05T15:39:40.222+0000',
|
||||
'definition': '{ "parameters" :[{"id":"taskName","name":null,"nameKey":null,"type":"task","value":null,"dependsOn":"processDefinitionId"}]}'
|
||||
};
|
||||
|
||||
export var reportNoParameterDefinitions = {
|
||||
export let reportNoParameterDefinitions = {
|
||||
'id': 2006,
|
||||
'name': 'Fake Task service level agreement',
|
||||
'created': '2016-10-05T15:39:40.222+0000',
|
||||
'definition': '{ "parameters" : []}'
|
||||
};
|
||||
|
||||
export var reportDefParamTaskOptions = ['Fake task name 1', 'Fake task name 2'];
|
||||
export let reportDefParamTaskOptions = ['Fake task name 1', 'Fake task name 2'];
|
||||
|
||||
export var fieldProcessDef = new ReportParameterDetailsModel(
|
||||
export let fieldProcessDef = new ReportParameterDetailsModel(
|
||||
{
|
||||
id: 'processDefinitionId',
|
||||
type: 'processDefinition',
|
||||
|
||||
+150
-131
@@ -72,7 +72,9 @@ describe('AnalyticsGeneratorComponent', () => {
|
||||
|
||||
let translateService = TestBed.get(AlfrescoTranslationService);
|
||||
spyOn(translateService, 'addTranslationFolder').and.stub();
|
||||
spyOn(translateService, 'get').and.callFake((key) => { return Observable.of(key); });
|
||||
spyOn(translateService, 'get').and.callFake((key) => {
|
||||
return Observable.of(key);
|
||||
});
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -80,184 +82,201 @@ describe('AnalyticsGeneratorComponent', () => {
|
||||
component = fixture.componentInstance;
|
||||
debug = fixture.debugElement;
|
||||
element = fixture.nativeElement;
|
||||
fixture.detectChanges();
|
||||
componentHandler = jasmine.createSpyObj('componentHandler', [
|
||||
'upgradeAllRegistered'
|
||||
]);
|
||||
window['componentHandler'] = componentHandler;
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
jasmine.Ajax.install();
|
||||
});
|
||||
|
||||
describe('Rendering tests', () => {
|
||||
beforeEach(() => {
|
||||
jasmine.Ajax.install();
|
||||
afterEach(() => {
|
||||
jasmine.Ajax.uninstall();
|
||||
});
|
||||
|
||||
it('Should render the Process definition overview report ', (done) => {
|
||||
component.onSuccess.subscribe((res) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(res.length).toEqual(3);
|
||||
|
||||
expect(res[0]).toBeDefined();
|
||||
expect(res[0].type).toEqual('table');
|
||||
expect(res[0].datasets).toBeDefined();
|
||||
expect(res[0].datasets.length).toEqual(4);
|
||||
expect(res[0].datasets[0][0]).toEqual('__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-TOTAL-PROCESS-DEFINITIONS');
|
||||
expect(res[0].datasets[0][1]).toEqual('9');
|
||||
expect(res[0].datasets[1][0]).toEqual('__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-TOTAL-PROCESS-INSTANCES');
|
||||
expect(res[0].datasets[1][1]).toEqual('41');
|
||||
expect(res[0].datasets[2][0]).toEqual('__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-ACTIVE-PROCESS-INSTANCES');
|
||||
expect(res[0].datasets[2][1]).toEqual('3');
|
||||
expect(res[0].datasets[3][0]).toEqual('__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-COMPLETED-PROCESS-INSTANCES');
|
||||
expect(res[0].datasets[3][1]).toEqual('38');
|
||||
|
||||
expect(res[1]).toBeDefined();
|
||||
expect(res[1].type).toEqual('pie');
|
||||
|
||||
expect(res[2]).toBeDefined();
|
||||
expect(res[2].type).toEqual('table');
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jasmine.Ajax.uninstall();
|
||||
});
|
||||
component.reportId = 1001;
|
||||
component.reportParamQuery = new ReportQuery({status: 'All'});
|
||||
component.ngOnChanges();
|
||||
|
||||
it('Should render the Process definition overview report ', (done) => {
|
||||
component.onSuccess.subscribe((res) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(res.length).toEqual(3);
|
||||
|
||||
expect(res[0]).toBeDefined();
|
||||
expect(res[0].type).toEqual('table');
|
||||
expect(res[0].datasets).toBeDefined();
|
||||
expect(res[0].datasets.length).toEqual(4);
|
||||
expect(res[0].datasets[0][0]).toEqual('__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-TOTAL-PROCESS-DEFINITIONS');
|
||||
expect(res[0].datasets[0][1]).toEqual('9');
|
||||
expect(res[0].datasets[1][0]).toEqual('__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-TOTAL-PROCESS-INSTANCES');
|
||||
expect(res[0].datasets[1][1]).toEqual('41');
|
||||
expect(res[0].datasets[2][0]).toEqual('__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-ACTIVE-PROCESS-INSTANCES');
|
||||
expect(res[0].datasets[2][1]).toEqual('3');
|
||||
expect(res[0].datasets[3][0]).toEqual('__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-COMPLETED-PROCESS-INSTANCES');
|
||||
expect(res[0].datasets[3][1]).toEqual('38');
|
||||
|
||||
expect(res[1]).toBeDefined();
|
||||
expect(res[1].type).toEqual('pie');
|
||||
|
||||
expect(res[2]).toBeDefined();
|
||||
expect(res[2].type).toEqual('table');
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
let reportId = 1001;
|
||||
let reportParamQuery = new ReportQuery({status: 'All'});
|
||||
|
||||
component.generateReport(reportId, reportParamQuery);
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
status: 200,
|
||||
contentType: 'json',
|
||||
responseText: analyticMock.chartProcessDefOverview
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('Should render the Process definition overview report when onchanges is called ', (done) => {
|
||||
component.onSuccess.subscribe((res) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(res.length).toEqual(3);
|
||||
it('Should render the Process definition overview report when onchanges is called ', (done) => {
|
||||
component.onSuccess.subscribe((res) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(res.length).toEqual(3);
|
||||
|
||||
expect(res[0]).toBeDefined();
|
||||
expect(res[0].type).toEqual('table');
|
||||
expect(res[0].datasets).toBeDefined();
|
||||
expect(res[0].datasets.length).toEqual(4);
|
||||
expect(res[0].datasets[0][0]).toEqual('__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-TOTAL-PROCESS-DEFINITIONS');
|
||||
expect(res[0].datasets[0][1]).toEqual('9');
|
||||
expect(res[0].datasets[1][0]).toEqual('__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-TOTAL-PROCESS-INSTANCES');
|
||||
expect(res[0].datasets[1][1]).toEqual('41');
|
||||
expect(res[0].datasets[2][0]).toEqual('__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-ACTIVE-PROCESS-INSTANCES');
|
||||
expect(res[0].datasets[2][1]).toEqual('3');
|
||||
expect(res[0].datasets[3][0]).toEqual('__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-COMPLETED-PROCESS-INSTANCES');
|
||||
expect(res[0].datasets[3][1]).toEqual('38');
|
||||
expect(res[0]).toBeDefined();
|
||||
expect(res[0].type).toEqual('table');
|
||||
expect(res[0].datasets).toBeDefined();
|
||||
expect(res[0].datasets.length).toEqual(4);
|
||||
expect(res[0].datasets[0][0]).toEqual('__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-TOTAL-PROCESS-DEFINITIONS');
|
||||
expect(res[0].datasets[0][1]).toEqual('9');
|
||||
expect(res[0].datasets[1][0]).toEqual('__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-TOTAL-PROCESS-INSTANCES');
|
||||
expect(res[0].datasets[1][1]).toEqual('41');
|
||||
expect(res[0].datasets[2][0]).toEqual('__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-ACTIVE-PROCESS-INSTANCES');
|
||||
expect(res[0].datasets[2][1]).toEqual('3');
|
||||
expect(res[0].datasets[3][0]).toEqual('__KEY_REPORTING.DEFAULT-REPORTS.PROCESS-DEFINITION-OVERVIEW.GENERAL-TABLE-COMPLETED-PROCESS-INSTANCES');
|
||||
expect(res[0].datasets[3][1]).toEqual('38');
|
||||
|
||||
expect(res[1]).toBeDefined();
|
||||
expect(res[1].type).toEqual('pie');
|
||||
expect(res[1]).toBeDefined();
|
||||
expect(res[1].type).toEqual('pie');
|
||||
|
||||
expect(res[2]).toBeDefined();
|
||||
expect(res[2].type).toEqual('table');
|
||||
expect(res[2]).toBeDefined();
|
||||
expect(res[2].type).toEqual('table');
|
||||
|
||||
done();
|
||||
});
|
||||
done();
|
||||
});
|
||||
|
||||
component.reportId = 1001;
|
||||
component.reportParamQuery = new ReportQuery({status: 'All'});
|
||||
component.ngOnChanges();
|
||||
component.reportId = 1001;
|
||||
component.reportParamQuery = new ReportQuery({status: 'All'});
|
||||
component.ngOnChanges();
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
status: 200,
|
||||
contentType: 'json',
|
||||
responseText: analyticMock.chartProcessDefOverview
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('Should render the Task overview report ', (done) => {
|
||||
component.onSuccess.subscribe((res) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(res.length).toEqual(3);
|
||||
it('Should render the Task overview report ', (done) => {
|
||||
component.onSuccess.subscribe((res) => {
|
||||
expect(res).toBeDefined();
|
||||
expect(res.length).toEqual(3);
|
||||
|
||||
expect(res[0]).toBeDefined();
|
||||
expect(res[0].type).toEqual('bar');
|
||||
expect(res[0].labels).toBeDefined();
|
||||
expect(res[0].labels.length).toEqual(2);
|
||||
expect(res[0].labels[0]).toEqual('2016-09-30T00:00:00.000+0000');
|
||||
expect(res[0].labels[1]).toEqual('2016-10-04T00:00:00.000+0000');
|
||||
expect(res[0].datasets[0].label).toEqual('series1');
|
||||
expect(res[0].datasets[0].data[0]).toEqual(3);
|
||||
expect(res[0].datasets[0].data[1]).toEqual(1);
|
||||
expect(res[0]).toBeDefined();
|
||||
expect(res[0].type).toEqual('bar');
|
||||
expect(res[0].labels).toBeDefined();
|
||||
expect(res[0].labels.length).toEqual(2);
|
||||
expect(res[0].labels[0]).toEqual('2016-09-30T00:00:00.000+0000');
|
||||
expect(res[0].labels[1]).toEqual('2016-10-04T00:00:00.000+0000');
|
||||
expect(res[0].datasets[0].label).toEqual('series1');
|
||||
expect(res[0].datasets[0].data[0]).toEqual(3);
|
||||
expect(res[0].datasets[0].data[1]).toEqual(1);
|
||||
|
||||
expect(res[1]).toBeDefined();
|
||||
expect(res[1].type).toEqual('masterDetailTable');
|
||||
expect(res[1].datasets).toBeDefined();
|
||||
expect(res[1].datasets.length).toEqual(2);
|
||||
expect(res[1].datasets[0][0]).toEqual('fake 1 user task');
|
||||
expect(res[1].datasets[0][1]).toEqual('1');
|
||||
expect(res[1].datasets[0][2]).toEqual('2.0');
|
||||
expect(res[1].datasets[0][3]).toEqual('3.0');
|
||||
expect(res[1].datasets[0][4]).toEqual('4.0');
|
||||
expect(res[1].datasets[0][5]).toEqual('5.0');
|
||||
expect(res[1].datasets[0][6]).toEqual('6.0');
|
||||
expect(res[1].datasets[1][0]).toEqual('fake 2 user task');
|
||||
expect(res[1].datasets[1][1]).toEqual('1');
|
||||
expect(res[1].datasets[1][2]).toEqual('2.0');
|
||||
expect(res[1].datasets[1][3]).toEqual('3.0');
|
||||
expect(res[1].datasets[1][4]).toEqual('4.0');
|
||||
expect(res[1].datasets[1][5]).toEqual('5.0');
|
||||
expect(res[1].datasets[1][6]).toEqual('6.0');
|
||||
expect(res[1]).toBeDefined();
|
||||
expect(res[1].type).toEqual('masterDetailTable');
|
||||
expect(res[1].datasets).toBeDefined();
|
||||
expect(res[1].datasets.length).toEqual(2);
|
||||
expect(res[1].datasets[0][0]).toEqual('fake 1 user task');
|
||||
expect(res[1].datasets[0][1]).toEqual('1');
|
||||
expect(res[1].datasets[0][2]).toEqual('2.0');
|
||||
expect(res[1].datasets[0][3]).toEqual('3.0');
|
||||
expect(res[1].datasets[0][4]).toEqual('4.0');
|
||||
expect(res[1].datasets[0][5]).toEqual('5.0');
|
||||
expect(res[1].datasets[0][6]).toEqual('6.0');
|
||||
expect(res[1].datasets[1][0]).toEqual('fake 2 user task');
|
||||
expect(res[1].datasets[1][1]).toEqual('1');
|
||||
expect(res[1].datasets[1][2]).toEqual('2.0');
|
||||
expect(res[1].datasets[1][3]).toEqual('3.0');
|
||||
expect(res[1].datasets[1][4]).toEqual('4.0');
|
||||
expect(res[1].datasets[1][5]).toEqual('5.0');
|
||||
expect(res[1].datasets[1][6]).toEqual('6.0');
|
||||
|
||||
expect(res[2]).toBeDefined();
|
||||
expect(res[2].type).toEqual('multiBar');
|
||||
expect(res[2].labels).toBeDefined();
|
||||
expect(res[2].labels.length).toEqual(3);
|
||||
expect(res[2].labels[0]).toEqual(1);
|
||||
expect(res[2].labels[1]).toEqual(2);
|
||||
expect(res[2].labels[2]).toEqual(3);
|
||||
expect(res[2].datasets[0].label).toEqual('averages');
|
||||
expect(res[2].datasets[0].data[0]).toEqual(0);
|
||||
expect(res[2].datasets[0].data[1]).toEqual(5);
|
||||
expect(res[2].datasets[0].data[2]).toEqual(2);
|
||||
expect(res[2].datasets[1].label).toEqual('minima');
|
||||
expect(res[2].datasets[1].data[0]).toEqual(0);
|
||||
expect(res[2].datasets[1].data[1]).toEqual(0);
|
||||
expect(res[2].datasets[1].data[2]).toEqual(0);
|
||||
expect(res[2].datasets[2].label).toEqual('maxima');
|
||||
expect(res[2].datasets[2].data[0]).toEqual(0);
|
||||
expect(res[2].datasets[2].data[1]).toEqual(29);
|
||||
expect(res[2].datasets[2].data[2]).toEqual(29);
|
||||
expect(res[2]).toBeDefined();
|
||||
expect(res[2].type).toEqual('multiBar');
|
||||
expect(res[2].labels).toBeDefined();
|
||||
expect(res[2].labels.length).toEqual(3);
|
||||
expect(res[2].labels[0]).toEqual(1);
|
||||
expect(res[2].labels[1]).toEqual(2);
|
||||
expect(res[2].labels[2]).toEqual(3);
|
||||
expect(res[2].datasets[0].label).toEqual('averages');
|
||||
expect(res[2].datasets[0].data[0]).toEqual(0);
|
||||
expect(res[2].datasets[0].data[1]).toEqual(5);
|
||||
expect(res[2].datasets[0].data[2]).toEqual(2);
|
||||
expect(res[2].datasets[1].label).toEqual('minima');
|
||||
expect(res[2].datasets[1].data[0]).toEqual(0);
|
||||
expect(res[2].datasets[1].data[1]).toEqual(0);
|
||||
expect(res[2].datasets[1].data[2]).toEqual(0);
|
||||
expect(res[2].datasets[2].label).toEqual('maxima');
|
||||
expect(res[2].datasets[2].data[0]).toEqual(0);
|
||||
expect(res[2].datasets[2].data[1]).toEqual(29);
|
||||
expect(res[2].datasets[2].data[2]).toEqual(29);
|
||||
|
||||
done();
|
||||
});
|
||||
done();
|
||||
});
|
||||
|
||||
let reportParamQuery = new ReportQuery({status: 'All'});
|
||||
component.reportId = 1;
|
||||
component.generateReport(reportParamQuery);
|
||||
component.reportId = 1;
|
||||
component.reportParamQuery = new ReportQuery({status: 'All'});
|
||||
component.ngOnChanges();
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
status: 200,
|
||||
contentType: 'json',
|
||||
responseText: analyticMock.chartTaskOverview
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('Should reset the reports when the onChanged is call', () => {
|
||||
component.reports = [ new Chart({id: 'fake', type: 'fake-type'})];
|
||||
component.reportId = 1;
|
||||
component.ngOnChanges();
|
||||
it('Should reset the reports when the onChanged is call', () => {
|
||||
component.reports = [new Chart({id: 'fake', type: 'fake-type'})];
|
||||
component.reportId = 1;
|
||||
component.ngOnChanges();
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
expect(component.reports).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
it('Should emit onError event with a 404 response ', (done) => {
|
||||
component.onError.subscribe((err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
it('Should emit onError event with a 404 response ', (done) => {
|
||||
component.onError.subscribe((err) => {
|
||||
expect(err).toBeDefined();
|
||||
done();
|
||||
});
|
||||
|
||||
let reportParamQuery = new ReportQuery({status: 'All'});
|
||||
component.reportId = 1;
|
||||
component.generateReport(reportParamQuery);
|
||||
component.reportId = 1;
|
||||
component.reportParamQuery = new ReportQuery({status: 'All'});
|
||||
component.ngOnChanges();
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
status: 404,
|
||||
contentType: 'json',
|
||||
|
||||
@@ -22,7 +22,6 @@ import { ReportQuery } from '../models/report.model';
|
||||
import { Chart } from '../models/chart.model';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'activiti-analytics-generator',
|
||||
templateUrl: './analytics-generator.component.html',
|
||||
styleUrls: ['./analytics-generator.component.css']
|
||||
@@ -94,7 +93,6 @@ export class AnalyticsGeneratorComponent implements OnChanges {
|
||||
},
|
||||
(err: any) => {
|
||||
this.onError.emit(err);
|
||||
this.logService.error(err);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ declare let jasmine: any;
|
||||
describe('AnalyticsReportHeatMapComponent', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let component: any;
|
||||
let component: AnalyticsReportHeatMapComponent;
|
||||
let fixture: ComponentFixture<AnalyticsReportHeatMapComponent>;
|
||||
let debug: DebugElement;
|
||||
let element: HTMLElement;
|
||||
|
||||
-1
@@ -21,7 +21,6 @@ import { AnalyticsService } from '../services/analytics.service';
|
||||
import { FormGroup, FormBuilder, FormControl } from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'analytics-report-heat-map',
|
||||
templateUrl: './analytics-report-heat-map.component.html'
|
||||
})
|
||||
|
||||
+11
-2
@@ -22,7 +22,6 @@ import { AnalyticsService } from '../services/analytics.service';
|
||||
import { ReportParametersModel } from '../models/report.model';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'analytics-report-list',
|
||||
templateUrl: './analytics-report-list.component.html',
|
||||
styleUrls: ['./analytics-report-list.component.css']
|
||||
@@ -38,6 +37,9 @@ export class AnalyticsReportListComponent implements OnInit {
|
||||
@Input()
|
||||
appId: string;
|
||||
|
||||
@Input()
|
||||
selectFirst: boolean = false;
|
||||
|
||||
@Output()
|
||||
reportClick: EventEmitter<ReportParametersModel> = new EventEmitter<ReportParametersModel>();
|
||||
|
||||
@@ -91,12 +93,14 @@ export class AnalyticsReportListComponent implements OnInit {
|
||||
res.forEach((report) => {
|
||||
this.reportObserver.next(report);
|
||||
});
|
||||
if (this.selectFirst) {
|
||||
this.selectFirstReport();
|
||||
}
|
||||
this.onSuccess.emit(res);
|
||||
}
|
||||
},
|
||||
(err: any) => {
|
||||
this.onError.emit(err);
|
||||
this.logService.error(err);
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -145,6 +149,11 @@ export class AnalyticsReportListComponent implements OnInit {
|
||||
this.reportClick.emit(report);
|
||||
}
|
||||
|
||||
selectFirstReport() {
|
||||
this.selectReport(this.reports[0]);
|
||||
this.selectFirst = false;
|
||||
}
|
||||
|
||||
isSelected(report: any) {
|
||||
return this.currentReport === report ? true : false;
|
||||
}
|
||||
|
||||
+49
-19
@@ -108,7 +108,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
});
|
||||
|
||||
let reportId = 1;
|
||||
let change = new SimpleChange(null, reportId);
|
||||
let change = new SimpleChange(null, reportId, true);
|
||||
component.ngOnChanges({ 'reportId': change });
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
@@ -128,7 +128,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
});
|
||||
|
||||
let reportId = 1;
|
||||
let change = new SimpleChange(null, reportId);
|
||||
let change = new SimpleChange(null, reportId, true);
|
||||
component.ngOnChanges({ 'reportId': change });
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
@@ -155,7 +155,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
});
|
||||
|
||||
let reportId = 1;
|
||||
let change = new SimpleChange(null, reportId);
|
||||
let change = new SimpleChange(null, reportId, true);
|
||||
component.ngOnChanges({ 'reportId': change });
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
@@ -216,7 +216,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
});
|
||||
|
||||
let reportId = 1;
|
||||
let change = new SimpleChange(null, reportId);
|
||||
let change = new SimpleChange(null, reportId, true);
|
||||
component.ngOnChanges({ 'reportId': change });
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
@@ -229,6 +229,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
it('Should render a date range components when the definition parameter type is \'dateRange\' ', (done) => {
|
||||
component.onSuccessReportParams.subscribe(() => {
|
||||
fixture.detectChanges();
|
||||
|
||||
let today = moment().format('YYYY-MM-DD');
|
||||
|
||||
const startDate: any = element.querySelector('#startDateInput');
|
||||
@@ -240,7 +241,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
});
|
||||
|
||||
let reportId = 1;
|
||||
let change = new SimpleChange(null, reportId);
|
||||
let change = new SimpleChange(null, reportId, true);
|
||||
component.ngOnChanges({ 'reportId': change });
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
@@ -265,7 +266,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
});
|
||||
|
||||
let reportId = 1;
|
||||
let change = new SimpleChange(null, reportId);
|
||||
let change = new SimpleChange(null, reportId, true);
|
||||
component.ngOnChanges({ 'reportId': change });
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
@@ -303,7 +304,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
});
|
||||
|
||||
let reportId = 1;
|
||||
let change = new SimpleChange(null, reportId);
|
||||
let change = new SimpleChange(null, reportId, true);
|
||||
component.ngOnChanges({ 'reportId': change });
|
||||
|
||||
});
|
||||
@@ -337,7 +338,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
|
||||
component.appId = appId;
|
||||
component.reportId = '1';
|
||||
let change = new SimpleChange(null, appId);
|
||||
let change = new SimpleChange(null, appId, true);
|
||||
component.ngOnChanges({ 'appId': change });
|
||||
|
||||
});
|
||||
@@ -350,7 +351,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
});
|
||||
|
||||
let reportId = 1;
|
||||
let change = new SimpleChange(null, reportId);
|
||||
let change = new SimpleChange(null, reportId, true);
|
||||
component.ngOnChanges({ 'reportId': change });
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
@@ -400,7 +401,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
});
|
||||
|
||||
let reportId = 1;
|
||||
let change = new SimpleChange(null, reportId);
|
||||
let change = new SimpleChange(null, reportId, true);
|
||||
component.ngOnChanges({ 'reportId': change });
|
||||
|
||||
});
|
||||
@@ -412,7 +413,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
});
|
||||
|
||||
let reportId = 1;
|
||||
let change = new SimpleChange(null, reportId);
|
||||
let change = new SimpleChange(null, reportId, true);
|
||||
component.ngOnChanges({ 'reportId': change });
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
@@ -458,14 +459,16 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
let reportId = 1;
|
||||
let change = new SimpleChange(null, reportId);
|
||||
let change = new SimpleChange(null, reportId, true);
|
||||
component.ngOnChanges({ 'reportId': change });
|
||||
fixture.detectChanges();
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
status: 200,
|
||||
contentType: 'json',
|
||||
responseText: analyticParamsMock.reportDefParamStatus
|
||||
});
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
component.toggleParameters();
|
||||
component.reportId = '1';
|
||||
@@ -480,28 +483,35 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
validForm = true;
|
||||
});
|
||||
|
||||
it('Should be able to change the report title', async(() => {
|
||||
xit('Should be able to change the report title', (done) => {
|
||||
|
||||
let title: HTMLElement = element.querySelector('h4');
|
||||
title.click();
|
||||
fixture.detectChanges();
|
||||
|
||||
let reportName: HTMLInputElement = <HTMLInputElement> element.querySelector('#reportName');
|
||||
expect(reportName).not.toBeNull();
|
||||
|
||||
reportName.focus();
|
||||
component.reportParameters.name = 'FAKE_TEST_NAME';
|
||||
reportName.value = 'FAKE_TEST_NAME';
|
||||
reportName.blur();
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
status: 200,
|
||||
contentType: 'json',
|
||||
responseText: analyticParamsMock.reportDefParamStatus
|
||||
});
|
||||
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
let titleChanged: HTMLElement = element.querySelector('h4');
|
||||
expect(titleChanged.textContent.trim()).toEqual('FAKE_TEST_NAME');
|
||||
done();
|
||||
});
|
||||
}));
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
status: 200,
|
||||
contentType: 'json',
|
||||
responseText: analyticParamsMock.reportDefParamStatus
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
it('Should show a dialog to allowing report save', async(() => {
|
||||
component.saveReportSuccess.subscribe(() => {
|
||||
@@ -515,7 +525,9 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
expect(saveButton).toBeDefined();
|
||||
expect(saveButton).not.toBeNull();
|
||||
saveButton.click();
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
let reportDialogTitle: HTMLElement = <HTMLElement>element.querySelector('#report-dialog-title');
|
||||
@@ -523,11 +535,14 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
let inputSaveName: HTMLInputElement = <HTMLInputElement> element.querySelector('#repName');
|
||||
let performActionButton: HTMLButtonElement = <HTMLButtonElement>element.querySelector('#action-dialog-button');
|
||||
let todayDate = component.getTodayDate();
|
||||
|
||||
expect(reportDialogTitle).not.toBeNull();
|
||||
expect(saveTitleSubMessage).not.toBeNull();
|
||||
expect(inputSaveName.value.trim()).toEqual(analyticParamsMock.reportDefParamStatus.name + ' ( ' + todayDate + ' )');
|
||||
expect(performActionButton).not.toBeNull();
|
||||
|
||||
performActionButton.click();
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
status: 200,
|
||||
contentType: 'json'
|
||||
@@ -539,20 +554,26 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
component.submit(values);
|
||||
fixture.detectChanges();
|
||||
let exportButton: HTMLButtonElement = <HTMLButtonElement>element.querySelector('#export-button');
|
||||
|
||||
expect(exportButton).toBeDefined();
|
||||
expect(exportButton).not.toBeNull();
|
||||
exportButton.click();
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
let reportDialogTitle: HTMLElement = <HTMLElement>element.querySelector('#report-dialog-title');
|
||||
let inputSaveName: HTMLInputElement = <HTMLInputElement> element.querySelector('#repName');
|
||||
let performActionButton: HTMLButtonElement = <HTMLButtonElement>element.querySelector('#action-dialog-button');
|
||||
let todayDate = component.getTodayDate();
|
||||
|
||||
expect(reportDialogTitle).not.toBeNull();
|
||||
expect(inputSaveName.value.trim()).toEqual(analyticParamsMock.reportDefParamStatus.name + ' ( ' + todayDate + ' )');
|
||||
expect(performActionButton).not.toBeNull();
|
||||
|
||||
performActionButton.click();
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
status: 200,
|
||||
contentType: 'json'
|
||||
@@ -568,7 +589,9 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
component.deleteReportSuccess.subscribe((reportId) => {
|
||||
expect(reportId).not.toBeNull();
|
||||
});
|
||||
|
||||
deleteButton.click();
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
status: 200,
|
||||
contentType: 'json'
|
||||
@@ -580,7 +603,9 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
expect(exportButton).toBeDefined();
|
||||
expect(exportButton).not.toBeNull();
|
||||
validForm = false;
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
exportButton = <HTMLButtonElement>element.querySelector('#export-button');
|
||||
@@ -593,7 +618,9 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
expect(saveButton).toBeDefined();
|
||||
expect(saveButton).not.toBeNull();
|
||||
validForm = false;
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
saveButton = <HTMLButtonElement>element.querySelector('#save-button');
|
||||
@@ -609,10 +636,13 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
expect(saveButton).toBeNull();
|
||||
expect(exportButton).toBeNull();
|
||||
validForm = true;
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
|
||||
saveButton = <HTMLButtonElement>element.querySelector('#save-button');
|
||||
exportButton = <HTMLButtonElement>element.querySelector('#export-button');
|
||||
|
||||
expect(saveButton).not.toBeNull();
|
||||
expect(saveButton).toBeDefined();
|
||||
expect(exportButton).not.toBeNull();
|
||||
|
||||
+1
-5
@@ -43,7 +43,6 @@ declare var componentHandler;
|
||||
declare let dialogPolyfill: any;
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'analytics-report-parameters',
|
||||
templateUrl: './analytics-report-parameters.component.html',
|
||||
styleUrls: ['./analytics-report-parameters.component.css']
|
||||
@@ -210,7 +209,6 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On
|
||||
}
|
||||
},
|
||||
(err: any) => {
|
||||
this.logService.error(err);
|
||||
this.onError.emit(err);
|
||||
}
|
||||
);
|
||||
@@ -224,7 +222,6 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On
|
||||
this.onSuccessParamOpt.emit(opts);
|
||||
},
|
||||
(err: any) => {
|
||||
this.logService.error(err);
|
||||
this.onError.emit(err);
|
||||
}
|
||||
);
|
||||
@@ -321,7 +318,6 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On
|
||||
this.onEdit.emit(this.reportParameters.name);
|
||||
},
|
||||
(err: any) => {
|
||||
this.logService.error(err);
|
||||
this.onError.emit(err);
|
||||
}
|
||||
);
|
||||
@@ -369,7 +365,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On
|
||||
doExport(paramQuery: ReportQuery) {
|
||||
this.analyticsService.exportReportToCsv(this.reportId, paramQuery).subscribe(
|
||||
(data: any) => {
|
||||
let blob: Blob = new Blob([data], { type: 'text/csv' });
|
||||
let blob: Blob = new Blob([data], {type: 'text/csv'});
|
||||
this.contentService.downloadBlob(blob, paramQuery.reportName + '.csv');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import { ReportQuery } from '../models/report.model';
|
||||
import { AnalyticsGeneratorComponent } from './analytics-generator.component';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'activiti-analytics',
|
||||
templateUrl: './analytics.component.html',
|
||||
styleUrls: ['./analytics.component.css']
|
||||
|
||||
-1
@@ -20,7 +20,6 @@ import { WidgetComponent } from './../widget.component';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'checkbox-widget',
|
||||
templateUrl: './checkbox.widget.html'
|
||||
})
|
||||
|
||||
-1
@@ -30,7 +30,6 @@ function dateCheck(c: AbstractControl) {
|
||||
declare let mdDateTimePicker: any;
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'date-range-widget',
|
||||
templateUrl: './date-range.widget.html',
|
||||
styleUrls: ['./date-range.widget.css']
|
||||
|
||||
-1
@@ -20,7 +20,6 @@ import { FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { WidgetComponent } from './../widget.component';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'dropdown-widget',
|
||||
templateUrl: './dropdown.widget.html',
|
||||
styleUrls: ['./dropdown.widget.css']
|
||||
|
||||
-1
@@ -21,7 +21,6 @@ import { ReportParameterDetailsModel, ParameterValueModel } from './../../../mod
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'duration-widget',
|
||||
templateUrl: './duration.widget.html',
|
||||
styleUrls: ['./duration.widget.css']
|
||||
|
||||
@@ -20,7 +20,6 @@ import { WidgetComponent } from './../widget.component';
|
||||
import { FormGroup, Validators } from '@angular/forms';
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
selector: 'number-widget',
|
||||
templateUrl: './number.widget.html',
|
||||
styleUrls: ['./number.widget.css']
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
/*!
|
||||
* @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 { ReflectiveInjector } from '@angular/core';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { async } from '@angular/core/testing';
|
||||
import { CoreModule, AlfrescoApiService, LogService } from 'ng2-alfresco-core';
|
||||
import { ReportParametersModel, ParameterValueModel } from '../models/report.model';
|
||||
import { AnalyticsService } from './analytics.service';
|
||||
import { fakeReportList } from '../assets/analytics.service.mock';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
describe('Activiti Analytics Service', () => {
|
||||
|
||||
let service: AnalyticsService;
|
||||
let apiService: AlfrescoApiService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
providers: [
|
||||
AnalyticsService
|
||||
]
|
||||
});
|
||||
service = TestBed.get(AnalyticsService);
|
||||
apiService = TestBed.get(AlfrescoApiService);
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jasmine.Ajax.install();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jasmine.Ajax.uninstall();
|
||||
});
|
||||
|
||||
describe('Content tests', () => {
|
||||
|
||||
it('should return the report list by appId', (done) => {
|
||||
service.getReportList('1').subscribe(
|
||||
(reportList) => {
|
||||
expect(reportList).toBeDefined();
|
||||
expect(reportList.length).toEqual(2);
|
||||
expect(reportList[0].name).toEqual('Fake Report 1');
|
||||
expect(reportList[1].name).toEqual('Fake Report 2');
|
||||
done();
|
||||
}
|
||||
);
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
'status': 200,
|
||||
contentType: 'application/json',
|
||||
responseText: JSON.stringify(fakeReportList)
|
||||
});
|
||||
});
|
||||
|
||||
it('should return the report by report name', (done) => {
|
||||
service.getReportByName('Fake Report 2').subscribe(
|
||||
(report) => {
|
||||
expect(report).toBeDefined();
|
||||
expect(report).not.toBeNull();
|
||||
expect(report.id).toEqual(2);
|
||||
done();
|
||||
}
|
||||
);
|
||||
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
'status': 200,
|
||||
contentType: 'application/json',
|
||||
responseText: JSON.stringify(fakeReportList)
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -55,6 +55,18 @@ export class AnalyticsService {
|
||||
}).catch(err => this.handleError(err));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrive Report by name
|
||||
* @param reportName - string - The name of report
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
getReportByName(reportName: string): Observable<any> {
|
||||
return Observable.fromPromise(this.apiService.getInstance().activiti.reportApi.getReportList())
|
||||
.map((response: any) => {
|
||||
return response.find(report => report.name === reportName);
|
||||
}).catch(err => this.handleError(err));
|
||||
}
|
||||
|
||||
private isReportValid(appId: string, report: ReportParametersModel) {
|
||||
let isValid: boolean = true;
|
||||
if (appId && appId !== '0' && report.name.includes('Process definition overview')) {
|
||||
@@ -94,9 +106,9 @@ export class AnalyticsService {
|
||||
getProcessStatusValues(): Observable<any> {
|
||||
let paramOptions: ParameterValueModel[] = [];
|
||||
|
||||
paramOptions.push(new ParameterValueModel({ id: 'All', name: 'All' }));
|
||||
paramOptions.push(new ParameterValueModel({ id: 'Active', name: 'Active' }));
|
||||
paramOptions.push(new ParameterValueModel({ id: 'Complete', name: 'Complete' }));
|
||||
paramOptions.push(new ParameterValueModel({id: 'All', name: 'All'}));
|
||||
paramOptions.push(new ParameterValueModel({id: 'Active', name: 'Active'}));
|
||||
paramOptions.push(new ParameterValueModel({id: 'Complete', name: 'Complete'}));
|
||||
|
||||
return Observable.create(observer => {
|
||||
observer.next(paramOptions);
|
||||
@@ -107,11 +119,11 @@ export class AnalyticsService {
|
||||
getDateIntervalValues(): Observable<any> {
|
||||
let paramOptions: ParameterValueModel[] = [];
|
||||
|
||||
paramOptions.push(new ParameterValueModel({ id: 'byHour', name: 'By hour' }));
|
||||
paramOptions.push(new ParameterValueModel({ id: 'byDay', name: 'By day' }));
|
||||
paramOptions.push(new ParameterValueModel({ id: 'byWeek', name: 'By week' }));
|
||||
paramOptions.push(new ParameterValueModel({ id: 'byMonth', name: 'By month' }));
|
||||
paramOptions.push(new ParameterValueModel({ id: 'byYear', name: 'By year' }));
|
||||
paramOptions.push(new ParameterValueModel({id: 'byHour', name: 'By hour'}));
|
||||
paramOptions.push(new ParameterValueModel({id: 'byDay', name: 'By day'}));
|
||||
paramOptions.push(new ParameterValueModel({id: 'byWeek', name: 'By week'}));
|
||||
paramOptions.push(new ParameterValueModel({id: 'byMonth', name: 'By month'}));
|
||||
paramOptions.push(new ParameterValueModel({id: 'byYear', name: 'By year'}));
|
||||
|
||||
return Observable.create(observer => {
|
||||
observer.next(paramOptions);
|
||||
@@ -122,9 +134,9 @@ export class AnalyticsService {
|
||||
getMetricValues(): Observable<any> {
|
||||
let paramOptions: ParameterValueModel[] = [];
|
||||
|
||||
paramOptions.push(new ParameterValueModel({ id: 'totalCount', name: 'Number of times a step is executed' }));
|
||||
paramOptions.push(new ParameterValueModel({ id: 'totalTime', name: 'Total time spent in a process step' }));
|
||||
paramOptions.push(new ParameterValueModel({ id: 'avgTime', name: 'Average time spent in a process step' }));
|
||||
paramOptions.push(new ParameterValueModel({id: 'totalCount', name: 'Number of times a step is executed'}));
|
||||
paramOptions.push(new ParameterValueModel({id: 'totalTime', name: 'Total time spent in a process step'}));
|
||||
paramOptions.push(new ParameterValueModel({id: 'avgTime', name: 'Average time spent in a process step'}));
|
||||
|
||||
return Observable.create(observer => {
|
||||
observer.next(paramOptions);
|
||||
@@ -144,7 +156,7 @@ export class AnalyticsService {
|
||||
}
|
||||
|
||||
getProcessDefinitionsValues(appId: string): Observable<any> {
|
||||
let options = { 'appDefinitionId': appId };
|
||||
let options = {'appDefinitionId': appId};
|
||||
return Observable.fromPromise(this.apiService.getInstance().activiti.processDefinitionsApi.getProcessDefinitions(options))
|
||||
.map((res: any) => {
|
||||
let paramOptions: ParameterValueModel[] = [];
|
||||
@@ -160,7 +172,7 @@ export class AnalyticsService {
|
||||
.map((res: any) => {
|
||||
let paramOptions: ParameterValueModel[] = [];
|
||||
res.forEach((opt) => {
|
||||
paramOptions.push(new ParameterValueModel({ id: opt, name: opt }));
|
||||
paramOptions.push(new ParameterValueModel({id: opt, name: opt}));
|
||||
});
|
||||
return paramOptions;
|
||||
}).catch(err => this.handleError(err));
|
||||
@@ -227,7 +239,7 @@ export class AnalyticsService {
|
||||
|
||||
private handleError(error: Response) {
|
||||
this.logService.error(error);
|
||||
return Observable.throw(error.json().error || 'Server error');
|
||||
return Observable.throw(error || 'Server error');
|
||||
}
|
||||
|
||||
toJson(res: any) {
|
||||
|
||||
@@ -16,22 +16,37 @@
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"removeComments": true,
|
||||
"declaration": true,
|
||||
"outDir": "./dist",
|
||||
"baseUrl" : "./",
|
||||
"paths": {
|
||||
"ng2-alfresco-core": ["../ng2-alfresco-core/"],
|
||||
"ng2-alfresco-datatable": ["../ng2-alfresco-datatable/"],
|
||||
"ng2-activiti-diagrams": ["../ng2-activiti-diagrams/"],
|
||||
"ng2-activiti-analytics":["../ng2-activiti-analytics/"],
|
||||
"ng2-activiti-form":["../ng2-activiti-form/"],
|
||||
"ng2-activiti-tasklist": ["../ng2-activiti-tasklist/"],
|
||||
"ng2-activiti-processlist": ["../ng2-activiti-processlist/"],
|
||||
"ng2-alfresco-documentlist": ["../ng2-alfresco-documentlist/"],
|
||||
"ng2-alfresco-login": ["../ng2-alfresco-login/"],
|
||||
"ng2-alfresco-search": ["../ng2-alfresco-search/"],
|
||||
"ng2-alfresco-social": ["../ng2-alfresco-social/"],
|
||||
"ng2-alfresco-tag": ["../ng2-alfresco-tag/"],
|
||||
"ng2-alfresco-upload": ["../ng2-alfresco-upload/"],
|
||||
"ng2-alfresco-viewer": ["../ng2-alfresco-viewer/"],
|
||||
"ng2-alfresco-webscript": ["../ng2-alfresco-webscript/"],
|
||||
"ng2-alfresco-userinfo": ["../ng2-alfresco-userinfo"],
|
||||
"alfresco-js-api": ["../node_modules/alfresco-js-api/"]
|
||||
},
|
||||
"lib": [
|
||||
"es2015",
|
||||
"dom"
|
||||
],
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
],
|
||||
"suppressImplicitAnyIndexErrors": true
|
||||
},
|
||||
"exclude": [
|
||||
"demo",
|
||||
"node_modules",
|
||||
"dist",
|
||||
"tools",
|
||||
"gulpfile.ts",
|
||||
"gulpfile.d.ts"
|
||||
"dist"
|
||||
],
|
||||
"angularCompilerOptions": {
|
||||
"strictMetadataEmit": false,
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
const webpack = require('webpack');
|
||||
const webpackMerge = require('webpack-merge');
|
||||
const commonConfig = require('./config/webpack.common.js');
|
||||
|
||||
module.exports = webpackMerge(commonConfig, {
|
||||
|
||||
output: {
|
||||
filename: './bundles/[name].js',
|
||||
library: '[name]',
|
||||
libraryTarget: 'umd',
|
||||
chunkFilename: '[id].chunk.js'
|
||||
},
|
||||
|
||||
entry: {
|
||||
"ng2-activiti-analytics": "./index.ts"
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,8 @@
|
||||
const webpack = require('webpack');
|
||||
const webpackMerge = require('webpack-merge');
|
||||
const testConfig = require('./config/webpack.test.js');
|
||||
|
||||
module.exports = webpackMerge(testConfig, {
|
||||
|
||||
|
||||
});
|
||||
@@ -1,6 +1,7 @@
|
||||
npm-debug.log
|
||||
node_modules
|
||||
.idea
|
||||
.npmrc
|
||||
typings
|
||||
coverage
|
||||
dist
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
npm-debug.log
|
||||
.idea
|
||||
.npmrc
|
||||
|
||||
coverage/
|
||||
demo/
|
||||
|
||||
@@ -104,7 +104,12 @@ Follow the 3 steps below:
|
||||
This component shows the diagram of a process.
|
||||
|
||||
```html
|
||||
<activiti-diagrams [processDefinitionId]="processDefinitionId"></activiti-diagrams>
|
||||
<activiti-diagram [processDefinitionId]="processDefinitionId"></activiti-diagram>
|
||||
```
|
||||
Or below component shows the diagram of a running process instance with the activities highlighted according to their state (Active/Completed/Pending).
|
||||
|
||||
```html
|
||||
<activiti-diagram [processInstanceId]="processInstanceId"></activiti-diagram>
|
||||
```
|
||||
|
||||
Usage example of this component :
|
||||
@@ -165,7 +170,9 @@ platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
|
||||
| Name | Description |
|
||||
| --- | --- |
|
||||
| `metricPercentage` | The array that contains the percentage of the time for each element |
|
||||
| `metricPercentages` | The array that contains the percentage of the time for each element |
|
||||
| `metricColor` | The array that contains the color for each element |
|
||||
| `metricType` | The string that specifies the metric type |
|
||||
|
||||
## Build from sources
|
||||
|
||||
@@ -219,7 +226,6 @@ npm start
|
||||
| Command | Description |
|
||||
| --- | --- |
|
||||
| npm run build | Build component |
|
||||
| npm run build:w | Build component and keep watching the changes |
|
||||
| npm run test | Run unit tests in the console |
|
||||
| npm run test-browser | Run unit tests in the browser
|
||||
| npm run coverage | Run unit tests and display code coverage report |
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
@@ -0,0 +1,14 @@
|
||||
@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.
|
||||
-3
@@ -21,7 +21,6 @@
|
||||
"interface-name": false,
|
||||
"jsdoc-format": true,
|
||||
"label-position": true,
|
||||
"label-undefined": true,
|
||||
"max-line-length": [
|
||||
true,
|
||||
180
|
||||
@@ -47,7 +46,6 @@
|
||||
"no-construct": true,
|
||||
"no-constructor-vars": false,
|
||||
"no-debugger": true,
|
||||
"no-duplicate-key": true,
|
||||
"no-duplicate-variable": true,
|
||||
"no-empty": false,
|
||||
"no-eval": true,
|
||||
@@ -57,7 +55,6 @@
|
||||
"no-shadowed-variable": true,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-trailing-whitespace": true,
|
||||
"no-unreachable": true,
|
||||
"no-unused-expression": true,
|
||||
"no-unused-variable": true,
|
||||
"no-use-before-declare": true,
|
||||
@@ -0,0 +1,70 @@
|
||||
var path = require('path');
|
||||
var loaderUtils = require('loader-utils');
|
||||
|
||||
module.exports = function(content) {
|
||||
this.cacheable && this.cacheable();
|
||||
if(!this.emitFile) throw new Error('emitFile is required from module system');
|
||||
|
||||
var query = loaderUtils.getOptions(this) || {};
|
||||
var configKey = query.config || 'multiFileLoader';
|
||||
var options = this.options[configKey] || {};
|
||||
var config = {
|
||||
publicPath: false,
|
||||
useRelativePath: false,
|
||||
name: '[hash].[ext]'
|
||||
};
|
||||
|
||||
// options takes precedence over config
|
||||
Object.keys(options).forEach(function(attr) {
|
||||
config[attr] = options[attr];
|
||||
});
|
||||
|
||||
// query takes precedence over config and options
|
||||
Object.keys(query).forEach(function(attr) {
|
||||
config[attr] = query[attr];
|
||||
});
|
||||
|
||||
var context = config.context || this.options.context;
|
||||
var url = loaderUtils.interpolateName(this, config.name, {
|
||||
context: context,
|
||||
content: content,
|
||||
regExp: config.regExp
|
||||
});
|
||||
var path = loaderUtils.interpolateName(this, '[path]', {
|
||||
context: context,
|
||||
content: content,
|
||||
regExp: config.regExp
|
||||
});
|
||||
|
||||
var outputPath = '';
|
||||
|
||||
if (config.outputPath) {
|
||||
outputPath = (
|
||||
typeof config.outputPath === 'function'
|
||||
? config.outputPath(url, path)
|
||||
: config.outputPath + url
|
||||
);
|
||||
} else {
|
||||
outputPath = url;
|
||||
}
|
||||
|
||||
var publicPath = JSON.stringify(url);
|
||||
|
||||
if (config.publicPath) {
|
||||
publicPath = JSON.stringify(
|
||||
typeof config.publicPath === 'function'
|
||||
? config.publicPath(url, path)
|
||||
: config.publicPath + url
|
||||
);
|
||||
}
|
||||
|
||||
publicPath = '__webpack_public_path__ + ' + publicPath;
|
||||
|
||||
if (query.emitFile === undefined || query.emitFile) {
|
||||
this.emitFile(outputPath, content);
|
||||
}
|
||||
|
||||
return 'module.exports = ' + publicPath + ';';
|
||||
};
|
||||
|
||||
module.exports.raw = true;
|
||||
@@ -0,0 +1,67 @@
|
||||
var path = require('path');
|
||||
var loaderUtils = require('loader-utils');
|
||||
var fs = require('fs');
|
||||
|
||||
var licenseFileUtf8Store = undefined;
|
||||
|
||||
function readLicenseHeaderFile(licenseFilePath) {
|
||||
if (licenseFileUtf8Store) {
|
||||
return licenseFileUtf8Store;
|
||||
}
|
||||
|
||||
if (fs.existsSync(licenseFilePath)) {
|
||||
licenseFileUtf8Store = fs.readFileSync(licenseFilePath, 'utf8').split(/\r?\n/);
|
||||
return licenseFileUtf8Store;
|
||||
}
|
||||
|
||||
throw new Error('The license header file path is wrong ' + licenseFilePath);
|
||||
}
|
||||
|
||||
function isFileEmpty(fileContents) {
|
||||
return fileContents.toString('utf8').trim() === '';
|
||||
}
|
||||
|
||||
function readCurrentFile(fileContent) {
|
||||
return fileContent.toString('utf8').split(/\r?\n/);
|
||||
}
|
||||
|
||||
function isLicenseHeaderPresent(currentFileContent, licenseFilePath) {
|
||||
if (!isFileEmpty(currentFileContent)) {
|
||||
var currentFileUtf8 = readCurrentFile(currentFileContent),
|
||||
licenseFileUtf8 = readLicenseHeaderFile(licenseFilePath);
|
||||
skipStrict = 0;
|
||||
|
||||
if(currentFileUtf8[0] === '"use strict";' ) {
|
||||
skipStrict = 1;
|
||||
}
|
||||
|
||||
for (var i = skipStrict; i < licenseFileUtf8.length; i++) {
|
||||
if (currentFileUtf8[i + skipStrict] !== licenseFileUtf8[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function report(hasHeader, emitter, filename) {
|
||||
if (hasHeader) return;
|
||||
emitter('Missing license header file : ' + filename);
|
||||
}
|
||||
|
||||
function licenseCheck(webpackInstance, input, options) {
|
||||
var isLicensePresent = isLicenseHeaderPresent(input, options.licenseFile);
|
||||
|
||||
var emitter = options.emitErrors ? webpackInstance.emitError : webpackInstance.emitWarning;
|
||||
|
||||
report(isLicensePresent, emitter, webpackInstance.resourcePath);
|
||||
}
|
||||
|
||||
module.exports = function(input, map) {
|
||||
this.cacheable && this.cacheable();
|
||||
var callback = this.async();
|
||||
|
||||
var options = loaderUtils.getOptions(this);
|
||||
licenseCheck(this, input, options);
|
||||
callback(null, input, map);
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
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;
|
||||
@@ -0,0 +1,124 @@
|
||||
const webpack = require('webpack');
|
||||
const helpers = require('./helpers');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
|
||||
resolveLoader: {
|
||||
alias: {
|
||||
"file-multi-loader": path.resolve(__dirname, "./custom-loaders/file-loader-multi"),
|
||||
"license-check": path.resolve(__dirname, "./custom-loaders/license-check")
|
||||
}
|
||||
},
|
||||
|
||||
// require those dependencies but don't bundle them
|
||||
externals: [
|
||||
/^\@angular\//,
|
||||
/^rxjs\//,
|
||||
'moment',
|
||||
'raphael',
|
||||
'ng2-charts',
|
||||
'alfresco-js-api',
|
||||
'ng2-alfresco-core',
|
||||
'ng2-alfresco-datatable',
|
||||
'ng2-activiti-analytics',
|
||||
'ng2-activiti-diagrams',
|
||||
'ng2-activiti-form',
|
||||
"ng2-activiti-tasklist",
|
||||
'ng2-alfresco-documentlist'
|
||||
],
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.js$/,
|
||||
loader: 'source-map-loader',
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.ts$/,
|
||||
use: 'source-map-loader',
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.ts$/,
|
||||
loader: 'tslint-loader',
|
||||
options: {
|
||||
emitErrors: true,
|
||||
configFile: path.resolve(__dirname, './assets/tslint.json')
|
||||
},
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.ts$/,
|
||||
use: ['ts-loader', 'angular2-template-loader'],
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
loader: 'html-loader',
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
loader: ['to-string-loader', 'css-loader'],
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},{
|
||||
enforce: 'pre',
|
||||
test: /\.ts$/,
|
||||
loader: 'license-check',
|
||||
options: {
|
||||
emitErrors: true,
|
||||
licenseFile: path.resolve(__dirname, './assets/license_header.txt')
|
||||
},
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/, /rendering-queue.services.ts/ ],
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
|
||||
loader: 'file-multi-loader',
|
||||
query: {
|
||||
name: '[name].[hash].[ext]',
|
||||
outputPath: (url, resourcePath)=> {
|
||||
return resourcePath.replace('src', 'bundles') + url;
|
||||
},
|
||||
publicPath: (url, resourcePath)=> {
|
||||
var component = resourcePath.substring(0, resourcePath.indexOf('src'));
|
||||
var path = resourcePath.replace(component, '').replace('src/', '');
|
||||
return path + url;
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
resolve: {
|
||||
extensions: ['.ts', '.js'],
|
||||
symlinks: false,
|
||||
modules: [
|
||||
'../ng2-components', 'node_modules'
|
||||
]
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
|
||||
new webpack.BannerPlugin(fs.readFileSync(path.resolve(__dirname, './assets/license_header_add.txt'), 'utf8')),
|
||||
|
||||
new webpack.ContextReplacementPlugin(
|
||||
/angular(\\|\/)core(\\|\/)@angular/,
|
||||
helpers.root('./src'),
|
||||
{}
|
||||
)
|
||||
],
|
||||
|
||||
devtool: 'cheap-module-source-map',
|
||||
|
||||
node: {
|
||||
fs: 'empty',
|
||||
module: false
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,85 @@
|
||||
const webpack = require('webpack');
|
||||
const helpers = require('./helpers');
|
||||
|
||||
const ENV = process.env.NODE_ENV = process.env.ENV = 'production';
|
||||
|
||||
module.exports = {
|
||||
|
||||
devtool: 'inline-source-map',
|
||||
|
||||
resolve: {
|
||||
extensions: ['.ts', '.js'],
|
||||
symlinks: false,
|
||||
modules: [helpers.root('../ng2-components'), helpers.root('node_modules')]
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
enforce: 'pre',
|
||||
test: /\.js$/,
|
||||
loader: 'source-map-loader',
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.ts$/,
|
||||
loaders: ['ts-loader?' + JSON.stringify({ transpileOnly: true}), 'angular2-template-loader'],
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.html$/,
|
||||
loader: 'html-loader',
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
||||
loader: ['to-string-loader', 'css-loader'],
|
||||
exclude: [/node_modules/, /bundles/, /dist/, /demo/]
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico|pdf)$/,
|
||||
loader: 'file-loader',
|
||||
query: {
|
||||
name: '[path][name].[ext]',
|
||||
outputPath: (url)=> {
|
||||
return url.replace('src', 'dist');
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
enforce: 'post',
|
||||
test: /\.ts$/,
|
||||
loader: 'istanbul-instrumenter-loader',
|
||||
exclude: [
|
||||
/node_modules/,
|
||||
/test/
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
|
||||
new webpack.ContextReplacementPlugin(
|
||||
/angular(\\|\/)core(\\|\/)@angular/,
|
||||
helpers.root('./src'),
|
||||
{}
|
||||
),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': {
|
||||
'ENV': JSON.stringify(ENV)
|
||||
}
|
||||
}),
|
||||
new webpack.LoaderOptionsPlugin({
|
||||
htmlLoader: {
|
||||
minimize: false // workaround for ng2
|
||||
}
|
||||
})
|
||||
],
|
||||
|
||||
node: {
|
||||
fs: 'empty',
|
||||
module: false
|
||||
}
|
||||
};
|
||||
@@ -5,14 +5,14 @@
|
||||
"author": "Alfresco Software, Ltd.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"clean": "npm install rimraf && npm run clean-build && rimraf dist node_modules typings dist",
|
||||
"clean": "npm run clean-build && rimraf dist node_modules typings dist",
|
||||
"clean-build" : "rimraf 'src/{,**/}**.js' 'src/{,**/}**.js.map' 'src/{,**/}**.d.ts'",
|
||||
"postinstall": "npm run build",
|
||||
"start": "npm run build && concurrently \"npm run tsc:w\" \"npm run server\" ",
|
||||
"server": "wsrv -o -s -l",
|
||||
"build": "npm run tslint && npm run clean-build && npm run tsc",
|
||||
"build:w": "npm run tslint && rimraf dist && npm run tsc:w",
|
||||
"travis": "npm link ng2-alfresco-core",
|
||||
"travis": "npm link ng2-alfresco-core ng2-activiti-diagrams",
|
||||
"tsc": "tsc",
|
||||
"tsc:w": "tsc -w",
|
||||
"tslint": "tslint -c tslint.json *.ts && tslint -c tslint.json src/{,**/}**.ts -e '{,**/}**.d.ts'"
|
||||
@@ -32,32 +32,34 @@
|
||||
"activiti-diagrams"
|
||||
],
|
||||
"dependencies": {
|
||||
"@angular/common": "2.2.2",
|
||||
"@angular/compiler": "2.2.2",
|
||||
"@angular/compiler-cli": "2.2.2",
|
||||
"@angular/core": "2.2.2",
|
||||
"@angular/forms": "2.2.2",
|
||||
"@angular/http": "2.2.2",
|
||||
"@angular/platform-browser": "2.2.2",
|
||||
"@angular/platform-browser-dynamic": "2.2.2",
|
||||
"@angular/animations": "~4.0.0",
|
||||
"@angular/common": "~4.0.0",
|
||||
"@angular/compiler": "~4.0.0",
|
||||
"@angular/core": "~4.0.0",
|
||||
"@angular/forms": "~4.0.0",
|
||||
"@angular/http": "~4.0.0",
|
||||
"@angular/platform-browser": "~4.0.0",
|
||||
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||
"@angular/router": "~4.0.0",
|
||||
|
||||
"@angular/material": "2.0.0-beta.1",
|
||||
"@angular/router": "3.2.2",
|
||||
"@angular/upgrade": "2.2.2",
|
||||
"alfresco-js-api": "~1.4.0",
|
||||
"alfresco-js-api": "~1.5.0",
|
||||
"core-js": "2.4.1",
|
||||
"hammerjs": "2.0.8",
|
||||
"ng2-alfresco-core": "1.5.0",
|
||||
"ng2-translate": "5.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.4.0",
|
||||
"ng2-alfresco-core": "1.4.0",
|
||||
"ng2-translate": "2.5.0",
|
||||
"raphael": "^2.2.6",
|
||||
"reflect-metadata": "0.1.10",
|
||||
"rxjs": "5.0.0-beta.12",
|
||||
"systemjs": "0.19.27",
|
||||
"zone.js": "0.6.26"
|
||||
"ng2-activiti-diagrams": "1.5.0",
|
||||
"raphael": "^2.2.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jasmine": "^2.2.33",
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
|
||||
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
|
||||
'@angular/material': 'npm:@angular/material/bundles/material.umd.js',
|
||||
'@angular/animations': 'npm:@angular/animations/bundles/animations.umd.min.js',
|
||||
'@angular/animations/browser':'npm:@angular/animations/bundles/animations-browser.umd.js',
|
||||
'@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js',
|
||||
|
||||
// other libraries
|
||||
'rxjs': 'npm:rxjs',
|
||||
@@ -44,8 +47,8 @@
|
||||
'moment': { defaultExtension: 'js' },
|
||||
'ng2-translate': { defaultExtension: 'js' },
|
||||
'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'},
|
||||
'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'},
|
||||
'ng2-activiti-diagrams': { main: './index.js', defaultExtension: 'js'}
|
||||
'ng2-alfresco-core': { main: './bundles/ng2-alfresco-core.js', defaultExtension: 'js'},
|
||||
'ng2-activiti-diagrams': { main: './bundles/ng2-activiti-diagrams.js', defaultExtension: 'js'}
|
||||
}
|
||||
});
|
||||
})(this);
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
],
|
||||
"no-any": false,
|
||||
"no-arg": true,
|
||||
"no-bitwise": true,
|
||||
"no-bitwise": false,
|
||||
"no-conditional-assignment": true,
|
||||
"no-consecutive-blank-lines": true,
|
||||
"no-console": [
|
||||
@@ -52,11 +52,11 @@
|
||||
"no-debugger": true,
|
||||
"no-duplicate-key": true,
|
||||
"no-duplicate-variable": true,
|
||||
"no-empty": true,
|
||||
"no-empty": false,
|
||||
"no-eval": true,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": true,
|
||||
"no-require-imports": true,
|
||||
"no-require-imports": false,
|
||||
"no-shadowed-variable": true,
|
||||
"no-switch-case-fall-through": true,
|
||||
"no-trailing-whitespace": true,
|
||||
|
||||
@@ -1,310 +0,0 @@
|
||||
import * as gulp from 'gulp';
|
||||
import * as util from 'gulp-util';
|
||||
import * as runSequence from 'run-sequence';
|
||||
import * as gulpLoadPlugins from 'gulp-load-plugins';
|
||||
import * as merge from 'merge-stream';
|
||||
import * as rimraf from 'rimraf';
|
||||
import { join } from 'path';
|
||||
import * as Builder from 'systemjs-builder';
|
||||
var autoprefixer = require('autoprefixer');
|
||||
import * as cssnano from 'cssnano';
|
||||
import * as filter from 'gulp-filter';
|
||||
import * as sourcemaps from 'gulp-sourcemaps';
|
||||
|
||||
var APP_SRC = `.`;
|
||||
var CSS_PROD_BUNDLE = 'main.css';
|
||||
var JS_PROD_SHIMS_BUNDLE = 'shims.js';
|
||||
var NG_FACTORY_FILE = 'main-prod';
|
||||
|
||||
const BUILD_TYPES = {
|
||||
DEVELOPMENT: 'dev',
|
||||
PRODUCTION: 'prod'
|
||||
};
|
||||
|
||||
function normalizeDependencies(deps) {
|
||||
deps
|
||||
.filter((d) => !/\*/.test(d.src)) // Skip globs
|
||||
.forEach((d) => d.src = require.resolve(d.src));
|
||||
return deps;
|
||||
}
|
||||
|
||||
function filterDependency(type: string, d): boolean {
|
||||
const t = d.buildType || d.env;
|
||||
d.buildType = t;
|
||||
if (!t) {
|
||||
d.buildType = Object.keys(BUILD_TYPES).map(k => BUILD_TYPES[k]);
|
||||
}
|
||||
if (!(d.buildType instanceof Array)) {
|
||||
(<any>d).env = [d.buildType];
|
||||
}
|
||||
return d.buildType.indexOf(type) >= 0;
|
||||
}
|
||||
|
||||
function getInjectableDependency() {
|
||||
var APP_ASSETS = [
|
||||
{src: `src/css/main.css`, inject: true, vendor: false},
|
||||
];
|
||||
|
||||
var NPM_DEPENDENCIES = [
|
||||
{src: 'zone.js/dist/zone.js', inject: 'libs'},
|
||||
{src: 'core-js/client/shim.min.js', inject: 'shims'},
|
||||
{src: 'systemjs/dist/system.src.js', inject: 'shims', buildType:'dev'}
|
||||
];
|
||||
|
||||
return normalizeDependencies(NPM_DEPENDENCIES.filter(filterDependency.bind(null, 'dev')))
|
||||
.concat(APP_ASSETS.filter(filterDependency.bind(null, 'dev')));
|
||||
}
|
||||
|
||||
const plugins = <any>gulpLoadPlugins();
|
||||
|
||||
let tsProjects: any = {};
|
||||
|
||||
function makeTsProject(options: Object = {}) {
|
||||
let optionsHash = JSON.stringify(options);
|
||||
if (!tsProjects[optionsHash]) {
|
||||
let config = Object.assign({
|
||||
typescript: require('typescript')
|
||||
}, options);
|
||||
tsProjects[optionsHash] =
|
||||
plugins.typescript.createProject('tsconfig.json', config);
|
||||
}
|
||||
return tsProjects[optionsHash];
|
||||
}
|
||||
|
||||
gulp.task('build.html_css', () => {
|
||||
const gulpConcatCssConfig = {
|
||||
targetFile: CSS_PROD_BUNDLE,
|
||||
options: {
|
||||
rebaseUrls: false
|
||||
}
|
||||
};
|
||||
|
||||
const processors = [
|
||||
autoprefixer({
|
||||
browsers: [
|
||||
'ie >= 10',
|
||||
'ie_mob >= 10',
|
||||
'ff >= 30',
|
||||
'chrome >= 34',
|
||||
'safari >= 7',
|
||||
'opera >= 23',
|
||||
'ios >= 7',
|
||||
'android >= 4.4',
|
||||
'bb >= 10'
|
||||
]
|
||||
})
|
||||
];
|
||||
|
||||
const reportPostCssError = (e: any) => util.log(util.colors.red(e.message));
|
||||
|
||||
processors.push(
|
||||
cssnano({
|
||||
discardComments: {removeAll: true},
|
||||
discardUnused: false, // unsafe, see http://goo.gl/RtrzwF
|
||||
zindex: false, // unsafe, see http://goo.gl/vZ4gbQ
|
||||
reduceIdents: false // unsafe, see http://goo.gl/tNOPv0
|
||||
})
|
||||
);
|
||||
|
||||
/**
|
||||
* Processes the CSS files within `src/client` excluding those in `src/client/assets` using `postcss` with the
|
||||
* configured processors
|
||||
* Execute the appropriate component-stylesheet processing method based on user stylesheet preference.
|
||||
*/
|
||||
function processComponentStylesheets() {
|
||||
return gulp.src(join('src/**', '*.css'))
|
||||
.pipe(plugins.cached('process-component-css'))
|
||||
.pipe(plugins.postcss(processors))
|
||||
.on('error', reportPostCssError);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a stream of external css files for subsequent processing.
|
||||
*/
|
||||
function getExternalCssStream() {
|
||||
return gulp.src(getExternalCss())
|
||||
.pipe(plugins.cached('process-external-css'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array of filenames referring to all external css stylesheets.
|
||||
*/
|
||||
function getExternalCss() {
|
||||
return getInjectableDependency().filter(dep => /\.css$/.test(dep.src)).map(dep => dep.src);
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the external CSS files using `postcss` with the configured processors.
|
||||
*/
|
||||
function processExternalCss() {
|
||||
return getExternalCssStream()
|
||||
.pipe(plugins.postcss(processors))
|
||||
.pipe(plugins.concatCss(gulpConcatCssConfig.targetFile, gulpConcatCssConfig.options))
|
||||
.on('error', reportPostCssError);
|
||||
}
|
||||
|
||||
return merge(processComponentStylesheets(), processExternalCss());
|
||||
|
||||
});
|
||||
|
||||
gulp.task('build.bundles.app', (done) => {
|
||||
var BUNDLER_OPTIONS = {
|
||||
format: 'umd',
|
||||
minify: false,
|
||||
mangle: false,
|
||||
sourceMaps: true
|
||||
};
|
||||
var CONFIG_TYPESCRIPT = {
|
||||
baseURL: '.',
|
||||
transpiler: 'typescript',
|
||||
typescriptOptions: {
|
||||
module: 'cjs'
|
||||
},
|
||||
map: {
|
||||
typescript: 'node_modules/typescript/lib/typescript.js',
|
||||
'@angular': 'node_modules/@angular',
|
||||
rxjs: 'node_modules/rxjs',
|
||||
'ng2-translate': 'node_modules/ng2-translate',
|
||||
'alfresco-js-api': 'node_modules/alfresco-js-api/dist/alfresco-js-api',
|
||||
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core/',
|
||||
'ng2-activiti-diagrams': 'node_modules/ng2-activiti-diagrams/',
|
||||
'ng2-activiti-analytics': 'node_modules/ng2-activiti-analytics/',
|
||||
'ng2-alfresco-datatable': 'node_modules/ng2-alfresco-datatable/',
|
||||
'ng2-alfresco-documentlist': 'node_modules/ng2-alfresco-documentlist/',
|
||||
'ng2-activiti-form': 'node_modules/ng2-activiti-form/',
|
||||
'ng2-alfresco-login': 'node_modules/ng2-alfresco-login/',
|
||||
'ng2-activiti-processlist': 'node_modules/ng2-activiti-processlist/',
|
||||
'ng2-alfresco-search': 'node_modules/ng2-alfresco-search/',
|
||||
'ng2-activiti-tasklist': 'node_modules/ng2-activiti-tasklist/',
|
||||
'ng2-alfresco-tag': 'node_modules/ng2-alfresco-tag/',
|
||||
'ng2-alfresco-upload': 'node_modules/ng2-alfresco-upload/',
|
||||
'ng2-alfresco-userinfo': 'node_modules/ng2-alfresco-userinfo/',
|
||||
'ng2-alfresco-viewer': 'node_modules/ng2-alfresco-viewer/',
|
||||
'ng2-alfresco-webscript': 'node_modules/ng2-alfresco-webscript/',
|
||||
'ng2-charts' : 'node_modules/ng2-charts',
|
||||
'raphael':'node_modules/raphael/raphael'
|
||||
|
||||
},
|
||||
paths: {
|
||||
'*': '*.js'
|
||||
},
|
||||
meta: {
|
||||
'node_modules/@angular/*': {build: false},
|
||||
'node_modules/rxjs/*': {build: false},
|
||||
'node_modules/ng2-translate/*': {build: false},
|
||||
'node_modules/ng2-alfresco-core/*': {build: false},
|
||||
'node_modules/ng2-activiti-diagrams/*': {build: false},
|
||||
'node_modules/ng2-activiti-analytics/*': {build: false},
|
||||
'node_modules/ng2-alfresco-datatable/*': {build: false},
|
||||
'node_modules/ng2-alfresco-documentlist/*': {build: false},
|
||||
'node_modules/ng2-activiti-form/*': {build: false},
|
||||
'node_modules/ng2-alfresco-login/*': {build: false},
|
||||
'node_modules/ng2-activiti-processlist/*': {build: false},
|
||||
'node_modules/ng2-alfresco-search/*': {build: false},
|
||||
'node_modules/ng2-activiti-tasklist/*': {build: false},
|
||||
'node_modules/ng2-alfresco-tag/*': {build: false},
|
||||
'node_modules/ng2-alfresco-upload/*': {build: false},
|
||||
'node_modules/ng2-alfresco-userinfo/*': {build: false},
|
||||
'node_modules/ng2-alfresco-viewer/*': {build: false},
|
||||
'node_modules/ng2-alfresco-webscript/*': {build: false}
|
||||
}
|
||||
};
|
||||
|
||||
var pkg = require('./package.json');
|
||||
var namePkg = pkg.name;
|
||||
|
||||
var builder = new Builder(CONFIG_TYPESCRIPT);
|
||||
builder
|
||||
.buildStatic(APP_SRC + "/index", 'bundles/' + namePkg + '.js', BUNDLER_OPTIONS)
|
||||
.then(function () {
|
||||
return done();
|
||||
})
|
||||
.catch(function (err) {
|
||||
return done(err);
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('build.assets.prod', () => {
|
||||
return gulp.src([
|
||||
join('src/**', '*.ts'),
|
||||
'index.ts',
|
||||
join('src/**', '*.css'),
|
||||
join('src/**', '*.html'),
|
||||
'!'+join('*/**', '*.d.ts'),
|
||||
'!'+join('*/**', '*.spec.ts'),
|
||||
'!gulpfile.ts'])
|
||||
|
||||
});
|
||||
|
||||
gulp.task('build.bundles', () => {
|
||||
merge(bundleShims());
|
||||
|
||||
/**
|
||||
* Returns the shim files to be injected.
|
||||
*/
|
||||
function getShims() {
|
||||
let libs = getInjectableDependency()
|
||||
.filter(d => /\.js$/.test(d.src));
|
||||
|
||||
return libs.filter(l => l.inject === 'shims')
|
||||
.concat(libs.filter(l => l.inject === 'libs'))
|
||||
.concat(libs.filter(l => l.inject === true))
|
||||
.map(l => l.src);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bundles the shim files.
|
||||
*/
|
||||
function bundleShims() {
|
||||
return gulp.src(getShims())
|
||||
.pipe(plugins.concat(JS_PROD_SHIMS_BUNDLE))
|
||||
// Strip the first (global) 'use strict' added by reflect-metadata, but don't strip any others to avoid unintended scope leaks.
|
||||
.pipe(plugins.replace(/('|")use strict\1;var Reflect;/, 'var Reflect;'))
|
||||
.pipe(gulp.dest('bundles'));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
gulp.task('build.js.prod', () => {
|
||||
const INLINE_OPTIONS = {
|
||||
base: APP_SRC,
|
||||
target: 'es5',
|
||||
useRelativePaths: true,
|
||||
removeLineBreaks: true
|
||||
};
|
||||
|
||||
let tsProject = makeTsProject();
|
||||
let src = [
|
||||
join('src/**/*.ts'),
|
||||
join('!src/**/*.d.ts'),
|
||||
join('!src/**/*.spec.ts'),
|
||||
`!src/**/${NG_FACTORY_FILE}.ts`
|
||||
];
|
||||
|
||||
let result = gulp.src(src)
|
||||
.pipe(plugins.plumber())
|
||||
.pipe(plugins.inlineNg2Template(INLINE_OPTIONS))
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(tsProject())
|
||||
.once('error', function (e: any) {
|
||||
this.once('finish', () => process.exit(1));
|
||||
});
|
||||
|
||||
return result.js
|
||||
.pipe(plugins.template())
|
||||
.pipe(sourcemaps.write())
|
||||
.pipe(gulp.dest('src'))
|
||||
.on('error', (e: any) => {
|
||||
console.log(e);
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('build.prod', (done: any) =>
|
||||
runSequence(
|
||||
'build.assets.prod',
|
||||
'build.html_css',
|
||||
'build.js.prod',
|
||||
'build.bundles',
|
||||
'build.bundles.app',
|
||||
done));
|
||||
@@ -1,118 +1,25 @@
|
||||
// Tun on full stack traces in errors to help debugging
|
||||
Error.stackTraceLimit = Infinity;
|
||||
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 100000;
|
||||
require('core-js/es6');
|
||||
require('core-js/es7/reflect');
|
||||
|
||||
window.componentHandler = {
|
||||
upgradeAllRegistered: function () {
|
||||
},
|
||||
upgradeElement: function () {
|
||||
}
|
||||
};
|
||||
require('zone.js/dist/zone');
|
||||
require('zone.js/dist/long-stack-trace-zone');
|
||||
require('zone.js/dist/proxy');
|
||||
require('zone.js/dist/sync-test');
|
||||
require('zone.js/dist/jasmine-patch');
|
||||
require('zone.js/dist/async-test');
|
||||
require('zone.js/dist/fake-async-test');
|
||||
|
||||
__karma__.loaded = function() {};
|
||||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
|
||||
|
||||
var builtPath = '/base/src/';
|
||||
var appContext = require.context('./src', true, /\.spec\.ts/);
|
||||
appContext.keys().forEach(appContext);
|
||||
|
||||
function isJsFile(path) {
|
||||
return path.slice(-3) == '.js';
|
||||
}
|
||||
|
||||
function isSpecFile(path) {
|
||||
return /\.spec\.(.*\.)?js$/.test(path);
|
||||
}
|
||||
var testing = require('@angular/core/testing');
|
||||
var browser = require('@angular/platform-browser-dynamic/testing');
|
||||
|
||||
function isBuiltFile(path) {
|
||||
return isJsFile(path) && (path.substr(0, builtPath.length) == builtPath);
|
||||
}
|
||||
testing.TestBed.initTestEnvironment(browser.BrowserDynamicTestingModule, browser.platformBrowserDynamicTesting());
|
||||
|
||||
var allSpecFiles = Object.keys(window.__karma__.files)
|
||||
.filter(isSpecFile)
|
||||
.filter(isBuiltFile);
|
||||
|
||||
var paths = {
|
||||
// paths serve as alias
|
||||
'npm:': 'base/node_modules/'
|
||||
};
|
||||
|
||||
var map = {
|
||||
'app': 'base/src',
|
||||
// angular bundles
|
||||
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
|
||||
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
|
||||
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
|
||||
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
|
||||
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
|
||||
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
|
||||
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
|
||||
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
|
||||
'@angular/material': 'npm:@angular/material/bundles/material.umd.js',
|
||||
|
||||
// testing
|
||||
'@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js',
|
||||
'@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js',
|
||||
'@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js',
|
||||
'@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
|
||||
'@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
|
||||
'@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js',
|
||||
'@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js',
|
||||
'@angular/forms/testing': 'npm:@angular/forms/bundles/forms-testing.umd.js',
|
||||
|
||||
// other libraries
|
||||
'rxjs': 'npm:rxjs',
|
||||
'ng2-translate': 'npm:ng2-translate',
|
||||
'ng2-charts' : 'npm:ng2-charts',
|
||||
'hammerjs': 'npm:hammerjs',
|
||||
|
||||
'raphael':'npm:raphael/raphael.js',
|
||||
'alfresco-js-api': 'npm:alfresco-js-api/dist',
|
||||
'ng2-alfresco-core': 'npm:ng2-alfresco-core'
|
||||
};
|
||||
|
||||
var packages = {
|
||||
'app': { main: 'main.js', defaultExtension: 'js' },
|
||||
'rxjs': { defaultExtension: 'js' },
|
||||
'ng2-translate': { defaultExtension: 'js' },
|
||||
'ng2-charts': { defaultExtension: 'js' },
|
||||
'hammerjs': {main: './hammerjs.js', defaultExtension: 'js'},
|
||||
|
||||
'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'},
|
||||
'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'}
|
||||
};
|
||||
|
||||
var config = {
|
||||
paths: paths,
|
||||
map: map,
|
||||
packages: packages
|
||||
};
|
||||
|
||||
System.config(config);
|
||||
|
||||
System.import('@angular/core/testing')
|
||||
.then(initTestBed)
|
||||
.then(initTesting);
|
||||
|
||||
function initTestBed(){
|
||||
return Promise.all([
|
||||
System.import('@angular/core/testing'),
|
||||
System.import('@angular/platform-browser-dynamic/testing')
|
||||
])
|
||||
.then(function (providers) {
|
||||
var coreTesting = providers[0];
|
||||
var browserTesting = providers[1];
|
||||
|
||||
coreTesting.TestBed.initTestEnvironment(
|
||||
browserTesting.BrowserDynamicTestingModule,
|
||||
browserTesting.platformBrowserDynamicTesting());
|
||||
})
|
||||
}
|
||||
|
||||
// Import all spec files and start karma
|
||||
function initTesting () {
|
||||
return Promise.all(
|
||||
allSpecFiles.map(function (moduleName) {
|
||||
return System.import(moduleName);
|
||||
})
|
||||
)
|
||||
.then(__karma__.start, __karma__.error);
|
||||
}
|
||||
|
||||
@@ -1,70 +1,36 @@
|
||||
'use strict';
|
||||
var webpackConfig = require('./webpack.test');
|
||||
|
||||
module.exports = function (config) {
|
||||
var configuration = {
|
||||
var _config = {
|
||||
basePath: '.',
|
||||
|
||||
frameworks: ['jasmine-ajax', 'jasmine'],
|
||||
|
||||
files: [
|
||||
// System.js for module loading
|
||||
'node_modules/systemjs/dist/system.src.js',
|
||||
'./node_modules/hammerjs/hammer.js',
|
||||
|
||||
// Polyfills
|
||||
'node_modules/core-js/client/shim.js',
|
||||
'node_modules/reflect-metadata/Reflect.js',
|
||||
//diagrams
|
||||
'./node_modules/chart.js/dist/Chart.js',
|
||||
'./node_modules/alfresco-js-api/dist/alfresco-js-api.js',
|
||||
'./node_modules/raphael/raphael.js',
|
||||
'./node_modules/moment/min/moment.min.js',
|
||||
'./node_modules/md-date-time-picker/dist/js/mdDateTimePicker.js',
|
||||
|
||||
// zone.js
|
||||
'node_modules/zone.js/dist/zone.js',
|
||||
'node_modules/zone.js/dist/long-stack-trace-zone.js',
|
||||
'node_modules/zone.js/dist/proxy.js',
|
||||
'node_modules/zone.js/dist/sync-test.js',
|
||||
'node_modules/zone.js/dist/jasmine-patch.js',
|
||||
'node_modules/zone.js/dist/async-test.js',
|
||||
'node_modules/zone.js/dist/fake-async-test.js',
|
||||
'node_modules/hammerjs/hammer.js',
|
||||
{pattern: './node_modules/ng2-translate/**/*.js', included: false, watched: false},
|
||||
{pattern: './node_modules/ng2-charts/**/*.js', included: false, served: true, watched: false},
|
||||
{pattern: './node_modules/md-date-time-picker/**/*.js', included: false, served: true, watched: false},
|
||||
{pattern: './node_modules/moment/**/*.js', included: false, served: true, watched: false},
|
||||
|
||||
// RxJs
|
||||
{ pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false },
|
||||
{ pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false },
|
||||
|
||||
// Paths loaded via module imports:
|
||||
// Angular itself
|
||||
{pattern: 'node_modules/@angular/**/*.js', included: false, watched: false},
|
||||
{pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false},
|
||||
|
||||
'node_modules/chart.js/dist/Chart.js',
|
||||
'node_modules/alfresco-js-api/dist/alfresco-js-api.js',
|
||||
'node_modules/raphael/raphael.js',
|
||||
|
||||
{pattern: 'node_modules/ng2-translate/**/*.js', included: false, watched: false},
|
||||
{pattern: 'node_modules/ng2-charts/**/*.js', included: false, served: true, watched: false},
|
||||
|
||||
'karma-test-shim.js',
|
||||
|
||||
// paths loaded via module imports
|
||||
{pattern: 'src/**/*.js', included: false, watched: true},
|
||||
{pattern: 'src/**/*.html', included: true, served: true, watched: true},
|
||||
{pattern: 'src/**/*.css', included: true, served: true, watched: true},
|
||||
|
||||
// ng2-components
|
||||
{ pattern: 'node_modules/ng2-alfresco-core/src/**/*.*', included: false, served: true, watched: false },
|
||||
{ pattern: 'node_modules/ng2-alfresco-core/index.js', included: false, served: true, watched: false },
|
||||
|
||||
// paths to support debugging with source maps in dev tools
|
||||
{pattern: 'src/**/*.ts', included: false, watched: false},
|
||||
{pattern: 'src/**/*.json', included: false, watched: false},
|
||||
{pattern: 'src/**/*.js.map', included: false, watched: false}
|
||||
{pattern: 'karma-test-shim.js', watched: false},
|
||||
{pattern: './src/assets/**/*.*', included: false, served: true, watched: false},
|
||||
{pattern: './src/i18n/**/*.*', included: false, served: true, watched: false},
|
||||
{pattern: './src/**/*.ts', included: false, served: true, watched: false}
|
||||
],
|
||||
|
||||
exclude: [
|
||||
'node_modules/**/*spec.js'
|
||||
],
|
||||
webpack: webpackConfig,
|
||||
|
||||
// proxied base paths
|
||||
proxies: {
|
||||
// required for component assets fetched by Angular's compiler
|
||||
'/src/': '/base/src/'
|
||||
webpackMiddleware: {
|
||||
stats: 'errors-only'
|
||||
},
|
||||
|
||||
port: 9876,
|
||||
@@ -93,29 +59,35 @@ module.exports = function (config) {
|
||||
|
||||
// Karma plugins loaded
|
||||
plugins: [
|
||||
'karma-jasmine',
|
||||
'karma-coverage',
|
||||
'karma-jasmine-ajax',
|
||||
'karma-chrome-launcher',
|
||||
'karma-mocha-reporter',
|
||||
'karma-jasmine-html-reporter'
|
||||
require('./node_modules/karma-jasmine'),
|
||||
require('./node_modules/karma-coverage'),
|
||||
require('./node_modules/karma-sourcemap-loader'),
|
||||
require('./node_modules/karma-jasmine-ajax'),
|
||||
require('./node_modules/karma-chrome-launcher'),
|
||||
require('./node_modules/karma-mocha-reporter'),
|
||||
require('./node_modules/karma-webpack'),
|
||||
require('./node_modules/karma-jasmine-html-reporter')
|
||||
],
|
||||
|
||||
webpackServer: {
|
||||
noInfo: true
|
||||
},
|
||||
|
||||
// Coverage reporter generates the coverage
|
||||
reporters: ['mocha', 'coverage', 'kjhtml'],
|
||||
|
||||
// Source files that you wanna generate coverage for.
|
||||
// Do not include tests or libraries (these files will be instrumented by Istanbul)
|
||||
preprocessors: {
|
||||
'src/**/!(*spec|index|*mock|*model|*event).js': 'coverage'
|
||||
'karma-test-shim.js': ['webpack', 'sourcemap'],
|
||||
'./src/**/!(*spec|index|*mock|*model|*event).js': 'coverage'
|
||||
},
|
||||
|
||||
coverageReporter: {
|
||||
includeAllSources: true,
|
||||
dir: 'coverage/',
|
||||
dir: 'coverage',
|
||||
subdir: 'report',
|
||||
reporters: [
|
||||
{type: 'text'},
|
||||
{type: 'text-summary'},
|
||||
{type: 'json', file: 'coverage-final.json'},
|
||||
{type: 'html'},
|
||||
{type: 'lcov'}
|
||||
@@ -124,8 +96,8 @@ module.exports = function (config) {
|
||||
};
|
||||
|
||||
if (process.env.TRAVIS) {
|
||||
configuration.browsers = ['Chrome_travis_ci'];
|
||||
config.browsers = ['Chrome_travis_ci'];
|
||||
}
|
||||
|
||||
config.set(configuration)
|
||||
config.set(_config);
|
||||
};
|
||||
|
||||
@@ -1,30 +1,18 @@
|
||||
{
|
||||
"name": "ng2-activiti-diagrams",
|
||||
"description": "Activiti Angular2 Diagrams Component",
|
||||
"version": "1.4.0",
|
||||
"version": "1.5.0",
|
||||
"author": "Alfresco Software, Ltd.",
|
||||
"scripts": {
|
||||
"clean": "npm install rimraf && npm run clean-build && rimraf dist node_modules typings",
|
||||
"clean-build": "rimraf index.js index.js.map index.d.ts 'src/{,**/}**.js' 'src/{,**/}**.js.map' 'src/{,**/}**.d.ts' bundles",
|
||||
"build": "npm run clean-build && npm run tslint && tsc && license-check && npm run build.umd",
|
||||
"build:w": "npm run clean-build && npm run tslint && npm run tsc:w && license-check && npm run build.umd",
|
||||
"tslint": "tslint -c tslint.json 'src/{,**/}**.ts' 'index.ts' -e '{,**/}**.d.ts' -e './gulpfile.ts'",
|
||||
"tsc": "tsc",
|
||||
"tsc:w": "tsc -w",
|
||||
"pretest": "npm run build",
|
||||
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run",
|
||||
"test-browser": "npm run build && concurrently \"karma start karma.conf.js --reporters kjhtml\" \"npm run watch-task\"",
|
||||
"posttest": "remap-istanbul -i coverage/report/coverage-final.json -o coverage/report -t html && remap-istanbul -i coverage/report/coverage-final.json -o coverage/report/coverage-final.json",
|
||||
"clean": "rimraf dist node_modules typings bundles coverage .npmrc",
|
||||
"rimraf": "rimraf",
|
||||
"build": "webpack --config webpack.build.js --progress --profile --bail",
|
||||
"test": "karma start karma.conf.js --reporters mocha,coverage --single-run --component",
|
||||
"test-browser": "karma start karma.conf.js --reporters kjhtml --component",
|
||||
"coverage": "npm run test && wsrv -o -p 9875 ./coverage/report",
|
||||
"publish:prod": "npm run test && npm publish",
|
||||
"travis": "npm link ng2-alfresco-core",
|
||||
"gulp": "gulp",
|
||||
"build.umd": "gulp build.prod --color --env-config prod --build-type prod",
|
||||
"reinstall": "npm cache clean && npm install"
|
||||
"prepublish" : "npm run build"
|
||||
},
|
||||
"main": "./index.js",
|
||||
"module": "./index.js",
|
||||
"typings": "./index.d.ts",
|
||||
"main": "bundles/ng2-activiti-diagrams.js",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Maurizio Vitale",
|
||||
@@ -39,83 +27,84 @@
|
||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular/common": "2.2.2",
|
||||
"@angular/compiler": "2.2.2",
|
||||
"@angular/core": "2.2.2",
|
||||
"@angular/forms": "2.2.2",
|
||||
"@angular/http": "2.2.2",
|
||||
"@angular/animations": "~4.0.0",
|
||||
"@angular/common": "~4.0.0",
|
||||
"@angular/compiler": "~4.0.0",
|
||||
"@angular/core": "~4.0.0",
|
||||
"@angular/forms": "~4.0.0",
|
||||
"@angular/http": "~4.0.0",
|
||||
"@angular/platform-browser": "~4.0.0",
|
||||
"@angular/platform-browser-dynamic": "~4.0.0",
|
||||
"@angular/router": "~4.0.0",
|
||||
|
||||
"@angular/material": "2.0.0-beta.1",
|
||||
"@angular/platform-browser": "2.2.2",
|
||||
"@angular/platform-browser-dynamic": "2.2.2",
|
||||
"@angular/router": "3.2.2",
|
||||
"alfresco-js-api": "~1.4.0",
|
||||
"alfresco-js-api": "~1.5.0",
|
||||
"core-js": "2.4.1",
|
||||
"hammerjs": "2.0.8",
|
||||
"ng2-alfresco-core": "1.4.0",
|
||||
"ng2-translate": "2.5.0",
|
||||
"ng2-alfresco-core": "1.5.0",
|
||||
"ng2-translate": "5.0.0",
|
||||
"raphael": "^2.2.6",
|
||||
"reflect-metadata": "0.1.10",
|
||||
"rxjs": "5.0.0-beta.12",
|
||||
"rxjs": "5.1.0",
|
||||
"systemjs": "0.19.27",
|
||||
"zone.js": "0.6.26"
|
||||
"zone.js": "0.8.4"
|
||||
},
|
||||
"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",
|
||||
"concurrently": "^2.2.0",
|
||||
"cpx": "1.3.1",
|
||||
"copy-webpack-plugin": "^4.0.1",
|
||||
"css-loader": "^0.23.1",
|
||||
"css-to-string-loader": "^0.1.2",
|
||||
"cssnano": "^3.8.1",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-autoprefixer": "^3.1.1",
|
||||
"gulp-cached": "^1.1.1",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-concat-css": "^2.3.0",
|
||||
"gulp-filter": "^4.0.0",
|
||||
"gulp-inline-ng2-template": "^4.0.0",
|
||||
"gulp-load-plugins": "^1.4.0",
|
||||
"gulp-plumber": "^1.1.0",
|
||||
"gulp-postcss": "^6.2.0",
|
||||
"gulp-replace": "^0.5.4",
|
||||
"gulp-sourcemaps": "^1.9.1",
|
||||
"gulp-template": "^4.0.0",
|
||||
"gulp-typescript": "^3.1.3",
|
||||
"gulp-uglify": "^2.0.0",
|
||||
"gulp-util": "^3.0.7",
|
||||
"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.0.0",
|
||||
"karma-jasmine": "1.0.2",
|
||||
"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.0.3",
|
||||
"license-check": "1.1.5",
|
||||
"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.2",
|
||||
"loader-utils": "^1.1.0",
|
||||
"merge-stream": "^1.0.1",
|
||||
"remap-istanbul": "0.6.3",
|
||||
"rimraf": "2.5.2",
|
||||
"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",
|
||||
"traceur": "0.0.91",
|
||||
"to-string-loader": "^1.1.4",
|
||||
"traceur": "^0.0.91",
|
||||
"ts-loader": "^2.0.0",
|
||||
"ts-node": "^1.7.0",
|
||||
"tslint": "3.15.1",
|
||||
"typescript": "^2.0.3",
|
||||
"wsrv": "^0.1.5"
|
||||
"tslint": "^4.4.2",
|
||||
"tslint-loader": "^3.3.0",
|
||||
"typescript": "^2.1.6",
|
||||
"webpack": "^2.2.1",
|
||||
"webpack-dev-server": "^2.3.0",
|
||||
"webpack-merge": "2.6.1",
|
||||
"wsrv": "^0.1.7"
|
||||
},
|
||||
"keywords": [
|
||||
"tag",
|
||||
"alfresco-analytics",
|
||||
"alfresco-diagrams"
|
||||
],
|
||||
"license-check-config": {
|
||||
"src": [
|
||||
"./src/**/*.js"
|
||||
],
|
||||
"path": "assets/license_header.txt",
|
||||
"blocking": true,
|
||||
"logInfo": false,
|
||||
"logError": true
|
||||
},
|
||||
"license": "Apache-2.0"
|
||||
}
|
||||
|
||||
@@ -26,6 +26,32 @@ export let userTask = {
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let userTaskActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake User task',
|
||||
type: 'UserTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let userTaskCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake User task',
|
||||
type: 'UserTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let manualTask = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Manual task',
|
||||
@@ -37,6 +63,32 @@ export let manualTask = {
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let manualTaskActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Manual task',
|
||||
type: 'ManualTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let manualTaskCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Manual task',
|
||||
type: 'ManualTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let serviceTask = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Service task',
|
||||
@@ -48,6 +100,32 @@ export let serviceTask = {
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let serviceTaskActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Service task',
|
||||
type: 'ServiceTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let serviceTaskCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Service task',
|
||||
type: 'ServiceTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let receiveTask = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Receive task',
|
||||
@@ -59,6 +137,32 @@ export let receiveTask = {
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let receiveTaskActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Receive task',
|
||||
type: 'ReceiveTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let receiveTaskCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Receive task',
|
||||
type: 'ReceiveTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let scriptTask = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Script task',
|
||||
@@ -70,6 +174,32 @@ export let scriptTask = {
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let scriptTaskActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Script task',
|
||||
type: 'ScriptTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let scriptTaskCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Script task',
|
||||
type: 'ScriptTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let businessRuleTask = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake BusinessRule task',
|
||||
@@ -81,6 +211,32 @@ export let businessRuleTask = {
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let businessRuleTaskActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake BusinessRule task',
|
||||
type: 'BusinessRuleTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let businessRuleTaskCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake BusinessRule task',
|
||||
type: 'BusinessRuleTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let mailTask = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Mail task',
|
||||
@@ -93,6 +249,34 @@ export let mailTask = {
|
||||
taskType: 'mail'
|
||||
};
|
||||
|
||||
export let mailTaskActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Mail task',
|
||||
type: 'ServiceTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
taskType: 'mail'
|
||||
};
|
||||
|
||||
export let mailTaskCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Mail task',
|
||||
type: 'ServiceTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
taskType: 'mail'
|
||||
};
|
||||
|
||||
export let camelTask = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Camel task',
|
||||
@@ -105,6 +289,34 @@ export let camelTask = {
|
||||
taskType: 'camel'
|
||||
};
|
||||
|
||||
export let camelTaskActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Camel task',
|
||||
type: 'ServiceTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
taskType: 'camel'
|
||||
};
|
||||
|
||||
export let camelTaskCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Camel task',
|
||||
type: 'ServiceTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
taskType: 'camel'
|
||||
};
|
||||
|
||||
export let restCallTask = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Rest Call task',
|
||||
@@ -117,6 +329,34 @@ export let restCallTask = {
|
||||
taskType: 'rest_call'
|
||||
};
|
||||
|
||||
export let restCallTaskActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Rest Call task',
|
||||
type: 'ServiceTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
taskType: 'rest_call'
|
||||
};
|
||||
|
||||
export let restCallTaskCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Rest Call task',
|
||||
type: 'ServiceTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
taskType: 'rest_call'
|
||||
};
|
||||
|
||||
export let muleTask = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Mule task',
|
||||
@@ -129,6 +369,34 @@ export let muleTask = {
|
||||
taskType: 'mule'
|
||||
};
|
||||
|
||||
export let muleTaskActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Mule task',
|
||||
type: 'ServiceTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
taskType: 'mule'
|
||||
};
|
||||
|
||||
export let muleTaskCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Mule task',
|
||||
type: 'ServiceTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
taskType: 'mule'
|
||||
};
|
||||
|
||||
export let alfrescoPublishTask = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Alfresco Publish task',
|
||||
@@ -141,6 +409,34 @@ export let alfrescoPublishTask = {
|
||||
taskType: 'alfresco_publish'
|
||||
};
|
||||
|
||||
export let alfrescoPublishTaskActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Alfresco Publish task',
|
||||
type: 'ServiceTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
taskType: 'alfresco_publish'
|
||||
};
|
||||
|
||||
export let alfrescoPublishTaskCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Alfresco Publish task',
|
||||
type: 'ServiceTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
taskType: 'alfresco_publish'
|
||||
};
|
||||
|
||||
export let googleDrivePublishTask = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Google Drive Publish task',
|
||||
@@ -153,6 +449,34 @@ export let googleDrivePublishTask = {
|
||||
taskType: 'google_drive_publish'
|
||||
};
|
||||
|
||||
export let googleDrivePublishTaskActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Google Drive Publish task',
|
||||
type: 'ServiceTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
taskType: 'google_drive_publish'
|
||||
};
|
||||
|
||||
export let googleDrivePublishTaskCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Google Drive Publish task',
|
||||
type: 'ServiceTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
taskType: 'google_drive_publish'
|
||||
};
|
||||
|
||||
export let boxPublishTask = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Box Publish task',
|
||||
@@ -164,3 +488,31 @@ export let boxPublishTask = {
|
||||
properties: [{}],
|
||||
taskType: 'box_publish'
|
||||
};
|
||||
|
||||
export let boxPublishTaskActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Box Publish task',
|
||||
type: 'ServiceTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
taskType: 'box_publish'
|
||||
};
|
||||
|
||||
export let boxPublishTaskCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
name: 'Fake Box Publish task',
|
||||
type: 'ServiceTask',
|
||||
width: 82,
|
||||
height: 67,
|
||||
x: 75.56890135999998,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
taskType: 'box_publish'
|
||||
};
|
||||
|
||||
@@ -26,6 +26,32 @@ export let boundaryTimeEvent = {
|
||||
eventDefinition: {type: 'timer'}
|
||||
};
|
||||
|
||||
export let boundaryTimeEventActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'BoundaryEvent',
|
||||
width: 31,
|
||||
height: 31,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
eventDefinition: {type: 'timer'}
|
||||
};
|
||||
|
||||
export let boundaryTimeEventCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'BoundaryEvent',
|
||||
width: 31,
|
||||
height: 31,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
eventDefinition: {type: 'timer'}
|
||||
};
|
||||
|
||||
export let boundaryErrorEvent = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'BoundaryEvent',
|
||||
@@ -37,6 +63,32 @@ export let boundaryErrorEvent = {
|
||||
eventDefinition: {type: 'error'}
|
||||
};
|
||||
|
||||
export let boundaryErrorEventActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'BoundaryEvent',
|
||||
width: 31,
|
||||
height: 31,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
eventDefinition: {type: 'error'}
|
||||
};
|
||||
|
||||
export let boundaryErrorEventCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'BoundaryEvent',
|
||||
width: 31,
|
||||
height: 31,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
eventDefinition: {type: 'error'}
|
||||
};
|
||||
|
||||
export let boundarySignalEvent = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'BoundaryEvent',
|
||||
@@ -48,6 +100,32 @@ export let boundarySignalEvent = {
|
||||
eventDefinition: {type: 'signal'}
|
||||
};
|
||||
|
||||
export let boundarySignalEventActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'BoundaryEvent',
|
||||
width: 31,
|
||||
height: 31,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
eventDefinition: {type: 'signal'}
|
||||
};
|
||||
|
||||
export let boundarySignalEventCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'BoundaryEvent',
|
||||
width: 31,
|
||||
height: 31,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
eventDefinition: {type: 'signal'}
|
||||
};
|
||||
|
||||
export let boundaryMessageEvent = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'BoundaryEvent',
|
||||
@@ -58,3 +136,29 @@ export let boundaryMessageEvent = {
|
||||
properties: [{}],
|
||||
eventDefinition: {type: 'message'}
|
||||
};
|
||||
|
||||
export let boundaryMessageEventActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'BoundaryEvent',
|
||||
width: 31,
|
||||
height: 31,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
eventDefinition: {type: 'message'}
|
||||
};
|
||||
|
||||
export let boundaryMessageEventCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'BoundaryEvent',
|
||||
width: 31,
|
||||
height: 31,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
eventDefinition: {type: 'message'}
|
||||
};
|
||||
|
||||
@@ -25,6 +25,30 @@ export let startEvent = {
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let startEventActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'startEvent1',
|
||||
type: 'StartEvent',
|
||||
width: 30,
|
||||
height: 30,
|
||||
x: 15,
|
||||
y: 48.5,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let startEventCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'startEvent1',
|
||||
type: 'StartEvent',
|
||||
width: 30,
|
||||
height: 30,
|
||||
x: 15,
|
||||
y: 48.5,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let startTimeEvent = {
|
||||
id: 'startEvent1',
|
||||
type: 'StartEvent',
|
||||
@@ -36,6 +60,32 @@ export let startTimeEvent = {
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let startTimeEventActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'startEvent1',
|
||||
type: 'StartEvent',
|
||||
width: 30,
|
||||
height: 30,
|
||||
x: 15,
|
||||
y: 48.5,
|
||||
eventDefinition: {type: 'timer'},
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let startTimeEventCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'startEvent1',
|
||||
type: 'StartEvent',
|
||||
width: 30,
|
||||
height: 30,
|
||||
x: 15,
|
||||
y: 48.5,
|
||||
eventDefinition: {type: 'timer'},
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let startSignalEvent = {
|
||||
id: 'startEvent1',
|
||||
type: 'StartEvent',
|
||||
@@ -47,6 +97,32 @@ export let startSignalEvent = {
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let startSignalEventActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'startEvent1',
|
||||
type: 'StartEvent',
|
||||
width: 30,
|
||||
height: 30,
|
||||
x: 15,
|
||||
y: 48.5,
|
||||
eventDefinition: {type: 'signal'},
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let startSignalEventCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'startEvent1',
|
||||
type: 'StartEvent',
|
||||
width: 30,
|
||||
height: 30,
|
||||
x: 15,
|
||||
y: 48.5,
|
||||
eventDefinition: {type: 'signal'},
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let startMessageEvent = {
|
||||
id: 'startEvent1',
|
||||
type: 'StartEvent',
|
||||
@@ -58,6 +134,32 @@ export let startMessageEvent = {
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let startMessageEventActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'startEvent1',
|
||||
type: 'StartEvent',
|
||||
width: 30,
|
||||
height: 30,
|
||||
x: 15,
|
||||
y: 48.5,
|
||||
eventDefinition: {type: 'message'},
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let startMessageEventCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'startEvent1',
|
||||
type: 'StartEvent',
|
||||
width: 30,
|
||||
height: 30,
|
||||
x: 15,
|
||||
y: 48.5,
|
||||
eventDefinition: {type: 'message'},
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let startErrorEvent = {
|
||||
id: 'startEvent1',
|
||||
type: 'StartEvent',
|
||||
@@ -69,6 +171,32 @@ export let startErrorEvent = {
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let startErrorEventActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'startEvent1',
|
||||
type: 'StartEvent',
|
||||
width: 30,
|
||||
height: 30,
|
||||
x: 15,
|
||||
y: 48.5,
|
||||
eventDefinition: {type: 'error'},
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let startErrorEventCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'startEvent1',
|
||||
type: 'StartEvent',
|
||||
width: 30,
|
||||
height: 30,
|
||||
x: 15,
|
||||
y: 48.5,
|
||||
eventDefinition: {type: 'error'},
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let endEvent = {
|
||||
id: 'sid-CED2A8DB-47E2-4057-A7B8-3ABBE5CE795E',
|
||||
type: 'EndEvent',
|
||||
@@ -79,6 +207,30 @@ export let endEvent = {
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let endEventActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-CED2A8DB-47E2-4057-A7B8-3ABBE5CE795E',
|
||||
type: 'EndEvent',
|
||||
width: 28,
|
||||
height: 28,
|
||||
x: 15,
|
||||
y: 48.5,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let endEventCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-CED2A8DB-47E2-4057-A7B8-3ABBE5CE795E',
|
||||
type: 'EndEvent',
|
||||
width: 28,
|
||||
height: 28,
|
||||
x: 15,
|
||||
y: 48.5,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let endErrorEvent = {
|
||||
id: 'sid-CED2A8DB-47E2-4057-A7B8-3ABBE5CE795E',
|
||||
type: 'EndEvent',
|
||||
@@ -89,3 +241,30 @@ export let endErrorEvent = {
|
||||
eventDefinition: {type: 'error'},
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
|
||||
export let endErrorEventActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-CED2A8DB-47E2-4057-A7B8-3ABBE5CE795E',
|
||||
type: 'EndEvent',
|
||||
width: 28,
|
||||
height: 28,
|
||||
x: 15,
|
||||
y: 48.5,
|
||||
eventDefinition: {type: 'error'},
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let endErrorEventCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-CED2A8DB-47E2-4057-A7B8-3ABBE5CE795E',
|
||||
type: 'EndEvent',
|
||||
width: 28,
|
||||
height: 28,
|
||||
x: 15,
|
||||
y: 48.5,
|
||||
eventDefinition: {type: 'error'},
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
@@ -25,6 +25,30 @@ export let exclusiveGatway = {
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let exclusiveGatwayActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'ExclusiveGateway',
|
||||
width: 40,
|
||||
height: 40,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let exclusiveGatwayCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'ExclusiveGateway',
|
||||
width: 40,
|
||||
height: 40,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let inclusiveGatway = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'InclusiveGateway',
|
||||
@@ -35,6 +59,30 @@ export let inclusiveGatway = {
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let inclusiveGatwayActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'InclusiveGateway',
|
||||
width: 40,
|
||||
height: 40,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let inclusiveGatwayCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'InclusiveGateway',
|
||||
width: 40,
|
||||
height: 40,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let parallelGatway = {
|
||||
id: 'sid-14EE23CE-0731-4E23-80F3-C557DA2A0CFC',
|
||||
type: 'ParallelGateway',
|
||||
@@ -45,6 +93,30 @@ export let parallelGatway = {
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let parallelGatwayActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-14EE23CE-0731-4E23-80F3-C557DA2A0CFC',
|
||||
type: 'ParallelGateway',
|
||||
width: 40,
|
||||
height: 40,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let parallelGatwayCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-14EE23CE-0731-4E23-80F3-C557DA2A0CFC',
|
||||
type: 'ParallelGateway',
|
||||
width: 40,
|
||||
height: 40,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let eventGatway = {
|
||||
id: 'sid-14EE23CE-0731-4E23-80F3-C557DA2A0CFC',
|
||||
type: 'EventGateway',
|
||||
@@ -54,3 +126,27 @@ export let eventGatway = {
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let eventGatwayActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-14EE23CE-0731-4E23-80F3-C557DA2A0CFC',
|
||||
type: 'EventGateway',
|
||||
width: 40,
|
||||
height: 40,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let eventGatwayCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-14EE23CE-0731-4E23-80F3-C557DA2A0CFC',
|
||||
type: 'EventGateway',
|
||||
width: 40,
|
||||
height: 40,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
@@ -26,6 +26,33 @@ export let intermediateCatchingTimeEvent = {
|
||||
eventDefinition: {type: 'timer'}
|
||||
};
|
||||
|
||||
export let intermediateCatchingTimeEventActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'IntermediateCatchEvent',
|
||||
width: 31,
|
||||
height: 31,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
eventDefinition: {type: 'timer'}
|
||||
};
|
||||
|
||||
export let intermediateCatchingTimeEventCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'IntermediateCatchEvent',
|
||||
width: 31,
|
||||
height: 31,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
eventDefinition: {type: 'timer'}
|
||||
};
|
||||
|
||||
|
||||
export let intermediateCatchingErrorEvent = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'IntermediateCatchEvent',
|
||||
@@ -37,6 +64,32 @@ export let intermediateCatchingErrorEvent = {
|
||||
eventDefinition: {type: 'error'}
|
||||
};
|
||||
|
||||
export let intermediateCatchingErrorEventActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'IntermediateCatchEvent',
|
||||
width: 31,
|
||||
height: 31,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
eventDefinition: {type: 'error'}
|
||||
};
|
||||
|
||||
export let intermediateCatchingErrorEventCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'IntermediateCatchEvent',
|
||||
width: 31,
|
||||
height: 31,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
eventDefinition: {type: 'error'}
|
||||
};
|
||||
|
||||
export let intermediateCatchingSignalEvent = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'IntermediateCatchEvent',
|
||||
@@ -48,6 +101,33 @@ export let intermediateCatchingSignalEvent = {
|
||||
eventDefinition: {type: 'signal'}
|
||||
};
|
||||
|
||||
export let intermediateCatchingSignalEventActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'IntermediateCatchEvent',
|
||||
width: 31,
|
||||
height: 31,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
eventDefinition: {type: 'signal'}
|
||||
};
|
||||
|
||||
export let intermediateCatchingSignalEventCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'IntermediateCatchEvent',
|
||||
width: 31,
|
||||
height: 31,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
eventDefinition: {type: 'signal'}
|
||||
};
|
||||
|
||||
|
||||
export let intermediateCatchingMessageEvent = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'IntermediateCatchEvent',
|
||||
@@ -58,3 +138,29 @@ export let intermediateCatchingMessageEvent = {
|
||||
properties: [{}],
|
||||
eventDefinition: {type: 'message'}
|
||||
};
|
||||
|
||||
export let intermediateCatchingMessageEventActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'IntermediateCatchEvent',
|
||||
width: 31,
|
||||
height: 31,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
eventDefinition: {type: 'message'}
|
||||
};
|
||||
|
||||
export let intermediateCatchingMessageEventCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'IntermediateCatchEvent',
|
||||
width: 31,
|
||||
height: 31,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}],
|
||||
eventDefinition: {type: 'message'}
|
||||
};
|
||||
|
||||
@@ -25,6 +25,30 @@ export let subProcess = {
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let subProcessActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'SubProcess',
|
||||
width: 300,
|
||||
height: 200,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let subProcessCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'SubProcess',
|
||||
width: 300,
|
||||
height: 200,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let eventSubProcess = {
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'EventSubProcess',
|
||||
@@ -34,3 +58,27 @@ export let eventSubProcess = {
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let eventSubProcessActive = {
|
||||
completed: false,
|
||||
current: true,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'EventSubProcess',
|
||||
width: 300,
|
||||
height: 200,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
export let eventSubProcessCompleted = {
|
||||
completed: true,
|
||||
current: false,
|
||||
id: 'sid-C05B7CB7-1CFD-4AE4-9E01-C2C91E35E5A7',
|
||||
type: 'EventSubProcess',
|
||||
width: 300,
|
||||
height: 200,
|
||||
x: 40,
|
||||
y: 30,
|
||||
properties: [{}]
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user