mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
[ADF-1103] Add custom tslint rules to avoid unwanted Class and File name prefix (#2087)
* custom tslint rules adf project name files * filename and class prefix rule * filename process service mock * fix spec filename * fix demo shell * rename mock * alias deprecated name class * core rename services * fix pacakge.json adf-rules * add exclude in whitelist
This commit is contained in:
parent
77c8ef459f
commit
a8eac42c05
@ -20,20 +20,20 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { AnalyticsReportListComponent } from 'ng2-activiti-analytics';
|
||||
import { FormEvent, FormFieldEvent, FormRenderingService, FormService } from 'ng2-activiti-form';
|
||||
import {
|
||||
ActivitiProcessFiltersComponent,
|
||||
ActivitiProcessInstanceDetailsComponent,
|
||||
ActivitiProcessInstanceListComponent,
|
||||
ActivitiStartProcessInstanceComponent,
|
||||
FilterProcessRepresentationModel,
|
||||
ProcessInstance
|
||||
ProcessFiltersComponent,
|
||||
ProcessInstance,
|
||||
ProcessInstanceDetailsComponent,
|
||||
ProcessInstanceListComponent,
|
||||
StartProcessInstanceComponent
|
||||
} from 'ng2-activiti-processlist';
|
||||
import {
|
||||
ActivitiAppsComponent,
|
||||
ActivitiFiltersComponent,
|
||||
ActivitiTaskDetailsComponent,
|
||||
ActivitiTaskListComponent,
|
||||
AppsListComponent,
|
||||
FilterRepresentationModel,
|
||||
TaskDetailsEvent
|
||||
TaskDetailsComponent,
|
||||
TaskDetailsEvent,
|
||||
TaskFiltersComponent,
|
||||
TaskListComponent
|
||||
} from 'ng2-activiti-tasklist';
|
||||
import { AlfrescoApiService } from 'ng2-alfresco-core';
|
||||
import {
|
||||
@ -55,26 +55,26 @@ const currentProcessIdNew = '__NEW__';
|
||||
})
|
||||
export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit {
|
||||
|
||||
@ViewChild(ActivitiFiltersComponent)
|
||||
activitifilter: ActivitiFiltersComponent;
|
||||
@ViewChild(TaskFiltersComponent)
|
||||
activitifilter: TaskFiltersComponent;
|
||||
|
||||
@ViewChild(ActivitiTaskListComponent)
|
||||
taskList: ActivitiTaskListComponent;
|
||||
@ViewChild(TaskListComponent)
|
||||
taskList: TaskListComponent;
|
||||
|
||||
@ViewChild(ActivitiProcessFiltersComponent)
|
||||
activitiprocessfilter: ActivitiProcessFiltersComponent;
|
||||
@ViewChild(ProcessFiltersComponent)
|
||||
activitiprocessfilter: ProcessFiltersComponent;
|
||||
|
||||
@ViewChild(ActivitiProcessInstanceListComponent)
|
||||
processList: ActivitiProcessInstanceListComponent;
|
||||
@ViewChild(ProcessInstanceListComponent)
|
||||
processList: ProcessInstanceListComponent;
|
||||
|
||||
@ViewChild(ActivitiProcessInstanceDetailsComponent)
|
||||
activitiprocessdetails: ActivitiProcessInstanceDetailsComponent;
|
||||
@ViewChild(ProcessInstanceDetailsComponent)
|
||||
activitiprocessdetails: ProcessInstanceDetailsComponent;
|
||||
|
||||
@ViewChild(ActivitiTaskDetailsComponent)
|
||||
activitidetails: ActivitiTaskDetailsComponent;
|
||||
@ViewChild(TaskDetailsComponent)
|
||||
activitidetails: TaskDetailsComponent;
|
||||
|
||||
@ViewChild(ActivitiStartProcessInstanceComponent)
|
||||
activitiStartProcess: ActivitiStartProcessInstanceComponent;
|
||||
@ViewChild(StartProcessInstanceComponent)
|
||||
activitiStartProcess: StartProcessInstanceComponent;
|
||||
|
||||
@ViewChild(AnalyticsReportListComponent)
|
||||
analyticsreportlist: AnalyticsReportListComponent;
|
||||
@ -159,7 +159,7 @@ export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit {
|
||||
this.processFilter = null;
|
||||
this.currentProcessInstanceId = null;
|
||||
});
|
||||
this.layoutType = ActivitiAppsComponent.LAYOUT_GRID;
|
||||
this.layoutType = AppsListComponent.LAYOUT_GRID;
|
||||
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, Input, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivitiProcessAttachmentListComponent, ProcessUploadService } from 'ng2-activiti-processlist';
|
||||
import { ProcessAttachmentListComponent, ProcessUploadService } from 'ng2-activiti-processlist';
|
||||
import { UploadService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
@ -33,8 +33,8 @@ export class ActivitiProcessAttachmentsComponent implements OnInit {
|
||||
@Input()
|
||||
processId: string;
|
||||
|
||||
@ViewChild(ActivitiProcessAttachmentListComponent)
|
||||
processAttachList: ActivitiProcessAttachmentListComponent;
|
||||
@ViewChild(ProcessAttachmentListComponent)
|
||||
processAttachList: ProcessAttachmentListComponent;
|
||||
|
||||
fileShowed: boolean = false;
|
||||
content: Blob;
|
||||
|
61
ng2-components/adf-rules/adfClassNameRule.js
Normal file
61
ng2-components/adf-rules/adfClassNameRule.js
Normal file
@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Lint = require("tslint");
|
||||
var sprintf_js_1 = require("sprintf-js");
|
||||
var walkerFactory_1 = require("codelyzer/walkerFactory/walkerFactory");
|
||||
var walkerFn_1 = require("codelyzer/walkerFactory/walkerFn");
|
||||
var function_1 = require("codelyzer/util/function");
|
||||
var Rule = (function (_super) {
|
||||
__extends(Rule, _super);
|
||||
function Rule() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Rule.invalidName = function (className) {
|
||||
var whiteList = ['ActivitiContentComponent', 'ActivitiForm'];
|
||||
var classNameReg = /^(alfresco|activiti|adf|activity)/ig;
|
||||
var classNameMatch = classNameReg.exec(className);
|
||||
var isWhiteListName = whiteList.find(function (currentWhiteListName) {
|
||||
return currentWhiteListName === className;
|
||||
});
|
||||
if (classNameMatch && !isWhiteListName) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
Rule.prototype.apply = function (sourceFile) {
|
||||
return this.applyWithWalker(Rule.walkerBuilder(sourceFile, this.getOptions()));
|
||||
};
|
||||
Rule.metadata = {
|
||||
ruleName: 'adf-class-name',
|
||||
type: 'maintainability',
|
||||
description: "Enforce consistent name avoid prefix",
|
||||
descriptionDetails: "See more at https://angular.io/styleguide#style-05-13.",
|
||||
rationale: "Consistent conventions make it easy to quickly identify class when you search with autocomplete.",
|
||||
options: null,
|
||||
optionsDescription: "Not configurable.",
|
||||
typescriptOnly: true,
|
||||
};
|
||||
Rule.FAILURE_STRING = 'The name of the class should not start with ADF Alfresco or Activiti prefix ';
|
||||
Rule.walkerBuilder = walkerFn_1.all(walkerFn_1.validateComponent(function (meta, suffixList) {
|
||||
return function_1.Maybe.lift(meta.controller)
|
||||
.fmap(function (controller) { return controller.name; })
|
||||
.fmap(function (name) {
|
||||
var className = name.text;
|
||||
if (Rule.invalidName(className)) {
|
||||
return [new walkerFactory_1.Failure(name, sprintf_js_1.sprintf(Rule.FAILURE_STRING + className, className, suffixList))];
|
||||
}
|
||||
});
|
||||
}));
|
||||
return Rule;
|
||||
}(Lint.Rules.AbstractRule));
|
||||
exports.Rule = Rule;
|
61
ng2-components/adf-rules/adfClassNameRule.ts
Normal file
61
ng2-components/adf-rules/adfClassNameRule.ts
Normal file
@ -0,0 +1,61 @@
|
||||
import * as Lint from 'tslint';
|
||||
import * as ts from 'typescript';
|
||||
import {sprintf} from 'sprintf-js';
|
||||
import {ComponentMetadata} from 'codelyzer/angular/metadata';
|
||||
import {Failure} from 'codelyzer/walkerFactory/walkerFactory';
|
||||
import {all, validateComponent} from 'codelyzer/walkerFactory/walkerFn';
|
||||
import {Maybe, F2} from 'codelyzer/util/function';
|
||||
import {IOptions} from 'tslint';
|
||||
import {NgWalker} from 'codelyzer/angular/ngWalker';
|
||||
|
||||
export class Rule extends Lint.Rules.AbstractRule {
|
||||
|
||||
public static metadata: Lint.IRuleMetadata = {
|
||||
ruleName: 'adf-class-name',
|
||||
type: 'maintainability',
|
||||
description: `Enforce consistent name avoid prefix`,
|
||||
descriptionDetails: `See more at https://angular.io/styleguide#style-05-13.`,
|
||||
rationale: `Consistent conventions make it easy to quickly identify class when you search with autocomplete.`,
|
||||
options: null,
|
||||
optionsDescription: "Not configurable.",
|
||||
typescriptOnly: true,
|
||||
};
|
||||
|
||||
public static FAILURE_STRING = 'The name of the class should not start with ADF Alfresco or Activiti prefix ';
|
||||
|
||||
static walkerBuilder: F2<ts.SourceFile, IOptions, NgWalker> =
|
||||
all(
|
||||
validateComponent((meta: ComponentMetadata, suffixList?: string[]) =>
|
||||
Maybe.lift(meta.controller)
|
||||
.fmap(controller => controller.name)
|
||||
.fmap(name => {
|
||||
const className = name.text;
|
||||
if (Rule.invalidName(className)) {
|
||||
return [new Failure(name, sprintf(Rule.FAILURE_STRING + className , className, suffixList))];
|
||||
}
|
||||
})
|
||||
));
|
||||
|
||||
static invalidName(className: string): boolean {
|
||||
var whiteList = ['ActivitiContentComponent', 'ActivitiForm'];
|
||||
|
||||
var classNameReg = /^(alfresco|activiti|adf|activity)/ig;
|
||||
var classNameMatch = classNameReg.exec(className);
|
||||
|
||||
var isWhiteListName = whiteList.find((currentWhiteListName)=>{
|
||||
return currentWhiteListName === className;
|
||||
});
|
||||
|
||||
if (classNameMatch && !isWhiteListName) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
|
||||
return this.applyWithWalker(
|
||||
Rule.walkerBuilder(sourceFile, this.getOptions())
|
||||
);
|
||||
}
|
||||
}
|
67
ng2-components/adf-rules/adfFileNameRule.js
Normal file
67
ng2-components/adf-rules/adfFileNameRule.js
Normal file
@ -0,0 +1,67 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Lint = require("tslint");
|
||||
var Rule = (function (_super) {
|
||||
__extends(Rule, _super);
|
||||
function Rule() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
Rule.prototype.apply = function (sourceFile) {
|
||||
return this.applyWithWalker(new AdfFileName(sourceFile, this.getOptions()));
|
||||
};
|
||||
Rule.metadata = {
|
||||
ruleName: 'adf-file-name',
|
||||
type: 'maintainability',
|
||||
description: "Enforce consistent name avoid prefix",
|
||||
descriptionDetails: "See more at https://angular.io/styleguide#style-05-13.",
|
||||
rationale: "Consistent conventions make it easy to quickly identify files when you search with autocomplete.",
|
||||
options: null,
|
||||
optionsDescription: "Not configurable.",
|
||||
typescriptOnly: true,
|
||||
};
|
||||
Rule.FAILURE_STRING = 'The name of the File should not start with ADF Alfresco or Activiti prefix ';
|
||||
return Rule;
|
||||
}(Lint.Rules.AbstractRule));
|
||||
exports.Rule = Rule;
|
||||
var AdfFileName = (function (_super) {
|
||||
__extends(AdfFileName, _super);
|
||||
function AdfFileName() {
|
||||
return _super !== null && _super.apply(this, arguments) || this;
|
||||
}
|
||||
AdfFileName.prototype.visitSourceFile = function (node) {
|
||||
var whiteList = ['activiti-content.component.ts', 'activiti-alfresco.service.ts', 'activiti-content-service.ts',
|
||||
'alfresco-api.service.ts', 'alfresco-settings.service.ts', 'alfresco-content.service.ts',
|
||||
'activiti-content.component.spec.ts', 'activiti-alfresco.service.spec.ts', 'activiti-content-service.spec.ts',
|
||||
'alfresco-api.service.spec.ts', 'alfresco-settings.service.spec.ts', 'alfresco-content.service.spec.ts',
|
||||
'activiti-content.service.spec.ts', 'activiti-content.service.ts'];
|
||||
var fileName = this.getFilename();
|
||||
var fileNameReg = /^(alfresco|activiti|adf|activity)/ig;
|
||||
var filenameMatch = fileNameReg.exec(fileName);
|
||||
var isWhiteListName = whiteList.find(function (currentWhiteListName) {
|
||||
return currentWhiteListName === fileName;
|
||||
});
|
||||
if (filenameMatch && !isWhiteListName) {
|
||||
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING + fileName));
|
||||
_super.prototype.visitSourceFile.call(this, node);
|
||||
}
|
||||
};
|
||||
AdfFileName.prototype.getFilename = function () {
|
||||
var filename = this.getSourceFile().fileName;
|
||||
var lastSlash = filename.lastIndexOf('/');
|
||||
if (lastSlash > -1) {
|
||||
return filename.substring(lastSlash + 1);
|
||||
}
|
||||
return filename;
|
||||
};
|
||||
return AdfFileName;
|
||||
}(Lint.RuleWalker));
|
56
ng2-components/adf-rules/adfFileNameRule.ts
Normal file
56
ng2-components/adf-rules/adfFileNameRule.ts
Normal file
@ -0,0 +1,56 @@
|
||||
import * as ts from "typescript";
|
||||
import * as Lint from "tslint";
|
||||
|
||||
|
||||
export class Rule extends Lint.Rules.AbstractRule {
|
||||
public static metadata: Lint.IRuleMetadata = {
|
||||
ruleName: 'adf-file-name',
|
||||
type: 'maintainability',
|
||||
description: `Enforce consistent name avoid prefix`,
|
||||
descriptionDetails: `See more at https://angular.io/styleguide#style-05-13.`,
|
||||
rationale: `Consistent conventions make it easy to quickly identify files when you search with autocomplete.`,
|
||||
options: null,
|
||||
optionsDescription: "Not configurable.",
|
||||
typescriptOnly: true,
|
||||
};
|
||||
|
||||
public static FAILURE_STRING = 'The name of the File should not start with ADF Alfresco or Activiti prefix ';
|
||||
|
||||
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
|
||||
return this.applyWithWalker(new AdfFileName(sourceFile, this.getOptions()));
|
||||
}
|
||||
}
|
||||
|
||||
// The walker takes care of all the work.
|
||||
class AdfFileName extends Lint.RuleWalker {
|
||||
public visitSourceFile(node: ts.SourceFile) {
|
||||
var whiteList = ['activiti-content.component.ts', 'activiti-alfresco.service.ts', 'activiti-content-service.ts',
|
||||
'alfresco-api.service.ts', 'alfresco-settings.service.ts', 'alfresco-content.service.ts',
|
||||
'activiti-content.component.spec.ts', 'activiti-alfresco.service.spec.ts', 'activiti-content-service.spec.ts',
|
||||
'alfresco-api.service.spec.ts', 'alfresco-settings.service.spec.ts', 'alfresco-content.service.spec.ts',
|
||||
'activiti-content.service.spec.ts', 'activiti-content.service.ts'];
|
||||
|
||||
var fileName = this.getFilename();
|
||||
|
||||
var fileNameReg = /^(alfresco|activiti|adf|activity)/ig;
|
||||
var filenameMatch = fileNameReg.exec(fileName);
|
||||
|
||||
var isWhiteListName = whiteList.find((currentWhiteListName)=>{
|
||||
return currentWhiteListName === fileName;
|
||||
});
|
||||
|
||||
if (filenameMatch && !isWhiteListName) {
|
||||
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING + fileName));
|
||||
super.visitSourceFile(node);
|
||||
}
|
||||
}
|
||||
|
||||
private getFilename(): string {
|
||||
const filename = this.getSourceFile().fileName;
|
||||
const lastSlash = filename.lastIndexOf('/');
|
||||
if (lastSlash > -1) {
|
||||
return filename.substring(lastSlash + 1);
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
}
|
2128
ng2-components/adf-rules/package-lock.json
generated
Normal file
2128
ng2-components/adf-rules/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
57
ng2-components/adf-rules/package.json
Normal file
57
ng2-components/adf-rules/package.json
Normal file
@ -0,0 +1,57 @@
|
||||
{
|
||||
"name": "adf-tlsint-rules",
|
||||
"description": "Custom Rules for the ADF project",
|
||||
"version": "1.6.1",
|
||||
"author": "Alfresco Software, Ltd.",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"tscv": "tsc --version",
|
||||
"tsc": "tsc",
|
||||
"tsc:watch": "tsc --w"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Eugenio Romano",
|
||||
"email": "eugenio.romano@alfresco.com"
|
||||
}
|
||||
],
|
||||
"devDependencies": {
|
||||
"@angular/compiler": "^4.2.3",
|
||||
"@angular/core": "^4.2.3",
|
||||
"@types/chai": "^3.4.33",
|
||||
"@types/less": "0.0.31",
|
||||
"@types/mocha": "^2.2.32",
|
||||
"@types/node": "^6.0.41",
|
||||
"@types/node-sass": "^3.10.31",
|
||||
"@types/source-map": "^0.5.0",
|
||||
"@types/sprintf-js": "0.0.27",
|
||||
"chai": "^3.5.0",
|
||||
"chai-spies": "^0.7.1",
|
||||
"minimalist": "1.0.0",
|
||||
"mocha": "3.0.2",
|
||||
"node-sass": "^3.13.0",
|
||||
"rimraf": "^2.5.2",
|
||||
"rxjs": "5.4.1",
|
||||
"ts-node": "1.2.2",
|
||||
"tslint": "^5.0.0",
|
||||
"typescript": "2.4.0",
|
||||
"zone.js": "^0.8.4",
|
||||
"js-yaml": "^3.8.4",
|
||||
"json-stringify-pretty-compact": "^1.0.4",
|
||||
"@types/js-yaml": "^3.5.31"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/compiler": "^2.3.1 || >=4.0.0-beta <5.0.0",
|
||||
"@angular/core": "^2.3.1 || >=4.0.0-beta <5.0.0",
|
||||
"tslint": "^5.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"app-root-path": "^2.0.1",
|
||||
"css-selector-tokenizer": "^0.7.0",
|
||||
"cssauron": "^1.4.0",
|
||||
"semver-dsl": "^1.0.1",
|
||||
"source-map": "^0.5.6",
|
||||
"sprintf-js": "^1.0.3"
|
||||
},
|
||||
"license": "Apache-2.0"
|
||||
}
|
22
ng2-components/adf-rules/tsconfig.json
Normal file
22
ng2-components/adf-rules/tsconfig.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"target": "es5",
|
||||
"module": "commonjs",
|
||||
"declaration": false,
|
||||
"noImplicitAny": false,
|
||||
"removeComments": true,
|
||||
"lib": ["es6", "es2015", "dom"],
|
||||
"noLib": false,
|
||||
"typeRoots": [
|
||||
"./node_modules/@types",
|
||||
"./node_modules"
|
||||
],
|
||||
"types": [
|
||||
"mocha",
|
||||
"chai",
|
||||
"node",
|
||||
"sprintf-js"
|
||||
]
|
||||
}
|
||||
}
|
5
ng2-components/adf-rules/tslint.json
Normal file
5
ng2-components/adf-rules/tslint.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"rules": {
|
||||
"adf-file-naming": true
|
||||
}
|
||||
}
|
@ -21,10 +21,10 @@ import { MdButtonModule, MdCardModule, MdCheckboxModule, MdIconModule, MdInputMo
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||
import { ActivitiContentComponent } from './src/components/activiti-content.component';
|
||||
import { ActivitiForm } from './src/components/activiti-form.component';
|
||||
import { ActivitiStartFormComponent } from './src/components/activiti-start-form.component';
|
||||
import { ADFFormListComponent } from './src/components/adf-form-list.component';
|
||||
import { FormFieldComponent } from './src/components/form-field/form-field.component';
|
||||
import { FormListComponent } from './src/components/form-list.component';
|
||||
import { FormComponent } from './src/components/form.component';
|
||||
import { StartFormComponent } from './src/components/start-form.component';
|
||||
import { MASK_DIRECTIVE, WIDGET_DIRECTIVES } from './src/components/widgets/index';
|
||||
import { ActivitiAlfrescoContentService } from './src/services/activiti-alfresco.service';
|
||||
import { ActivitiContentService } from './src/services/activiti-content-service';
|
||||
@ -34,10 +34,10 @@ import { FormService } from './src/services/form.service';
|
||||
import { NodeService } from './src/services/node.service';
|
||||
import { WidgetVisibilityService } from './src/services/widget-visibility.service';
|
||||
|
||||
export * from './src/components/activiti-form.component';
|
||||
export * from './src/components/adf-form-list.component';
|
||||
export * from './src/components/form.component';
|
||||
export * from './src/components/form-list.component';
|
||||
export * from './src/components/activiti-content.component';
|
||||
export * from './src/components/activiti-start-form.component';
|
||||
export * from './src/components/start-form.component';
|
||||
export * from './src/services/form.service';
|
||||
export * from './src/services/activiti-content-service';
|
||||
export * from './src/components/widgets/index';
|
||||
@ -46,13 +46,26 @@ export * from './src/services/node.service';
|
||||
export * from './src/services/form-rendering.service';
|
||||
export * from './src/events/index';
|
||||
|
||||
// Old deprecated import
|
||||
import {ActivitiContentComponent as ActivitiContent} from './src/components/activiti-content.component';
|
||||
import {FormComponent as ActivitiForm} from './src/components/form.component';
|
||||
import {StartFormComponent as ActivitiStartForm} from './src/components/start-form.component';
|
||||
export {FormComponent as ActivitiForm} from './src/components/form.component';
|
||||
export {ActivitiContentComponent as ActivitiContent} from './src/components/activiti-content.component';
|
||||
export {StartFormComponent as ActivitiStartForm} from './src/components/start-form.component';
|
||||
|
||||
export const ACTIVITI_FORM_DIRECTIVES: any[] = [
|
||||
ActivitiForm,
|
||||
ADFFormListComponent,
|
||||
FormComponent,
|
||||
FormListComponent,
|
||||
ActivitiContentComponent,
|
||||
ActivitiStartFormComponent,
|
||||
StartFormComponent,
|
||||
FormFieldComponent,
|
||||
...WIDGET_DIRECTIVES
|
||||
...WIDGET_DIRECTIVES,
|
||||
|
||||
// Old Deprecated export
|
||||
ActivitiForm,
|
||||
ActivitiContent,
|
||||
ActivitiStartForm
|
||||
];
|
||||
|
||||
export const ACTIVITI_FORM_PROVIDERS: any[] = [
|
||||
|
@ -22,14 +22,14 @@ import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { EcmModelService } from '../services/ecm-model.service';
|
||||
import { FormService } from '../services/form.service';
|
||||
import { ADFFormListComponent } from './adf-form-list.component';
|
||||
import { FormListComponent } from './form-list.component';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
describe('TaskAttachmentList', () => {
|
||||
|
||||
let component: ADFFormListComponent;
|
||||
let fixture: ComponentFixture<ADFFormListComponent>;
|
||||
let component: FormListComponent;
|
||||
let fixture: ComponentFixture<FormListComponent>;
|
||||
let service: FormService;
|
||||
let componentHandler: any;
|
||||
|
||||
@ -40,7 +40,7 @@ describe('TaskAttachmentList', () => {
|
||||
DataTableModule
|
||||
],
|
||||
declarations: [
|
||||
ADFFormListComponent
|
||||
FormListComponent
|
||||
],
|
||||
providers: [
|
||||
FormService,
|
||||
@ -63,7 +63,7 @@ describe('TaskAttachmentList', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ADFFormListComponent);
|
||||
fixture = TestBed.createComponent(FormListComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
service = TestBed.get(FormService);
|
@ -21,10 +21,10 @@ import { FormService } from './../services/form.service';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-form-list',
|
||||
templateUrl: './adf-form-list.component.html',
|
||||
styleUrls: ['./adf-form-list.component.css']
|
||||
templateUrl: './form-list.component.html',
|
||||
styleUrls: ['./form-list.component.css']
|
||||
})
|
||||
export class ADFFormListComponent implements OnChanges {
|
||||
export class FormListComponent implements OnChanges {
|
||||
|
||||
@Input()
|
||||
forms: any [] = [];
|
@ -18,18 +18,18 @@
|
||||
import { SimpleChange } from '@angular/core';
|
||||
import { LogService } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { fakeForm } from '../assets/activiti-form.component.mock';
|
||||
import { fakeForm } from '../assets/form.component.mock';
|
||||
import { FormService } from './../services/form.service';
|
||||
import { NodeService } from './../services/node.service';
|
||||
import { WidgetVisibilityService } from './../services/widget-visibility.service';
|
||||
import { ActivitiForm } from './activiti-form.component';
|
||||
import { FormComponent } from './form.component';
|
||||
import { FormFieldModel, FormFieldTypes, FormModel, FormOutcomeEvent, FormOutcomeModel } from './widgets/index';
|
||||
|
||||
describe('ActivitiForm', () => {
|
||||
describe('FormComponent', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let formService: FormService;
|
||||
let formComponent: ActivitiForm;
|
||||
let formComponent: FormComponent;
|
||||
let visibilityService: WidgetVisibilityService;
|
||||
let nodeService: NodeService;
|
||||
let logService: LogService;
|
||||
@ -45,7 +45,7 @@ describe('ActivitiForm', () => {
|
||||
spyOn(visibilityService, 'refreshVisibility').and.stub();
|
||||
formService = new FormService(null, null, logService);
|
||||
nodeService = new NodeService(null);
|
||||
formComponent = new ActivitiForm(formService, visibilityService, null, nodeService, logService);
|
||||
formComponent = new FormComponent(formService, visibilityService, null, nodeService, logService);
|
||||
});
|
||||
|
||||
it('should upgrade MDL content on view checked', () => {
|
||||
@ -325,7 +325,7 @@ describe('ActivitiForm', () => {
|
||||
it('should save form on [save] outcome click', () => {
|
||||
let formModel = new FormModel();
|
||||
let outcome = new FormOutcomeModel(formModel, {
|
||||
id: ActivitiForm.SAVE_OUTCOME_ID,
|
||||
id: FormComponent.SAVE_OUTCOME_ID,
|
||||
name: 'Save',
|
||||
isSystem: true
|
||||
});
|
||||
@ -341,7 +341,7 @@ describe('ActivitiForm', () => {
|
||||
it('should complete form on [complete] outcome click', () => {
|
||||
let formModel = new FormModel();
|
||||
let outcome = new FormOutcomeModel(formModel, {
|
||||
id: ActivitiForm.COMPLETE_OUTCOME_ID,
|
||||
id: FormComponent.COMPLETE_OUTCOME_ID,
|
||||
name: 'Complete',
|
||||
isSystem: true
|
||||
});
|
||||
@ -357,7 +357,7 @@ describe('ActivitiForm', () => {
|
||||
it('should emit form saved event on custom outcome click', () => {
|
||||
let formModel = new FormModel();
|
||||
let outcome = new FormOutcomeModel(formModel, {
|
||||
id: ActivitiForm.CUSTOM_OUTCOME_ID,
|
||||
id: FormComponent.CUSTOM_OUTCOME_ID,
|
||||
name: 'Custom',
|
||||
isSystem: true
|
||||
});
|
||||
@ -666,7 +666,7 @@ describe('ActivitiForm', () => {
|
||||
it('should prevent default outcome execution', () => {
|
||||
|
||||
let outcome = new FormOutcomeModel(new FormModel(), {
|
||||
id: ActivitiForm.CUSTOM_OUTCOME_ID,
|
||||
id: FormComponent.CUSTOM_OUTCOME_ID,
|
||||
name: 'Custom'
|
||||
});
|
||||
|
||||
@ -683,7 +683,7 @@ describe('ActivitiForm', () => {
|
||||
|
||||
it('should not prevent default outcome execution', () => {
|
||||
let outcome = new FormOutcomeModel(new FormModel(), {
|
||||
id: ActivitiForm.CUSTOM_OUTCOME_ID,
|
||||
id: FormComponent.CUSTOM_OUTCOME_ID,
|
||||
name: 'Custom'
|
||||
});
|
||||
|
||||
@ -740,7 +740,7 @@ describe('ActivitiForm', () => {
|
||||
formComponent.form = formModel;
|
||||
|
||||
let outcome = new FormOutcomeModel(new FormModel(), {
|
||||
id: ActivitiForm.CUSTOM_OUTCOME_ID,
|
||||
id: FormComponent.CUSTOM_OUTCOME_ID,
|
||||
name: 'Custom'
|
||||
});
|
||||
|
||||
@ -766,7 +766,7 @@ describe('ActivitiForm', () => {
|
||||
expect(formModel.isValid).toBeFalsy();
|
||||
|
||||
let outcome = new FormOutcomeModel(new FormModel(), {
|
||||
id: ActivitiForm.SAVE_OUTCOME_ID,
|
||||
id: FormComponent.SAVE_OUTCOME_ID,
|
||||
name: FormOutcomeModel.SAVE_ACTION
|
||||
});
|
||||
|
||||
@ -788,7 +788,7 @@ describe('ActivitiForm', () => {
|
||||
expect(formModel.isValid).toBeFalsy();
|
||||
|
||||
let outcome = new FormOutcomeModel(new FormModel(), {
|
||||
id: ActivitiForm.CUSTOM_OUTCOME_ID,
|
||||
id: FormComponent.CUSTOM_OUTCOME_ID,
|
||||
name: 'Custom'
|
||||
});
|
||||
|
||||
@ -812,7 +812,7 @@ describe('ActivitiForm', () => {
|
||||
});
|
||||
|
||||
let outcome = new FormOutcomeModel(new FormModel(), {
|
||||
id: ActivitiForm.CUSTOM_OUTCOME_ID,
|
||||
id: FormComponent.CUSTOM_OUTCOME_ID,
|
||||
name: 'Custom'
|
||||
});
|
||||
|
@ -31,10 +31,10 @@ declare var componentHandler: any;
|
||||
|
||||
@Component({
|
||||
selector: 'adf-form, activiti-form',
|
||||
templateUrl: './activiti-form.component.html',
|
||||
styleUrls: ['./activiti-form.component.css']
|
||||
templateUrl: './form.component.html',
|
||||
styleUrls: ['./form.component.css']
|
||||
})
|
||||
export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
|
||||
export class FormComponent implements OnInit, AfterViewChecked, OnChanges {
|
||||
|
||||
static SAVE_OUTCOME_ID: string = '$save';
|
||||
static COMPLETE_OUTCOME_ID: string = '$complete';
|
||||
@ -227,22 +227,22 @@ export class ActivitiForm implements OnInit, AfterViewChecked, OnChanges {
|
||||
}
|
||||
|
||||
if (outcome.isSystem) {
|
||||
if (outcome.id === ActivitiForm.SAVE_OUTCOME_ID) {
|
||||
if (outcome.id === FormComponent.SAVE_OUTCOME_ID) {
|
||||
this.saveTaskForm();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (outcome.id === ActivitiForm.COMPLETE_OUTCOME_ID) {
|
||||
if (outcome.id === FormComponent.COMPLETE_OUTCOME_ID) {
|
||||
this.completeTaskForm();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (outcome.id === ActivitiForm.START_PROCESS_OUTCOME_ID) {
|
||||
if (outcome.id === FormComponent.START_PROCESS_OUTCOME_ID) {
|
||||
this.completeTaskForm();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (outcome.id === ActivitiForm.CUSTOM_OUTCOME_ID) {
|
||||
if (outcome.id === FormComponent.CUSTOM_OUTCOME_ID) {
|
||||
this.onTaskSaved(this.form);
|
||||
this.storeFormAsMetadata();
|
||||
return true;
|
@ -27,7 +27,7 @@ import { EcmModelService } from './../services/ecm-model.service';
|
||||
import { FormService } from './../services/form.service';
|
||||
import { WidgetVisibilityService } from './../services/widget-visibility.service';
|
||||
import { ActivitiContentComponent } from './activiti-content.component';
|
||||
import { ActivitiStartFormComponent } from './activiti-start-form.component';
|
||||
import { StartFormComponent } from './start-form.component';
|
||||
import { FormFieldComponent } from './form-field/form-field.component';
|
||||
import { MASK_DIRECTIVE } from './widgets/index';
|
||||
import { WIDGET_DIRECTIVES } from './widgets/index';
|
||||
@ -36,8 +36,8 @@ describe('ActivitiStartForm', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let formService: FormService;
|
||||
let component: ActivitiStartFormComponent;
|
||||
let fixture: ComponentFixture<ActivitiStartFormComponent>;
|
||||
let component: StartFormComponent;
|
||||
let fixture: ComponentFixture<StartFormComponent>;
|
||||
let getStartFormSpy: jasmine.Spy;
|
||||
|
||||
const exampleId1 = 'my:process1';
|
||||
@ -50,7 +50,7 @@ describe('ActivitiStartForm', () => {
|
||||
MdInputModule,
|
||||
CoreModule.forRoot()],
|
||||
declarations: [
|
||||
ActivitiStartFormComponent,
|
||||
StartFormComponent,
|
||||
FormFieldComponent,
|
||||
ActivitiContentComponent,
|
||||
...WIDGET_DIRECTIVES,
|
||||
@ -67,7 +67,7 @@ describe('ActivitiStartForm', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ActivitiStartFormComponent);
|
||||
fixture = TestBed.createComponent(StartFormComponent);
|
||||
component = fixture.componentInstance;
|
||||
formService = fixture.debugElement.injector.get(FormService);
|
||||
|
@ -19,7 +19,7 @@ import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output,
|
||||
import { AlfrescoTranslationService, LogService } from 'ng2-alfresco-core';
|
||||
import { FormService } from './../services/form.service';
|
||||
import { WidgetVisibilityService } from './../services/widget-visibility.service';
|
||||
import { ActivitiForm } from './activiti-form.component';
|
||||
import { FormComponent } from './form.component';
|
||||
import { ContentLinkModel } from './widgets/core/content-link.model';
|
||||
import { FormOutcomeModel } from './widgets/core/index';
|
||||
|
||||
@ -38,14 +38,14 @@ import { FormOutcomeModel } from './widgets/core/index';
|
||||
* {formSaved} EventEmitter - This event is fired when the form is saved, it pass all the value in the form.
|
||||
* {formCompleted} EventEmitter - This event is fired when the form is completed, it pass all the value in the form.
|
||||
*
|
||||
* @returns {ActivitiForm} .
|
||||
* @returns {FormComponent} .
|
||||
*/
|
||||
@Component({
|
||||
selector: 'adf-start-form, activiti-start-form',
|
||||
templateUrl: './activiti-start-form.component.html',
|
||||
styleUrls: ['./activiti-form.component.css']
|
||||
templateUrl: './start-form.component.html',
|
||||
styleUrls: ['./form.component.css']
|
||||
})
|
||||
export class ActivitiStartFormComponent extends ActivitiForm implements OnChanges, OnInit {
|
||||
export class StartFormComponent extends FormComponent implements OnChanges, OnInit {
|
||||
|
||||
@Input()
|
||||
processDefinitionId: string;
|
@ -99,7 +99,6 @@ export const WIDGET_DIRECTIVES: any[] = [
|
||||
PeopleWidgetComponent,
|
||||
DateWidgetComponent,
|
||||
AmountWidgetComponent,
|
||||
|
||||
DynamicTableWidgetComponent,
|
||||
DateEditorComponent,
|
||||
DropdownEditorComponent,
|
||||
|
@ -298,10 +298,10 @@ Displays comments associated with a particular process instances and allows the
|
||||
This component displays attached documents on a specified process instance
|
||||
|
||||
```html
|
||||
<adf-process-attachment-list
|
||||
<process-attachment-list
|
||||
[processInstanceId]="YOUR_PROCESS_INSTANCE_ID"
|
||||
(attachmentClick="YOUR_ATTACHMENT_CLICK_EMITTER_HANDLER">
|
||||
</adf-process-attachment-list>
|
||||
</process-attachment-list>
|
||||
```
|
||||

|
||||
|
||||
|
@ -22,53 +22,93 @@ import { ActivitiTaskListModule } from 'ng2-activiti-tasklist';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||
|
||||
import {
|
||||
ActivitiCreateProcessAttachmentComponent,
|
||||
ActivitiProcessAttachmentListComponent,
|
||||
ActivitiProcessCommentsComponent,
|
||||
ActivitiProcessFiltersComponent,
|
||||
ActivitiProcessInstanceDetailsComponent,
|
||||
ActivitiProcessInstanceHeaderComponent,
|
||||
ActivitiProcessInstanceListComponent,
|
||||
ActivitiProcessInstanceTasksComponent,
|
||||
ActivitiProcessInstanceVariablesComponent,
|
||||
ActivitiStartProcessInstanceComponent
|
||||
} from './src/components/index';
|
||||
import {CreateProcessAttachmentComponent} from './src/components/create-process-attachment.component';
|
||||
import {ProcessAttachmentListComponent} from './src/components/process-attachment-list.component';
|
||||
import {ProcessCommentsComponent} from './src/components/process-comments.component';
|
||||
import {ProcessFiltersComponent} from './src/components/process-filters.component';
|
||||
import {ProcessInstanceDetailsComponent} from './src/components/process-instance-details.component';
|
||||
import {ProcessInstanceHeaderComponent} from './src/components/process-instance-header.component';
|
||||
import {ProcessInstanceTasksComponent} from './src/components/process-instance-tasks.component';
|
||||
import {ProcessInstanceVariablesComponent} from './src/components/process-instance-variables.component';
|
||||
import {ProcessInstanceListComponent} from './src/components/processlist.component';
|
||||
import {StartProcessInstanceComponent} from './src/components/start-process.component';
|
||||
export {ProcessAttachmentListComponent} from './src/components/process-attachment-list.component';
|
||||
export {ProcessCommentsComponent} from './src/components/process-comments.component';
|
||||
export {ProcessFiltersComponent} from './src/components/process-filters.component';
|
||||
export {ProcessInstanceDetailsComponent} from './src/components/process-instance-details.component';
|
||||
export {ProcessInstanceHeaderComponent} from './src/components/process-instance-header.component';
|
||||
export {ProcessInstanceTasksComponent} from './src/components/process-instance-tasks.component';
|
||||
export {ProcessInstanceVariablesComponent} from './src/components/process-instance-variables.component';
|
||||
export {ProcessInstanceListComponent} from './src/components/processlist.component';
|
||||
export {StartProcessInstanceComponent} from './src/components/start-process.component';
|
||||
|
||||
import { ActivitiProcessService } from './src/services/activiti-process.service';
|
||||
import { ProcessUploadService } from './src/services/process-upload.service';
|
||||
|
||||
// components
|
||||
export * from './src/components/activiti-processlist.component';
|
||||
export * from './src/components/activiti-filters.component';
|
||||
export * from './src/components/activiti-process-instance-details.component';
|
||||
export * from './src/components/activiti-start-process.component';
|
||||
export * from './src/components/adf-process-attachment-list.component';
|
||||
export * from './src/components/adf-create-process-attachment.component';
|
||||
export * from './src/services/process-upload.service';
|
||||
import { ProcessService } from './src/services/process.service';
|
||||
export { ProcessService } from './src/services/process.service';
|
||||
export { ProcessUploadService } from './src/services/process-upload.service';
|
||||
|
||||
// models
|
||||
export * from './src/models/index';
|
||||
export * from './src/models/filter-process.model';
|
||||
export * from './src/models/process-definition.model';
|
||||
export * from './src/models/process-instance.model';
|
||||
export * from './src/models/process-instance-filter.model';
|
||||
export * from './src/models/process-instance-variable.model';
|
||||
|
||||
// services
|
||||
export * from './src/services/activiti-process.service';
|
||||
// Old derprecate export
|
||||
import {CreateProcessAttachmentComponent as ActivitiCreateProcessAttachmentComponent } from './src/components/create-process-attachment.component';
|
||||
import {ProcessAttachmentListComponent as ActivitiProcessAttachmentListComponent} from './src/components/process-attachment-list.component';
|
||||
import {ProcessCommentsComponent as ActivitiProcessComments } from './src/components/process-comments.component';
|
||||
import {ProcessFiltersComponent as ActivitiProcessFilters} from './src/components/process-filters.component';
|
||||
import {ProcessInstanceDetailsComponent as ActivitiProcessInstanceDetails} from './src/components/process-instance-details.component';
|
||||
import {ProcessInstanceHeaderComponent as ActivitiProcessInstanceHeader} from './src/components/process-instance-header.component';
|
||||
import {ProcessInstanceTasksComponent as ActivitiProcessInstanceTasks} from './src/components/process-instance-tasks.component';
|
||||
import {ProcessInstanceVariablesComponent as ActivitiProcessInstanceVariables} from './src/components/process-instance-variables.component';
|
||||
import {ProcessInstanceListComponent as ActivitiProcessInstanceListComponent} from './src/components/processlist.component';
|
||||
import {StartProcessInstanceComponent as ActivitiStartProcessInstance} from './src/components/start-process.component';
|
||||
import {ProcessService as ActivitiProcessService} from './src/services/process.service';
|
||||
export {CreateProcessAttachmentComponent as ActivitiCreateProcessAttachmentComponent } from './src/components/create-process-attachment.component';
|
||||
export {ProcessAttachmentListComponent as ActivitiProcessAttachmentListComponent} from './src/components/process-attachment-list.component';
|
||||
export {ProcessCommentsComponent as ActivitiProcessComments } from './src/components/process-comments.component';
|
||||
export {ProcessFiltersComponent as ActivitiProcessFilters} from './src/components/process-filters.component';
|
||||
export {ProcessInstanceDetailsComponent as ActivitiProcessInstanceDetails} from './src/components/process-instance-details.component';
|
||||
export {ProcessInstanceHeaderComponent as ActivitiProcessInstanceHeader} from './src/components/process-instance-header.component';
|
||||
export {ProcessInstanceTasksComponent as ActivitiProcessInstanceTasks} from './src/components/process-instance-tasks.component';
|
||||
export {ProcessInstanceVariablesComponent as ActivitiProcessInstanceVariables} from './src/components/process-instance-variables.component';
|
||||
export {ProcessInstanceListComponent as ActivitiProcessInstanceListComponent} from './src/components/processlist.component';
|
||||
export {StartProcessInstanceComponent as ActivitiStartProcessInstance} from './src/components/start-process.component';
|
||||
export {ProcessService as ActivitiProcessService} from './src/services/process.service';
|
||||
|
||||
export const ACTIVITI_PROCESSLIST_DIRECTIVES: [any] = [
|
||||
ProcessInstanceListComponent,
|
||||
ProcessFiltersComponent,
|
||||
ProcessInstanceDetailsComponent,
|
||||
ProcessInstanceHeaderComponent,
|
||||
ProcessInstanceTasksComponent,
|
||||
ProcessInstanceVariablesComponent,
|
||||
ProcessCommentsComponent,
|
||||
StartProcessInstanceComponent,
|
||||
ProcessAttachmentListComponent,
|
||||
CreateProcessAttachmentComponent,
|
||||
|
||||
// Old Deprecated export
|
||||
ActivitiProcessInstanceListComponent,
|
||||
ActivitiProcessFiltersComponent,
|
||||
ActivitiProcessInstanceDetailsComponent,
|
||||
ActivitiProcessInstanceHeaderComponent,
|
||||
ActivitiProcessInstanceTasksComponent,
|
||||
ActivitiProcessInstanceVariablesComponent,
|
||||
ActivitiProcessCommentsComponent,
|
||||
ActivitiStartProcessInstanceComponent,
|
||||
ActivitiProcessFilters,
|
||||
ActivitiProcessInstanceHeader,
|
||||
ActivitiProcessInstanceTasks,
|
||||
ActivitiProcessInstanceVariables,
|
||||
ActivitiProcessComments,
|
||||
ActivitiProcessInstanceDetails,
|
||||
ActivitiStartProcessInstance,
|
||||
ActivitiProcessAttachmentListComponent,
|
||||
ActivitiCreateProcessAttachmentComponent
|
||||
];
|
||||
|
||||
export const ACTIVITI_PROCESSLIST_PROVIDERS: [any] = [
|
||||
ActivitiProcessService,
|
||||
ProcessUploadService
|
||||
ProcessService,
|
||||
ProcessUploadService,
|
||||
|
||||
// Old Deprecated import
|
||||
ActivitiProcessService
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
@ -21,7 +21,8 @@ import {
|
||||
TaskDetailsModel,
|
||||
User
|
||||
} from 'ng2-activiti-tasklist';
|
||||
import { FilterProcessRepresentationModel, ProcessDefinitionRepresentation } from '../models/index';
|
||||
import { ProcessDefinitionRepresentation } from '../models/process-definition.model';
|
||||
import { FilterProcessRepresentationModel } from '../models/filter-process.model';
|
||||
|
||||
export let fakeFilters = {
|
||||
size: 1, total: 1, start: 0,
|
@ -19,7 +19,7 @@ import { SimpleChange } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ActivitiContentService } from 'ng2-activiti-form';
|
||||
import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
|
||||
import { ActivitiCreateProcessAttachmentComponent } from './adf-create-process-attachment.component';
|
||||
import { CreateProcessAttachmentComponent } from './create-process-attachment.component';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@ -27,8 +27,8 @@ describe('Activiti Process Create Attachment', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let service: ActivitiContentService;
|
||||
let component: ActivitiCreateProcessAttachmentComponent;
|
||||
let fixture: ComponentFixture<ActivitiCreateProcessAttachmentComponent>;
|
||||
let component: CreateProcessAttachmentComponent;
|
||||
let fixture: ComponentFixture<CreateProcessAttachmentComponent>;
|
||||
let element: HTMLElement;
|
||||
|
||||
let file = new File([new Blob()], 'Test');
|
||||
@ -55,7 +55,7 @@ describe('Activiti Process Create Attachment', () => {
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
ActivitiCreateProcessAttachmentComponent
|
||||
CreateProcessAttachmentComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoTranslationService },
|
||||
@ -65,7 +65,7 @@ describe('Activiti Process Create Attachment', () => {
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ActivitiCreateProcessAttachmentComponent);
|
||||
fixture = TestBed.createComponent(CreateProcessAttachmentComponent);
|
||||
component = fixture.componentInstance;
|
||||
service = fixture.debugElement.injector.get(ActivitiContentService);
|
||||
element = fixture.nativeElement;
|
@ -21,10 +21,10 @@ import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-create-process-attachment',
|
||||
styleUrls: ['./adf-create-process-attachment.component.css'],
|
||||
templateUrl: './adf-create-process-attachment.component.html'
|
||||
styleUrls: ['./create-process-attachment.component.css'],
|
||||
templateUrl: './create-process-attachment.component.html'
|
||||
})
|
||||
export class ActivitiCreateProcessAttachmentComponent implements OnChanges {
|
||||
export class CreateProcessAttachmentComponent implements OnChanges {
|
||||
|
||||
@Input()
|
||||
processInstanceId: string;
|
@ -1,27 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './activiti-processlist.component';
|
||||
export * from './activiti-filters.component';
|
||||
export * from './activiti-process-instance-header.component';
|
||||
export * from './activiti-process-instance-tasks.component';
|
||||
export * from './activiti-process-instance-variables.component';
|
||||
export * from './activiti-process-comments.component';
|
||||
export * from './activiti-process-instance-details.component';
|
||||
export * from './activiti-start-process.component';
|
||||
export * from './adf-process-attachment-list.component';
|
||||
export * from './adf-create-process-attachment.component';
|
@ -26,14 +26,14 @@ import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
|
||||
import { TranslationMock } from './../assets/translation.service.mock';
|
||||
import { ActivitiProcessAttachmentListComponent } from './adf-process-attachment-list.component';
|
||||
import { ProcessAttachmentListComponent } from './process-attachment-list.component';
|
||||
|
||||
describe('ActivitiProcessAttachmentListComponent', () => {
|
||||
describe('ProcessAttachmentListComponent', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let service: ActivitiContentService;
|
||||
let component: ActivitiProcessAttachmentListComponent;
|
||||
let fixture: ComponentFixture<ActivitiProcessAttachmentListComponent>;
|
||||
let component: ProcessAttachmentListComponent;
|
||||
let fixture: ComponentFixture<ProcessAttachmentListComponent>;
|
||||
let getProcessRelatedContentSpy: jasmine.Spy;
|
||||
let deleteContentSpy: jasmine.Spy;
|
||||
let getFileRawContentSpy: jasmine.Spy;
|
||||
@ -47,7 +47,7 @@ describe('ActivitiProcessAttachmentListComponent', () => {
|
||||
MdProgressSpinnerModule
|
||||
],
|
||||
declarations: [
|
||||
ActivitiProcessAttachmentListComponent
|
||||
ProcessAttachmentListComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoTranslationService, useClass: TranslationMock },
|
||||
@ -58,7 +58,7 @@ describe('ActivitiProcessAttachmentListComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ActivitiProcessAttachmentListComponent);
|
||||
fixture = TestBed.createComponent(ProcessAttachmentListComponent);
|
||||
component = fixture.componentInstance;
|
||||
service = fixture.debugElement.injector.get(ActivitiContentService);
|
||||
|
@ -20,11 +20,11 @@ import { ActivitiContentService } from 'ng2-activiti-form';
|
||||
import { AlfrescoTranslationService, ContentService, ThumbnailService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-process-attachment-list',
|
||||
styleUrls: ['./adf-process-attachment-list.component.css'],
|
||||
templateUrl: './adf-process-attachment-list.component.html'
|
||||
selector: 'process-attachment-list',
|
||||
styleUrls: ['./process-attachment-list.component.css'],
|
||||
templateUrl: './process-attachment-list.component.html'
|
||||
})
|
||||
export class ActivitiProcessAttachmentListComponent implements OnChanges {
|
||||
export class ProcessAttachmentListComponent implements OnChanges {
|
||||
|
||||
@Input()
|
||||
processInstanceId: string;
|
@ -24,15 +24,15 @@ import { ActivitiFormModule } from 'ng2-activiti-form';
|
||||
import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
|
||||
|
||||
import { TranslationMock } from './../assets/translation.service.mock';
|
||||
import { ActivitiProcessService } from './../services/activiti-process.service';
|
||||
import { ActivitiProcessCommentsComponent } from './activiti-process-comments.component';
|
||||
import { ProcessService } from './../services/process.service';
|
||||
import { ProcessCommentsComponent } from './process-comments.component';
|
||||
|
||||
describe('ActivitiProcessInstanceComments', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let service: ActivitiProcessService;
|
||||
let component: ActivitiProcessCommentsComponent;
|
||||
let fixture: ComponentFixture<ActivitiProcessCommentsComponent>;
|
||||
let service: ProcessService;
|
||||
let component: ProcessCommentsComponent;
|
||||
let fixture: ComponentFixture<ProcessCommentsComponent>;
|
||||
let getCommentsSpy: jasmine.Spy;
|
||||
let addCommentSpy: jasmine.Spy;
|
||||
|
||||
@ -43,20 +43,20 @@ describe('ActivitiProcessInstanceComments', () => {
|
||||
ActivitiFormModule
|
||||
],
|
||||
declarations: [
|
||||
ActivitiProcessCommentsComponent
|
||||
ProcessCommentsComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoTranslationService, useClass: TranslationMock },
|
||||
ActivitiProcessService
|
||||
ProcessService
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ActivitiProcessCommentsComponent);
|
||||
fixture = TestBed.createComponent(ProcessCommentsComponent);
|
||||
component = fixture.componentInstance;
|
||||
service = fixture.debugElement.injector.get(ActivitiProcessService);
|
||||
service = fixture.debugElement.injector.get(ProcessService);
|
||||
|
||||
getCommentsSpy = spyOn(service, 'getProcessInstanceComments').and.returnValue(Observable.of([{
|
||||
message: 'Test1'
|
@ -20,18 +20,18 @@ import { Comment } from 'ng2-activiti-tasklist';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Observer } from 'rxjs/Observer';
|
||||
import { ActivitiProcessService } from './../services/activiti-process.service';
|
||||
import { ProcessService } from './../services/process.service';
|
||||
|
||||
declare let componentHandler: any;
|
||||
declare let dialogPolyfill: any;
|
||||
|
||||
@Component({
|
||||
selector: 'adf-process-instance-comments, activiti-process-instance-comments',
|
||||
templateUrl: './activiti-process-comments.component.html',
|
||||
styleUrls: ['./activiti-process-comments.component.css'],
|
||||
providers: [ActivitiProcessService]
|
||||
templateUrl: './process-comments.component.html',
|
||||
styleUrls: ['./process-comments.component.css'],
|
||||
providers: [ProcessService]
|
||||
})
|
||||
export class ActivitiProcessCommentsComponent implements OnChanges {
|
||||
export class ProcessCommentsComponent implements OnChanges {
|
||||
|
||||
@Input()
|
||||
processInstanceId: string;
|
||||
@ -56,7 +56,7 @@ export class ActivitiProcessCommentsComponent implements OnChanges {
|
||||
* @param activitiProcess Process service
|
||||
*/
|
||||
constructor(private translate: AlfrescoTranslationService,
|
||||
private activitiProcess: ActivitiProcessService) {
|
||||
private activitiProcess: ProcessService) {
|
||||
|
||||
if (translate) {
|
||||
translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist');
|
@ -19,13 +19,13 @@ import { SimpleChange } from '@angular/core';
|
||||
import { LogServiceMock } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { FilterProcessRepresentationModel } from '../models/filter-process.model';
|
||||
import { ActivitiProcessService } from '../services/activiti-process.service';
|
||||
import { ActivitiProcessFiltersComponent } from './activiti-filters.component';
|
||||
import { ProcessService } from '../services/process.service';
|
||||
import { ProcessFiltersComponent } from './process-filters.component';
|
||||
|
||||
describe('ActivitiFilters', () => {
|
||||
|
||||
let filterList: ActivitiProcessFiltersComponent;
|
||||
let activitiService: ActivitiProcessService;
|
||||
let filterList: ProcessFiltersComponent;
|
||||
let activitiService: ProcessService;
|
||||
let logService: LogServiceMock;
|
||||
|
||||
let fakeGlobalFilter = [];
|
||||
@ -52,8 +52,8 @@ describe('ActivitiFilters', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
logService = new LogServiceMock();
|
||||
activitiService = new ActivitiProcessService(null, logService);
|
||||
filterList = new ActivitiProcessFiltersComponent(null, activitiService, logService);
|
||||
activitiService = new ProcessService(null, logService);
|
||||
filterList = new ProcessFiltersComponent(null, activitiService, logService);
|
||||
});
|
||||
|
||||
it('should return the filter task list', (done) => {
|
@ -19,16 +19,16 @@ import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChange
|
||||
import { AlfrescoTranslationService, LogService } from 'ng2-alfresco-core';
|
||||
import { Observable, Observer } from 'rxjs/Rx';
|
||||
import { FilterParamsModel, FilterProcessRepresentationModel } from './../models/filter-process.model';
|
||||
import { ActivitiProcessService } from './../services/activiti-process.service';
|
||||
import { ProcessService } from './../services/process.service';
|
||||
|
||||
declare let componentHandler: any;
|
||||
|
||||
@Component({
|
||||
selector: 'adf-process-instance-filters, activiti-process-instance-filters',
|
||||
templateUrl: './activiti-filters.component.html',
|
||||
styleUrls: ['activiti-filters.component.css']
|
||||
templateUrl: './process-filters.component.html',
|
||||
styleUrls: ['process-filters.component.css']
|
||||
})
|
||||
export class ActivitiProcessFiltersComponent implements OnInit, OnChanges {
|
||||
export class ProcessFiltersComponent implements OnInit, OnChanges {
|
||||
|
||||
@Input()
|
||||
filterParam: FilterParamsModel;
|
||||
@ -59,7 +59,7 @@ export class ActivitiProcessFiltersComponent implements OnInit, OnChanges {
|
||||
filters: FilterProcessRepresentationModel [] = [];
|
||||
|
||||
constructor(private translate: AlfrescoTranslationService,
|
||||
private activiti: ActivitiProcessService,
|
||||
private activiti: ProcessService,
|
||||
private logService: LogService) {
|
||||
this.filter$ = new Observable<FilterProcessRepresentationModel>(observer => this.filterObserver = observer).share();
|
||||
|
@ -25,18 +25,18 @@ import { ActivitiTaskListModule } from 'ng2-activiti-tasklist';
|
||||
import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
|
||||
|
||||
import { ProcessInstance } from '../models/process-instance.model';
|
||||
import { exampleProcess, exampleProcessNoName } from './../assets/activiti-process.model.mock';
|
||||
import { exampleProcess, exampleProcessNoName } from './../assets/process.model.mock';
|
||||
import { TranslationMock } from './../assets/translation.service.mock';
|
||||
import { ActivitiProcessService } from './../services/activiti-process.service';
|
||||
import { ActivitiProcessInstanceDetailsComponent } from './activiti-process-instance-details.component';
|
||||
import { ProcessService } from './../services/process.service';
|
||||
import { ProcessInstanceDetailsComponent } from './process-instance-details.component';
|
||||
|
||||
describe('ActivitiProcessInstanceDetailsComponent', () => {
|
||||
describe('ProcessInstanceDetailsComponent', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let service: ActivitiProcessService;
|
||||
let service: ProcessService;
|
||||
let formService: FormService;
|
||||
let component: ActivitiProcessInstanceDetailsComponent;
|
||||
let fixture: ComponentFixture<ActivitiProcessInstanceDetailsComponent>;
|
||||
let component: ProcessInstanceDetailsComponent;
|
||||
let fixture: ComponentFixture<ProcessInstanceDetailsComponent>;
|
||||
let getProcessSpy: jasmine.Spy;
|
||||
|
||||
beforeEach(async(() => {
|
||||
@ -47,11 +47,11 @@ describe('ActivitiProcessInstanceDetailsComponent', () => {
|
||||
ActivitiTaskListModule
|
||||
],
|
||||
declarations: [
|
||||
ActivitiProcessInstanceDetailsComponent
|
||||
ProcessInstanceDetailsComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoTranslationService, useClass: TranslationMock },
|
||||
ActivitiProcessService
|
||||
ProcessService
|
||||
],
|
||||
schemas: [ NO_ERRORS_SCHEMA ]
|
||||
}).compileComponents();
|
||||
@ -59,9 +59,9 @@ describe('ActivitiProcessInstanceDetailsComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ActivitiProcessInstanceDetailsComponent);
|
||||
fixture = TestBed.createComponent(ProcessInstanceDetailsComponent);
|
||||
component = fixture.componentInstance;
|
||||
service = fixture.debugElement.injector.get(ActivitiProcessService);
|
||||
service = fixture.debugElement.injector.get(ProcessService);
|
||||
formService = fixture.debugElement.injector.get(FormService);
|
||||
|
||||
getProcessSpy = spyOn(service, 'getProcess').and.returnValue(Observable.of(exampleProcess));
|
@ -21,25 +21,25 @@ import {TaskDetailsEvent} from 'ng2-activiti-tasklist';
|
||||
import {AlfrescoTranslationService, LogService} from 'ng2-alfresco-core';
|
||||
|
||||
import {ProcessInstance} from '../models/process-instance.model';
|
||||
import {ActivitiProcessService} from './../services/activiti-process.service';
|
||||
import {ActivitiProcessInstanceHeaderComponent} from './activiti-process-instance-header.component';
|
||||
import {ActivitiProcessInstanceTasksComponent} from './activiti-process-instance-tasks.component';
|
||||
import {ProcessService} from './../services/process.service';
|
||||
import {ProcessInstanceHeaderComponent} from './process-instance-header.component';
|
||||
import {ProcessInstanceTasksComponent} from './process-instance-tasks.component';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-process-instance-details, activiti-process-instance-details',
|
||||
templateUrl: './activiti-process-instance-details.component.html',
|
||||
styleUrls: ['./activiti-process-instance-details.component.css']
|
||||
templateUrl: './process-instance-details.component.html',
|
||||
styleUrls: ['./process-instance-details.component.css']
|
||||
})
|
||||
export class ActivitiProcessInstanceDetailsComponent implements OnChanges {
|
||||
export class ProcessInstanceDetailsComponent implements OnChanges {
|
||||
|
||||
@Input()
|
||||
processInstanceId: string;
|
||||
|
||||
@ViewChild(ActivitiProcessInstanceHeaderComponent)
|
||||
processInstanceHeader: ActivitiProcessInstanceHeaderComponent;
|
||||
@ViewChild(ProcessInstanceHeaderComponent)
|
||||
processInstanceHeader: ProcessInstanceHeaderComponent;
|
||||
|
||||
@ViewChild(ActivitiProcessInstanceTasksComponent)
|
||||
tasksList: ActivitiProcessInstanceTasksComponent;
|
||||
@ViewChild(ProcessInstanceTasksComponent)
|
||||
tasksList: ProcessInstanceTasksComponent;
|
||||
|
||||
@Input()
|
||||
showTitle: boolean = true;
|
||||
@ -67,7 +67,7 @@ export class ActivitiProcessInstanceDetailsComponent implements OnChanges {
|
||||
* @param activitiProcess Process service
|
||||
*/
|
||||
constructor(private translate: AlfrescoTranslationService,
|
||||
private activitiProcess: ActivitiProcessService,
|
||||
private activitiProcess: ProcessService,
|
||||
private logService: LogService) {
|
||||
|
||||
if (translate) {
|
@ -18,18 +18,18 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
|
||||
import { exampleProcess, processEnded } from './../assets/activiti-process.model.mock';
|
||||
import { exampleProcess, processEnded } from './../assets/process.model.mock';
|
||||
import { TranslationMock } from './../assets/translation.service.mock';
|
||||
import { ProcessInstance } from './../models/process-instance.model';
|
||||
import { ActivitiProcessService } from './../services/activiti-process.service';
|
||||
import { ActivitiProcessCommentsComponent } from './activiti-process-comments.component';
|
||||
import { ActivitiProcessInstanceHeaderComponent } from './activiti-process-instance-header.component';
|
||||
import { ProcessService } from './../services/process.service';
|
||||
import { ProcessCommentsComponent } from './process-comments.component';
|
||||
import { ProcessInstanceHeaderComponent } from './process-instance-header.component';
|
||||
|
||||
describe('ActivitiProcessInstanceHeaderComponent', () => {
|
||||
describe('ProcessInstanceHeaderComponent', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let component: ActivitiProcessInstanceHeaderComponent;
|
||||
let fixture: ComponentFixture<ActivitiProcessInstanceHeaderComponent>;
|
||||
let component: ProcessInstanceHeaderComponent;
|
||||
let fixture: ComponentFixture<ProcessInstanceHeaderComponent>;
|
||||
let element: HTMLElement;
|
||||
|
||||
beforeEach(async(() => {
|
||||
@ -38,11 +38,11 @@ describe('ActivitiProcessInstanceHeaderComponent', () => {
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
ActivitiProcessInstanceHeaderComponent,
|
||||
ActivitiProcessCommentsComponent
|
||||
ProcessInstanceHeaderComponent,
|
||||
ProcessCommentsComponent
|
||||
],
|
||||
providers: [
|
||||
ActivitiProcessService,
|
||||
ProcessService,
|
||||
{provide: AlfrescoTranslationService, useClass: TranslationMock}
|
||||
]
|
||||
}).compileComponents();
|
||||
@ -50,7 +50,7 @@ describe('ActivitiProcessInstanceHeaderComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ActivitiProcessInstanceHeaderComponent);
|
||||
fixture = TestBed.createComponent(ProcessInstanceHeaderComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
|
@ -24,10 +24,10 @@ declare let componentHandler: any;
|
||||
|
||||
@Component({
|
||||
selector: 'adf-process-instance-header, activiti-process-instance-header',
|
||||
templateUrl: './activiti-process-instance-header.component.html',
|
||||
styleUrls: ['./activiti-process-instance-header.component.css']
|
||||
templateUrl: './process-instance-header.component.html',
|
||||
styleUrls: ['./process-instance-header.component.css']
|
||||
})
|
||||
export class ActivitiProcessInstanceHeaderComponent {
|
||||
export class ProcessInstanceHeaderComponent {
|
||||
|
||||
@Input()
|
||||
showDiagram: boolean = true;
|
@ -26,16 +26,16 @@ import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
|
||||
import { taskDetailsMock } from './../assets/task-details.mock';
|
||||
import { TranslationMock } from './../assets/translation.service.mock';
|
||||
import { ProcessInstance } from './../models/process-instance.model';
|
||||
import { ActivitiProcessService } from './../services/activiti-process.service';
|
||||
import { ActivitiProcessInstanceTasksComponent } from './activiti-process-instance-tasks.component';
|
||||
import { ProcessService } from './../services/process.service';
|
||||
import { ProcessInstanceTasksComponent } from './process-instance-tasks.component';
|
||||
|
||||
describe('ActivitiProcessInstanceTasksComponent', () => {
|
||||
describe('ProcessInstanceTasksComponent', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let component: ActivitiProcessInstanceTasksComponent;
|
||||
let fixture: ComponentFixture<ActivitiProcessInstanceTasksComponent>;
|
||||
let component: ProcessInstanceTasksComponent;
|
||||
let fixture: ComponentFixture<ProcessInstanceTasksComponent>;
|
||||
let debugElement: DebugElement;
|
||||
let service: ActivitiProcessService;
|
||||
let service: ProcessService;
|
||||
let getProcessTasksSpy: jasmine.Spy;
|
||||
|
||||
let exampleProcessInstance = new ProcessInstance({ id: '123' });
|
||||
@ -46,11 +46,11 @@ describe('ActivitiProcessInstanceTasksComponent', () => {
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
ActivitiProcessInstanceTasksComponent
|
||||
ProcessInstanceTasksComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoTranslationService, useClass: TranslationMock },
|
||||
ActivitiProcessService
|
||||
ProcessService
|
||||
],
|
||||
schemas: [NO_ERRORS_SCHEMA]
|
||||
}).compileComponents();
|
||||
@ -58,10 +58,10 @@ describe('ActivitiProcessInstanceTasksComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ActivitiProcessInstanceTasksComponent);
|
||||
fixture = TestBed.createComponent(ProcessInstanceTasksComponent);
|
||||
component = fixture.componentInstance;
|
||||
debugElement = fixture.debugElement;
|
||||
service = fixture.debugElement.injector.get(ActivitiProcessService);
|
||||
service = fixture.debugElement.injector.get(ProcessService);
|
||||
getProcessTasksSpy = spyOn(service, 'getProcessTasks').and.returnValue(Observable.of([new TaskDetailsModel(taskDetailsMock)]));
|
||||
|
||||
componentHandler = jasmine.createSpyObj('componentHandler', [
|
@ -21,17 +21,17 @@ import { TaskDetailsEvent, TaskDetailsModel } from 'ng2-activiti-tasklist';
|
||||
import { AlfrescoTranslationService, LogService } from 'ng2-alfresco-core';
|
||||
import { Observable, Observer } from 'rxjs/Rx';
|
||||
import { ProcessInstance } from '../models/process-instance.model';
|
||||
import { ActivitiProcessService } from './../services/activiti-process.service';
|
||||
import { ProcessService } from './../services/process.service';
|
||||
|
||||
declare let componentHandler: any;
|
||||
declare let dialogPolyfill: any;
|
||||
|
||||
@Component({
|
||||
selector: 'adf-process-instance-tasks, activiti-process-instance-tasks',
|
||||
templateUrl: './activiti-process-instance-tasks.component.html',
|
||||
styleUrls: ['./activiti-process-instance-tasks.component.css']
|
||||
templateUrl: './process-instance-tasks.component.html',
|
||||
styleUrls: ['./process-instance-tasks.component.css']
|
||||
})
|
||||
export class ActivitiProcessInstanceTasksComponent implements OnInit, OnChanges {
|
||||
export class ProcessInstanceTasksComponent implements OnInit, OnChanges {
|
||||
|
||||
@Input()
|
||||
processInstanceDetails: ProcessInstance;
|
||||
@ -67,7 +67,7 @@ export class ActivitiProcessInstanceTasksComponent implements OnInit, OnChanges
|
||||
taskClick: EventEmitter<TaskDetailsEvent> = new EventEmitter<TaskDetailsEvent>();
|
||||
|
||||
constructor(private translate: AlfrescoTranslationService,
|
||||
private activitiProcess: ActivitiProcessService,
|
||||
private activitiProcess: ProcessService,
|
||||
private logService: LogService) {
|
||||
if (translate) {
|
||||
translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist');
|
@ -25,15 +25,15 @@ import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
|
||||
import { DataTableModule, ObjectDataRow, ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
|
||||
|
||||
import { TranslationMock } from './../assets/translation.service.mock';
|
||||
import { ActivitiProcessService } from './../services/activiti-process.service';
|
||||
import { ActivitiProcessInstanceVariablesComponent } from './activiti-process-instance-variables.component';
|
||||
import { ProcessService } from './../services/process.service';
|
||||
import { ProcessInstanceVariablesComponent } from './process-instance-variables.component';
|
||||
|
||||
describe('ActivitiProcessInstanceVariablesComponent', () => {
|
||||
describe('ProcessInstanceVariablesComponent', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let service: ActivitiProcessService;
|
||||
let component: ActivitiProcessInstanceVariablesComponent;
|
||||
let fixture: ComponentFixture<ActivitiProcessInstanceVariablesComponent>;
|
||||
let service: ProcessService;
|
||||
let component: ProcessInstanceVariablesComponent;
|
||||
let fixture: ComponentFixture<ProcessInstanceVariablesComponent>;
|
||||
let getVariablesSpy: jasmine.Spy;
|
||||
let createOrUpdateProcessInstanceVariablesSpy: jasmine.Spy;
|
||||
let deleteProcessInstanceVariableSpy: jasmine.Spy;
|
||||
@ -46,20 +46,20 @@ describe('ActivitiProcessInstanceVariablesComponent', () => {
|
||||
MdProgressSpinnerModule
|
||||
],
|
||||
declarations: [
|
||||
ActivitiProcessInstanceVariablesComponent
|
||||
ProcessInstanceVariablesComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AlfrescoTranslationService, useClass: TranslationMock },
|
||||
ActivitiProcessService
|
||||
ProcessService
|
||||
]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ActivitiProcessInstanceVariablesComponent);
|
||||
fixture = TestBed.createComponent(ProcessInstanceVariablesComponent);
|
||||
component = fixture.componentInstance;
|
||||
service = fixture.debugElement.injector.get(ActivitiProcessService);
|
||||
service = fixture.debugElement.injector.get(ProcessService);
|
||||
|
||||
getVariablesSpy = spyOn(service, 'getProcessInstanceVariables').and.returnValue(Observable.of([{
|
||||
name: 'var1',
|
@ -20,18 +20,18 @@ import { Component, DebugElement, EventEmitter, Input, OnChanges, OnInit, Output
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { DataCellEvent, DataTableAdapter, ObjectDataRow, ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
|
||||
import { ProcessInstanceVariable } from './../models/process-instance-variable.model';
|
||||
import { ActivitiProcessService } from './../services/activiti-process.service';
|
||||
import { ProcessService } from './../services/process.service';
|
||||
|
||||
declare let componentHandler: any;
|
||||
declare let dialogPolyfill: any;
|
||||
|
||||
@Component({
|
||||
selector: 'adf-process-instance-variables, activiti-process-instance-variables',
|
||||
templateUrl: './activiti-process-instance-variables.component.html',
|
||||
styleUrls: ['./activiti-process-instance-variables.component.css'],
|
||||
providers: [ActivitiProcessService]
|
||||
templateUrl: './process-instance-variables.component.html',
|
||||
styleUrls: ['./process-instance-variables.component.css'],
|
||||
providers: [ProcessService]
|
||||
})
|
||||
export class ActivitiProcessInstanceVariablesComponent implements OnInit, OnChanges {
|
||||
export class ProcessInstanceVariablesComponent implements OnInit, OnChanges {
|
||||
|
||||
@Input()
|
||||
processInstanceId: string;
|
||||
@ -69,7 +69,7 @@ export class ActivitiProcessInstanceVariablesComponent implements OnInit, OnChan
|
||||
* @param activitiProcess Process service
|
||||
*/
|
||||
constructor(private translate: AlfrescoTranslationService,
|
||||
private activitiProcess: ActivitiProcessService) {
|
||||
private activitiProcess: ProcessService) {
|
||||
|
||||
if (translate) {
|
||||
translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist');
|
@ -19,21 +19,21 @@ import { SimpleChange } from '@angular/core';
|
||||
import { async, ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { MdProgressSpinnerModule } from '@angular/material';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { ActivitiProcessInstanceListComponent } from './activiti-processlist.component';
|
||||
import { ProcessInstanceListComponent } from './processlist.component';
|
||||
|
||||
import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
|
||||
import { DataRowEvent, DataSorting, DataTableModule, ObjectDataRow, ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
|
||||
|
||||
import { fakeProcessInstances, fakeProcessInstancesWithNoName } from '../assets/activiti-process-instances-list.mock';
|
||||
import { ActivitiProcessService } from '../services/activiti-process.service';
|
||||
import { fakeProcessInstances, fakeProcessInstancesWithNoName } from '../assets/process-instances-list.mock';
|
||||
import { ProcessService } from '../services/process.service';
|
||||
import { TranslationMock } from './../assets/translation.service.mock';
|
||||
|
||||
describe('ActivitiProcessInstanceListComponent', () => {
|
||||
describe('ProcessInstanceListComponent', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let fixture: ComponentFixture<ActivitiProcessInstanceListComponent>;
|
||||
let component: ActivitiProcessInstanceListComponent;
|
||||
let service: ActivitiProcessService;
|
||||
let fixture: ComponentFixture<ProcessInstanceListComponent>;
|
||||
let component: ProcessInstanceListComponent;
|
||||
let service: ProcessService;
|
||||
let getProcessInstancesSpy: jasmine.Spy;
|
||||
|
||||
beforeEach(async(() => {
|
||||
@ -43,15 +43,15 @@ describe('ActivitiProcessInstanceListComponent', () => {
|
||||
DataTableModule.forRoot(),
|
||||
MdProgressSpinnerModule
|
||||
],
|
||||
declarations: [ ActivitiProcessInstanceListComponent ],
|
||||
declarations: [ ProcessInstanceListComponent ],
|
||||
providers: [
|
||||
ActivitiProcessService,
|
||||
ProcessService,
|
||||
{provide: AlfrescoTranslationService, useClass: TranslationMock}
|
||||
]
|
||||
}).compileComponents().then(() => {
|
||||
fixture = TestBed.createComponent(ActivitiProcessInstanceListComponent);
|
||||
fixture = TestBed.createComponent(ProcessInstanceListComponent);
|
||||
component = fixture.componentInstance;
|
||||
service = fixture.debugElement.injector.get(ActivitiProcessService);
|
||||
service = fixture.debugElement.injector.get(ProcessService);
|
||||
|
||||
getProcessInstancesSpy = spyOn(service, 'getProcessInstances').and.returnValue(Observable.of(fakeProcessInstances));
|
||||
|
@ -21,14 +21,14 @@ import { AlfrescoTranslationService, DataColumnListComponent } from 'ng2-alfresc
|
||||
import { DataColumn, DataRowEvent, DataSorting, DataTableAdapter, ObjectDataRow, ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
|
||||
import { ProcessFilterRequestRepresentation } from '../models/process-instance-filter.model';
|
||||
import { ProcessInstance } from '../models/process-instance.model';
|
||||
import { ActivitiProcessService } from '../services/activiti-process.service';
|
||||
import { ProcessService } from '../services/process.service';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-process-instance-list, activiti-process-instance-list',
|
||||
styleUrls: ['./activiti-processlist.component.css'],
|
||||
templateUrl: './activiti-processlist.component.html'
|
||||
styleUrls: ['./processlist.component.css'],
|
||||
templateUrl: './processlist.component.html'
|
||||
})
|
||||
export class ActivitiProcessInstanceListComponent implements OnChanges, AfterContentInit {
|
||||
export class ProcessInstanceListComponent implements OnChanges, AfterContentInit {
|
||||
|
||||
@ContentChild(DataColumnListComponent) columnList: DataColumnListComponent;
|
||||
|
||||
@ -69,7 +69,7 @@ export class ActivitiProcessInstanceListComponent implements OnChanges, AfterCon
|
||||
{ type: 'text', key: 'created', title: 'Created', cssClass: 'hidden', sortable: true }
|
||||
];
|
||||
|
||||
constructor(private processService: ActivitiProcessService,
|
||||
constructor(private processService: ProcessService,
|
||||
private translate: AlfrescoTranslationService) {
|
||||
if (translate !== null) {
|
||||
translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist');
|
@ -23,17 +23,17 @@ import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
|
||||
import { RestVariable } from 'alfresco-js-api';
|
||||
import { ActivitiProcessService } from '../services/activiti-process.service';
|
||||
import { fakeProcessDefs, fakeProcessDefWithForm, newProcess, taskFormMock } from './../assets/activiti-start-process.component.mock';
|
||||
import { ProcessService } from '../services/process.service';
|
||||
import { fakeProcessDefs, fakeProcessDefWithForm, newProcess, taskFormMock } from './../assets/start-process.component.mock';
|
||||
import { TranslationMock } from './../assets/translation.service.mock';
|
||||
import { ActivitiStartProcessInstanceComponent } from './activiti-start-process.component';
|
||||
import { StartProcessInstanceComponent } from './start-process.component';
|
||||
|
||||
describe('ActivitiStartProcessInstanceComponent', () => {
|
||||
describe('StartProcessInstanceComponent', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let component: ActivitiStartProcessInstanceComponent;
|
||||
let fixture: ComponentFixture<ActivitiStartProcessInstanceComponent>;
|
||||
let processService: ActivitiProcessService;
|
||||
let component: StartProcessInstanceComponent;
|
||||
let fixture: ComponentFixture<StartProcessInstanceComponent>;
|
||||
let processService: ProcessService;
|
||||
let formService: FormService;
|
||||
let getDefinitionsSpy: jasmine.Spy;
|
||||
let getStartFormDefinitionSpy: jasmine.Spy;
|
||||
@ -47,11 +47,11 @@ describe('ActivitiStartProcessInstanceComponent', () => {
|
||||
ActivitiFormModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
ActivitiStartProcessInstanceComponent
|
||||
StartProcessInstanceComponent
|
||||
],
|
||||
providers: [
|
||||
{provide: AlfrescoTranslationService, useClass: TranslationMock},
|
||||
ActivitiProcessService,
|
||||
ProcessService,
|
||||
FormService
|
||||
]
|
||||
}).compileComponents();
|
||||
@ -59,10 +59,10 @@ describe('ActivitiStartProcessInstanceComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ActivitiStartProcessInstanceComponent);
|
||||
fixture = TestBed.createComponent(StartProcessInstanceComponent);
|
||||
component = fixture.componentInstance;
|
||||
debugElement = fixture.debugElement;
|
||||
processService = fixture.debugElement.injector.get(ActivitiProcessService);
|
||||
processService = fixture.debugElement.injector.get(ProcessService);
|
||||
formService = fixture.debugElement.injector.get(FormService);
|
||||
|
||||
getDefinitionsSpy = spyOn(processService, 'getProcessDefinitions').and.returnValue(Observable.of(fakeProcessDefs));
|
@ -17,21 +17,21 @@
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { RestVariable } from 'alfresco-js-api';
|
||||
import { ActivitiStartFormComponent } from 'ng2-activiti-form';
|
||||
import { StartFormComponent } from 'ng2-activiti-form';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { ProcessDefinitionRepresentation } from './../models/process-definition.model';
|
||||
import { ProcessInstance } from './../models/process-instance.model';
|
||||
import { ActivitiProcessService } from './../services/activiti-process.service';
|
||||
import { ProcessService } from './../services/process.service';
|
||||
|
||||
declare let componentHandler: any;
|
||||
declare let dialogPolyfill: any;
|
||||
|
||||
@Component({
|
||||
selector: 'adf-start-process, activiti-start-process',
|
||||
templateUrl: './activiti-start-process.component.html',
|
||||
styleUrls: ['./activiti-start-process.component.css']
|
||||
templateUrl: './start-process.component.html',
|
||||
styleUrls: ['./start-process.component.css']
|
||||
})
|
||||
export class ActivitiStartProcessInstanceComponent implements OnChanges {
|
||||
export class StartProcessInstanceComponent implements OnChanges {
|
||||
|
||||
@Input()
|
||||
appId: string;
|
||||
@ -45,8 +45,8 @@ export class ActivitiStartProcessInstanceComponent implements OnChanges {
|
||||
@Output()
|
||||
error: EventEmitter<ProcessInstance> = new EventEmitter<ProcessInstance>();
|
||||
|
||||
@ViewChild(ActivitiStartFormComponent)
|
||||
startForm: ActivitiStartFormComponent;
|
||||
@ViewChild(StartFormComponent)
|
||||
startForm: StartFormComponent;
|
||||
|
||||
processDefinitions: ProcessDefinitionRepresentation[] = [];
|
||||
|
||||
@ -57,7 +57,7 @@ export class ActivitiStartProcessInstanceComponent implements OnChanges {
|
||||
errorMessageId: string = '';
|
||||
|
||||
constructor(private translate: AlfrescoTranslationService,
|
||||
private activitiProcess: ActivitiProcessService) {
|
||||
private activitiProcess: ProcessService) {
|
||||
|
||||
if (translate) {
|
||||
translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist');
|
@ -1,22 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './filter-process.model';
|
||||
export * from './process-definition.model';
|
||||
export * from './process-instance.model';
|
||||
export * from './process-instance-filter.model';
|
||||
export * from './process-instance-variable.model';
|
@ -19,7 +19,7 @@ import { TestBed } from '@angular/core/testing';
|
||||
import { async } from '@angular/core/testing';
|
||||
import { AlfrescoApi } from 'alfresco-js-api';
|
||||
import { AlfrescoApiService, CoreModule } from 'ng2-alfresco-core';
|
||||
import { exampleProcess } from '../assets/activiti-process.model.mock';
|
||||
import { exampleProcess } from '../assets/process.model.mock';
|
||||
import {
|
||||
fakeApp1,
|
||||
fakeApp2,
|
||||
@ -28,16 +28,16 @@ import {
|
||||
fakeFilters,
|
||||
fakeProcessDef,
|
||||
fakeTaskList
|
||||
} from '../assets/activiti-process.service.mock';
|
||||
} from '../assets/process.service.mock';
|
||||
import { FilterProcessRepresentationModel } from '../models/filter-process.model';
|
||||
import { ProcessFilterRequestRepresentation } from '../models/process-instance-filter.model';
|
||||
import { ProcessInstanceVariable } from '../models/process-instance-variable.model';
|
||||
import { ActivitiProcessService } from './activiti-process.service';
|
||||
import { ProcessService } from './process.service';
|
||||
|
||||
declare let jasmine: any;
|
||||
describe('ActivitiProcessService', () => {
|
||||
describe('ProcessService', () => {
|
||||
|
||||
let service: ActivitiProcessService;
|
||||
let service: ProcessService;
|
||||
let apiService: AlfrescoApiService;
|
||||
let alfrescoApi: AlfrescoApi;
|
||||
|
||||
@ -47,10 +47,10 @@ describe('ActivitiProcessService', () => {
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
providers: [
|
||||
ActivitiProcessService
|
||||
ProcessService
|
||||
]
|
||||
});
|
||||
service = TestBed.get(ActivitiProcessService);
|
||||
service = TestBed.get(ProcessService);
|
||||
apiService = TestBed.get(AlfrescoApiService);
|
||||
alfrescoApi = apiService.getInstance();
|
||||
});
|
@ -21,14 +21,15 @@ import { AppDefinitionRepresentationModel, Comment, TaskDetailsModel, User } fro
|
||||
import { AlfrescoApiService, LogService } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { FilterProcessRepresentationModel } from '../models/filter-process.model';
|
||||
import { ProcessDefinitionRepresentation, ProcessInstance } from '../models/index';
|
||||
import { ProcessDefinitionRepresentation } from '../models/process-definition.model';
|
||||
import { ProcessFilterRequestRepresentation } from '../models/process-instance-filter.model';
|
||||
import { ProcessInstance } from '../models/process-instance.model';
|
||||
import { ProcessInstanceVariable } from './../models/process-instance-variable.model';
|
||||
|
||||
declare let moment: any;
|
||||
|
||||
@Injectable()
|
||||
export class ActivitiProcessService {
|
||||
export class ProcessService {
|
||||
|
||||
constructor(private apiService: AlfrescoApiService,
|
||||
private logService: LogService) {
|
@ -17,71 +17,133 @@
|
||||
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { ModuleWithProviders, NgModule } from '@angular/core';
|
||||
import {
|
||||
MdAutocompleteModule,
|
||||
MdButtonModule,
|
||||
MdCardModule,
|
||||
MdDatepickerModule,
|
||||
MdGridListModule,
|
||||
MdIconModule,
|
||||
MdInputModule,
|
||||
MdNativeDateModule,
|
||||
MdProgressSpinnerModule,
|
||||
MdSelectModule
|
||||
} from '@angular/material';
|
||||
import { MdAutocompleteModule, MdButtonModule, MdCardModule, MdDatepickerModule, MdGridListModule,
|
||||
MdIconModule, MdInputModule, MdNativeDateModule, MdProgressSpinnerModule, MdSelectModule } from '@angular/material';
|
||||
import { ActivitiFormModule } from 'ng2-activiti-form';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||
import { ActivitiPeopleService } from './src/services/activiti-people.service';
|
||||
import { ActivitiTaskListService } from './src/services/activiti-tasklist.service';
|
||||
import { PeopleService } from './src/services/people.service';
|
||||
import { ProcessUploadService } from './src/services/process-upload.service';
|
||||
import { TaskListService } from './src/services/tasklist.service';
|
||||
|
||||
import {
|
||||
ActivitiAppsComponent,
|
||||
ActivitiChecklistComponent,
|
||||
ActivitiCommentsComponent,
|
||||
ActivitiCreateTaskAttachmentComponent,
|
||||
ActivitiFiltersComponent,
|
||||
ActivitiPeopleComponent,
|
||||
ActivitiPeopleSearchComponent,
|
||||
ActivitiStartTaskComponent,
|
||||
ActivitiTaskDetailsComponent,
|
||||
ActivitiTaskHeaderComponent,
|
||||
ActivitiTaskListComponent,
|
||||
AdfCommentListComponent,
|
||||
NoTaskDetailsTemplateDirective,
|
||||
PeopleListComponent,
|
||||
TaskAttachmentListComponent
|
||||
} from './src/components/index';
|
||||
import {AppsListComponent } from './src/components/apps-list.component';
|
||||
import {ChecklistComponent } from './src/components/checklist.component';
|
||||
import {CommentListComponent } from './src/components/comment-list.component';
|
||||
import {CommentsComponent } from './src/components/comments.component';
|
||||
import {AttachmentComponent } from './src/components/create-task-attachment.component';
|
||||
import {NoTaskDetailsTemplateDirective } from './src/components/no-task-detail-template.directive';
|
||||
import {PeopleListComponent } from './src/components/people-list.component';
|
||||
import {PeopleSearchComponent } from './src/components/people-search.component';
|
||||
import {PeopleComponent } from './src/components/people.component';
|
||||
import {StartTaskComponent } from './src/components/start-task.component';
|
||||
import {TaskAttachmentListComponent} from './src/components/task-attachment-list.component';
|
||||
import {TaskDetailsComponent } from './src/components/task-details.component';
|
||||
import {TaskFiltersComponent } from './src/components/task-filters.component';
|
||||
import {TaskHeaderComponent } from './src/components/task-header.component';
|
||||
import {TaskListComponent } from './src/components/tasklist.component';
|
||||
|
||||
export * from './src/components/index';
|
||||
export * from './src/services/activiti-tasklist.service';
|
||||
export * from './src/services/activiti-people.service';
|
||||
export * from './src/services/process-upload.service';
|
||||
export * from './src/models/index';
|
||||
export {AppsListComponent } from './src/components/apps-list.component';
|
||||
export {TaskListComponent } from './src/components/tasklist.component';
|
||||
export {ChecklistComponent } from './src/components/checklist.component';
|
||||
export {CommentsComponent } from './src/components/comments.component';
|
||||
export {TaskAttachmentListComponent} from './src/components/task-attachment-list.component';
|
||||
export {PeopleComponent } from './src/components/people.component';
|
||||
export {TaskHeaderComponent } from './src/components/task-header.component';
|
||||
export {NoTaskDetailsTemplateDirective } from './src/components/no-task-detail-template.directive';
|
||||
export {TaskFiltersComponent } from './src/components/task-filters.component';
|
||||
export {TaskDetailsComponent } from './src/components/task-details.component';
|
||||
export {StartTaskComponent } from './src/components/start-task.component';
|
||||
export {PeopleSearchComponent } from './src/components/people-search.component';
|
||||
export {AttachmentComponent } from './src/components/create-task-attachment.component';
|
||||
export {PeopleListComponent } from './src/components/people-list.component';
|
||||
export {CommentListComponent } from './src/components/comment-list.component';
|
||||
|
||||
export { TaskListService } from './src/services/tasklist.service';
|
||||
export { PeopleService } from './src/services/people.service';
|
||||
export { ProcessUploadService } from './src/services/process-upload.service';
|
||||
|
||||
// Old Deprecated export
|
||||
import {AppsListComponent as ActivitiApps} from './src/components/apps-list.component';
|
||||
import {ChecklistComponent as ActivitiChecklist} from './src/components/checklist.component';
|
||||
import {CommentsComponent as ActivitiComments} from './src/components/comments.component';
|
||||
import {AttachmentComponent as ActivitiCreateTaskAttachmentComponent } from './src/components/create-task-attachment.component';
|
||||
import {NoTaskDetailsTemplateDirective as NoTaskDetailsTemplateComponent } from './src/components/no-task-detail-template.directive';
|
||||
import {PeopleListComponent as PeopleList } from './src/components/people-list.component';
|
||||
import {PeopleSearchComponent as ActivitiPeopleSearch } from './src/components/people-search.component';
|
||||
import {PeopleComponent as ActivitiPeople} from './src/components/people.component';
|
||||
import {StartTaskComponent as ActivitiStartTaskButton } from './src/components/start-task.component';
|
||||
import {TaskDetailsComponent as ActivitiTaskDetails } from './src/components/task-details.component';
|
||||
import {TaskFiltersComponent as ActivitiFilters } from './src/components/task-filters.component';
|
||||
import {TaskHeaderComponent as ActivitiTaskHeader} from './src/components/task-header.component';
|
||||
import {TaskListComponent as ActivitiTaskList } from './src/components/tasklist.component';
|
||||
import {PeopleService as ActivitiPeopleService } from './src/services/people.service';
|
||||
import {TaskListService as ActivitiTaskListService } from './src/services/tasklist.service';
|
||||
export {AppsListComponent as ActivitiApps} from './src/components/apps-list.component';
|
||||
export {ChecklistComponent as ActivitiChecklist} from './src/components/checklist.component';
|
||||
export {CommentsComponent as ActivitiComments} from './src/components/comments.component';
|
||||
export {AttachmentComponent as ActivitiCreateTaskAttachmentComponent } from './src/components/create-task-attachment.component';
|
||||
export {NoTaskDetailsTemplateDirective as NoTaskDetailsTemplateComponent } from './src/components/no-task-detail-template.directive';
|
||||
export {PeopleListComponent as PeopleList } from './src/components/people-list.component';
|
||||
export {PeopleSearchComponent as ActivitiPeopleSearch } from './src/components/people-search.component';
|
||||
export {PeopleComponent as ActivitiPeople} from './src/components/people.component';
|
||||
export {StartTaskComponent as ActivitiStartTaskButton } from './src/components/start-task.component';
|
||||
export {TaskDetailsComponent as ActivitiTaskDetails } from './src/components/task-details.component';
|
||||
export {TaskFiltersComponent as ActivitiFilters } from './src/components/task-filters.component';
|
||||
export {TaskHeaderComponent as ActivitiTaskHeader} from './src/components/task-header.component';
|
||||
export {TaskListComponent as ActivitiTaskList } from './src/components/tasklist.component';
|
||||
export {PeopleService as ActivitiPeopleService } from './src/services/people.service';
|
||||
export {TaskListService as ActivitiTaskListService } from './src/services/tasklist.service';
|
||||
|
||||
export * from './src/models/comment.model';
|
||||
export * from './src/models/filter.model';
|
||||
export * from './src/models/icon.model';
|
||||
export * from './src/models/user.model';
|
||||
export * from './src/models/task-details.model';
|
||||
export * from './src/models/task-details.event';
|
||||
export * from './src/models/user-event.model';
|
||||
export * from './src/models/start-task.model';
|
||||
|
||||
export const ACTIVITI_TASKLIST_DIRECTIVES: any[] = [
|
||||
NoTaskDetailsTemplateDirective,
|
||||
ActivitiAppsComponent,
|
||||
ActivitiFiltersComponent,
|
||||
ActivitiTaskListComponent,
|
||||
ActivitiTaskDetailsComponent,
|
||||
ActivitiChecklistComponent,
|
||||
ActivitiCommentsComponent,
|
||||
ActivitiPeopleComponent,
|
||||
ActivitiTaskHeaderComponent,
|
||||
ActivitiStartTaskComponent,
|
||||
ActivitiPeopleSearchComponent,
|
||||
AppsListComponent,
|
||||
TaskFiltersComponent,
|
||||
TaskListComponent,
|
||||
TaskDetailsComponent,
|
||||
ChecklistComponent,
|
||||
CommentsComponent,
|
||||
PeopleComponent,
|
||||
TaskHeaderComponent,
|
||||
StartTaskComponent,
|
||||
PeopleSearchComponent,
|
||||
TaskAttachmentListComponent,
|
||||
ActivitiCreateTaskAttachmentComponent,
|
||||
AttachmentComponent,
|
||||
PeopleListComponent,
|
||||
AdfCommentListComponent
|
||||
CommentListComponent,
|
||||
|
||||
// Old Deprecated export
|
||||
ActivitiApps,
|
||||
ActivitiTaskList,
|
||||
ActivitiTaskDetails,
|
||||
ActivitiFilters,
|
||||
NoTaskDetailsTemplateComponent,
|
||||
ActivitiChecklist,
|
||||
ActivitiComments,
|
||||
ActivitiPeople,
|
||||
ActivitiTaskHeader,
|
||||
ActivitiStartTaskButton,
|
||||
ActivitiPeopleSearch,
|
||||
ActivitiCreateTaskAttachmentComponent,
|
||||
PeopleList
|
||||
];
|
||||
|
||||
export const ACTIVITI_TASKLIST_PROVIDERS: any[] = [
|
||||
TaskListService,
|
||||
PeopleService,
|
||||
ProcessUploadService,
|
||||
|
||||
// Old Deprecated export
|
||||
ActivitiTaskListService,
|
||||
ActivitiPeopleService,
|
||||
ProcessUploadService
|
||||
ActivitiPeopleService
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
@ -21,17 +21,17 @@ import { By } from '@angular/platform-browser';
|
||||
import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
|
||||
import { defaultApp, deployedApps, nonDeployedApps } from './../assets/activiti-apps.mock';
|
||||
import { ActivitiTaskListService } from './../services/activiti-tasklist.service';
|
||||
import { ActivitiAppsComponent } from './activiti-apps.component';
|
||||
import { defaultApp, deployedApps, nonDeployedApps } from './../assets/apps-list.mock';
|
||||
import { TaskListService } from './../services/tasklist.service';
|
||||
import { AppsListComponent } from './apps-list.component';
|
||||
|
||||
describe('ActivitiAppsComponent', () => {
|
||||
describe('AppsListComponent', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let component: ActivitiAppsComponent;
|
||||
let fixture: ComponentFixture<ActivitiAppsComponent>;
|
||||
let component: AppsListComponent;
|
||||
let fixture: ComponentFixture<AppsListComponent>;
|
||||
let debugElement: DebugElement;
|
||||
let service: ActivitiTaskListService;
|
||||
let service: TaskListService;
|
||||
let getAppsSpy: jasmine.Spy;
|
||||
|
||||
beforeEach(async(() => {
|
||||
@ -40,10 +40,10 @@ describe('ActivitiAppsComponent', () => {
|
||||
CoreModule
|
||||
],
|
||||
declarations: [
|
||||
ActivitiAppsComponent
|
||||
AppsListComponent
|
||||
],
|
||||
providers: [
|
||||
ActivitiTaskListService
|
||||
TaskListService
|
||||
]
|
||||
}).compileComponents();
|
||||
|
||||
@ -54,11 +54,11 @@ describe('ActivitiAppsComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ActivitiAppsComponent);
|
||||
fixture = TestBed.createComponent(AppsListComponent);
|
||||
component = fixture.componentInstance;
|
||||
debugElement = fixture.debugElement;
|
||||
|
||||
service = fixture.debugElement.injector.get(ActivitiTaskListService);
|
||||
service = fixture.debugElement.injector.get(TaskListService);
|
||||
getAppsSpy = spyOn(service, 'getDeployedApplications').and.returnValue(Observable.of(deployedApps));
|
||||
|
||||
componentHandler = jasmine.createSpyObj('componentHandler', [
|
||||
@ -148,14 +148,14 @@ describe('ActivitiAppsComponent', () => {
|
||||
});
|
||||
|
||||
it('should display a grid when configured to', () => {
|
||||
component.layoutType = ActivitiAppsComponent.LAYOUT_GRID;
|
||||
component.layoutType = AppsListComponent.LAYOUT_GRID;
|
||||
fixture.detectChanges();
|
||||
expect(component.isGrid()).toBe(true);
|
||||
expect(component.isList()).toBe(false);
|
||||
});
|
||||
|
||||
it('should display a list when configured to', () => {
|
||||
component.layoutType = ActivitiAppsComponent.LAYOUT_LIST;
|
||||
component.layoutType = AppsListComponent.LAYOUT_LIST;
|
||||
fixture.detectChanges();
|
||||
expect(component.isGrid()).toBe(false);
|
||||
expect(component.isList()).toBe(true);
|
@ -21,17 +21,17 @@ import { Observable } from 'rxjs/Observable';
|
||||
import { Observer } from 'rxjs/Observer';
|
||||
import { AppDefinitionRepresentationModel } from '../models/filter.model';
|
||||
import { IconModel } from '../models/icon.model';
|
||||
import { ActivitiTaskListService } from './../services/activiti-tasklist.service';
|
||||
import { TaskListService } from './../services/tasklist.service';
|
||||
|
||||
declare let componentHandler: any;
|
||||
|
||||
@Component({
|
||||
selector: 'adf-apps, activiti-apps',
|
||||
templateUrl: 'activiti-apps.component.html',
|
||||
styleUrls: ['./activiti-apps.component.css', './activiti-apps-grid.component.css'],
|
||||
providers: [ActivitiTaskListService]
|
||||
templateUrl: 'apps-list.component.html',
|
||||
styleUrls: ['./apps-list.component.css', './apps-grid.component.css'],
|
||||
providers: [TaskListService]
|
||||
})
|
||||
export class ActivitiAppsComponent implements OnInit {
|
||||
export class AppsListComponent implements OnInit {
|
||||
|
||||
public static LAYOUT_LIST: string = 'LIST';
|
||||
public static LAYOUT_GRID: string = 'GRID';
|
||||
@ -42,7 +42,7 @@ export class ActivitiAppsComponent implements OnInit {
|
||||
public static DEFAULT_TASKS_APP_MATERIAL_ICON: string = 'favorite_border';
|
||||
|
||||
@Input()
|
||||
layoutType: string = ActivitiAppsComponent.LAYOUT_GRID;
|
||||
layoutType: string = AppsListComponent.LAYOUT_GRID;
|
||||
|
||||
@Input()
|
||||
filtersAppId: any[];
|
||||
@ -68,7 +68,7 @@ export class ActivitiAppsComponent implements OnInit {
|
||||
* @param activitiTaskList Task service
|
||||
*/
|
||||
constructor(private translateService: AlfrescoTranslationService,
|
||||
private activitiTaskList: ActivitiTaskListService) {
|
||||
private activitiTaskList: TaskListService) {
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist');
|
||||
@ -94,10 +94,10 @@ export class ActivitiAppsComponent implements OnInit {
|
||||
(res) => {
|
||||
res = this.filterApps(res);
|
||||
res.forEach((app: AppDefinitionRepresentationModel) => {
|
||||
if (app.defaultAppId === ActivitiAppsComponent.DEFAULT_TASKS_APP) {
|
||||
app.name = ActivitiAppsComponent.DEFAULT_TASKS_APP_NAME;
|
||||
app.theme = ActivitiAppsComponent.DEFAULT_TASKS_APP_THEME;
|
||||
app.icon = ActivitiAppsComponent.DEFAULT_TASKS_APP_ICON;
|
||||
if (app.defaultAppId === AppsListComponent.DEFAULT_TASKS_APP) {
|
||||
app.name = AppsListComponent.DEFAULT_TASKS_APP_NAME;
|
||||
app.theme = AppsListComponent.DEFAULT_TASKS_APP_THEME;
|
||||
app.icon = AppsListComponent.DEFAULT_TASKS_APP_ICON;
|
||||
this.appsObserver.next(app);
|
||||
} else if (app.deploymentId) {
|
||||
this.appsObserver.next(app);
|
||||
@ -154,7 +154,7 @@ export class ActivitiAppsComponent implements OnInit {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isValidType(): boolean {
|
||||
if (this.layoutType && (this.layoutType === ActivitiAppsComponent.LAYOUT_LIST || this.layoutType === ActivitiAppsComponent.LAYOUT_GRID)) {
|
||||
if (this.layoutType && (this.layoutType === AppsListComponent.LAYOUT_LIST || this.layoutType === AppsListComponent.LAYOUT_GRID)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -164,7 +164,7 @@ export class ActivitiAppsComponent implements OnInit {
|
||||
* Assign the default value to LayoutType
|
||||
*/
|
||||
setDefaultLayoutType(): void {
|
||||
this.layoutType = ActivitiAppsComponent.LAYOUT_GRID;
|
||||
this.layoutType = AppsListComponent.LAYOUT_GRID;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -172,7 +172,7 @@ export class ActivitiAppsComponent implements OnInit {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isList(): boolean {
|
||||
return this.layoutType === ActivitiAppsComponent.LAYOUT_LIST;
|
||||
return this.layoutType === AppsListComponent.LAYOUT_LIST;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -180,7 +180,7 @@ export class ActivitiAppsComponent implements OnInit {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isGrid(): boolean {
|
||||
return this.layoutType === ActivitiAppsComponent.LAYOUT_GRID;
|
||||
return this.layoutType === AppsListComponent.LAYOUT_GRID;
|
||||
}
|
||||
|
||||
isEmpty(): boolean {
|
@ -20,8 +20,8 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
import { ActivitiTaskListService } from '../services/activiti-tasklist.service';
|
||||
import { ActivitiChecklistComponent } from './activiti-checklist.component';
|
||||
import { TaskListService } from '../services/tasklist.service';
|
||||
import { ChecklistComponent } from './checklist.component';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@ -30,10 +30,10 @@ const fakeTaskDetail = new TaskDetailsModel({
|
||||
name: 'fake-check-name'
|
||||
});
|
||||
|
||||
describe('ActivitiChecklistComponent', () => {
|
||||
describe('ChecklistComponent', () => {
|
||||
|
||||
let checklistComponent: ActivitiChecklistComponent;
|
||||
let fixture: ComponentFixture<ActivitiChecklistComponent>;
|
||||
let checklistComponent: ChecklistComponent;
|
||||
let fixture: ComponentFixture<ChecklistComponent>;
|
||||
let element: HTMLElement;
|
||||
let showChecklistDialog, closeCheckDialogButton;
|
||||
|
||||
@ -43,10 +43,10 @@ describe('ActivitiChecklistComponent', () => {
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
ActivitiChecklistComponent
|
||||
ChecklistComponent
|
||||
],
|
||||
providers: [
|
||||
ActivitiTaskListService
|
||||
TaskListService
|
||||
]
|
||||
}).compileComponents().then(() => {
|
||||
let translateService = TestBed.get(AlfrescoTranslationService);
|
||||
@ -55,7 +55,7 @@ describe('ActivitiChecklistComponent', () => {
|
||||
return Observable.of(key);
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(ActivitiChecklistComponent);
|
||||
fixture = TestBed.createComponent(ChecklistComponent);
|
||||
checklistComponent = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
|
@ -19,17 +19,17 @@ import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChange
|
||||
import { AlfrescoTranslationService, LogService } from 'ng2-alfresco-core';
|
||||
import { Observable, Observer } from 'rxjs/Rx';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
import { ActivitiTaskListService } from './../services/activiti-tasklist.service';
|
||||
import { TaskListService } from './../services/tasklist.service';
|
||||
|
||||
declare let dialogPolyfill: any;
|
||||
|
||||
@Component({
|
||||
selector: 'adf-checklist, activiti-checklist',
|
||||
templateUrl: './activiti-checklist.component.html',
|
||||
styleUrls: ['./activiti-checklist.component.css'],
|
||||
providers: [ActivitiTaskListService]
|
||||
templateUrl: './checklist.component.html',
|
||||
styleUrls: ['./checklist.component.css'],
|
||||
providers: [TaskListService]
|
||||
})
|
||||
export class ActivitiChecklistComponent implements OnInit, OnChanges {
|
||||
export class ChecklistComponent implements OnInit, OnChanges {
|
||||
|
||||
@Input()
|
||||
taskId: string;
|
||||
@ -65,7 +65,7 @@ export class ActivitiChecklistComponent implements OnInit, OnChanges {
|
||||
* @param translate
|
||||
*/
|
||||
constructor(private translateService: AlfrescoTranslationService,
|
||||
private activitiTaskList: ActivitiTaskListService,
|
||||
private activitiTaskList: TaskListService,
|
||||
private logService: LogService) {
|
||||
|
||||
if (translateService) {
|
@ -19,8 +19,9 @@ import { DatePipe } from '@angular/common';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { DataRowEvent, DataTableModule, ObjectDataRow } from 'ng2-alfresco-datatable';
|
||||
import { Comment, User } from '../models/index';
|
||||
import { AdfCommentListComponent } from './adf-comment-list.component';
|
||||
import { Comment } from '../models/comment.model';
|
||||
import { User } from '../models/user.model';
|
||||
import { CommentListComponent } from './comment-list.component';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@ -33,10 +34,10 @@ const testUser: User = new User({
|
||||
const testDate = new Date();
|
||||
const testComment: Comment = new Comment(1, 'Test Comment', testDate.toDateString(), testUser);
|
||||
|
||||
describe('AdfCommentListComponent', () => {
|
||||
describe('CommentListComponent', () => {
|
||||
|
||||
let commentList: AdfCommentListComponent;
|
||||
let fixture: ComponentFixture<AdfCommentListComponent>;
|
||||
let commentList: CommentListComponent;
|
||||
let fixture: ComponentFixture<CommentListComponent>;
|
||||
let element: HTMLElement;
|
||||
let componentHandler;
|
||||
|
||||
@ -47,14 +48,14 @@ describe('AdfCommentListComponent', () => {
|
||||
DataTableModule
|
||||
],
|
||||
declarations: [
|
||||
AdfCommentListComponent
|
||||
CommentListComponent
|
||||
],
|
||||
providers: [
|
||||
DatePipe
|
||||
]
|
||||
}).compileComponents().then(() => {
|
||||
|
||||
fixture = TestBed.createComponent(AdfCommentListComponent);
|
||||
fixture = TestBed.createComponent(CommentListComponent);
|
||||
commentList = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
componentHandler = jasmine.createSpyObj('componentHandler', [
|
@ -17,15 +17,16 @@
|
||||
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { Comment, User } from '../models/index';
|
||||
import { Comment } from '../models/comment.model';
|
||||
import { User } from '../models/user.model';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-comment-list',
|
||||
templateUrl: './adf-comment-list.component.html',
|
||||
styleUrls: ['./adf-comment-list.component.css']
|
||||
templateUrl: './comment-list.component.html',
|
||||
styleUrls: ['./comment-list.component.css']
|
||||
})
|
||||
|
||||
export class AdfCommentListComponent {
|
||||
export class CommentListComponent {
|
||||
|
||||
@Input()
|
||||
comments: Comment[];
|
@ -25,16 +25,16 @@ import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { MdInputModule } from '@angular/material';
|
||||
import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||
import { ActivitiTaskListService } from './../services/activiti-tasklist.service';
|
||||
import { ActivitiCommentsComponent } from './activiti-comments.component';
|
||||
import { AdfCommentListComponent } from './adf-comment-list.component';
|
||||
import { TaskListService } from './../services/tasklist.service';
|
||||
import { CommentsComponent } from './comments.component';
|
||||
import { CommentListComponent } from './comment-list.component';
|
||||
|
||||
describe('ActivitiCommentsComponent', () => {
|
||||
describe('CommentsComponent', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let service: ActivitiTaskListService;
|
||||
let component: ActivitiCommentsComponent;
|
||||
let fixture: ComponentFixture<ActivitiCommentsComponent>;
|
||||
let service: TaskListService;
|
||||
let component: CommentsComponent;
|
||||
let fixture: ComponentFixture<CommentsComponent>;
|
||||
let getCommentsSpy: jasmine.Spy;
|
||||
let addCommentSpy: jasmine.Spy;
|
||||
|
||||
@ -47,11 +47,11 @@ describe('ActivitiCommentsComponent', () => {
|
||||
MdInputModule
|
||||
],
|
||||
declarations: [
|
||||
ActivitiCommentsComponent,
|
||||
AdfCommentListComponent
|
||||
CommentsComponent,
|
||||
CommentListComponent
|
||||
],
|
||||
providers: [
|
||||
ActivitiTaskListService,
|
||||
TaskListService,
|
||||
DatePipe
|
||||
]
|
||||
}).compileComponents();
|
||||
@ -62,9 +62,9 @@ describe('ActivitiCommentsComponent', () => {
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ActivitiCommentsComponent);
|
||||
fixture = TestBed.createComponent(CommentsComponent);
|
||||
component = fixture.componentInstance;
|
||||
service = fixture.debugElement.injector.get(ActivitiTaskListService);
|
||||
service = fixture.debugElement.injector.get(TaskListService);
|
||||
|
||||
getCommentsSpy = spyOn(service, 'getTaskComments').and.returnValue(Observable.of([
|
||||
{ message: 'Test1', created: Date.now(), createdBy: {firstName: 'Admin', lastName: 'User'} },
|
@ -20,15 +20,15 @@ import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { Observable, Observer } from 'rxjs/Rx';
|
||||
|
||||
import { Comment } from '../models/comment.model';
|
||||
import { ActivitiTaskListService } from '../services/activiti-tasklist.service';
|
||||
import { TaskListService } from '../services/tasklist.service';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-comments, activiti-comments',
|
||||
templateUrl: './activiti-comments.component.html',
|
||||
styleUrls: ['./activiti-comments.component.css'],
|
||||
providers: [ActivitiTaskListService]
|
||||
templateUrl: './comments.component.html',
|
||||
styleUrls: ['./comments.component.css'],
|
||||
providers: [TaskListService]
|
||||
})
|
||||
export class ActivitiCommentsComponent implements OnChanges {
|
||||
export class CommentsComponent implements OnChanges {
|
||||
|
||||
@Input()
|
||||
taskId: string;
|
||||
@ -54,7 +54,7 @@ export class ActivitiCommentsComponent implements OnChanges {
|
||||
* @param activitiTaskList Task service
|
||||
*/
|
||||
constructor(private translateService: AlfrescoTranslationService,
|
||||
private activitiTaskList: ActivitiTaskListService) {
|
||||
private activitiTaskList: TaskListService) {
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist');
|
@ -22,14 +22,14 @@ import { Observable } from 'rxjs/Rx';
|
||||
import { ActivitiContentService } from 'ng2-activiti-form';
|
||||
import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
|
||||
|
||||
import { ActivitiCreateTaskAttachmentComponent } from './adf-create-task-attachment.component';
|
||||
import { AttachmentComponent } from './create-task-attachment.component';
|
||||
|
||||
describe('Activiti Task Create Attachment', () => {
|
||||
|
||||
let componentHandler: any;
|
||||
let service: ActivitiContentService;
|
||||
let component: ActivitiCreateTaskAttachmentComponent;
|
||||
let fixture: ComponentFixture<ActivitiCreateTaskAttachmentComponent>;
|
||||
let component: AttachmentComponent;
|
||||
let fixture: ComponentFixture<AttachmentComponent>;
|
||||
let createTaskRelatedContentSpy: jasmine.Spy;
|
||||
|
||||
beforeEach(async(() => {
|
||||
@ -38,7 +38,7 @@ describe('Activiti Task Create Attachment', () => {
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
declarations: [
|
||||
ActivitiCreateTaskAttachmentComponent
|
||||
AttachmentComponent
|
||||
],
|
||||
providers: [
|
||||
{provide: AlfrescoTranslationService},
|
||||
@ -49,7 +49,7 @@ describe('Activiti Task Create Attachment', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
fixture = TestBed.createComponent(ActivitiCreateTaskAttachmentComponent);
|
||||
fixture = TestBed.createComponent(AttachmentComponent);
|
||||
component = fixture.componentInstance;
|
||||
service = fixture.debugElement.injector.get(ActivitiContentService);
|
||||
|
@ -21,10 +21,10 @@ import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-create-task-attachment',
|
||||
styleUrls: ['./adf-create-task-attachment.component.css'],
|
||||
templateUrl: './adf-create-task-attachment.component.html'
|
||||
styleUrls: ['./create-task-attachment.component.css'],
|
||||
templateUrl: './create-task-attachment.component.html'
|
||||
})
|
||||
export class ActivitiCreateTaskAttachmentComponent implements OnChanges {
|
||||
export class AttachmentComponent implements OnChanges {
|
||||
|
||||
@Input()
|
||||
taskId: string;
|
@ -1,32 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export * from './activiti-apps.component';
|
||||
export * from './activiti-tasklist.component';
|
||||
export * from './activiti-checklist.component';
|
||||
export * from './activiti-comments.component';
|
||||
export * from './adf-task-attachment-list.component';
|
||||
export * from './activiti-people.component';
|
||||
export * from './activiti-task-header.component';
|
||||
export * from './no-task-detail-template.component';
|
||||
export * from './activiti-filters.component';
|
||||
export * from './activiti-task-details.component';
|
||||
export * from './activiti-start-task.component';
|
||||
export * from './activiti-people-search.component';
|
||||
export * from './adf-create-task-attachment.component';
|
||||
export * from './adf-people-list.component';
|
||||
export * from './adf-comment-list.component';
|
@ -15,16 +15,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ActivitiTaskDetailsComponent } from './activiti-task-details.component';
|
||||
import { NoTaskDetailsTemplateDirective } from './no-task-detail-template.component';
|
||||
import { TaskDetailsComponent } from './task-details.component';
|
||||
import { NoTaskDetailsTemplateDirective } from './no-task-detail-template.directive';
|
||||
|
||||
describe('NoTaskDetailsTemplateDirective', () => {
|
||||
|
||||
let component: NoTaskDetailsTemplateDirective;
|
||||
let detailsComponent: ActivitiTaskDetailsComponent;
|
||||
let detailsComponent: TaskDetailsComponent;
|
||||
|
||||
beforeEach(() => {
|
||||
detailsComponent = new ActivitiTaskDetailsComponent(null, null, null, null, null, null);
|
||||
detailsComponent = new TaskDetailsComponent(null, null, null, null, null, null);
|
||||
component = new NoTaskDetailsTemplateDirective(detailsComponent);
|
||||
});
|
||||
|
@ -21,7 +21,7 @@ import {
|
||||
Directive,
|
||||
TemplateRef
|
||||
} from '@angular/core';
|
||||
import { ActivitiTaskDetailsComponent } from './activiti-task-details.component';
|
||||
import { TaskDetailsComponent } from './task-details.component';
|
||||
|
||||
@Directive({
|
||||
selector: 'no-task-details-template'
|
||||
@ -32,7 +32,7 @@ export class NoTaskDetailsTemplateDirective implements AfterContentInit {
|
||||
template: any;
|
||||
|
||||
constructor(
|
||||
private activitiTaskDetails: ActivitiTaskDetailsComponent) {
|
||||
private activitiTaskDetails: TaskDetailsComponent) {
|
||||
}
|
||||
|
||||
ngAfterContentInit() {
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user