update(TSK-890): Updated to ng8. Tests are passing locally. Adjusted svg-styling, mocked a svg-dependency

This commit is contained in:
Patric Schumann 2019-10-22 10:08:00 +02:00 committed by Mustapha Zorgati
parent bcfb1ecefa
commit 5afd9612c8
23 changed files with 3623 additions and 2151 deletions

5640
web/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -13,14 +13,13 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "7.1.3", "@angular/animations": "8.2.11",
"@angular/common": "7.1.3", "@angular/common": "8.2.11",
"@angular/forms": "7.1.3", "@angular/forms": "8.2.11",
"@angular/http": "7.1.3", "@angular/platform-browser": "8.2.11",
"@angular/platform-browser": "7.1.3", "@angular/platform-browser-dynamic": "8.2.11",
"@angular/platform-browser-dynamic": "7.1.3", "@angular/router": "8.2.11",
"@angular/router": "7.1.3", "angular-svg-icon": "^7.2.1",
"angular-svg-icon": "6.0.0",
"angular-tree-component": "8.2.0", "angular-tree-component": "8.2.0",
"bootstrap": "4.3.1", "bootstrap": "4.3.1",
"bootstrap-sass": "3.4.1", "bootstrap-sass": "3.4.1",
@ -31,23 +30,23 @@
"magic-string": "0.22.4", "magic-string": "0.22.4",
"material-design-icons": "3.0.1", "material-design-icons": "3.0.1",
"ng2-charts": "1.6.0", "ng2-charts": "1.6.0",
"ngx-bootstrap": "3.2.0", "ngx-bootstrap": "^4.3.0",
"ngx-infinite-scroll": "6.0.1", "ngx-infinite-scroll": "6.0.1",
"node-sass": "^4.12.0", "node-sass": "^4.12.0",
"popper.js": "1.14.3", "popper.js": "1.14.3",
"rxjs": "6.3.3", "rxjs": "6.5.3",
"zone.js": "0.8.26" "zone.js": "~0.9.1"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "^0.13.9", "@angular-devkit/build-angular": "~0.803.12",
"@angular/cli": "^7.3.9", "@angular/cli": "^8.3.12",
"@angular/compiler": "^7.2.7", "@angular/compiler": "^8.2.11",
"@angular/compiler-cli": "7.2.7", "@angular/compiler-cli": "8.2.11",
"@angular/core": "^7.1.3", "@angular/core": "^8.2.11",
"@types/jasmine": "2.8.4", "@types/jasmine": "2.8.4",
"@types/node": "9.3.0", "@types/node": "9.3.0",
"ajv": "^6.10.2", "ajv": "^6.10.2",
"codelyzer": "4.4.2", "codelyzer": "^5.0.1",
"diff": "^3.5.0", "diff": "^3.5.0",
"hoek": "5.0.3", "hoek": "5.0.3",
"jasmine-core": "2.9.1", "jasmine-core": "2.9.1",
@ -65,6 +64,6 @@
"ts-mockito": "2.3.0", "ts-mockito": "2.3.0",
"ts-node": "4.1.0", "ts-node": "4.1.0",
"tslint": "5.9.1", "tslint": "5.9.1",
"typescript": "3.1.6" "typescript": "3.5.3"
} }
} }

View File

@ -67,7 +67,7 @@ export class ClassificationDetailsComponent implements OnInit, OnDestroy {
private domainSubscription: Subscription; private domainSubscription: Subscription;
private importingExportingSubscription: Subscription; private importingExportingSubscription: Subscription;
@ViewChild('ClassificationForm') classificationForm: NgForm; @ViewChild('ClassificationForm', { static: false }) classificationForm: NgForm;
toogleValidationMap = new Map<string, boolean>(); toogleValidationMap = new Map<string, boolean>();
constructor(private classificationsService: ClassificationsService, constructor(private classificationsService: ClassificationsService,

View File

@ -20,7 +20,7 @@ export class ImportExportComponent implements OnInit {
@Input() currentSelection: TaskanaType; @Input() currentSelection: TaskanaType;
@ViewChild('selectedFile') @ViewChild('selectedFile', { static: true })
selectedFileInput; selectedFileInput;
domains: string[] = []; domains: string[] = [];
@ -94,7 +94,7 @@ export class ImportExportComponent implements OnInit {
} }
private resetProgress() { private resetProgress() {
this.uploadservice.setCurrentProgressValue(0) this.uploadservice.setCurrentProgressValue(0);
this.uploadservice.isInUse = false; this.uploadservice.isInUse = false;
this.selectedFileInput.nativeElement.value = ''; this.selectedFileInput.nativeElement.value = '';
} }
@ -115,7 +115,7 @@ export class ImportExportComponent implements OnInit {
this.errorHandler(title, JSON.parse(event.responseText).message); this.errorHandler(title, JSON.parse(event.responseText).message);
} else if (event.readyState === 4 && event.status === 200) { } else if (event.readyState === 4 && event.status === 200) {
this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, 'Import was successful')) this.alertService.triggerAlert(new AlertModel(AlertType.SUCCESS, 'Import was successful'));
this.importExportService.setImportingFinished(true); this.importExportService.setImportingFinished(true);
this.resetProgress(); this.resetProgress();
} }

View File

@ -62,7 +62,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
selectAllLeft = false; selectAllLeft = false;
selectAllRight = false; selectAllRight = false;
@ViewChild('panelBody') @ViewChild('panelBody', { static: false })
private panelBody: ElementRef; private panelBody: ElementRef;
constructor( constructor(
@ -92,7 +92,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
if (side === Side.LEFT) { if (side === Side.LEFT) {
const itemsLeft = this.distributionTargetsLeft.length; const itemsLeft = this.distributionTargetsLeft.length;
const itemsRight = this.distributionTargetsRight.length; const itemsRight = this.distributionTargetsRight.length;
const itemsSelected = this.getSelectedItems(this.distributionTargetsLeft, this.distributionTargetsRight) const itemsSelected = this.getSelectedItems(this.distributionTargetsLeft, this.distributionTargetsRight);
this.distributionTargetsSelected = this.distributionTargetsSelected.concat(itemsSelected); this.distributionTargetsSelected = this.distributionTargetsSelected.concat(itemsSelected);
this.distributionTargetsRight = this.distributionTargetsRight.concat(itemsSelected); this.distributionTargetsRight = this.distributionTargetsRight.concat(itemsSelected);
if (((itemsLeft - itemsSelected.length) <= TaskanaQueryParameters.pageSize) && ((itemsLeft + itemsRight) < this.page.totalElements)) { if (((itemsLeft - itemsSelected.length) <= TaskanaQueryParameters.pageSize) && ((itemsLeft + itemsRight) < this.page.totalElements)) {
@ -121,17 +121,17 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
return true; return true;
}, },
error => { error => {
this.generalModalService.triggerMessage(new MessageModal(`There was error while saving your workbasket's distribution targets`, error)) this.generalModalService.triggerMessage(new MessageModal(`There was error while saving your workbasket's distribution targets`, error));
this.requestInProgressService.setRequestInProgress(false); this.requestInProgressService.setRequestInProgress(false);
return false; return false;
} }
) );
return false; return false;
} }
onClear() { onClear() {
this.alertService.triggerAlert(new AlertModel(AlertType.INFO, 'Reset edited fields')) this.alertService.triggerAlert(new AlertModel(AlertType.INFO, 'Reset edited fields'));
this.distributionTargetsLeft = Object.assign([], this.distributionTargetsClone); this.distributionTargetsLeft = Object.assign([], this.distributionTargetsClone);
this.distributionTargetsRight = Object.assign([], this.distributionTargetsSelectedClone); this.distributionTargetsRight = Object.assign([], this.distributionTargetsSelectedClone);
this.distributionTargetsSelected = Object.assign([], this.distributionTargetsSelectedClone); this.distributionTargetsSelected = Object.assign([], this.distributionTargetsSelectedClone);
@ -270,7 +270,7 @@ export class DistributionTargetsComponent implements OnChanges, OnDestroy {
const distributionTargetsSelelected: Array<string> = []; const distributionTargetsSelelected: Array<string> = [];
this.distributionTargetsSelected.forEach(item => { this.distributionTargetsSelected.forEach(item => {
distributionTargetsSelelected.push(item.workbasketId); distributionTargetsSelelected.push(item.workbasketId);
}) });
return distributionTargetsSelelected; return distributionTargetsSelelected;
} }

View File

@ -73,7 +73,7 @@ export class WorkbasketInformationComponent
private workbasketSubscription: Subscription; private workbasketSubscription: Subscription;
private routeSubscription: Subscription; private routeSubscription: Subscription;
@ViewChild('WorkbasketForm') @ViewChild('WorkbasketForm', { static: false })
workbasketForm: NgForm; workbasketForm: NgForm;
constructor( constructor(

View File

@ -33,7 +33,7 @@ export class WorkbasketListComponent implements OnInit, OnDestroy {
sort: SortingModel = new SortingModel(); sort: SortingModel = new SortingModel();
filterBy: FilterModel = new FilterModel({name: '', owner: '', type: '', description: '', key: ''}); filterBy: FilterModel = new FilterModel({name: '', owner: '', type: '', description: '', key: ''});
@ViewChild('wbToolbar') @ViewChild('wbToolbar', { static: true })
private toolbarElement: ElementRef; private toolbarElement: ElementRef;
private workBasketSummarySubscription: Subscription; private workBasketSummarySubscription: Subscription;
private workbasketServiceSubscription: Subscription; private workbasketServiceSubscription: Subscription;

View File

@ -14,22 +14,22 @@ const appRoutes: Routes = [
{ {
canActivate: [BusinessAdminGuard], canActivate: [BusinessAdminGuard],
path: 'administration', path: 'administration',
loadChildren: './administration/administration.module#AdministrationModule', loadChildren: () => import('./administration/administration.module').then(m => m.AdministrationModule),
}, },
{ {
canActivate: [MonitorGuard], canActivate: [MonitorGuard],
path: 'monitor', path: 'monitor',
loadChildren: './monitor/monitor.module#MonitorModule', loadChildren: () => import('./monitor/monitor.module').then(m => m.MonitorModule),
}, },
{ {
canActivate: [UserGuard], canActivate: [UserGuard],
path: 'workplace', path: 'workplace',
loadChildren: './workplace/workplace.module#WorkplaceModule' loadChildren: () => import('./workplace/workplace.module').then(m => m.WorkplaceModule)
}, },
{ {
canActivate: [HistoryGuard], canActivate: [HistoryGuard],
path: 'history', path: 'history',
loadChildren: './history/history.module#HistoryModule' loadChildren: () => import('./history/history.module').then(m => m.HistoryModule)
}, },
{ {
path: 'no-role', path: 'no-role',

View File

@ -17,7 +17,7 @@ export class GeneralMessageModalComponent implements OnChanges {
@Input() @Input()
type: string; type: string;
@ViewChild('generalModal') @ViewChild('generalModal', { static: true })
private modal; private modal;
constructor() { } constructor() { }

View File

@ -13,7 +13,7 @@ export class RemoveConfirmationComponent implements OnInit {
private confirmationCallback: Function; private confirmationCallback: Function;
message: string; message: string;
@ViewChild('removeConfirmationModal') @ViewChild('removeConfirmationModal', { static: true })
private modal; private modal;
constructor(private removeConfirmationService: RemoveConfirmationService) { } constructor(private removeConfirmationService: RemoveConfirmationService) { }

View File

@ -50,7 +50,7 @@ export class SpinnerComponent implements OnDestroy {
@Output() @Output()
spinnerIsRunning = new EventEmitter<boolean>(); spinnerIsRunning = new EventEmitter<boolean>();
@ViewChild('spinnerModal') @ViewChild('spinnerModal', { static: true })
private modal; private modal;
constructor(private generalModalService: GeneralModalService) { constructor(private generalModalService: GeneralModalService) {

View File

@ -28,7 +28,7 @@ import {ClassificationsService} from '../services/classifications/classification
}) })
export class TaskanaTreeComponent implements OnInit, AfterViewChecked, OnDestroy { export class TaskanaTreeComponent implements OnInit, AfterViewChecked, OnDestroy {
@ViewChild('tree') @ViewChild('tree', { static: true })
private tree: TreeComponent; private tree: TreeComponent;
@Input() treeNodes: Array<TreeNodeModel>; @Input() treeNodes: Array<TreeNodeModel>;

View File

@ -47,7 +47,7 @@ export class TypeAheadComponent implements OnInit, ControlValueAccessor {
@Output() @Output()
onSelect = new EventEmitter<AccessIdDefinition>(); onSelect = new EventEmitter<AccessIdDefinition>();
@ViewChild('inputTypeAhead') @ViewChild('inputTypeAhead', { static: false })
private inputTypeAhead; private inputTypeAhead;
typeaheadLoading = false; typeaheadLoading = false;

View File

@ -22,7 +22,7 @@ export class TaskdetailsGeneralFieldsComponent implements OnInit, OnChanges {
saveToggleTriggered: boolean; saveToggleTriggered: boolean;
@Output() formValid: EventEmitter<boolean> = new EventEmitter<boolean>(); @Output() formValid: EventEmitter<boolean> = new EventEmitter<boolean>();
@ViewChild('TaskForm') @ViewChild('TaskForm', { static: false })
taskForm: NgForm; taskForm: NgForm;
toogleValidationMap = new Map<string, boolean>(); toogleValidationMap = new Map<string, boolean>();

View File

@ -7,7 +7,6 @@ import { HttpClientModule } from '@angular/common/http';
import { Routes } from '@angular/router'; import { Routes } from '@angular/router';
import { Component, ChangeDetectorRef } from '@angular/core'; import { Component, ChangeDetectorRef } from '@angular/core';
import { WorkplaceService } from 'app/workplace/services/workplace.service'; import { WorkplaceService } from 'app/workplace/services/workplace.service';
import { SvgIconComponent, SvgIconRegistryService } from 'angular-svg-icon';
import {DateTimeZonePipe} from '../../../shared/pipes/date-time-zone/date-time-zone.pipe'; import {DateTimeZonePipe} from '../../../shared/pipes/date-time-zone/date-time-zone.pipe';
@ -18,6 +17,13 @@ import {DateTimeZonePipe} from '../../../shared/pipes/date-time-zone/date-time-z
export class DummyDetailComponent { export class DummyDetailComponent {
} }
@Component({
selector: 'svg-icon',
template: '<p>Mock Icon Component</p>'
})
export class MockSvgIconComponent {
}
describe('TaskListComponent', () => { describe('TaskListComponent', () => {
let component: TaskListComponent; let component: TaskListComponent;
let fixture: ComponentFixture<TaskListComponent>; let fixture: ComponentFixture<TaskListComponent>;
@ -35,13 +41,12 @@ describe('TaskListComponent', () => {
declarations: [ declarations: [
TaskListComponent, TaskListComponent,
DummyDetailComponent, DummyDetailComponent,
SvgIconComponent, MockSvgIconComponent,
DateTimeZonePipe DateTimeZonePipe
], ],
providers: [ providers: [
WorkplaceService, WorkplaceService,
ChangeDetectorRef, ChangeDetectorRef
SvgIconRegistryService
] ]
}) })
.compileComponents(); .compileComponents();

View File

@ -41,7 +41,7 @@ export class TaskMasterComponent implements OnInit, OnDestroy {
objectReference: ObjectReference; objectReference: ObjectReference;
selectedSearchType: Search = Search.byWorkbasket; selectedSearchType: Search = Search.byWorkbasket;
@ViewChild('wbToolbar') @ViewChild('wbToolbar', { static: true })
private toolbarElement: ElementRef; private toolbarElement: ElementRef;
private taskChangeSubscription: Subscription; private taskChangeSubscription: Subscription;
private taskDeletedSubscription: Subscription; private taskDeletedSubscription: Subscription;

View File

@ -17,3 +17,4 @@
@import 'bootstrap-3-backward-compatibility'; @import 'bootstrap-3-backward-compatibility';
@import 'mixin/colors'; @import 'mixin/colors';
@import 'progress-bar'; @import 'progress-bar';
@import 'shameful';

View File

@ -0,0 +1,4 @@
// used until the icon handling is done in a proper way and we got rid of this lib
svg-icon {
display: inline-block;
}

View File

@ -11,27 +11,13 @@
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
* *
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html * Learn more in https://angular.io/guide/browser-support
*/ */
/*************************************************************************************************** /***************************************************************************************************
* BROWSER POLYFILLS * BROWSER POLYFILLS
*/ */
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/set';
/** IE10 and IE11 requires the following for NgClass support on SVG elements */ /** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`. // import 'classlist.js'; // Run `npm install --save classlist.js`.

View File

@ -2,7 +2,6 @@
"extends": "../tsconfig.json", "extends": "../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../out-tsc/app", "outDir": "../out-tsc/app",
"module": "es2015",
"baseUrl": "", "baseUrl": "",
"types": [] "types": []
}, },

View File

@ -2,8 +2,6 @@
"extends": "../tsconfig.json", "extends": "../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "../out-tsc/spec", "outDir": "../out-tsc/spec",
"module": "commonjs",
"target": "es5",
"baseUrl": "", "baseUrl": "",
"types": [ "types": [
"jasmine", "jasmine",

View File

@ -1,6 +1,8 @@
{ {
"compileOnSave": false, "compileOnSave": false,
"compilerOptions": { "compilerOptions": {
"downlevelIteration": true,
"module": "esnext",
"outDir": "./dist/out-tsc", "outDir": "./dist/out-tsc",
"baseUrl": "src", "baseUrl": "src",
"sourceMap": true, "sourceMap": true,
@ -8,7 +10,7 @@
"moduleResolution": "node", "moduleResolution": "node",
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"target": "es5", "target": "es2015",
"typeRoots": [ "typeRoots": [
"node_modules/@types" "node_modules/@types"
], ],

View File

@ -112,12 +112,12 @@
"taskana", "taskana",
"kebab-case" "kebab-case"
], ],
"use-input-property-decorator": true, "no-inputs-metadata-property": true,
"use-output-property-decorator": true, "no-outputs-metadata-property": true,
"use-host-property-decorator": true, "no-host-metadata-property": true,
"no-input-rename": true, "no-input-rename": true,
"no-output-rename": true, "no-output-rename": true,
"use-life-cycle-interface": true, "use-lifecycle-interface": true,
"use-pipe-transform-interface": true, "use-pipe-transform-interface": true,
"component-class-suffix": true, "component-class-suffix": true,
"directive-class-suffix": true "directive-class-suffix": true