mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
#62 core test and coverage
This commit is contained in:
parent
e0978c2a13
commit
31bad389b9
128
ng2-components/ng2-alfresco-core/karma.conf.js
Normal file
128
ng2-components/ng2-alfresco-core/karma.conf.js
Normal file
@ -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;
|
||||||
|
}
|
||||||
|
};
|
17
ng2-components/ng2-alfresco-core/material.d.ts
vendored
17
ng2-components/ng2-alfresco-core/material.d.ts
vendored
@ -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';
|
|
@ -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
|
|
@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"material.js","sourceRoot":"","sources":["material.ts"],"names":[],"mappings":""}
|
|
@ -1,4 +1,4 @@
|
|||||||
/**
|
/*!
|
||||||
* @license
|
* @license
|
||||||
* Copyright 2016 Alfresco Software, Ltd.
|
* Copyright 2016 Alfresco Software, Ltd.
|
||||||
*
|
*
|
||||||
@ -14,4 +14,5 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './material/MaterialDesignLiteUpgradeElement';
|
export * from './material/MaterialDesignLiteUpgradeElement';
|
||||||
|
@ -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;
|
|
||||||
}
|
|
@ -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
|
|
@ -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"}
|
|
@ -1,6 +1,6 @@
|
|||||||
/**
|
/*!
|
||||||
* @license
|
* @license
|
||||||
* Copyright (C) 2016 Alfresco Software Limited.
|
* Copyright 2016 Alfresco Software, Ltd.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {Directive, AfterViewInit} from 'angular2/core';
|
import {Directive, AfterViewInit} from 'angular2/core';
|
||||||
declare var componentHandler;
|
declare var componentHandler;
|
||||||
|
|
||||||
|
@ -4,10 +4,15 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"author": "Alfresco Software, Ltd.",
|
"author": "Alfresco Software, Ltd.",
|
||||||
"scripts": {
|
"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": "tsc",
|
||||||
"tsc:w": "tsc -w",
|
"tsc:w": "tsc -w",
|
||||||
"typings": "typings"
|
"typings": "typings",
|
||||||
|
"test": "karma start karma.conf.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -21,6 +26,10 @@
|
|||||||
{
|
{
|
||||||
"name": "Denys Vuika",
|
"name": "Denys Vuika",
|
||||||
"email": "denis.vuyka@gmail.com"
|
"email": "denis.vuyka@gmail.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Mario Romano",
|
||||||
|
"email": "mario.romano83@gmail.com"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@ -35,14 +44,44 @@
|
|||||||
"es6-shim": "^0.35.0",
|
"es6-shim": "^0.35.0",
|
||||||
"reflect-metadata": "0.1.2",
|
"reflect-metadata": "0.1.2",
|
||||||
"rxjs": "5.0.0-beta.2",
|
"rxjs": "5.0.0-beta.2",
|
||||||
"zone.js": "0.6.10",
|
"zone.js": "^0.6.12",
|
||||||
"ng2-translate": "^1.11.2"
|
"ng2-translate": "^1.11.2",
|
||||||
|
"es6-module-loader": "^0.17.8"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"angular2": "2.0.0-beta.15"
|
"angular2": "2.0.0-beta.15"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typescript": "^1.8.10",
|
"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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
26
ng2-components/ng2-alfresco-core/services.d.ts
vendored
26
ng2-components/ng2-alfresco-core/services.d.ts
vendored
@ -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];
|
|
@ -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
|
|
@ -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"}
|
|
@ -1,4 +1,4 @@
|
|||||||
/**
|
/*!
|
||||||
* @license
|
* @license
|
||||||
* Copyright 2016 Alfresco Software, Ltd.
|
* Copyright 2016 Alfresco Software, Ltd.
|
||||||
*
|
*
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
export declare class AlfrescoSettingsService {
|
|
||||||
private _host;
|
|
||||||
host: string;
|
|
||||||
getAuthToken(): string;
|
|
||||||
}
|
|
@ -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
|
|
@ -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"}
|
|
@ -1,4 +1,4 @@
|
|||||||
/**
|
/*!
|
||||||
* @license
|
* @license
|
||||||
* Copyright 2016 Alfresco Software, Ltd.
|
* Copyright 2016 Alfresco Software, Ltd.
|
||||||
*
|
*
|
||||||
|
@ -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<any>;
|
|
||||||
}
|
|
@ -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
|
|
@ -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"}
|
|
@ -1,4 +1,4 @@
|
|||||||
/**
|
/*!
|
||||||
* @license
|
* @license
|
||||||
* Copyright 2016 Alfresco Software, Ltd.
|
* Copyright 2016 Alfresco Software, Ltd.
|
||||||
*
|
*
|
||||||
|
78
ng2-components/ng2-alfresco-core/test-main.js
Normal file
78
ng2-components/ng2-alfresco-core/test-main.js
Normal file
@ -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$/, '');
|
||||||
|
}
|
@ -1,18 +1,27 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"module": "system",
|
"module": "commonjs",
|
||||||
"moduleResolution": "node",
|
"declaration": false,
|
||||||
"sourceMap": true,
|
"removeComments": true,
|
||||||
|
"noLib": false,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"removeComments": false,
|
"sourceMap": true,
|
||||||
|
"allowUnreachableCode": false,
|
||||||
|
"allowUnusedLabels": false,
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"declaration": true
|
"noImplicitReturns": true,
|
||||||
|
"noImplicitUseStrict": false,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"outDir": "dist"
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"typings/main",
|
"dist",
|
||||||
"typings/main.d.ts"
|
"typings/browser.d.ts",
|
||||||
]
|
"typings/browser",
|
||||||
|
"demo"
|
||||||
|
],
|
||||||
|
"compileOnSave": false
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user