From 3590811f340d24055e677c6a0a83959e43aaea08 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Sun, 4 Jun 2017 23:36:46 +0100 Subject: [PATCH] Source Mapping is not working on test debugging (#1931) * coverage single components run fix * remove spec.ts from coverage * make the coverage and the istanbul-instrumenter-loader works only over the console test because a problem on the remapping for the browser test * move tslint on the main folder of any component * remove build:w from readme * stop build tslint error also in spec files * clear karma file from unnecessary files * add set -f for build all script in order to accept * * fix lint problem and failing tests * fix failing test search component * add loader test for viewer * fix tslint error userinfo * --max_old_space_size=2048 remove * fix tslint error uploader unused EventEmitter * remove spec|index|.*mock|.*model|.*event from coverage --- .../config/webpack.common.js | 2 ++ .../ng2-activiti-analytics/tslint.json | 2 +- .../config/webpack.common.js | 2 ++ .../config/webpack.common.js | 2 ++ .../dynamic-table.widget.spec.ts | 5 ++- .../config/webpack.common.js | 2 ++ ...reate-process-attachment.component.spec.ts | 1 - ...-process-attachment-list.component.spec.ts | 2 +- .../activiti-start-process.component.spec.ts | 1 - .../config/webpack.common.js | 2 ++ ...i-create-task-attachment.component.spec.ts | 1 - .../config/webpack.common.js | 2 ++ .../config/webpack.common.js | 2 ++ .../datatable/datatable.component.spec.ts | 2 +- .../config/webpack.common.js | 2 ++ .../config/webpack.common.js | 2 ++ .../config/webpack.common.js | 2 ++ .../config/webpack.common.js | 2 ++ .../ng2-alfresco-tag/config/webpack.common.js | 2 ++ .../ng2-alfresco-tag/demo/src/main.ts | 32 +++---------------- .../config/webpack.common.js | 2 ++ .../config/webpack.common.js | 2 ++ .../config/webpack.common.js | 2 ++ .../config/webpack.common.js | 2 ++ ng2-components/package.json | 1 + 25 files changed, 43 insertions(+), 36 deletions(-) diff --git a/ng2-components/ng2-activiti-analytics/config/webpack.common.js b/ng2-components/ng2-activiti-analytics/config/webpack.common.js index f4f8f36993..eabc6b5f9b 100644 --- a/ng2-components/ng2-activiti-analytics/config/webpack.common.js +++ b/ng2-components/ng2-activiti-analytics/config/webpack.common.js @@ -8,6 +8,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; +const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; + module.exports = { resolveLoader: { diff --git a/ng2-components/ng2-activiti-analytics/tslint.json b/ng2-components/ng2-activiti-analytics/tslint.json index f5ca6283b5..611a015c7e 100644 --- a/ng2-components/ng2-activiti-analytics/tslint.json +++ b/ng2-components/ng2-activiti-analytics/tslint.json @@ -59,7 +59,7 @@ "no-unused-variable": true, "no-use-before-declare": true, "no-var-keyword": true, - "no-var-requires": false, + "no-var-requires": true, "object-literal-sort-keys": false, "one-line": [ true, diff --git a/ng2-components/ng2-activiti-diagrams/config/webpack.common.js b/ng2-components/ng2-activiti-diagrams/config/webpack.common.js index 86e6abf95c..af0ca38ed7 100644 --- a/ng2-components/ng2-activiti-diagrams/config/webpack.common.js +++ b/ng2-components/ng2-activiti-diagrams/config/webpack.common.js @@ -8,6 +8,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; +const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; + module.exports = { resolveLoader: { diff --git a/ng2-components/ng2-activiti-form/config/webpack.common.js b/ng2-components/ng2-activiti-form/config/webpack.common.js index 7f57340503..f7635417cd 100644 --- a/ng2-components/ng2-activiti-form/config/webpack.common.js +++ b/ng2-components/ng2-activiti-form/config/webpack.common.js @@ -8,6 +8,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; +const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; + module.exports = { resolveLoader: { diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/dynamic-table/dynamic-table.widget.spec.ts b/ng2-components/ng2-activiti-form/src/components/widgets/dynamic-table/dynamic-table.widget.spec.ts index cf8bdeec30..29f97ff238 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/dynamic-table/dynamic-table.widget.spec.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/dynamic-table/dynamic-table.widget.spec.ts @@ -42,10 +42,9 @@ import { DateEditorComponent } from './editors/date/date.editor'; import { BooleanEditorComponent } from './editors/boolean/boolean.editor'; import { TextEditorComponent } from './editors/text/text.editor'; - let fakeFormField = { - id: "fake-dynamic-table", - name: "fake-label", + id: 'fake-dynamic-table', + name: 'fake-label', value: [{ 1: 1, 2: 2, 3: 4 }], required: false, readOnly: false, diff --git a/ng2-components/ng2-activiti-processlist/config/webpack.common.js b/ng2-components/ng2-activiti-processlist/config/webpack.common.js index 92bc275d79..4a0feaa24a 100644 --- a/ng2-components/ng2-activiti-processlist/config/webpack.common.js +++ b/ng2-components/ng2-activiti-processlist/config/webpack.common.js @@ -8,6 +8,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; +const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; + module.exports = { resolveLoader: { diff --git a/ng2-components/ng2-activiti-processlist/src/components/activiti-create-process-attachment.component.spec.ts b/ng2-components/ng2-activiti-processlist/src/components/activiti-create-process-attachment.component.spec.ts index 91631267c8..b4b8f89ed5 100644 --- a/ng2-components/ng2-activiti-processlist/src/components/activiti-create-process-attachment.component.spec.ts +++ b/ng2-components/ng2-activiti-processlist/src/components/activiti-create-process-attachment.component.spec.ts @@ -17,7 +17,6 @@ import { SimpleChange } from '@angular/core'; import { ComponentFixture, TestBed, async } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; import { Observable } from 'rxjs/Rx'; import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core'; diff --git a/ng2-components/ng2-activiti-processlist/src/components/activiti-process-attachment-list.component.spec.ts b/ng2-components/ng2-activiti-processlist/src/components/activiti-process-attachment-list.component.spec.ts index cc0c99e4bb..a9e11fdaec 100644 --- a/ng2-components/ng2-activiti-processlist/src/components/activiti-process-attachment-list.component.spec.ts +++ b/ng2-components/ng2-activiti-processlist/src/components/activiti-process-attachment-list.component.spec.ts @@ -22,7 +22,7 @@ import { Observable } from 'rxjs/Rx'; import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core'; import { ActivitiContentService } from 'ng2-activiti-form'; -import { DataTableModule, ObjectDataRow, DataRowEvent, ObjectDataTableAdapter, DataSorting } from 'ng2-alfresco-datatable'; +import { DataTableModule } from 'ng2-alfresco-datatable'; import { ActivitiProcessAttachmentListComponent } from './activiti-process-attachment-list.component'; import { TranslationMock } from './../assets/translation.service.mock'; diff --git a/ng2-components/ng2-activiti-processlist/src/components/activiti-start-process.component.spec.ts b/ng2-components/ng2-activiti-processlist/src/components/activiti-start-process.component.spec.ts index 3121e72ffb..df36236aa3 100644 --- a/ng2-components/ng2-activiti-processlist/src/components/activiti-start-process.component.spec.ts +++ b/ng2-components/ng2-activiti-processlist/src/components/activiti-start-process.component.spec.ts @@ -26,7 +26,6 @@ import { TranslationMock } from './../assets/translation.service.mock'; import { newProcess, fakeProcessDefs, fakeProcessDefWithForm, taskFormMock } from './../assets/activiti-start-process.component.mock'; import { ActivitiStartProcessInstance } from './activiti-start-process.component'; import { ActivitiProcessService } from '../services/activiti-process.service'; -import { RestVariable } from 'alfresco-js-api'; describe('ActivitiStartProcessInstance', () => { diff --git a/ng2-components/ng2-activiti-tasklist/config/webpack.common.js b/ng2-components/ng2-activiti-tasklist/config/webpack.common.js index 42e5b73ffe..3f026c9a6e 100644 --- a/ng2-components/ng2-activiti-tasklist/config/webpack.common.js +++ b/ng2-components/ng2-activiti-tasklist/config/webpack.common.js @@ -8,6 +8,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; +const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; + module.exports = { resolveLoader: { diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-create-task-attachment.component.spec.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-create-task-attachment.component.spec.ts index defcaf09a4..aca833d26e 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-create-task-attachment.component.spec.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-create-task-attachment.component.spec.ts @@ -17,7 +17,6 @@ import { SimpleChange } from '@angular/core'; import { ComponentFixture, TestBed, async } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; import { Observable } from 'rxjs/Rx'; import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core'; diff --git a/ng2-components/ng2-alfresco-core/config/webpack.common.js b/ng2-components/ng2-alfresco-core/config/webpack.common.js index c17a4fdb00..85f1a2be09 100644 --- a/ng2-components/ng2-alfresco-core/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-core/config/webpack.common.js @@ -8,6 +8,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; +const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; + module.exports = { resolveLoader: { diff --git a/ng2-components/ng2-alfresco-datatable/config/webpack.common.js b/ng2-components/ng2-alfresco-datatable/config/webpack.common.js index 7f57340503..f7635417cd 100644 --- a/ng2-components/ng2-alfresco-datatable/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-datatable/config/webpack.common.js @@ -8,6 +8,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; +const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; + module.exports = { resolveLoader: { diff --git a/ng2-components/ng2-alfresco-datatable/src/components/datatable/datatable.component.spec.ts b/ng2-components/ng2-alfresco-datatable/src/components/datatable/datatable.component.spec.ts index 261b704348..2337c9b81f 100644 --- a/ng2-components/ng2-alfresco-datatable/src/components/datatable/datatable.component.spec.ts +++ b/ng2-components/ng2-alfresco-datatable/src/components/datatable/datatable.component.spec.ts @@ -26,7 +26,7 @@ import { DataColumn, DataSorting, ObjectDataTableAdapter, - ObjectDataColumn, ObjectDataRow + ObjectDataColumn } from './../../data/index'; describe('DataTable', () => { diff --git a/ng2-components/ng2-alfresco-documentlist/config/webpack.common.js b/ng2-components/ng2-alfresco-documentlist/config/webpack.common.js index 3e3781c49b..0f360a4e4e 100644 --- a/ng2-components/ng2-alfresco-documentlist/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-documentlist/config/webpack.common.js @@ -8,6 +8,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; +const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; + module.exports = { resolveLoader: { diff --git a/ng2-components/ng2-alfresco-login/config/webpack.common.js b/ng2-components/ng2-alfresco-login/config/webpack.common.js index 7f57340503..f7635417cd 100644 --- a/ng2-components/ng2-alfresco-login/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-login/config/webpack.common.js @@ -8,6 +8,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; +const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; + module.exports = { resolveLoader: { diff --git a/ng2-components/ng2-alfresco-search/config/webpack.common.js b/ng2-components/ng2-alfresco-search/config/webpack.common.js index 8e0c60ced2..31acd40d53 100644 --- a/ng2-components/ng2-alfresco-search/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-search/config/webpack.common.js @@ -8,6 +8,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; +const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; + module.exports = { resolveLoader: { diff --git a/ng2-components/ng2-alfresco-social/config/webpack.common.js b/ng2-components/ng2-alfresco-social/config/webpack.common.js index 7f57340503..f7635417cd 100644 --- a/ng2-components/ng2-alfresco-social/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-social/config/webpack.common.js @@ -8,6 +8,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; +const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; + module.exports = { resolveLoader: { diff --git a/ng2-components/ng2-alfresco-tag/config/webpack.common.js b/ng2-components/ng2-alfresco-tag/config/webpack.common.js index 7f57340503..f7635417cd 100644 --- a/ng2-components/ng2-alfresco-tag/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-tag/config/webpack.common.js @@ -8,6 +8,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; +const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; + module.exports = { resolveLoader: { diff --git a/ng2-components/ng2-alfresco-tag/demo/src/main.ts b/ng2-components/ng2-alfresco-tag/demo/src/main.ts index 254108b4c7..36585d7f1d 100644 --- a/ng2-components/ng2-alfresco-tag/demo/src/main.ts +++ b/ng2-components/ng2-alfresco-tag/demo/src/main.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { NgModule, Component, Input, OnInit } from '@angular/core'; +import { NgModule, Component, Input } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; @@ -29,14 +29,10 @@ import { TagModule } from 'ng2-alfresco-tag';



-
- Authentication failed to ip {{ ecmHost }} with user: admin, admin, you can still try to add a valid ticket to perform - operations. -



-
+
List Tags ECM
@@ -48,13 +44,13 @@ import { TagModule } from 'ng2-alfresco-tag';
` }) -class TagDemo implements OnInit { +class TagDemo { @Input() - nodeId: string = '74cd8a96-8a21-47e5-9b3b-a1b3e296787d'; + nodeId: string = 'a892714b-56ac-4b42-8b43-db0fa01eef33'; authenticated: boolean; - ecmHost: string = 'http://127.0.0.1:8080'; + ecmHost: string = 'http://localhost:8181/share/proxy'; ticket: string; constructor(private authService: AlfrescoAuthenticationService, @@ -70,30 +66,12 @@ class TagDemo implements OnInit { } } - ngOnInit() { - this.login(); - } - - login() { - this.authService.login('admin', 'admin').subscribe( - ticket => { - this.logService.info(ticket); - this.ticket = this.authService.getTicketEcm(); - this.authenticated = true; - }, - error => { - this.logService.error(error); - this.authenticated = false; - }); - } - public updateTicket(): void { this.storage.setItem('ticket-ECM', this.ticket); } public updateHost(): void { this.settingsService.ecmHost = this.ecmHost; - this.login(); } logData(data) { diff --git a/ng2-components/ng2-alfresco-upload/config/webpack.common.js b/ng2-components/ng2-alfresco-upload/config/webpack.common.js index 7f57340503..f7635417cd 100644 --- a/ng2-components/ng2-alfresco-upload/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-upload/config/webpack.common.js @@ -8,6 +8,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; +const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; + module.exports = { resolveLoader: { diff --git a/ng2-components/ng2-alfresco-userinfo/config/webpack.common.js b/ng2-components/ng2-alfresco-userinfo/config/webpack.common.js index 7f57340503..f7635417cd 100644 --- a/ng2-components/ng2-alfresco-userinfo/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-userinfo/config/webpack.common.js @@ -8,6 +8,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; +const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; + module.exports = { resolveLoader: { diff --git a/ng2-components/ng2-alfresco-viewer/config/webpack.common.js b/ng2-components/ng2-alfresco-viewer/config/webpack.common.js index 62488f670d..4fdfe8ef92 100644 --- a/ng2-components/ng2-alfresco-viewer/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-viewer/config/webpack.common.js @@ -8,6 +8,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; +const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; + module.exports = { resolveLoader: { diff --git a/ng2-components/ng2-alfresco-webscript/config/webpack.common.js b/ng2-components/ng2-alfresco-webscript/config/webpack.common.js index 5b71c8c582..b50bf283b2 100644 --- a/ng2-components/ng2-alfresco-webscript/config/webpack.common.js +++ b/ng2-components/ng2-alfresco-webscript/config/webpack.common.js @@ -8,6 +8,8 @@ const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; +const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; + module.exports = { resolveLoader: { diff --git a/ng2-components/package.json b/ng2-components/package.json index 51edfa2311..6a8dc81467 100644 --- a/ng2-components/package.json +++ b/ng2-components/package.json @@ -18,6 +18,7 @@ "tslint": "", "prepublish": "", "tsc": "", + "webpack": "node --max_old_space_size=2048 node_modules/webpack/bin/webpack.js", "pretest": "", "posttest": "", "publish:prod": "",