diff --git a/ng2-components/ng2-activiti-analytics/index.ts b/ng2-components/ng2-activiti-analytics/index.ts index 001531d6b3..279de053d7 100644 --- a/ng2-components/ng2-activiti-analytics/index.ts +++ b/ng2-components/ng2-activiti-analytics/index.ts @@ -15,4 +15,36 @@ * limitations under the License. */ +import { NgModule, ModuleWithProviders } from '@angular/core'; +import { CoreModule } from 'ng2-alfresco-core'; +import { AnalyticsComponent } from './src/components/analytics.component'; +import { CHART_DIRECTIVES } from 'ng2-charts/ng2-charts'; + export * from './src/components/analytics.component'; + +export const ANALYTICS_DIRECTIVES: any[] = [ + AnalyticsComponent +]; + +@NgModule({ + imports: [ + CoreModule + ], + declarations: [ + ...ANALYTICS_DIRECTIVES, + CHART_DIRECTIVES + ], + exports: [ + ...ANALYTICS_DIRECTIVES + ] +}) +export class AnalyticsModule { + static forRoot(): ModuleWithProviders { + return { + ngModule: AnalyticsModule, + providers: [ + ...ANALYTICS_DIRECTIVES + ] + }; + } +} diff --git a/ng2-components/ng2-activiti-analytics/karma-test-shim.js b/ng2-components/ng2-activiti-analytics/karma-test-shim.js index 5a6d23240a..688f465ff2 100644 --- a/ng2-components/ng2-activiti-analytics/karma-test-shim.js +++ b/ng2-components/ng2-activiti-analytics/karma-test-shim.js @@ -5,105 +5,103 @@ jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000; __karma__.loaded = function() {}; +var builtPath = '/base/dist/'; + +function isJsFile(path) { + return path.slice(-3) == '.js'; +} + +function isSpecFile(path) { + return /\.spec\.(.*\.)?js$/.test(path); +} + +function isBuiltFile(path) { + return isJsFile(path) && (path.substr(0, builtPath.length) == builtPath); +} + +var allSpecFiles = Object.keys(window.__karma__.files) + .filter(isSpecFile) + .filter(isBuiltFile); + +var paths = { + // paths serve as alias + 'npm:': 'base/node_modules/' +}; + var map = { 'app': 'base/dist', - 'rxjs': 'base/node_modules/rxjs', - '@angular': 'base/node_modules/@angular', - 'ng2-translate' : '/base/node_modules/ng2-translate', - 'ng2-charts' : '/base/node_modules/ng2-charts', - 'ng2-alfresco-core': '/base/node_modules/ng2-alfresco-core/dist' + // angular bundles + '@angular/core': 'npm:@angular/core/bundles/core.umd.js', + '@angular/common': 'npm:@angular/common/bundles/common.umd.js', + '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', + '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js', + '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', + '@angular/http': 'npm:@angular/http/bundles/http.umd.js', + '@angular/router': 'npm:@angular/router/bundles/router.umd.js', + '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', + // testing + '@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js', + '@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js', + '@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js', + '@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js', + '@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js', + '@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js', + '@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js', + '@angular/forms/testing': 'npm:@angular/forms/bundles/forms-testing.umd.js', + + // other libraries + 'rxjs': 'npm:rxjs', + 'ng2-translate': 'npm:ng2-translate', + + 'ng2-charts' : 'npm:ng2-charts', + + 'alfresco-js-api': 'npm:alfresco-js-api/dist', + 'ng2-alfresco-core': 'npm:ng2-alfresco-core/dist' }; var packages = { 'app': { main: 'main.js', defaultExtension: 'js' }, - 'rxjs': { defaultExtension: 'js' }, + 'rxjs': { defaultExtension: 'js' }, 'ng2-translate': { defaultExtension: 'js' }, - 'ng2-charts': { defaultExtension: 'js' }, - 'ng2-alfresco-core': { main: 'index.js', defaultExtension: 'js' } -}; -var packageNames = [ - '@angular/common', - '@angular/compiler', - '@angular/core', - '@angular/http', - '@angular/platform-browser', - '@angular/platform-browser-dynamic', - '@angular/router', - '@angular/router-deprecated', - '@angular/testing', - '@angular/upgrade' -]; - -packageNames.forEach(function(pkgName) { - packages[pkgName] = { main: 'index.js', defaultExtension: 'js' }; -}); - -packages['base/dist'] = { - defaultExtension: 'js', - format: 'register', - map: Object.keys(window.__karma__.files).filter(onlyAppFiles).reduce(createPathRecords, {}) + 'ng2-charts' : '/base/node_modules/ng2-charts', + 'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'}, + 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'} }; var config = { + paths: paths, map: map, packages: packages }; System.config(config); -System.import('@angular/platform-browser/src/browser/browser_adapter') - .then(function(browser_adapter) { browser_adapter.BrowserDomAdapter.makeCurrent(); }) - .then(function () { - return Promise.all([ +System.import('@angular/core/testing') + .then(initTestBed) + .then(initTesting); + +function initTestBed(){ + return Promise.all([ System.import('@angular/core/testing'), System.import('@angular/platform-browser-dynamic/testing') ]) - }) - .then(function (providers) { - var testing = providers[0]; - var testingBrowser = providers[1]; + .then(function (providers) { + var coreTesting = providers[0]; + var browserTesting = providers[1]; - testing.setBaseTestProviders( - testingBrowser.TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS, - testingBrowser.TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS); - - }) - .then(function() { return Promise.all(resolveTestFiles()); }) - .then( - function() { - __karma__.start(); - }, - function(error) { - if(typeof __karma__.error == 'function') { - __karma__.error(error.stack || error); - }else{ - console.error(error); - } - } - ); -function createPathRecords(pathsMapping, appPath) { - var pathParts = appPath.split('/'); - var moduleName = './' + pathParts.slice(Math.max(pathParts.length - 2, 1)).join('/'); - moduleName = moduleName.replace(/\.js$/, ''); - pathsMapping[moduleName] = appPath + '?' + window.__karma__.files[appPath]; - return pathsMapping; + coreTesting.TestBed.initTestEnvironment( + browserTesting.BrowserDynamicTestingModule, + browserTesting.platformBrowserDynamicTesting()); + }) } -function onlyAppFiles(filePath) { - return /\/base\/dist\/(?!.*\.spec\.js$).*\.js$/.test(filePath); -} - -function onlySpecFiles(path) { - return /\.spec\.js$/.test(path); -} - -function resolveTestFiles() { - return Object.keys(window.__karma__.files) // All files served by Karma. - .filter(onlySpecFiles) - .map(function(moduleName) { - // loads all spec files via their global module names (e.g. - // 'base/dist/vg-player/vg-player.spec') +// Import all spec files and start karma +function initTesting () { + return Promise.all( + allSpecFiles.map(function (moduleName) { return System.import(moduleName); - }); + }) + ) + .then(__karma__.start, __karma__.error); } diff --git a/ng2-components/ng2-activiti-analytics/karma.conf.js b/ng2-components/ng2-activiti-analytics/karma.conf.js index 9f91a8ed86..2e7c9d4430 100644 --- a/ng2-components/ng2-activiti-analytics/karma.conf.js +++ b/ng2-components/ng2-activiti-analytics/karma.conf.js @@ -7,26 +7,47 @@ module.exports = function (config) { frameworks: ['jasmine-ajax', 'jasmine'], files: [ - // paths loaded by Karma - {pattern: 'node_modules/reflect-metadata/Reflect.js', included: true, watched: true}, - {pattern: 'node_modules/systemjs/dist/system.src.js', included: true, watched: false}, - {pattern: 'node_modules/zone.js/dist/zone.js', included: true, watched: true}, - {pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false}, - {pattern: 'node_modules/rxjs/**/*.map', included: false, watched: false}, - {pattern: 'node_modules/@angular/**/*.js', included: false, watched: false}, - {pattern: 'node_modules/@angular/**/*.map', included: false, watched: false}, - {pattern: 'node_modules/ng2-alfresco-core/dist/**/*.js', included: false, served: true, watched: false}, - {pattern: 'node_modules/ng2-translate/**/*.js', included: false, served: true, watched: false}, - {pattern: 'node_modules/ng2-charts/**/*.js', included: false, served: true, watched: false}, - {pattern: 'node_modules/alfresco-js-api/dist/alfresco-js-api.js', included: true, watched: false}, + // System.js for module loading + 'node_modules/systemjs/dist/system.src.js', - {pattern: 'karma-test-shim.js', included: true, watched: true}, + // Polyfills + 'node_modules/core-js/client/shim.js', + 'node_modules/reflect-metadata/Reflect.js', + + // zone.js + 'node_modules/zone.js/dist/zone.js', + 'node_modules/zone.js/dist/long-stack-trace-zone.js', + 'node_modules/zone.js/dist/proxy.js', + 'node_modules/zone.js/dist/sync-test.js', + 'node_modules/zone.js/dist/jasmine-patch.js', + 'node_modules/zone.js/dist/async-test.js', + 'node_modules/zone.js/dist/fake-async-test.js', + + // RxJs + {pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false}, + {pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false}, + + // Paths loaded via module imports: + // Angular itself + {pattern: 'node_modules/@angular/**/*.js', included: false, watched: false}, + {pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false}, + + 'node_modules/alfresco-js-api/dist/alfresco-js-api.js', + {pattern: 'node_modules/ng2-translate/**/*.js', included: false, watched: false}, + {pattern: 'node_modules/ng2-translate/**/*.js.map', included: false, watched: false}, + + 'karma-test-shim.js', // paths loaded via module imports {pattern: 'dist/**/*.js', included: false, watched: true}, {pattern: 'dist/**/*.html', included: true, served: true, watched: true}, {pattern: 'dist/**/*.css', included: true, served: true, watched: true}, + // ng2-components + {pattern: 'node_modules/ng2-alfresco-core/dist/**/*.*', included: false, served: true, watched: false}, + + {pattern: 'node_modules/ng2-charts/**/*.js', included: false, served: true, watched: false}, + // paths to support debugging with source maps in dev tools {pattern: 'src/**/*.ts', included: false, watched: false}, {pattern: 'dist/**/*.js.map', included: false, watched: false} @@ -77,10 +98,11 @@ module.exports = function (config) { // Source files that you wanna generate coverage for. // Do not include tests or libraries (these files will be instrumented by Istanbul) preprocessors: { - 'dist/**/!(*spec).js': ['coverage'] + 'dist/**/!(*spec|index|*mock|*model).js': 'coverage' }, coverageReporter: { + includeAllSources: true, dir: 'coverage/', subdir: 'report', reporters: [ diff --git a/ng2-components/ng2-activiti-analytics/package.json b/ng2-components/ng2-activiti-analytics/package.json index 4aaaa27d11..76ae3079e9 100644 --- a/ng2-components/ng2-activiti-analytics/package.json +++ b/ng2-components/ng2-activiti-analytics/package.json @@ -41,29 +41,31 @@ "ng2", "angular", "angular2", + "analytics", + "alfresco-component", "alfresco" ], "dependencies": { - "@angular/common": "2.0.0-rc.3", - "@angular/compiler": "2.0.0-rc.3", - "@angular/core": "2.0.0-rc.3", - "@angular/forms": "0.1.1", - "@angular/http": "2.0.0-rc.3", - "@angular/platform-browser": "2.0.0-rc.3", - "@angular/platform-browser-dynamic": "2.0.0-rc.3", - "@angular/router": "3.0.0-alpha.7", - "@angular/router-deprecated": "2.0.0-rc.2", - "@angular/upgrade": "2.0.0-rc.3", + "@angular/common": "2.0.0", + "@angular/compiler": "2.0.0", + "@angular/core": "2.0.0", + "@angular/forms": "2.0.0", + "@angular/http": "2.0.0", + "@angular/platform-browser": "2.0.0", + "@angular/platform-browser-dynamic": "2.0.0", + "@angular/router": "3.0.0", + "@angular/upgrade": "2.0.0", + "@types/node": "^6.0.42", + "core-js": "^2.4.1", + "reflect-metadata": "^0.1.3", + "rxjs": "5.0.0-beta.12", "systemjs": "0.19.27", - "core-js": "2.4.0", - "reflect-metadata": "0.1.3", - "rxjs": "5.0.0-beta.6", - "zone.js": "0.6.12", - "chart.js": "^2.1.4", - "ng2-charts": "1.1.0", - "ng2-translate": "2.2.2", + "zone.js": "^0.6.23", + "ng2-translate": "2.5.0", + "alfresco-js-api": "^0.3.0", "ng2-alfresco-core": "0.3.2", - "alfresco-js-api": "^0.3.0" + "ng2-charts": "1.1.0", + "chart.js": "^2.1.4" }, "devDependencies": { "@types/core-js": "^0.9.32", @@ -83,7 +85,7 @@ "remap-istanbul": "0.6.3", "traceur": "0.0.91", "tslint": "3.8.1", - "typescript": "^2.0.2", + "typescript": "^2.0.3", "wsrv": "^0.1.5" }, "license-check-config": { @@ -94,5 +96,6 @@ "blocking": true, "logInfo": false, "logError": true - } + }, + "license": "Apache-2.0" } diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics.component.spec.ts b/ng2-components/ng2-activiti-analytics/src/components/analytics.component.spec.ts index e79859d36d..7f61019dd0 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/analytics.component.spec.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/analytics.component.spec.ts @@ -15,17 +15,47 @@ * limitations under the License. */ -import { describe, expect, it, inject } from '@angular/core/testing'; -import { TestComponentBuilder } from '@angular/compiler/testing'; +import { ComponentFixture, TestBed, async } from '@angular/core/testing'; import { AnalyticsComponent } from './analytics.component'; +import { DebugElement } from '@angular/core'; +import { + AlfrescoAuthenticationService, + AlfrescoSettingsService, + AlfrescoApiService, + CoreModule +} from 'ng2-alfresco-core'; -describe('Show component HTML', () => { - it('Display component tag base-chart', inject([TestComponentBuilder], (tcb: TestComponentBuilder) => { - return tcb - .createAsync(AnalyticsComponent) - .then((fixture) => { - let element = fixture.nativeElement; - expect(element.getElementsByTagName('base-chart')[0].innerHTML).toBeDefined(); - }); +describe('Test ng2-alfresco-analytics analytics component ', () => { + + let component: any; + let fixture: ComponentFixture; + let debug: DebugElement; + let element: HTMLElement; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + imports: [ + CoreModule + ], + declarations: [AnalyticsComponent], + providers: [ + AlfrescoSettingsService, + AlfrescoAuthenticationService, + AlfrescoApiService + ] + }).compileComponents(); })); + + beforeEach(() => { + fixture = TestBed.createComponent(AnalyticsComponent); + + debug = fixture.debugElement; + element = fixture.nativeElement; + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + xit('No test', () => { + }); }); + diff --git a/ng2-components/ng2-activiti-analytics/src/components/analytics.component.ts b/ng2-components/ng2-activiti-analytics/src/components/analytics.component.ts index dae27819a5..92f4aa7c40 100644 --- a/ng2-components/ng2-activiti-analytics/src/components/analytics.component.ts +++ b/ng2-components/ng2-activiti-analytics/src/components/analytics.component.ts @@ -16,17 +16,11 @@ */ import { Component } from '@angular/core'; -import { CORE_DIRECTIVES, FORM_DIRECTIVES, NgClass } from '@angular/common'; - -import { CHART_DIRECTIVES } from 'ng2-charts/ng2-charts'; - -declare let __moduleName: string; @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'activiti-analytics', - templateUrl: './analytics.component.html', - directives: [CHART_DIRECTIVES, NgClass, CORE_DIRECTIVES, FORM_DIRECTIVES] + templateUrl: './analytics.component.html' }) export class AnalyticsComponent { diff --git a/ng2-components/ng2-activiti-analytics/tsconfig.json b/ng2-components/ng2-activiti-analytics/tsconfig.json index b1effea355..7be35bfec8 100644 --- a/ng2-components/ng2-activiti-analytics/tsconfig.json +++ b/ng2-components/ng2-activiti-analytics/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "es5", - "module": "system", + "module": "commonjs", "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, @@ -16,7 +16,7 @@ "noImplicitUseStrict": false, "noFallthroughCasesInSwitch": true, "outDir": "dist", - "types": ["core-js", "jasmine"] + "types": ["core-js", "jasmine", "node"] }, "exclude": [ "demo", diff --git a/ng2-components/ng2-activiti-form/karma-test-shim.js b/ng2-components/ng2-activiti-form/karma-test-shim.js index 9662cebf0a..a58f01a39b 100644 --- a/ng2-components/ng2-activiti-form/karma-test-shim.js +++ b/ng2-components/ng2-activiti-form/karma-test-shim.js @@ -54,18 +54,7 @@ var map = { 'ng2-translate': 'npm:ng2-translate', 'alfresco-js-api': 'npm:alfresco-js-api/dist', - 'ng2-activiti-form': 'npm:ng2-activiti-form/dist', - 'ng2-activiti-processlist': 'npm:ng2-activiti-processlist/dist', - 'ng2-activiti-tasklist': 'npm:ng2-activiti-tasklist/dist', - 'ng2-alfresco-core': 'npm:ng2-alfresco-core/dist', - 'ng2-alfresco-datatable': 'npm:ng2-alfresco-datatable/dist', - 'ng2-alfresco-documentlist': 'npm:ng2-alfresco-documentlist/dist', - 'ng2-alfresco-login': 'npm:ng2-alfresco-login/dist', - 'ng2-alfresco-search': 'npm:ng2-alfresco-search/dist', - 'ng2-alfresco-tag': 'npm:ng2-alfresco-tag/dist', - 'ng2-alfresco-upload': 'npm:ng2-alfresco-upload/dist', - 'ng2-alfresco-viewer': 'npm:ng2-alfresco-viewer/dist', - 'ng2-alfresco-webscript': 'npm:ng2-alfresco-webscript/dist' + 'ng2-alfresco-core': 'npm:ng2-alfresco-core/dist' }; var packages = { @@ -74,18 +63,7 @@ var packages = { 'ng2-translate': { defaultExtension: 'js' }, 'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'}, - 'ng2-activiti-form': { main: './index.js', defaultExtension: 'js'}, - 'ng2-activiti-processlist': { main: './index.js', defaultExtension: 'js'}, - 'ng2-activiti-tasklist': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-datatable': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-documentlist': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-login': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-search': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-tag': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-upload': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-viewer': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-webscript': { main: './index.js', defaultExtension: 'js'} + 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'} }; var config = { diff --git a/ng2-components/ng2-activiti-form/karma.conf.js b/ng2-components/ng2-activiti-form/karma.conf.js index 2aa3ff5612..8f3adc54b4 100644 --- a/ng2-components/ng2-activiti-form/karma.conf.js +++ b/ng2-components/ng2-activiti-form/karma.conf.js @@ -44,18 +44,7 @@ module.exports = function (config) { {pattern: 'dist/**/*.css', included: true, served: true, watched: true}, // ng2-components - { pattern: 'node_modules/ng2-activiti-form/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-activiti-processlist/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-activiti-tasklist/dist/**/*.js', included: false, served: true, watched: false }, { pattern: 'node_modules/ng2-alfresco-core/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-datatable/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-documentlist/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-login/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-search/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-tag/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-upload/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-viewer/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-webscript/dist/**/*.js', included: false, served: true, watched: false }, // paths to support debugging with source maps in dev tools {pattern: 'src/**/*.ts', included: false, watched: false}, @@ -107,10 +96,11 @@ module.exports = function (config) { // Source files that you wanna generate coverage for. // Do not include tests or libraries (these files will be instrumented by Istanbul) preprocessors: { - // 'dist/**/!(*spec).js': ['coverage'] + 'dist/**/!(*spec|index|*mock|*model).js': 'coverage' }, coverageReporter: { + includeAllSources: true, dir: 'coverage/', subdir: 'report', reporters: [ diff --git a/ng2-components/ng2-activiti-form/package.json b/ng2-components/ng2-activiti-form/package.json index 2aeb209cfe..38a8d9109f 100644 --- a/ng2-components/ng2-activiti-form/package.json +++ b/ng2-components/ng2-activiti-form/package.json @@ -54,6 +54,7 @@ "@angular/platform-browser-dynamic": "2.0.0", "@angular/router": "3.0.0", "@angular/upgrade": "2.0.0", + "@types/node": "^6.0.42", "core-js": "^2.4.1", "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-beta.12", diff --git a/ng2-components/ng2-activiti-form/src/components/activiti-form.component.ts b/ng2-components/ng2-activiti-form/src/components/activiti-form.component.ts index 632df20775..1085e80028 100644 --- a/ng2-components/ng2-activiti-form/src/components/activiti-form.component.ts +++ b/ng2-components/ng2-activiti-form/src/components/activiti-form.component.ts @@ -28,7 +28,6 @@ import { FormService } from './../services/form.service'; import { NodeService } from './../services/node.service'; import { FormModel, FormOutcomeModel, FormValues, FormFieldModel, FormOutcomeEvent } from './widgets/core/index'; -declare let __moduleName: string; declare var componentHandler; import { WidgetVisibilityService } from './../services/widget-visibility.service'; @@ -76,7 +75,7 @@ import { WidgetVisibilityService } from './../services/widget-visibility.servic * @returns {ActivitiForm} . */ @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'activiti-form', templateUrl: './activiti-form.component.html', styleUrls: ['./activiti-form.component.css'] diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/amount/amount.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/amount/amount.widget.ts index 43cde7fe97..b40556b1fe 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/amount/amount.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/amount/amount.widget.ts @@ -18,10 +18,8 @@ import { Component, ElementRef, OnInit } from '@angular/core'; import { WidgetComponent } from './../widget.component'; -declare let __moduleName: string; - @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'amount-widget', templateUrl: './amount.widget.html', styleUrls: ['./amount.widget.css'] diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/attach/attach.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/attach/attach.widget.ts index fbb2293625..949281858e 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/attach/attach.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/attach/attach.widget.ts @@ -22,11 +22,10 @@ import { ExternalContent } from '../core/external-content'; import { ExternalContentLink } from '../core/external-content-link'; import { FormFieldModel } from '../core/form-field.model'; -declare let __moduleName: string; declare var componentHandler; @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'attach-widget', templateUrl: './attach.widget.html', styleUrls: ['./attach.widget.css'] diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/checkbox/checkbox.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/checkbox/checkbox.widget.ts index 168a6972b3..dd82162870 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/checkbox/checkbox.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/checkbox/checkbox.widget.ts @@ -18,11 +18,10 @@ import { Component } from '@angular/core'; import { WidgetComponent } from './../widget.component'; -declare let __moduleName: string; declare var componentHandler; @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'checkbox-widget', templateUrl: './checkbox.widget.html' }) diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/container/container.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/container/container.widget.ts index 3fe6391348..674166be3d 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/container/container.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/container/container.widget.ts @@ -18,11 +18,10 @@ import { Component, Input, AfterViewInit, Output, EventEmitter } from '@angular/core'; import { ContainerModel, FormFieldModel } from './../core/index'; -declare let __moduleName: string; declare var componentHandler; @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'container-widget', templateUrl: './container.widget.html', styleUrls: ['./container.widget.css'] diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/date/date.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/date/date.widget.ts index 3348865043..78bf35a398 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/date/date.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/date/date.widget.ts @@ -18,10 +18,8 @@ import { Component, ElementRef } from '@angular/core'; import { WidgetComponent } from './../widget.component'; -declare let __moduleName: string; - @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'date-widget', templateUrl: './date.widget.html', styleUrls: ['./date.widget.css'] diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/display-text/display-text.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/display-text/display-text.widget.ts index 2f39c56db3..9f7621afe2 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/display-text/display-text.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/display-text/display-text.widget.ts @@ -18,11 +18,10 @@ import { Component } from '@angular/core'; import { WidgetComponent } from './../widget.component'; -declare let __moduleName: string; declare var componentHandler; @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'display-text-widget', templateUrl: './display-text.widget.html', styleUrls: ['./display-text.widget.css'] diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/display-value/display-value.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/display-value/display-value.widget.ts index 20ea80675b..5ea68a5901 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/display-value/display-value.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/display-value/display-value.widget.ts @@ -21,11 +21,10 @@ import { FormFieldTypes } from '../core/form-field-types'; import { FormService } from '../../../services/form.service'; import { FormFieldOption } from './../core/form-field-option'; -declare let __moduleName: string; declare var componentHandler; @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'display-value-widget', templateUrl: './display-value.widget.html', styleUrls: ['./display-value.widget.css'] diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/dropdown/dropdown.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/dropdown/dropdown.widget.ts index 3bfcbe26a3..90691470ff 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/dropdown/dropdown.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/dropdown/dropdown.widget.ts @@ -20,10 +20,8 @@ import { FormService } from '../../../services/form.service'; import { WidgetComponent } from './../widget.component'; import { FormFieldOption } from './../core/form-field-option'; -declare let __moduleName: string; - @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'dropdown-widget', templateUrl: './dropdown.widget.html', styleUrls: ['./dropdown.widget.css'] diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/functional-group/functional-group.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/functional-group/functional-group.widget.ts index 4f91ac5864..0c9380b231 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/functional-group/functional-group.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/functional-group/functional-group.widget.ts @@ -20,10 +20,8 @@ import { WidgetComponent } from './../widget.component'; import { FormService } from '../../../services/form.service'; import { GroupModel } from './../core/group.model'; -declare let __moduleName: string; - @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'functional-group-widget', templateUrl: './functional-group.widget.html', styleUrls: ['./functional-group.widget.css'] diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/hyperlink/hyperlink.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/hyperlink/hyperlink.widget.ts index dd9c7e3fd2..9e12d2ecc3 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/hyperlink/hyperlink.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/hyperlink/hyperlink.widget.ts @@ -18,11 +18,10 @@ import { Component } from '@angular/core'; import { WidgetComponent } from './../widget.component'; -declare let __moduleName: string; declare var componentHandler; @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'hyperlink-widget', templateUrl: './hyperlink.widget.html', styleUrls: ['./hyperlink.widget.css'] diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/multiline-text/multiline-text.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/multiline-text/multiline-text.widget.ts index efdcbe1842..a14cd81be9 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/multiline-text/multiline-text.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/multiline-text/multiline-text.widget.ts @@ -18,10 +18,8 @@ import { Component, ElementRef } from '@angular/core'; import { WidgetComponent } from './../widget.component'; -declare let __moduleName: string; - @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'multiline-text-widget', templateUrl: './multiline-text.widget.html', styleUrls: ['./multiline-text.widget.css'] diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/number/number.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/number/number.widget.ts index df7ede255c..d888cb6d7d 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/number/number.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/number/number.widget.ts @@ -18,10 +18,8 @@ import { Component, ElementRef } from '@angular/core'; import { WidgetComponent } from './../widget.component'; -declare let __moduleName: string; - @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'number-widget', templateUrl: './number.widget.html', styleUrls: ['./number.widget.css'] diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/people/people.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/people/people.widget.ts index b7060c554b..c489a76269 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/people/people.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/people/people.widget.ts @@ -21,10 +21,8 @@ import { FormService } from '../../../services/form.service'; import { GroupModel } from '../core/group.model'; import { GroupUserModel } from '../core/group-user.model'; -declare let __moduleName: string; - @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'people-widget', templateUrl: './people.widget.html', styleUrls: ['./people.widget.css'] diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/radio-buttons/radio-buttons.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/radio-buttons/radio-buttons.widget.ts index 1f59c422ce..9eae35a7c8 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/radio-buttons/radio-buttons.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/radio-buttons/radio-buttons.widget.ts @@ -20,11 +20,10 @@ import { WidgetComponent } from './../widget.component'; import { FormService } from '../../../services/form.service'; import { FormFieldOption } from './../core/form-field-option'; -declare let __moduleName: string; declare var componentHandler; @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'radio-buttons-widget', templateUrl: './radio-buttons.widget.html', styleUrls: ['./radio-buttons.widget.css'] diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/tabs/tabs.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/tabs/tabs.widget.ts index cc73c08505..77f1819a82 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/tabs/tabs.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/tabs/tabs.widget.ts @@ -18,11 +18,10 @@ import { Component, Input, AfterViewInit } from '@angular/core'; import { TabModel } from './../core/index'; -declare let __moduleName: string; declare var componentHandler; @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'tabs-widget', templateUrl: './tabs.widget.html' }) diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/text/text.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/text/text.widget.ts index 2f79764a20..5d1261d014 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/text/text.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/text/text.widget.ts @@ -18,10 +18,8 @@ import { Component, ElementRef } from '@angular/core'; import { WidgetComponent } from './../widget.component'; -declare let __moduleName: string; - @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'text-widget', templateUrl: './text.widget.html', styleUrls: ['./text.widget.css'] diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/typeahead/typeahead.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/typeahead/typeahead.widget.ts index e6e24de8c2..98817dce0e 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/typeahead/typeahead.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/typeahead/typeahead.widget.ts @@ -20,11 +20,10 @@ import { FormService } from './../../../services/form.service'; import { WidgetComponent } from './../widget.component'; import { FormFieldOption } from './../core/form-field-option'; -declare let __moduleName: string; declare var componentHandler; @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'typeahead-widget', templateUrl: './typeahead.widget.html', styleUrls: ['./typeahead.widget.css'] diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/upload/upload.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/upload/upload.widget.ts index b8981b9f90..a6fba3bc23 100644 --- a/ng2-components/ng2-activiti-form/src/components/widgets/upload/upload.widget.ts +++ b/ng2-components/ng2-activiti-form/src/components/widgets/upload/upload.widget.ts @@ -19,11 +19,10 @@ import { Component, OnInit } from '@angular/core'; import { WidgetComponent } from './../widget.component'; import { AlfrescoSettingsService, AlfrescoAuthenticationService } from 'ng2-alfresco-core'; -declare let __moduleName: string; declare var componentHandler; @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'upload-widget', templateUrl: './upload.widget.html', styleUrls: ['./upload.widget.css'] diff --git a/ng2-components/ng2-activiti-form/tsconfig.json b/ng2-components/ng2-activiti-form/tsconfig.json index 3d10391028..7be35bfec8 100644 --- a/ng2-components/ng2-activiti-form/tsconfig.json +++ b/ng2-components/ng2-activiti-form/tsconfig.json @@ -1,19 +1,25 @@ { "compilerOptions": { "target": "es5", - "module": "system", + "module": "commonjs", "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "sourceMap": true, "removeComments": true, "declaration": true, + "noLib": false, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noImplicitAny": false, + "noImplicitReturns": false, + "noImplicitUseStrict": false, + "noFallthroughCasesInSwitch": true, "outDir": "dist", - "types": ["core-js", "jasmine"] + "types": ["core-js", "jasmine", "node"] }, "exclude": [ "demo", - "dist", "node_modules", "dist" ] diff --git a/ng2-components/ng2-activiti-tasklist/karma.conf.js b/ng2-components/ng2-activiti-tasklist/karma.conf.js index efb8a75940..6b32ae88b5 100644 --- a/ng2-components/ng2-activiti-tasklist/karma.conf.js +++ b/ng2-components/ng2-activiti-tasklist/karma.conf.js @@ -39,7 +39,9 @@ module.exports = function (config) { 'karma-test-shim.js', // paths loaded via module imports - {pattern: 'dist/**/*.*', included: false, watched: true}, + {pattern: 'dist/**/*.js', included: false, watched: true}, + {pattern: 'dist/**/*.html', included: true, served: true, watched: true}, + {pattern: 'dist/**/*.css', included: true, served: true, watched: true}, // ng2-components {pattern: 'node_modules/ng2-activiti-form/dist/**/*.*', included: false, served: true, watched: false}, @@ -96,10 +98,11 @@ module.exports = function (config) { // Source files that you wanna generate coverage for. // Do not include tests or libraries (these files will be instrumented by Istanbul) preprocessors: { - 'dist/**/!(*spec).js': ['coverage'] + 'dist/**/!(*spec|index|*mock|*model).js': 'coverage' }, coverageReporter: { + includeAllSources: true, dir: 'coverage/', subdir: 'report', reporters: [ diff --git a/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-details.component.ts b/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-details.component.ts index f2e2f5fb1b..763328fbc7 100644 --- a/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-details.component.ts +++ b/ng2-components/ng2-activiti-tasklist/src/components/activiti-task-details.component.ts @@ -23,7 +23,6 @@ import { User } from '../models/user.model'; import { FormModel, FormService } from 'ng2-activiti-form'; import { TaskQueryRequestRepresentationModel } from '../models/filter.model'; - declare let componentHandler: any; @Component({ diff --git a/ng2-components/ng2-alfresco-core/karma.conf.js b/ng2-components/ng2-alfresco-core/karma.conf.js index 54545187a4..ecfca9ea10 100644 --- a/ng2-components/ng2-alfresco-core/karma.conf.js +++ b/ng2-components/ng2-alfresco-core/karma.conf.js @@ -93,10 +93,11 @@ module.exports = function (config) { // Source files that you wanna generate coverage for. // Do not include tests or libraries (these files will be instrumented by Istanbul) preprocessors: { - 'dist/**/!(*spec).js': ['coverage'] + 'dist/**/!(*spec|index|*mock|*model).js': 'coverage' }, coverageReporter: { + includeAllSources: true, dir: 'coverage/', subdir: 'report', reporters: [ diff --git a/ng2-components/ng2-alfresco-datatable/karma-test-shim.js b/ng2-components/ng2-alfresco-datatable/karma-test-shim.js index 082f0076ec..a58f01a39b 100644 --- a/ng2-components/ng2-alfresco-datatable/karma-test-shim.js +++ b/ng2-components/ng2-alfresco-datatable/karma-test-shim.js @@ -54,38 +54,16 @@ var map = { 'ng2-translate': 'npm:ng2-translate', 'alfresco-js-api': 'npm:alfresco-js-api/dist', - 'ng2-activiti-form': 'npm:ng2-activiti-form/dist', - 'ng2-activiti-processlist': 'npm:ng2-activiti-processlist/dist', - 'ng2-activiti-tasklist': 'npm:ng2-activiti-tasklist/dist', - 'ng2-alfresco-core': 'npm:ng2-alfresco-core/dist', - 'ng2-alfresco-datatable': 'npm:ng2-alfresco-datatable/dist', - 'ng2-alfresco-documentlist': 'npm:ng2-alfresco-documentlist/dist', - 'ng2-alfresco-login': 'npm:ng2-alfresco-login/dist', - 'ng2-alfresco-search': 'npm:ng2-alfresco-search/dist', - 'ng2-alfresco-tag': 'npm:ng2-alfresco-tag/dist', - 'ng2-alfresco-upload': 'npm:ng2-alfresco-upload/dist', - 'ng2-alfresco-viewer': 'npm:ng2-alfresco-viewer/dist', - 'ng2-alfresco-webscript': 'npm:ng2-alfresco-webscript/dist' + 'ng2-alfresco-core': 'npm:ng2-alfresco-core/dist' }; var packages = { - 'app': { main: 'index.js', defaultExtension: 'js', format: 'register' }, + 'app': { main: 'main.js', defaultExtension: 'js' }, 'rxjs': { defaultExtension: 'js' }, 'ng2-translate': { defaultExtension: 'js' }, 'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'}, - 'ng2-activiti-form': { main: './index.js', defaultExtension: 'js'}, - 'ng2-activiti-processlist': { main: './index.js', defaultExtension: 'js'}, - 'ng2-activiti-tasklist': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-datatable': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-documentlist': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-login': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-search': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-tag': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-upload': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-viewer': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-webscript': { main: './index.js', defaultExtension: 'js'} + 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'} }; var config = { @@ -96,7 +74,7 @@ var config = { System.config(config); -System.import('app') +System.import('@angular/core/testing') .then(initTestBed) .then(initTesting); diff --git a/ng2-components/ng2-alfresco-datatable/karma.conf.js b/ng2-components/ng2-alfresco-datatable/karma.conf.js index f6004cd36b..8f3adc54b4 100644 --- a/ng2-components/ng2-alfresco-datatable/karma.conf.js +++ b/ng2-components/ng2-alfresco-datatable/karma.conf.js @@ -44,18 +44,7 @@ module.exports = function (config) { {pattern: 'dist/**/*.css', included: true, served: true, watched: true}, // ng2-components - { pattern: 'node_modules/ng2-activiti-form/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-activiti-processlist/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-activiti-tasklist/dist/**/*.js', included: false, served: true, watched: false }, { pattern: 'node_modules/ng2-alfresco-core/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-datatable/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-documentlist/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-login/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-search/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-tag/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-upload/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-viewer/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-webscript/dist/**/*.js', included: false, served: true, watched: false }, // paths to support debugging with source maps in dev tools {pattern: 'src/**/*.ts', included: false, watched: false}, @@ -107,10 +96,11 @@ module.exports = function (config) { // Source files that you wanna generate coverage for. // Do not include tests or libraries (these files will be instrumented by Istanbul) preprocessors: { - 'dist/**/!(*spec).js': ['coverage'] + 'dist/**/!(*spec|index|*mock|*model).js': 'coverage' }, coverageReporter: { + includeAllSources: true, dir: 'coverage/', subdir: 'report', reporters: [ diff --git a/ng2-components/ng2-alfresco-datatable/package.json b/ng2-components/ng2-alfresco-datatable/package.json index 2180c268b1..707237b82b 100644 --- a/ng2-components/ng2-alfresco-datatable/package.json +++ b/ng2-components/ng2-alfresco-datatable/package.json @@ -53,6 +53,7 @@ "@angular/platform-browser-dynamic": "2.0.0", "@angular/router": "3.0.0", "@angular/upgrade": "2.0.0", + "@types/node": "^6.0.42", "core-js": "^2.4.1", "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-beta.12", @@ -91,5 +92,6 @@ "blocking": true, "logInfo": false, "logError": true - } + }, + "license": "Apache-2.0" } diff --git a/ng2-components/ng2-alfresco-datatable/src/components/datatable/datatable.component.ts b/ng2-components/ng2-alfresco-datatable/src/components/datatable/datatable.component.ts index d7b3cd6922..9760b4da69 100644 --- a/ng2-components/ng2-alfresco-datatable/src/components/datatable/datatable.component.ts +++ b/ng2-components/ng2-alfresco-datatable/src/components/datatable/datatable.component.ts @@ -35,10 +35,9 @@ import { } from '../../data/index'; declare var componentHandler; -declare let __moduleName: string; @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'alfresco-datatable', styleUrls: ['./datatable.component.css'], templateUrl: './datatable.component.html' diff --git a/ng2-components/ng2-alfresco-datatable/src/components/pagination/pagination.component.ts b/ng2-components/ng2-alfresco-datatable/src/components/pagination/pagination.component.ts index bbd455a5b9..c465b73187 100644 --- a/ng2-components/ng2-alfresco-datatable/src/components/pagination/pagination.component.ts +++ b/ng2-components/ng2-alfresco-datatable/src/components/pagination/pagination.component.ts @@ -16,13 +16,10 @@ */ import { Component, Input } from '@angular/core'; - import { PaginationProvider } from './pagination-provider'; -declare let __moduleName: string; - @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'alfresco-pagination', templateUrl: './pagination.component.html', styleUrls: ['./pagination.component.css'] diff --git a/ng2-components/ng2-alfresco-datatable/tsconfig.json b/ng2-components/ng2-alfresco-datatable/tsconfig.json index 3d10391028..7be35bfec8 100644 --- a/ng2-components/ng2-alfresco-datatable/tsconfig.json +++ b/ng2-components/ng2-alfresco-datatable/tsconfig.json @@ -1,19 +1,25 @@ { "compilerOptions": { "target": "es5", - "module": "system", + "module": "commonjs", "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "sourceMap": true, "removeComments": true, "declaration": true, + "noLib": false, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noImplicitAny": false, + "noImplicitReturns": false, + "noImplicitUseStrict": false, + "noFallthroughCasesInSwitch": true, "outDir": "dist", - "types": ["core-js", "jasmine"] + "types": ["core-js", "jasmine", "node"] }, "exclude": [ "demo", - "dist", "node_modules", "dist" ] diff --git a/ng2-components/ng2-alfresco-documentlist/karma.conf.js b/ng2-components/ng2-alfresco-documentlist/karma.conf.js index 34fa5bf284..ae1dda1c20 100644 --- a/ng2-components/ng2-alfresco-documentlist/karma.conf.js +++ b/ng2-components/ng2-alfresco-documentlist/karma.conf.js @@ -38,8 +38,10 @@ module.exports = function (config) { 'karma-test-shim.js', // paths loaded via module imports - // paths loaded via module imports - {pattern: 'dist/**/*.*', included: false, watched: true}, + {pattern: 'dist/**/*.js', included: false, watched: true}, + {pattern: 'dist/**/*.html', included: true, served: true, watched: true}, + {pattern: 'dist/**/*.css', included: true, served: true, watched: true}, + // ng2-components { pattern: 'node_modules/ng2-alfresco-core/dist/**/*.*', included: false, served: true, watched: false }, @@ -95,10 +97,11 @@ module.exports = function (config) { // Source files that you wanna generate coverage for. // Do not include tests or libraries (these files will be instrumented by Istanbul) preprocessors: { - 'dist/**/!(*spec).js': ['coverage'] + 'dist/**/!(*spec|index|*mock|*model).js': 'coverage' }, coverageReporter: { + includeAllSources: true, dir: 'coverage/', subdir: 'report', reporters: [ diff --git a/ng2-components/ng2-alfresco-documentlist/package.json b/ng2-components/ng2-alfresco-documentlist/package.json index 38f694f8b4..8744d19758 100644 --- a/ng2-components/ng2-alfresco-documentlist/package.json +++ b/ng2-components/ng2-alfresco-documentlist/package.json @@ -62,6 +62,7 @@ "@angular/router": "3.0.0", "@angular/upgrade": "2.0.0", "@types/node": "^6.0.42", + "@types/node": "^6.0.42", "alfresco-js-api": "^0.3.1", "core-js": "^2.4.1", "ng2-alfresco-core": "0.3.2", diff --git a/ng2-components/ng2-alfresco-login/karma-test-shim.js b/ng2-components/ng2-alfresco-login/karma-test-shim.js index 9662cebf0a..a58f01a39b 100644 --- a/ng2-components/ng2-alfresco-login/karma-test-shim.js +++ b/ng2-components/ng2-alfresco-login/karma-test-shim.js @@ -54,18 +54,7 @@ var map = { 'ng2-translate': 'npm:ng2-translate', 'alfresco-js-api': 'npm:alfresco-js-api/dist', - 'ng2-activiti-form': 'npm:ng2-activiti-form/dist', - 'ng2-activiti-processlist': 'npm:ng2-activiti-processlist/dist', - 'ng2-activiti-tasklist': 'npm:ng2-activiti-tasklist/dist', - 'ng2-alfresco-core': 'npm:ng2-alfresco-core/dist', - 'ng2-alfresco-datatable': 'npm:ng2-alfresco-datatable/dist', - 'ng2-alfresco-documentlist': 'npm:ng2-alfresco-documentlist/dist', - 'ng2-alfresco-login': 'npm:ng2-alfresco-login/dist', - 'ng2-alfresco-search': 'npm:ng2-alfresco-search/dist', - 'ng2-alfresco-tag': 'npm:ng2-alfresco-tag/dist', - 'ng2-alfresco-upload': 'npm:ng2-alfresco-upload/dist', - 'ng2-alfresco-viewer': 'npm:ng2-alfresco-viewer/dist', - 'ng2-alfresco-webscript': 'npm:ng2-alfresco-webscript/dist' + 'ng2-alfresco-core': 'npm:ng2-alfresco-core/dist' }; var packages = { @@ -74,18 +63,7 @@ var packages = { 'ng2-translate': { defaultExtension: 'js' }, 'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'}, - 'ng2-activiti-form': { main: './index.js', defaultExtension: 'js'}, - 'ng2-activiti-processlist': { main: './index.js', defaultExtension: 'js'}, - 'ng2-activiti-tasklist': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-datatable': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-documentlist': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-login': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-search': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-tag': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-upload': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-viewer': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-webscript': { main: './index.js', defaultExtension: 'js'} + 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'} }; var config = { diff --git a/ng2-components/ng2-alfresco-login/karma.conf.js b/ng2-components/ng2-alfresco-login/karma.conf.js index f6004cd36b..8f3adc54b4 100644 --- a/ng2-components/ng2-alfresco-login/karma.conf.js +++ b/ng2-components/ng2-alfresco-login/karma.conf.js @@ -44,18 +44,7 @@ module.exports = function (config) { {pattern: 'dist/**/*.css', included: true, served: true, watched: true}, // ng2-components - { pattern: 'node_modules/ng2-activiti-form/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-activiti-processlist/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-activiti-tasklist/dist/**/*.js', included: false, served: true, watched: false }, { pattern: 'node_modules/ng2-alfresco-core/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-datatable/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-documentlist/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-login/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-search/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-tag/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-upload/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-viewer/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-webscript/dist/**/*.js', included: false, served: true, watched: false }, // paths to support debugging with source maps in dev tools {pattern: 'src/**/*.ts', included: false, watched: false}, @@ -107,10 +96,11 @@ module.exports = function (config) { // Source files that you wanna generate coverage for. // Do not include tests or libraries (these files will be instrumented by Istanbul) preprocessors: { - 'dist/**/!(*spec).js': ['coverage'] + 'dist/**/!(*spec|index|*mock|*model).js': 'coverage' }, coverageReporter: { + includeAllSources: true, dir: 'coverage/', subdir: 'report', reporters: [ diff --git a/ng2-components/ng2-alfresco-login/package.json b/ng2-components/ng2-alfresco-login/package.json index 79ef9f8954..5ffdc9cf1a 100644 --- a/ng2-components/ng2-alfresco-login/package.json +++ b/ng2-components/ng2-alfresco-login/package.json @@ -65,6 +65,7 @@ "@angular/platform-browser-dynamic": "2.0.0", "@angular/router": "3.0.0", "@angular/upgrade": "2.0.0", + "@types/node": "^6.0.42", "core-js": "^2.4.1", "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-beta.12", diff --git a/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.ts b/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.ts index c5c49b62ec..7606dd05f0 100644 --- a/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.ts +++ b/ng2-components/ng2-alfresco-login/src/components/alfresco-login.component.ts @@ -25,17 +25,16 @@ import { import { FormSubmitEvent } from '../models/form-submit-event.model'; declare let componentHandler: any; -declare let __moduleName: string; @Component({ selector: 'alfresco-login', - moduleId: __moduleName, + moduleId: module.id, templateUrl: './alfresco-login.component.html', styleUrls: ['./alfresco-login.component.css'] }) export class AlfrescoLoginComponent implements OnInit { - baseComponentPath = __moduleName.replace('/alfresco-login.component.js', ''); + baseComponentPath = module.id.replace('/alfresco-login.component.js', ''); isPasswordShow: boolean = false; diff --git a/ng2-components/ng2-alfresco-login/tsconfig.json b/ng2-components/ng2-alfresco-login/tsconfig.json index b1effea355..7be35bfec8 100644 --- a/ng2-components/ng2-alfresco-login/tsconfig.json +++ b/ng2-components/ng2-alfresco-login/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "es5", - "module": "system", + "module": "commonjs", "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, @@ -16,7 +16,7 @@ "noImplicitUseStrict": false, "noFallthroughCasesInSwitch": true, "outDir": "dist", - "types": ["core-js", "jasmine"] + "types": ["core-js", "jasmine", "node"] }, "exclude": [ "demo", diff --git a/ng2-components/ng2-alfresco-search/karma.conf.js b/ng2-components/ng2-alfresco-search/karma.conf.js index 7d786304a2..c9d211a3ae 100644 --- a/ng2-components/ng2-alfresco-search/karma.conf.js +++ b/ng2-components/ng2-alfresco-search/karma.conf.js @@ -96,10 +96,11 @@ module.exports = function (config) { // Source files that you wanna generate coverage for. // Do not include tests or libraries (these files will be instrumented by Istanbul) preprocessors: { - // 'dist/**/!(*spec).js': ['coverage'] + 'dist/**/!(*spec|index|*mock|*model).js': 'coverage' }, coverageReporter: { + includeAllSources: true, dir: 'coverage/', subdir: 'report', reporters: [ diff --git a/ng2-components/ng2-alfresco-search/package.json b/ng2-components/ng2-alfresco-search/package.json index cb24eaa3fb..af08568b8b 100644 --- a/ng2-components/ng2-alfresco-search/package.json +++ b/ng2-components/ng2-alfresco-search/package.json @@ -61,6 +61,7 @@ "@angular/platform-browser-dynamic": "2.0.0", "@angular/router": "3.0.0", "@angular/upgrade": "2.0.0", + "@types/node": "^6.0.42", "core-js": "^2.4.1", "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-beta.12", diff --git a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.ts b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.ts index 69e0859c16..313bbb9e70 100644 --- a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.ts +++ b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-autocomplete.component.ts @@ -20,17 +20,16 @@ import { AlfrescoSearchService } from './../services/alfresco-search.service'; import { AlfrescoThumbnailService } from './../services/alfresco-thumbnail.service'; import { AlfrescoTranslationService } from 'ng2-alfresco-core'; -declare let __moduleName: string; @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'alfresco-search-autocomplete', templateUrl: './alfresco-search-autocomplete.component.html', styleUrls: ['./alfresco-search-autocomplete.component.css'] }) export class AlfrescoSearchAutocompleteComponent implements OnInit, OnChanges { - baseComponentPath = __moduleName.replace('/components/alfresco-search-autocomplete.component.js', ''); + baseComponentPath = module.id.replace('/components/alfresco-search-autocomplete.component.js', ''); @Input() searchTerm: string = ''; diff --git a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.ts b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.ts index b572b7f444..125425276a 100644 --- a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.ts +++ b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.ts @@ -20,10 +20,9 @@ import { Component, Input, Output, OnInit, ElementRef, EventEmitter, ViewChild } import { AlfrescoTranslationService } from 'ng2-alfresco-core'; import { SearchTermValidator } from './../forms/search-term-validator'; -declare let __moduleName: string; @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'alfresco-search-control', templateUrl: './alfresco-search-control.component.html', styleUrls: ['./alfresco-search-control.component.css'] diff --git a/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.ts b/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.ts index b1aab94761..e38bb3e761 100644 --- a/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.ts +++ b/ng2-components/ng2-alfresco-search/src/components/alfresco-search.component.ts @@ -21,17 +21,15 @@ import { AlfrescoSearchService } from './../services/alfresco-search.service'; import { AlfrescoThumbnailService } from './../services/alfresco-thumbnail.service'; import { AlfrescoTranslationService } from 'ng2-alfresco-core'; -declare let __moduleName: string; - @Component({ - moduleId: __moduleName, + moduleId: module.id, selector: 'alfresco-search', styleUrls: ['./alfresco-search.component.css'], templateUrl: './alfresco-search.component.html' }) export class AlfrescoSearchComponent implements OnChanges, OnInit { - baseComponentPath = __moduleName.replace('/components/alfresco-search.component.js', ''); + baseComponentPath = module.id.replace('/components/alfresco-search.component.js', ''); @Input() searchTerm: string = ''; diff --git a/ng2-components/ng2-alfresco-search/tsconfig.json b/ng2-components/ng2-alfresco-search/tsconfig.json index 783f1a1584..7be35bfec8 100644 --- a/ng2-components/ng2-alfresco-search/tsconfig.json +++ b/ng2-components/ng2-alfresco-search/tsconfig.json @@ -1,15 +1,22 @@ { "compilerOptions": { "target": "es5", - "module": "system", + "module": "commonjs", "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, "sourceMap": true, "removeComments": true, "declaration": true, + "noLib": false, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noImplicitAny": false, + "noImplicitReturns": false, + "noImplicitUseStrict": false, + "noFallthroughCasesInSwitch": true, "outDir": "dist", - "types": ["core-js", "jasmine"] + "types": ["core-js", "jasmine", "node"] }, "exclude": [ "demo", diff --git a/ng2-components/ng2-alfresco-tag/karma-test-shim.js b/ng2-components/ng2-alfresco-tag/karma-test-shim.js index 01a3ee9781..a58f01a39b 100644 --- a/ng2-components/ng2-alfresco-tag/karma-test-shim.js +++ b/ng2-components/ng2-alfresco-tag/karma-test-shim.js @@ -63,8 +63,7 @@ var packages = { 'ng2-translate': { defaultExtension: 'js' }, 'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'}, - 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-tag': { main: './index.js', defaultExtension: 'js'} + 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'} }; var config = { diff --git a/ng2-components/ng2-alfresco-tag/karma.conf.js b/ng2-components/ng2-alfresco-tag/karma.conf.js index c5f2754cb1..a3823c4ea2 100644 --- a/ng2-components/ng2-alfresco-tag/karma.conf.js +++ b/ng2-components/ng2-alfresco-tag/karma.conf.js @@ -39,7 +39,9 @@ module.exports = function (config) { 'karma-test-shim.js', // paths loaded via module imports - {pattern: 'dist/**/*.*', included: false, watched: true}, + {pattern: 'dist/**/*.js', included: false, watched: true}, + {pattern: 'dist/**/*.html', included: true, served: true, watched: true}, + {pattern: 'dist/**/*.css', included: true, served: true, watched: true}, // ng2-components { pattern: 'node_modules/ng2-alfresco-core/dist/**/*.*', included: false, served: true, watched: false }, @@ -94,10 +96,11 @@ module.exports = function (config) { // Source files that you wanna generate coverage for. // Do not include tests or libraries (these files will be instrumented by Istanbul) preprocessors: { - 'dist/**/!(*spec).js': ['coverage'] + 'dist/**/!(*spec|index|*mock|*model).js': 'coverage' }, coverageReporter: { + includeAllSources: true, dir: 'coverage/', subdir: 'report', reporters: [ diff --git a/ng2-components/ng2-alfresco-tag/tsconfig.json b/ng2-components/ng2-alfresco-tag/tsconfig.json index c586e1848e..7be35bfec8 100644 --- a/ng2-components/ng2-alfresco-tag/tsconfig.json +++ b/ng2-components/ng2-alfresco-tag/tsconfig.json @@ -1,26 +1,26 @@ { - "compilerOptions": { - "target": "es5", - "module": "commonjs", - "moduleResolution": "node", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "sourceMap": true, - "removeComments": true, - "declaration": true, - "noLib": false, - "allowUnreachableCode": false, - "allowUnusedLabels": false, - "noImplicitAny": false, - "noImplicitReturns": false, - "noImplicitUseStrict": false, - "noFallthroughCasesInSwitch": true, - "outDir": "dist", - "types": ["core-js", "jasmine", "node"] - }, - "exclude": [ - "demo", - "node_modules", - "dist" - ] + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "sourceMap": true, + "removeComments": true, + "declaration": true, + "noLib": false, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noImplicitAny": false, + "noImplicitReturns": false, + "noImplicitUseStrict": false, + "noFallthroughCasesInSwitch": true, + "outDir": "dist", + "types": ["core-js", "jasmine", "node"] + }, + "exclude": [ + "demo", + "node_modules", + "dist" + ] } diff --git a/ng2-components/ng2-alfresco-upload/karma-test-shim.js b/ng2-components/ng2-alfresco-upload/karma-test-shim.js index 9662cebf0a..a58f01a39b 100644 --- a/ng2-components/ng2-alfresco-upload/karma-test-shim.js +++ b/ng2-components/ng2-alfresco-upload/karma-test-shim.js @@ -54,18 +54,7 @@ var map = { 'ng2-translate': 'npm:ng2-translate', 'alfresco-js-api': 'npm:alfresco-js-api/dist', - 'ng2-activiti-form': 'npm:ng2-activiti-form/dist', - 'ng2-activiti-processlist': 'npm:ng2-activiti-processlist/dist', - 'ng2-activiti-tasklist': 'npm:ng2-activiti-tasklist/dist', - 'ng2-alfresco-core': 'npm:ng2-alfresco-core/dist', - 'ng2-alfresco-datatable': 'npm:ng2-alfresco-datatable/dist', - 'ng2-alfresco-documentlist': 'npm:ng2-alfresco-documentlist/dist', - 'ng2-alfresco-login': 'npm:ng2-alfresco-login/dist', - 'ng2-alfresco-search': 'npm:ng2-alfresco-search/dist', - 'ng2-alfresco-tag': 'npm:ng2-alfresco-tag/dist', - 'ng2-alfresco-upload': 'npm:ng2-alfresco-upload/dist', - 'ng2-alfresco-viewer': 'npm:ng2-alfresco-viewer/dist', - 'ng2-alfresco-webscript': 'npm:ng2-alfresco-webscript/dist' + 'ng2-alfresco-core': 'npm:ng2-alfresco-core/dist' }; var packages = { @@ -74,18 +63,7 @@ var packages = { 'ng2-translate': { defaultExtension: 'js' }, 'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'}, - 'ng2-activiti-form': { main: './index.js', defaultExtension: 'js'}, - 'ng2-activiti-processlist': { main: './index.js', defaultExtension: 'js'}, - 'ng2-activiti-tasklist': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-datatable': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-documentlist': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-login': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-search': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-tag': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-upload': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-viewer': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-webscript': { main: './index.js', defaultExtension: 'js'} + 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'} }; var config = { diff --git a/ng2-components/ng2-alfresco-upload/karma.conf.js b/ng2-components/ng2-alfresco-upload/karma.conf.js index 2aa3ff5612..8f3adc54b4 100644 --- a/ng2-components/ng2-alfresco-upload/karma.conf.js +++ b/ng2-components/ng2-alfresco-upload/karma.conf.js @@ -44,18 +44,7 @@ module.exports = function (config) { {pattern: 'dist/**/*.css', included: true, served: true, watched: true}, // ng2-components - { pattern: 'node_modules/ng2-activiti-form/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-activiti-processlist/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-activiti-tasklist/dist/**/*.js', included: false, served: true, watched: false }, { pattern: 'node_modules/ng2-alfresco-core/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-datatable/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-documentlist/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-login/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-search/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-tag/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-upload/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-viewer/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-webscript/dist/**/*.js', included: false, served: true, watched: false }, // paths to support debugging with source maps in dev tools {pattern: 'src/**/*.ts', included: false, watched: false}, @@ -107,10 +96,11 @@ module.exports = function (config) { // Source files that you wanna generate coverage for. // Do not include tests or libraries (these files will be instrumented by Istanbul) preprocessors: { - // 'dist/**/!(*spec).js': ['coverage'] + 'dist/**/!(*spec|index|*mock|*model).js': 'coverage' }, coverageReporter: { + includeAllSources: true, dir: 'coverage/', subdir: 'report', reporters: [ diff --git a/ng2-components/ng2-alfresco-upload/package.json b/ng2-components/ng2-alfresco-upload/package.json index cd32832b64..093fd0e4fd 100644 --- a/ng2-components/ng2-alfresco-upload/package.json +++ b/ng2-components/ng2-alfresco-upload/package.json @@ -62,6 +62,7 @@ "@angular/platform-browser-dynamic": "2.0.0", "@angular/router": "3.0.0", "@angular/upgrade": "2.0.0", + "@types/node": "^6.0.42", "core-js": "^2.4.1", "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-beta.12", diff --git a/ng2-components/ng2-alfresco-upload/src/components/file-uploading-dialog.component.ts b/ng2-components/ng2-alfresco-upload/src/components/file-uploading-dialog.component.ts index 23b839abc9..71e3a814a0 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/file-uploading-dialog.component.ts +++ b/ng2-components/ng2-alfresco-upload/src/components/file-uploading-dialog.component.ts @@ -20,8 +20,6 @@ import { FileModel } from '../models/file.model'; import { AlfrescoTranslationService } from 'ng2-alfresco-core'; import { UploadService } from '../services/upload.service'; -declare let __moduleName: string; - /** * * @@ -35,7 +33,7 @@ declare let __moduleName: string; */ @Component({ selector: 'file-uploading-dialog', - moduleId: __moduleName, + moduleId: module.id, templateUrl: './file-uploading-dialog.component.html', styleUrls: ['./file-uploading-dialog.component.css'], host: {'[class.dialog-show]': 'toggleShowDialog'} diff --git a/ng2-components/ng2-alfresco-upload/src/components/file-uploading-list.component.ts b/ng2-components/ng2-alfresco-upload/src/components/file-uploading-list.component.ts index 1893c68601..ba164c54cb 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/file-uploading-list.component.ts +++ b/ng2-components/ng2-alfresco-upload/src/components/file-uploading-list.component.ts @@ -19,8 +19,6 @@ import { Component, ElementRef, Input } from '@angular/core'; import { FileModel } from '../models/file.model'; -declare let __moduleName: string; - /** * * @@ -33,7 +31,7 @@ declare let __moduleName: string; */ @Component({ selector: 'alfresco-file-uploading-list', - moduleId: __moduleName, + moduleId: module.id, templateUrl: './file-uploading-list.component.html', styleUrls: ['./file-uploading-list.component.css'] }) diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts index 91431e91f3..d994298144 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-button.component.ts @@ -23,7 +23,6 @@ import { AlfrescoTranslationService } from 'ng2-alfresco-core'; import 'rxjs/Rx'; declare let componentHandler: any; -declare let __moduleName: string; const ERROR_FOLDER_ALREADY_EXIST = 409; @@ -49,7 +48,7 @@ const ERROR_FOLDER_ALREADY_EXIST = 409; */ @Component({ selector: 'alfresco-upload-button', - moduleId: __moduleName, + moduleId: module.id, templateUrl: './upload-button.component.html', styleUrls: ['./upload-button.component.css'] }) diff --git a/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.ts b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.ts index a68f22c5d3..e947a86451 100644 --- a/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.ts +++ b/ng2-components/ng2-alfresco-upload/src/components/upload-drag-area.component.ts @@ -20,7 +20,6 @@ import { UploadService } from '../services/upload.service'; import { AlfrescoTranslationService } from 'ng2-alfresco-core'; import { FileModel } from '../models/file.model'; -declare let __moduleName: string; declare let componentHandler: any; const ERROR_FOLDER_ALREADY_EXIST = 409; @@ -36,7 +35,7 @@ const ERROR_FOLDER_ALREADY_EXIST = 409; */ @Component({ selector: 'alfresco-upload-drag-area', - moduleId: __moduleName, + moduleId: module.id, templateUrl: './upload-drag-area.component.html', styleUrls: ['./upload-drag-area.component.css'] }) diff --git a/ng2-components/ng2-alfresco-upload/tsconfig.json b/ng2-components/ng2-alfresco-upload/tsconfig.json index b1effea355..7be35bfec8 100644 --- a/ng2-components/ng2-alfresco-upload/tsconfig.json +++ b/ng2-components/ng2-alfresco-upload/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "es5", - "module": "system", + "module": "commonjs", "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, @@ -16,7 +16,7 @@ "noImplicitUseStrict": false, "noFallthroughCasesInSwitch": true, "outDir": "dist", - "types": ["core-js", "jasmine"] + "types": ["core-js", "jasmine", "node"] }, "exclude": [ "demo", diff --git a/ng2-components/ng2-alfresco-userinfo/karma-test-shim.js b/ng2-components/ng2-alfresco-userinfo/karma-test-shim.js index d7f5a90d43..a58f01a39b 100644 --- a/ng2-components/ng2-alfresco-userinfo/karma-test-shim.js +++ b/ng2-components/ng2-alfresco-userinfo/karma-test-shim.js @@ -54,19 +54,7 @@ var map = { 'ng2-translate': 'npm:ng2-translate', 'alfresco-js-api': 'npm:alfresco-js-api/dist', - 'ng2-activiti-form': 'npm:ng2-activiti-form/dist', - 'ng2-activiti-processlist': 'npm:ng2-activiti-processlist/dist', - 'ng2-activiti-tasklist': 'npm:ng2-activiti-tasklist/dist', - 'ng2-alfresco-core': 'npm:ng2-alfresco-core/dist', - 'ng2-alfresco-datatable': 'npm:ng2-alfresco-datatable/dist', - 'ng2-alfresco-documentlist': 'npm:ng2-alfresco-documentlist/dist', - 'ng2-alfresco-login': 'npm:ng2-alfresco-login/dist', - 'ng2-alfresco-search': 'npm:ng2-alfresco-search/dist', - 'ng2-alfresco-tag': 'npm:ng2-alfresco-tag/dist', - 'ng2-alfresco-upload': 'npm:ng2-alfresco-upload/dist', - 'ng2-alfresco-viewer': 'npm:ng2-alfresco-viewer/dist', - 'ng2-alfresco-webscript': 'npm:ng2-alfresco-webscript/dist', - 'ng2-alfresco-userinfo': 'npm:ng2-alfresco-userinfo/dist' + 'ng2-alfresco-core': 'npm:ng2-alfresco-core/dist' }; var packages = { @@ -75,19 +63,7 @@ var packages = { 'ng2-translate': { defaultExtension: 'js' }, 'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'}, - 'ng2-activiti-form': { main: './index.js', defaultExtension: 'js'}, - 'ng2-activiti-processlist': { main: './index.js', defaultExtension: 'js'}, - 'ng2-activiti-tasklist': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-datatable': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-documentlist': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-login': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-search': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-tag': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-upload': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-viewer': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-webscript': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-userinfo': { main: './index.js', defaultExtension: 'js'} + 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'} }; var config = { diff --git a/ng2-components/ng2-alfresco-userinfo/karma.conf.js b/ng2-components/ng2-alfresco-userinfo/karma.conf.js index 5495861358..8f3adc54b4 100644 --- a/ng2-components/ng2-alfresco-userinfo/karma.conf.js +++ b/ng2-components/ng2-alfresco-userinfo/karma.conf.js @@ -44,19 +44,7 @@ module.exports = function (config) { {pattern: 'dist/**/*.css', included: true, served: true, watched: true}, // ng2-components - { pattern: 'node_modules/ng2-activiti-form/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-activiti-processlist/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-activiti-tasklist/dist/**/*.js', included: false, served: true, watched: false }, { pattern: 'node_modules/ng2-alfresco-core/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-datatable/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-documentlist/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-login/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-search/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-tag/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-upload/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-viewer/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-webscript/dist/**/*.js', included: false, served: true, watched: false }, - { pattern: 'node_modules/ng2-alfresco-userinfo/dist/**/*.js', included: false, served: true, watched: false }, // paths to support debugging with source maps in dev tools {pattern: 'src/**/*.ts', included: false, watched: false}, @@ -108,10 +96,11 @@ module.exports = function (config) { // Source files that you wanna generate coverage for. // Do not include tests or libraries (these files will be instrumented by Istanbul) preprocessors: { - // 'dist/**/!(*spec).js': ['coverage'] + 'dist/**/!(*spec|index|*mock|*model).js': 'coverage' }, coverageReporter: { + includeAllSources: true, dir: 'coverage/', subdir: 'report', reporters: [ diff --git a/ng2-components/ng2-alfresco-userinfo/package.json b/ng2-components/ng2-alfresco-userinfo/package.json index 178fcc0e01..6afe347b8b 100644 --- a/ng2-components/ng2-alfresco-userinfo/package.json +++ b/ng2-components/ng2-alfresco-userinfo/package.json @@ -40,6 +40,7 @@ "@angular/platform-browser-dynamic": "2.0.0", "@angular/router": "3.0.0", "@angular/upgrade": "2.0.0", + "@types/node": "^6.0.42", "core-js": "^2.4.1", "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-beta.12", diff --git a/ng2-components/ng2-alfresco-userinfo/src/components/user-info.component.ts b/ng2-components/ng2-alfresco-userinfo/src/components/user-info.component.ts index 339ddfcc06..4f8ce3aa3c 100644 --- a/ng2-components/ng2-alfresco-userinfo/src/components/user-info.component.ts +++ b/ng2-components/ng2-alfresco-userinfo/src/components/user-info.component.ts @@ -22,18 +22,16 @@ import { EcmUserService } from './../services/ecm-user.service'; import { BpmUserService } from './../services/bpm-user.service'; import { AlfrescoAuthenticationService } from 'ng2-alfresco-core'; -declare let __moduleName: string; - @Component({ selector: 'ng2-alfresco-userinfo', - moduleId: __moduleName, + moduleId: module.id, styleUrls: ['./user-info.component.css'], templateUrl: './user-info.component.html' }) export class UserInfoComponent implements OnInit { - private baseComponentPath = __moduleName.replace('components/user-info.component.js', ''); + private baseComponentPath = module.id.replace('components/user-info.component.js', ''); ecmUser: EcmUserModel; bpmUser: BpmUserModel; diff --git a/ng2-components/ng2-alfresco-userinfo/tsconfig.json b/ng2-components/ng2-alfresco-userinfo/tsconfig.json index ae39a67a17..7be35bfec8 100644 --- a/ng2-components/ng2-alfresco-userinfo/tsconfig.json +++ b/ng2-components/ng2-alfresco-userinfo/tsconfig.json @@ -1,26 +1,26 @@ { - "compilerOptions": { - "target": "es5", - "module": "system", - "moduleResolution": "node", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "sourceMap": true, - "removeComments": true, - "declaration": true, - "noLib": false, - "allowUnreachableCode": false, - "allowUnusedLabels": false, - "noImplicitAny": false, - "noImplicitReturns": false, - "noImplicitUseStrict": false, - "noFallthroughCasesInSwitch": true, - "outDir": "dist", - "types": ["core-js", "jasmine"] - }, - "exclude": [ - "demo", - "node_modules", - "dist" - ] + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "sourceMap": true, + "removeComments": true, + "declaration": true, + "noLib": false, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noImplicitAny": false, + "noImplicitReturns": false, + "noImplicitUseStrict": false, + "noFallthroughCasesInSwitch": true, + "outDir": "dist", + "types": ["core-js", "jasmine", "node"] + }, + "exclude": [ + "demo", + "node_modules", + "dist" + ] } diff --git a/ng2-components/ng2-alfresco-viewer/karma.conf.js b/ng2-components/ng2-alfresco-viewer/karma.conf.js index 3836c9e17e..d616e7f7d3 100644 --- a/ng2-components/ng2-alfresco-viewer/karma.conf.js +++ b/ng2-components/ng2-alfresco-viewer/karma.conf.js @@ -39,7 +39,9 @@ module.exports = function (config) { 'karma-test-shim.js', // paths loaded via module imports - {pattern: 'dist/**/*.*', included: false, watched: true}, + {pattern: 'dist/**/*.js', included: false, watched: true}, + {pattern: 'dist/**/*.html', included: true, served: true, watched: true}, + {pattern: 'dist/**/*.css', included: true, served: true, watched: true}, // ng2-components { pattern: 'node_modules/ng2-alfresco-core/dist/**/*.*', included: false, served: true, watched: false }, @@ -100,10 +102,11 @@ module.exports = function (config) { // Source files that you wanna generate coverage for. // Do not include tests or libraries (these files will be instrumented by Istanbul) preprocessors: { - 'dist/**/!(*spec).js': ['coverage'] + 'dist/**/!(*spec|index|*mock|*model).js': 'coverage' }, coverageReporter: { + includeAllSources: true, dir: 'coverage/', subdir: 'report', reporters: [ diff --git a/ng2-components/ng2-alfresco-viewer/src/assets/PDFJS.mock.ts b/ng2-components/ng2-alfresco-viewer/src/assets/PDFJS.mock.ts deleted file mode 100644 index e7d54dacdf..0000000000 --- a/ng2-components/ng2-alfresco-viewer/src/assets/PDFJS.mock.ts +++ /dev/null @@ -1,29 +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 class PDFJSmock { - - getDocument(url: string) { - return new Promise((resolve) => { - resolve({numPages: '10'}); - }); - } - - getPage(numberPage: number) { - } -} diff --git a/ng2-components/ng2-alfresco-webscript/karma-test-shim.js b/ng2-components/ng2-alfresco-webscript/karma-test-shim.js index 4ce01e2d4c..63f6cf057f 100644 --- a/ng2-components/ng2-alfresco-webscript/karma-test-shim.js +++ b/ng2-components/ng2-alfresco-webscript/karma-test-shim.js @@ -55,8 +55,7 @@ var map = { 'alfresco-js-api': 'npm:alfresco-js-api/dist', 'ng2-alfresco-core': 'npm:ng2-alfresco-core/dist', - 'ng2-alfresco-datatable': 'npm:ng2-alfresco-datatable/dist', - 'ng2-alfresco-webscript': 'npm:ng2-alfresco-webscript/dist' + 'ng2-alfresco-datatable': 'npm:ng2-alfresco-datatable/dist' }; var packages = { @@ -66,8 +65,7 @@ var packages = { 'alfresco-js-api': { main: './alfresco-js-api.js', defaultExtension: 'js'}, 'ng2-alfresco-core': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-datatable': { main: './index.js', defaultExtension: 'js'}, - 'ng2-alfresco-webscript': { main: './index.js', defaultExtension: 'js'} + 'ng2-alfresco-datatable': { main: './index.js', defaultExtension: 'js'} }; var config = { diff --git a/ng2-components/ng2-alfresco-webscript/karma.conf.js b/ng2-components/ng2-alfresco-webscript/karma.conf.js index ff67ee3af2..e3d47c79cb 100644 --- a/ng2-components/ng2-alfresco-webscript/karma.conf.js +++ b/ng2-components/ng2-alfresco-webscript/karma.conf.js @@ -39,7 +39,9 @@ module.exports = function (config) { 'karma-test-shim.js', // paths loaded via module imports - {pattern: 'dist/**/*.*', included: false, watched: true}, + {pattern: 'dist/**/*.js', included: false, watched: true}, + {pattern: 'dist/**/*.html', included: true, served: true, watched: true}, + {pattern: 'dist/**/*.css', included: true, served: true, watched: true}, // ng2-components { pattern: 'node_modules/ng2-alfresco-core/dist/**/*.*', included: false, served: true, watched: false }, @@ -95,10 +97,11 @@ module.exports = function (config) { // Source files that you wanna generate coverage for. // Do not include tests or libraries (these files will be instrumented by Istanbul) preprocessors: { - 'dist/**/!(*spec).js': ['coverage'] + 'dist/**/!(*spec|index|*mock|*model).js': 'coverage' }, coverageReporter: { + includeAllSources: true, dir: 'coverage/', subdir: 'report', reporters: [ diff --git a/ng2-components/ng2-alfresco-webscript/package.json b/ng2-components/ng2-alfresco-webscript/package.json index e6b623638d..60db62d0f7 100644 --- a/ng2-components/ng2-alfresco-webscript/package.json +++ b/ng2-components/ng2-alfresco-webscript/package.json @@ -40,6 +40,7 @@ "@angular/platform-browser-dynamic": "2.0.0", "@angular/router": "3.0.0", "@angular/upgrade": "2.0.0", + "@types/node": "^6.0.42", "core-js": "^2.4.1", "reflect-metadata": "^0.1.3", "rxjs": "5.0.0-beta.12", diff --git a/ng2-components/ng2-alfresco-webscript/tsconfig.json b/ng2-components/ng2-alfresco-webscript/tsconfig.json index ce6e770c51..7be35bfec8 100644 --- a/ng2-components/ng2-alfresco-webscript/tsconfig.json +++ b/ng2-components/ng2-alfresco-webscript/tsconfig.json @@ -1,26 +1,26 @@ { - "compilerOptions": { - "target": "es5", - "module": "commonjs", - "moduleResolution": "node", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "sourceMap": true, - "removeComments": true, - "declaration": true, - "noLib": false, - "allowUnreachableCode": false, - "allowUnusedLabels": false, - "noImplicitAny": false, - "noImplicitReturns": false, - "noImplicitUseStrict": false, - "noFallthroughCasesInSwitch": true, - "outDir": "dist", - "types": ["core-js", "jasmine"] - }, - "exclude": [ - "demo", - "node_modules", - "dist" - ] + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "sourceMap": true, + "removeComments": true, + "declaration": true, + "noLib": false, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noImplicitAny": false, + "noImplicitReturns": false, + "noImplicitUseStrict": false, + "noFallthroughCasesInSwitch": true, + "outDir": "dist", + "types": ["core-js", "jasmine", "node"] + }, + "exclude": [ + "demo", + "node_modules", + "dist" + ] }