diff --git a/ng2-components/ng2-alfresco-core/karma.conf.js b/ng2-components/ng2-alfresco-core/karma.conf.js new file mode 100644 index 0000000000..4fc94d241f --- /dev/null +++ b/ng2-components/ng2-alfresco-core/karma.conf.js @@ -0,0 +1,128 @@ +// Karma configuration +// Generated on Wed Jul 15 2015 09:44:02 GMT+0200 (Romance Daylight Time) +'use strict'; + +var argv = require('yargs').argv; + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: './', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['jasmine'], + + + // list of files / patterns to load in the browser + files: [ + 'node_modules/zone.js/dist/zone.js', + 'node_modules/zone.js/dist/long-stack-trace-zone.js', + 'node_modules/zone.js/dist/jasmine-patch.js', + 'node_modules/zone.js/dist/async-test.js', + 'node_modules/zone.js/dist/fake-async-test.js', + 'node_modules/es6-module-loader/dist/es6-module-loader.js', + 'node_modules/traceur/bin/traceur-runtime.js', // Required by PhantomJS2, otherwise it shouts ReferenceError: Can't find variable: require + 'node_modules/traceur/bin/traceur.js', + 'node_modules/systemjs/dist/system.src.js', + 'node_modules/reflect-metadata/Reflect.js', + 'node_modules/angular2/es6/dev/src/testing/shims_for_IE.js', + { pattern: 'node_modules/ng2-translate/**/*.js', included: false, watched: false }, // source files + { pattern: 'node_modules/angular2/**/*.js', included: false, watched: false }, + { pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false }, + { pattern: 'dist/**/*.js', included: false, watched: true }, + { pattern: 'node_modules/systemjs/dist/system-polyfills.js', included: false, watched: false }, // PhantomJS2 (and possibly others) might require it + + // suppress annoying 404 warnings for resources, images, etc. + //{ pattern: 'dist/src/assets/**/*', watched: false, included: false, served: true }, + + 'test-main.js' + ], + + // must go along with above, suppress annoying 404 warnings. + proxies: { + '/assets/': '/base/dist/dev/assets/' + }, + + // list of files to exclude + exclude: [ + 'node_modules/angular2/**/*spec.js' + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + 'dist/**/!(*spec).js': ['coverage'] + }, + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['mocha', 'coverage'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: [ + 'PhantomJS', + 'Chrome' + ], + + + customLaunchers: { + Chrome_travis_ci: { + base: 'Chrome', + flags: ['--no-sandbox'] + } + }, + + coverageReporter: { + dir: 'coverage/', + reporters: [ + { type: 'text-summary' }, + { type: 'json', subdir: '.', file: 'coverage-final.json' }, + { type: 'html' } + ] + }, + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Passing command line arguments to tests + client: { + files: argv.files + } + }); + + if (process.env.APPVEYOR) { + config.browsers = ['IE']; + config.singleRun = true; + config.browserNoActivityTimeout = 90000; // Note: default value (10000) is not enough + } + + if (process.env.TRAVIS || process.env.CIRCLECI) { + config.browsers = ['Chrome_travis_ci']; + config.singleRun = true; + } +}; diff --git a/ng2-components/ng2-alfresco-core/material.d.ts b/ng2-components/ng2-alfresco-core/material.d.ts deleted file mode 100644 index 9cdceddc7f..0000000000 --- a/ng2-components/ng2-alfresco-core/material.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2016 Alfresco Software, Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export * from './material/MaterialDesignLiteUpgradeElement'; diff --git a/ng2-components/ng2-alfresco-core/material.js b/ng2-components/ng2-alfresco-core/material.js deleted file mode 100644 index 3eb3c496bb..0000000000 --- a/ng2-components/ng2-alfresco-core/material.js +++ /dev/null @@ -1,20 +0,0 @@ -System.register(['./material/MaterialDesignLiteUpgradeElement'], function(exports_1, context_1) { - "use strict"; - var __moduleName = context_1 && context_1.id; - function exportStar_1(m) { - var exports = {}; - for(var n in m) { - if (n !== "default") exports[n] = m[n]; - } - exports_1(exports); - } - return { - setters:[ - function (MaterialDesignLiteUpgradeElement_1_1) { - exportStar_1(MaterialDesignLiteUpgradeElement_1_1); - }], - execute: function() { - } - } -}); -//# sourceMappingURL=material.js.map \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-core/material.js.map b/ng2-components/ng2-alfresco-core/material.js.map deleted file mode 100644 index 24c78b2f94..0000000000 --- a/ng2-components/ng2-alfresco-core/material.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"material.js","sourceRoot":"","sources":["material.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-core/material.ts b/ng2-components/ng2-alfresco-core/material.ts index 9cdceddc7f..b168a54bc0 100644 --- a/ng2-components/ng2-alfresco-core/material.ts +++ b/ng2-components/ng2-alfresco-core/material.ts @@ -1,4 +1,4 @@ -/** +/*! * @license * Copyright 2016 Alfresco Software, Ltd. * @@ -14,4 +14,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export * from './material/MaterialDesignLiteUpgradeElement'; diff --git a/ng2-components/ng2-alfresco-core/material/MaterialDesignLiteUpgradeElement.d.ts b/ng2-components/ng2-alfresco-core/material/MaterialDesignLiteUpgradeElement.d.ts deleted file mode 100644 index cc51e8c345..0000000000 --- a/ng2-components/ng2-alfresco-core/material/MaterialDesignLiteUpgradeElement.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright (C) 2016 Alfresco Software Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { AfterViewInit } from 'angular2/core'; -export declare class MDL implements AfterViewInit { - ngAfterViewInit(): void; -} diff --git a/ng2-components/ng2-alfresco-core/material/MaterialDesignLiteUpgradeElement.js b/ng2-components/ng2-alfresco-core/material/MaterialDesignLiteUpgradeElement.js deleted file mode 100644 index 9e20c2fd36..0000000000 --- a/ng2-components/ng2-alfresco-core/material/MaterialDesignLiteUpgradeElement.js +++ /dev/null @@ -1,39 +0,0 @@ -System.register(['angular2/core'], function(exports_1, context_1) { - "use strict"; - var __moduleName = context_1 && context_1.id; - var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function (k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); - }; - var core_1; - var MDL; - return { - setters:[ - function (core_1_1) { - core_1 = core_1_1; - }], - execute: function() { - MDL = (function () { - function MDL() { - } - MDL.prototype.ngAfterViewInit = function () { - componentHandler.upgradeAllRegistered(); - }; - MDL = __decorate([ - core_1.Directive({ - selector: '[mdl]' - }), - __metadata('design:paramtypes', []) - ], MDL); - return MDL; - }()); - exports_1("MDL", MDL); - } - } -}); -//# sourceMappingURL=MaterialDesignLiteUpgradeElement.js.map \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-core/material/MaterialDesignLiteUpgradeElement.js.map b/ng2-components/ng2-alfresco-core/material/MaterialDesignLiteUpgradeElement.js.map deleted file mode 100644 index 45076211e4..0000000000 --- a/ng2-components/ng2-alfresco-core/material/MaterialDesignLiteUpgradeElement.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MaterialDesignLiteUpgradeElement.js","sourceRoot":"","sources":["MaterialDesignLiteUpgradeElement.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;YAsBA;gBAAA;gBAIA,CAAC;gBAHG,6BAAe,GAAf;oBACI,gBAAgB,CAAC,oBAAoB,EAAE,CAAC;gBAC5C,CAAC;gBANL;oBAAC,gBAAS,CAAC;wBACP,QAAQ,EAAE,OAAO;qBACpB,CAAC;;uBAAA;gBAKF,UAAC;YAAD,CAAC,AAJD,IAIC;YAJD,qBAIC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-core/material/MaterialDesignLiteUpgradeElement.ts b/ng2-components/ng2-alfresco-core/material/MaterialDesignLiteUpgradeElement.ts index 8a50a5b852..96d18655e5 100644 --- a/ng2-components/ng2-alfresco-core/material/MaterialDesignLiteUpgradeElement.ts +++ b/ng2-components/ng2-alfresco-core/material/MaterialDesignLiteUpgradeElement.ts @@ -1,6 +1,6 @@ -/** +/*! * @license - * Copyright (C) 2016 Alfresco Software Limited. + * 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. @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import {Directive, AfterViewInit} from 'angular2/core'; declare var componentHandler; diff --git a/ng2-components/ng2-alfresco-core/package.json b/ng2-components/ng2-alfresco-core/package.json index 6e63261f79..4d281a6fda 100644 --- a/ng2-components/ng2-alfresco-core/package.json +++ b/ng2-components/ng2-alfresco-core/package.json @@ -4,10 +4,15 @@ "version": "0.1.0", "author": "Alfresco Software, Ltd.", "scripts": { - "build": "typings install && tsc", + "build": "npm run tslint-test && npm run tslint-src && npm run tslint-root && typings install && rm -rf dist && tsc && license-check", + "tslint-test": "tslint -c tslint.json test/**/*.ts", + "tslint-src": "tslint -c tslint.json src/**/*.ts", + "tslint-root": "tslint -c tslint.json *.ts", + "licensecheck": "license-check", "tsc": "tsc", "tsc:w": "tsc -w", - "typings": "typings" + "typings": "typings", + "test": "karma start karma.conf.js" }, "repository": { "type": "git", @@ -21,6 +26,10 @@ { "name": "Denys Vuika", "email": "denis.vuyka@gmail.com" + }, + { + "name": "Mario Romano", + "email": "mario.romano83@gmail.com" } ], "keywords": [ @@ -35,14 +44,44 @@ "es6-shim": "^0.35.0", "reflect-metadata": "0.1.2", "rxjs": "5.0.0-beta.2", - "zone.js": "0.6.10", - "ng2-translate": "^1.11.2" + "zone.js": "^0.6.12", + "ng2-translate": "^1.11.2", + "es6-module-loader": "^0.17.8" }, "peerDependencies": { "angular2": "2.0.0-beta.15" }, "devDependencies": { "typescript": "^1.8.10", - "typings": "^0.7.12" + "typings": "^0.7.12", + "jasmine-spec-reporter": "^2.4.0", + "karma": "~0.13.22", + "karma-chrome-launcher": "~1.0.1", + "karma-coverage": "^1.0.0", + "karma-ie-launcher": "^1.0.0", + "karma-jasmine": "~1.0.2", + "karma-mocha-reporter": "^2.0.3", + "karma-phantomjs-launcher": "^1.0.0", + "traceur": "^0.0.91", + "remap-istanbul": "^0.6.3", + "phantomjs-prebuilt": "^2.1.7", + "coveralls": "^2.11.9", + "jasmine-ajax": "^3.2.0", + "jasmine-core": "2.4.1" + }, + "license-check-config": { + "src": [ + "**/*.js", + "**/*.ts", + "!/**/coverage/**/*", + "!/**/demo/**/*", + "!/**/node_modules/**/*", + "!/**/typings/**/*", + "!*.js" + ], + "path": "assets/license_header.txt", + "blocking": false, + "logInfo": false, + "logError": true } } diff --git a/ng2-components/ng2-alfresco-core/services.d.ts b/ng2-components/ng2-alfresco-core/services.d.ts deleted file mode 100644 index 13d810e400..0000000000 --- a/ng2-components/ng2-alfresco-core/services.d.ts +++ /dev/null @@ -1,26 +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. - */ -import { AlfrescoSettingsService } from './services/AlfrescoSettingsService'; -import { AlfrescoTranslationLoader } from './services/AlfrescoTranslationService'; -export * from './services/AlfrescoSettingsService'; -export * from './services/AlfrescoTranslationService'; -declare var _default: { - directives: undefined[]; - providers: (typeof AlfrescoSettingsService | typeof AlfrescoTranslationLoader)[]; -}; -export default _default; -export declare const ALFRESCO_CORE_PROVIDERS: [any]; diff --git a/ng2-components/ng2-alfresco-core/services.js b/ng2-components/ng2-alfresco-core/services.js deleted file mode 100644 index 6eda976d4a..0000000000 --- a/ng2-components/ng2-alfresco-core/services.js +++ /dev/null @@ -1,57 +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. - */ -System.register(['./services/AlfrescoSettingsService', './services/AlfrescoTranslationService'], function(exports_1, context_1) { - "use strict"; - var __moduleName = context_1 && context_1.id; - var AlfrescoSettingsService_1, AlfrescoTranslationService_1; - var ALFRESCO_CORE_PROVIDERS; - var exportedNames_1 = { - 'ALFRESCO_CORE_PROVIDERS': true - }; - function exportStar_1(m) { - var exports = {}; - for(var n in m) { - if (n !== "default"&& !exportedNames_1.hasOwnProperty(n)) exports[n] = m[n]; - } - exports_1(exports); - } - return { - setters:[ - function (AlfrescoSettingsService_1_1) { - AlfrescoSettingsService_1 = AlfrescoSettingsService_1_1; - exportStar_1(AlfrescoSettingsService_1_1); - }, - function (AlfrescoTranslationService_1_1) { - AlfrescoTranslationService_1 = AlfrescoTranslationService_1_1; - exportStar_1(AlfrescoTranslationService_1_1); - }], - execute: function() { - exports_1("default",{ - directives: [], - providers: [ - AlfrescoSettingsService_1.AlfrescoSettingsService, - AlfrescoTranslationService_1.AlfrescoTranslationLoader - ] - }); - exports_1("ALFRESCO_CORE_PROVIDERS", ALFRESCO_CORE_PROVIDERS = [ - AlfrescoSettingsService_1.AlfrescoSettingsService, - AlfrescoTranslationService_1.AlfrescoTranslationLoader - ]); - } - } -}); -//# sourceMappingURL=services.js.map \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-core/services.js.map b/ng2-components/ng2-alfresco-core/services.js.map deleted file mode 100644 index 3fa0b1c17e..0000000000 --- a/ng2-components/ng2-alfresco-core/services.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"services.js","sourceRoot":"","sources":["services.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;QAgBU,uBAAuB;;;;;;;;;;;;;;;;;;;;;;YARpC,oBAAe;gBACX,UAAU,EAAE,EAAE;gBACd,SAAS,EAAE;oBACP,iDAAuB;oBACvB,sDAAyB;iBAC5B;aACJ,EAAA;YAEY,qCAAA,uBAAuB,GAAU;gBAC1C,iDAAuB;gBACvB,sDAAyB;aAC5B,CAAA,CAAC"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-core/services.ts b/ng2-components/ng2-alfresco-core/services.ts index 681ff83dc8..3c41fd37fa 100644 --- a/ng2-components/ng2-alfresco-core/services.ts +++ b/ng2-components/ng2-alfresco-core/services.ts @@ -1,4 +1,4 @@ -/** +/*! * @license * Copyright 2016 Alfresco Software, Ltd. * diff --git a/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.d.ts b/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.d.ts deleted file mode 100644 index b202842f2e..0000000000 --- a/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare class AlfrescoSettingsService { - private _host; - host: string; - getAuthToken(): string; -} diff --git a/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.js b/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.js deleted file mode 100644 index 3251fea7db..0000000000 --- a/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.js +++ /dev/null @@ -1,65 +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. - */ -System.register(['angular2/core'], function(exports_1, context_1) { - "use strict"; - var __moduleName = context_1 && context_1.id; - var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function (k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); - }; - var core_1; - var AlfrescoSettingsService; - return { - setters:[ - function (core_1_1) { - core_1 = core_1_1; - }], - execute: function() { - AlfrescoSettingsService = (function () { - function AlfrescoSettingsService() { - this._host = 'http://127.0.0.1:8080'; - } - Object.defineProperty(AlfrescoSettingsService.prototype, "host", { - get: function () { - return this._host; - }, - set: function (value) { - this._host = value; - }, - enumerable: true, - configurable: true - }); - AlfrescoSettingsService.prototype.getAuthToken = function () { - // todo: get proper token value - return 'Basic ' + btoa('admin:admin'); - }; - AlfrescoSettingsService = __decorate([ - core_1.Injectable(), - __metadata('design:paramtypes', []) - ], AlfrescoSettingsService); - return AlfrescoSettingsService; - }()); - exports_1("AlfrescoSettingsService", AlfrescoSettingsService); - } - } -}); -//# sourceMappingURL=AlfrescoSettingsService.js.map \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.js.map b/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.js.map deleted file mode 100644 index 17f931e1fd..0000000000 --- a/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"AlfrescoSettingsService.js","sourceRoot":"","sources":["AlfrescoSettingsService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;YAKH;gBAAA;oBACY,UAAK,GAAW,uBAAuB,CAAC;gBAcpD,CAAC;gBAZG,sBAAW,yCAAI;yBAAf;wBACI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;oBACtB,CAAC;yBAED,UAAgB,KAAY;wBACxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;oBACvB,CAAC;;;mBAJA;gBAMD,8CAAY,GAAZ;oBACI,+BAA+B;oBAC/B,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;gBAC1C,CAAC;gBAfL;oBAAC,iBAAU,EAAE;;2CAAA;gBAgBb,8BAAC;YAAD,CAAC,AAfD,IAeC;YAfD,6DAeC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.ts b/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.ts index 0e05b4e237..200cbd5e7a 100644 --- a/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.ts +++ b/ng2-components/ng2-alfresco-core/services/AlfrescoSettingsService.ts @@ -1,4 +1,4 @@ -/** +/*! * @license * Copyright 2016 Alfresco Software, Ltd. * diff --git a/ng2-components/ng2-alfresco-core/services/AlfrescoTranslationService.d.ts b/ng2-components/ng2-alfresco-core/services/AlfrescoTranslationService.d.ts deleted file mode 100644 index 94e3955035..0000000000 --- a/ng2-components/ng2-alfresco-core/services/AlfrescoTranslationService.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Http } from 'angular2/http'; -import { TranslateLoader } from 'ng2-translate/ng2-translate'; -import { Observable } from 'rxjs/Observable'; -export declare class AlfrescoTranslationLoader implements TranslateLoader { - private http; - private prefix; - private suffix; - constructor(http: Http); - getTranslation(lang: string): Observable; -} diff --git a/ng2-components/ng2-alfresco-core/services/AlfrescoTranslationService.js b/ng2-components/ng2-alfresco-core/services/AlfrescoTranslationService.js deleted file mode 100644 index 208026abfd..0000000000 --- a/ng2-components/ng2-alfresco-core/services/AlfrescoTranslationService.js +++ /dev/null @@ -1,71 +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. - */ -System.register(['angular2/core', 'angular2/http', 'rxjs/Observable'], function(exports_1, context_1) { - "use strict"; - var __moduleName = context_1 && context_1.id; - var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; - }; - var __metadata = (this && this.__metadata) || function (k, v) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); - }; - var core_1, http_1, Observable_1; - var AlfrescoTranslationLoader; - return { - setters:[ - function (core_1_1) { - core_1 = core_1_1; - }, - function (http_1_1) { - http_1 = http_1_1; - }, - function (Observable_1_1) { - Observable_1 = Observable_1_1; - }], - execute: function() { - AlfrescoTranslationLoader = (function () { - function AlfrescoTranslationLoader(http) { - this.http = http; - this.prefix = 'i18n'; - this.suffix = '.json'; - } - AlfrescoTranslationLoader.prototype.getTranslation = function (lang) { - var _this = this; - return Observable_1.Observable.create(function (observer) { - Observable_1.Observable.forkJoin(_this.http.get(_this.prefix + "/" + lang + _this.suffix).map(function (res) { return res.json(); }), _this.http.get('node_modules/ng2-alfresco-upload/' + (_this.prefix + "/" + lang + _this.suffix)).map(function (res) { return res.json(); }), _this.http.get('node_modules/ng2-alfresco-login/' + (_this.prefix + "/" + lang + _this.suffix)).map(function (res) { return res.json(); })).subscribe(function (data) { - var multiLanguage = JSON.parse((JSON.stringify(data[0]) - + JSON.stringify(data[1]) - + JSON.stringify(data[2])).replace(/}{/g, ",")); - observer.next(multiLanguage); - observer.complete(); - }); - }); - }; - AlfrescoTranslationLoader = __decorate([ - core_1.Injectable(), - __metadata('design:paramtypes', [http_1.Http]) - ], AlfrescoTranslationLoader); - return AlfrescoTranslationLoader; - }()); - exports_1("AlfrescoTranslationLoader", AlfrescoTranslationLoader); - } - } -}); -//# sourceMappingURL=AlfrescoTranslationService.js.map \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-core/services/AlfrescoTranslationService.js.map b/ng2-components/ng2-alfresco-core/services/AlfrescoTranslationService.js.map deleted file mode 100644 index 8f818058b7..0000000000 --- a/ng2-components/ng2-alfresco-core/services/AlfrescoTranslationService.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"AlfrescoTranslationService.js","sourceRoot":"","sources":["AlfrescoTranslationService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;YAQH;gBAKI,mCAAoB,IAAU;oBAAV,SAAI,GAAJ,IAAI,CAAM;oBAHtB,WAAM,GAAW,MAAM,CAAC;oBACxB,WAAM,GAAW,OAAO,CAAC;gBAGjC,CAAC;gBAED,kDAAc,GAAd,UAAe,IAAY;oBAA3B,iBAeC;oBAdG,MAAM,CAAC,uBAAU,CAAC,MAAM,CAAC,UAAA,QAAQ;wBAC7B,uBAAU,CAAC,QAAQ,CACf,KAAI,CAAC,IAAI,CAAC,GAAG,CAAI,KAAI,CAAC,MAAM,SAAI,IAAI,GAAG,KAAI,CAAC,MAAQ,CAAC,CAAC,GAAG,CAAC,UAAC,GAAa,IAAK,OAAA,GAAG,CAAC,IAAI,EAAE,EAAV,CAAU,CAAC,EACxF,KAAI,CAAC,IAAI,CAAC,GAAG,CAAC,mCAAmC,GAAG,CAAG,KAAI,CAAC,MAAM,SAAI,IAAI,GAAG,KAAI,CAAC,MAAM,CAAE,CAAC,CAAC,GAAG,CAAC,UAAC,GAAa,IAAK,OAAA,GAAG,CAAC,IAAI,EAAE,EAAV,CAAU,CAAC,EAC9H,KAAI,CAAC,IAAI,CAAC,GAAG,CAAC,kCAAkC,GAAG,CAAG,KAAI,CAAC,MAAM,SAAI,IAAI,GAAG,KAAI,CAAC,MAAM,CAAE,CAAC,CAAC,GAAG,CAAC,UAAC,GAAa,IAAK,OAAA,GAAG,CAAC,IAAI,EAAE,EAAV,CAAU,CAAC,CAChI,CAAC,SAAS,CACP,UAAA,IAAI;4BACJ,IAAI,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;kCACjD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;kCACvB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;4BACpD,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;4BAC7B,QAAQ,CAAC,QAAQ,EAAE,CAAC;wBACpB,CAAC,CAAC,CAAC;oBACX,CAAC,CAAC,CAAC;gBACP,CAAC;gBAxBL;oBAAC,iBAAU,EAAE;;6CAAA;gBAyBb,gCAAC;YAAD,CAAC,AAxBD,IAwBC;YAxBD,iEAwBC,CAAA"} \ No newline at end of file diff --git a/ng2-components/ng2-alfresco-core/services/AlfrescoTranslationService.ts b/ng2-components/ng2-alfresco-core/services/AlfrescoTranslationService.ts index 2b07f76310..638448b295 100644 --- a/ng2-components/ng2-alfresco-core/services/AlfrescoTranslationService.ts +++ b/ng2-components/ng2-alfresco-core/services/AlfrescoTranslationService.ts @@ -1,4 +1,4 @@ -/** +/*! * @license * Copyright 2016 Alfresco Software, Ltd. * diff --git a/ng2-components/ng2-alfresco-core/test-main.js b/ng2-components/ng2-alfresco-core/test-main.js new file mode 100644 index 0000000000..65ecaefbc0 --- /dev/null +++ b/ng2-components/ng2-alfresco-core/test-main.js @@ -0,0 +1,78 @@ +if (!Object.hasOwnProperty('name')) { + Object.defineProperty(Function.prototype, 'name', { + get: function() { + var matches = this.toString().match(/^\s*function\s*(\S*)\s*\(/); + var name = matches && matches.length > 1 ? matches[1] : ""; + Object.defineProperty(this, 'name', {value: name}); + return name; + } + }); +} + +// Turn on full stack traces in errors to help debugging +Error.stackTraceLimit = Infinity; + +jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000; + +// Cancel Karma's synchronous start, +// we will call `__karma__.start()` later, once all the specs are loaded. +__karma__.loaded = function() {}; + +System.config({ + baseURL: '/base/', + defaultJSExtensions: true, + paths: { + 'angular2/*': 'node_modules/angular2/*.js', + 'rxjs/*': 'node_modules/rxjs/*.js', + 'ng2-translate/*':'node_modules/ng2-translate/*.js' + } +}); + +Promise.all([ + System.import('angular2/src/platform/browser/browser_adapter'), + System.import('angular2/platform/testing/browser'), + System.import('angular2/testing') +]).then(function (modules) { + var browser_adapter = modules[0]; + var providers = modules[1]; + var testing = modules[2]; + testing.setBaseTestProviders(providers.TEST_BROWSER_PLATFORM_PROVIDERS, + providers.TEST_BROWSER_APPLICATION_PROVIDERS); + + browser_adapter.BrowserDomAdapter.makeCurrent(); +}).then(function() { + return Promise.all( + Object.keys(window.__karma__.files) // All files served by Karma. + .filter(onlySpecFiles) + .map(file2moduleName) + .map(function(path) { + return System.import(path).then(function(module) { + if (module.hasOwnProperty('main')) { + module.main(); + } else { + throw new Error('Module ' + path + ' does not implement main() method.'); + } + }); + })); + }) + .then(function() { + __karma__.start(); + }, function(error) { + // console.error(error.stack || error); + __karma__.start(); + }); + +function onlySpecFiles(path) { + // check for individual files, if not given, always matches to all + var patternMatched = __karma__.config.files ? + path.match(new RegExp(__karma__.config.files)) : true; + + return patternMatched && /[\.|_]spec\.js$/.test(path); +} + +// Normalize paths to module names. +function file2moduleName(filePath) { + return filePath.replace(/\\/g, '/') + .replace(/^\/base\//, '') + .replace(/\.js$/, ''); +} diff --git a/ng2-components/ng2-alfresco-core/tsconfig.json b/ng2-components/ng2-alfresco-core/tsconfig.json index 2f3531e7b9..d35de149a4 100644 --- a/ng2-components/ng2-alfresco-core/tsconfig.json +++ b/ng2-components/ng2-alfresco-core/tsconfig.json @@ -1,18 +1,27 @@ { "compilerOptions": { "target": "es5", - "module": "system", - "moduleResolution": "node", - "sourceMap": true, + "module": "commonjs", + "declaration": false, + "removeComments": true, + "noLib": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, - "removeComments": false, + "sourceMap": true, + "allowUnreachableCode": false, + "allowUnusedLabels": false, "noImplicitAny": false, - "declaration": true + "noImplicitReturns": true, + "noImplicitUseStrict": false, + "noFallthroughCasesInSwitch": true, + "outDir": "dist" }, "exclude": [ "node_modules", - "typings/main", - "typings/main.d.ts" - ] + "dist", + "typings/browser.d.ts", + "typings/browser", + "demo" + ], + "compileOnSave": false }