Merge pull request #193 from Alfresco/dev-upgrade-rc1

Upgrade to angular 2 rc.1
This commit is contained in:
Mario Romano
2016-06-14 15:42:42 +01:00
committed by GitHub
123 changed files with 1458 additions and 1250 deletions

View File

@@ -33,6 +33,7 @@ env:
before_script:
- npm set proxy $DEV_REGISTRY
- npm config set https-proxy $DEV_REGISTRY
- npm config set "@angular:registry" http://registry.npmjs.org/
- cd ./ng2-components/$MODULE; npm install --registry $DEV_REGISTRY
- ls -ltrh ./node_modules/
script: npm run test

View File

@@ -49,8 +49,8 @@
<main class="mdl-layout__content">
<div class="page-content">
<alfresco-login method="{{methodName}}"></alfresco-login>
<!--<router-outlet></router-outlet>-->
<auth-router-outlet></auth-router-outlet>
<router-outlet></router-outlet>
<!--<auth-router-outlet></auth-router-outlet>-->
</div>
</main>
</div>

View File

@@ -15,11 +15,11 @@
* limitations under the License.
*/
import { Component } from 'angular2/core';
import { Router, RouteConfig, ROUTER_DIRECTIVES } from 'angular2/router';
import { Component } from '@angular/core';
import { Router, RouteConfig, ROUTER_DIRECTIVES } from '@angular/router-deprecated';
import { MDL } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
import { FilesComponent } from './components/files/files.component';
import { AuthRouterOutlet } from './components/router/AuthRouterOutlet';
import {
AlfrescoSettingsService,
AlfrescoTranslationService,
@@ -39,7 +39,7 @@ declare var document: any;
selector: 'alfresco-app',
templateUrl: 'app/app.component.html',
styleUrls: ['app/app.component.css'],
directives: [SearchBarComponent, ROUTER_DIRECTIVES, AuthRouterOutlet, MDL],
directives: [SearchBarComponent, ROUTER_DIRECTIVES, MDL],
pipes: [AlfrescoPipeTranslate]
})
@RouteConfig([

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component } from 'angular2/core';
import { Component } from '@angular/core';
import {
ALFRESCO_DATATABLE_DIRECTIVES,
ObjectDataTableAdapter,

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component } from 'angular2/core';
import { Component } from '@angular/core';
import {
DOCUMENT_LIST_DIRECTIVES,
DOCUMENT_LIST_PROVIDERS,

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component } from 'angular2/core';
import { Component } from '@angular/core';
import { AlfrescoLoginComponent } from 'ng2-alfresco-login/dist/ng2-alfresco-login';
declare let __moduleName: string;

View File

@@ -15,8 +15,9 @@
* limitations under the License.
*/
import { ElementRef, DynamicComponentLoader, Directive, Attribute } from 'angular2/core';
import { Router, RouterOutlet, ComponentInstruction } from 'angular2/router';
/*
import { ElementRef, DynamicComponentLoader, Directive, Attribute } from '@angular/core';
import { Router, RouterOutlet, ComponentInstruction } from '@angular/router-deprecated';
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
@Directive({selector: 'auth-router-outlet'})
@@ -49,3 +50,4 @@ export class AuthRouterOutlet extends RouterOutlet {
|| this.authentication.isLoggedIn();
}
}
*/

View File

@@ -15,8 +15,8 @@
* limitations under the License.
*/
import { Component } from 'angular2/core';
import { Router } from 'angular2/router';
import { Component } from '@angular/core';
import { Router } from '@angular/router-deprecated';
import { ALFRESCO_SEARCH_DIRECTIVES } from 'ng2-alfresco-search/dist/ng2-alfresco-search';
import { VIEWERCOMPONENT } from 'ng2-alfresco-viewer/dist/ng2-alfresco-viewer';
import {

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component } from 'angular2/core';
import { Component } from '@angular/core';
import { ALFRESCO_SEARCH_DIRECTIVES } from 'ng2-alfresco-search/dist/ng2-alfresco-search';
declare let __moduleName: string;

View File

@@ -15,8 +15,9 @@
* limitations under the License.
*/
import { Injectable } from 'angular2/core';
import { Http, Headers, RequestOptions, Response } from 'angular2/http';
import { Injectable } from '@angular/core';
import { Http, Headers, RequestOptions, Response } from '@angular/http';
// import { Observable } from 'rxjs/Rx';
@Injectable()
export class ActivitiService {

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component, OnInit } from 'angular2/core';
import { Component, OnInit } from '@angular/core';
import { ActivitiService } from './activiti.service';
import {
ALFRESCO_DATATABLE_DIRECTIVES,

View File

@@ -15,12 +15,12 @@
* limitations under the License.
*/
import { bootstrap } from 'angular2/platform/browser';
import { AppComponent } from './app.component';
import { ROUTER_PROVIDERS } from 'angular2/router';
import { HTTP_PROVIDERS } from 'angular2/http';
import { bootstrap } from '@angular/platform-browser-dynamic';
import { ROUTER_PROVIDERS } from '@angular/router-deprecated';
import { HTTP_PROVIDERS } from '@angular/http';
import { ALFRESCO_CORE_PROVIDERS } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
import { UploadService } from 'ng2-alfresco-upload/dist/ng2-alfresco-upload';
import { AppComponent } from './app.component';
bootstrap(AppComponent, [
ROUTER_PROVIDERS,

View File

@@ -16,17 +16,14 @@
<link href="node_modules/flag-icon-css/css/flag-icon.min.css" rel="stylesheet">
<!-- 1. Load libraries -->
<!-- IE required polyfills, in this exact order -->
<script src="node_modules/es6-shim/es6-shim.min.js"></script>
<script src="node_modules/systemjs/dist/system-polyfills.js"></script>
<script src="node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/rxjs/bundles/Rx.js"></script>
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
<script src="node_modules/angular2/bundles/router.dev.js"></script>
<script src="node_modules/angular2/bundles/http.dev.js"></script>
<!-- Polyfill(s) for older browsers -->
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/alfresco-js-api/bundle.js"></script>
<script src="/app/js/xml2json.js"></script>
<script src="node_modules/alfresco-js-api/bundle.js"></script>
@@ -37,7 +34,7 @@
<!-- 2. Configure SystemJS -->
<script src="systemjs.config.js"></script>
<script>
System.import('app/main').catch(function(err){ console.error(err); });
System.import('app').catch(function(err){ console.error(err); });
</script>
</head>
<!-- 3. Display the application -->

View File

@@ -8,7 +8,7 @@
"tsc": "tsc",
"tsc:w": "tsc -w",
"serve": "node browser-sync-config.js",
"typings": "typings",
"typings": "typings install",
"tslint": "npm run tslint-src && npm run tslint-root",
"tslint-src": "tslint -c tslint.json app/**/*.ts",
"tslint-root": "tslint -c tslint.json *.ts",
@@ -51,23 +51,35 @@
"alfresco"
],
"dependencies": {
"alfresco-js-api": "^0.1.0",
"angular2": "2.0.0-beta.15",
"es6-shim": "^0.35.0",
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.1",
"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",
"angular2-in-memory-web-api": "0.0.11",
"material-design-icons": "^2.2.3",
"material-design-lite": "^1.1.3",
"ng2-translate": "2.1.0",
"pdfjs-dist": "^1.5.258",
"alfresco-js-api": "^0.1.0",
"ng2-alfresco-core": "^0.1.0",
"ng2-alfresco-datatable": "^0.1.0",
"ng2-alfresco-documentlist": "^0.1.0",
"ng2-alfresco-login": "^0.1.0",
"ng2-alfresco-search": "^0.1.9",
"ng2-alfresco-upload": "^0.1.0",
"ng2-alfresco-viewer": "^0.1.13",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"systemjs": "0.19.26",
"zone.js": "0.6.10",
"ng2-translate": "1.11.1"
"ng2-alfresco-viewer": "^0.1.13"
},
"devDependencies": {
"browser-sync": "^2.10.0",
@@ -78,7 +90,7 @@
"license-check": "^1.0.4",
"tslint": "^3.8.1",
"typescript": "^1.8.10",
"typings": "^0.7.12"
"typings": "^1.0.4"
},
"license-check-config": {
"src": [

View File

@@ -1,57 +1,65 @@
/**
* @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 configuration for Angular 2 samples
* Adjust as necessary for your application needs.
*/
(function(global) {
// map tells the System loader where to look for things
var map = {
'app': 'app', // 'dist',
'@angular': 'node_modules/@angular',
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
'rxjs': 'node_modules/rxjs',
'ng2-translate': 'node_modules/ng2-translate',
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core',
'ng2-alfresco-datatable': 'node_modules/ng2-alfresco-datatable',
'ng2-alfresco-documentlist': 'node_modules/ng2-alfresco-documentlist',
'ng2-alfresco-login': 'node_modules/ng2-alfresco-login',
'ng2-alfresco-search': 'node_modules/ng2-alfresco-search',
'ng2-alfresco-upload': 'node_modules/ng2-alfresco-upload',
'ng2-alfresco-viewer': 'node_modules/ng2-alfresco-viewer',
'rxjs': 'node_modules/rxjs',
'ng2-translate': 'node_modules/ng2-translate'
'ng2-alfresco-viewer': 'node_modules/ng2-alfresco-viewer'
};
// packages tells the System loader how to load when no filename and/or no extension
var packages = {
app: {
format: 'register',
defaultExtension: 'js'
},
'app': { main: 'main.js', defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' },
'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
'ng2-translate': { defaultExtension: 'js' },
'ng2-alfresco-core': {defaultExtension: 'js'},
'ng2-alfresco-datatable': {defaultExtension: 'js'},
'ng2-alfresco-documentlist': {defaultExtension: 'js'},
'ng2-alfresco-login': {defaultExtension: 'js'},
'ng2-alfresco-search': {defaultExtension: 'js'},
'ng2-alfresco-upload': {defaultExtension: 'js'},
'ng2-alfresco-viewer': {defaultExtension: 'js'},
'rxjs': {defaultExtension: 'js'},
'ng2-translate': {defaultExtension: 'js'}
'ng2-alfresco-viewer': {defaultExtension: 'js'}
};
var ngPackageNames = [
'common',
'compiler',
'core',
'http',
'platform-browser',
'platform-browser-dynamic',
'router',
'router-deprecated',
'upgrade'
];
// Individual files (~300 requests):
function packIndex(pkgName) {
packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' };
}
// Bundled (~40 requests):
function packUmd(pkgName) {
packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' };
}
// Most environments should use UMD; some (Karma) need the individual index files
var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;
// Add package entries for angular packages
ngPackageNames.forEach(setPackageConfig);
var config = {
map: map,
packages: packages
};
System.config(config);
})(this);

View File

@@ -1,6 +1,7 @@
{
"ambientDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#d594ef506d1efe2fea15f8f39099d19b39436b71"
}
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
"jasmine": "registry:dt/jasmine#2.2.0+20160505161446",
"node": "registry:dt/node#4.0.0+20160509154515"
}
}

View File

@@ -49,17 +49,22 @@
"alfresco"
],
"dependencies": {
"angular2": "2.0.0-beta.15",
"es6-module-loader": "^0.17.8",
"es6-shim": "^0.35.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"systemjs": "0.19.26",
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.1",
"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",
"ng2-translate": "1.11.1"
},
"peerDependencies": {
"angular2": "2.0.0-beta.15"
"angular2-in-memory-web-api": "0.0.11",
"ng2-translate": "2.1.0"
},
"devDependencies": {
"copyfiles": "^0.2.1",
@@ -78,7 +83,7 @@
"traceur": "^0.0.91",
"tslint": "^3.8.1",
"typescript": "^1.8.10",
"typings": "^0.7.12"
"typings": "^1.0.4"
},
"license-check-config": {
"src": [

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component } from 'angular2/core';
import { Component } from '@angular/core';
import { ContextMenuService } from './../services/context-menu.service';
@Component({
@@ -59,7 +59,7 @@ import { ContextMenuService } from './../services/context-menu.service';
template: `
<div [ngStyle]="locationCss" class="menu-container">
<ul class="context-menu">
<li (click)="link.subject.next(link)" class="mdl-menu__item link" *ngFor="#link of links">
<li (click)="link.subject.next(link)" class="mdl-menu__item link" *ngFor="let link of links">
{{link.title || link.model?.title}}
</li>
</ul>

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Directive, Input } from 'angular2/core';
import { Directive, Input } from '@angular/core';
import { ContextMenuService } from './../services/context-menu.service';
@Directive({

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import {Directive, AfterViewInit} from 'angular2/core';
import { Directive, AfterViewInit } from '@angular/core';
declare var componentHandler;
@Directive({

View File

@@ -15,8 +15,8 @@
* limitations under the License.
*/
import { it, describe, beforeEach } from 'angular2/testing';
import { Injector } from 'angular2/core';
import { it, describe, beforeEach } from '@angular/core/testing';
import { ReflectiveInjector } from '@angular/core';
import { AlfrescoSettingsService } from './AlfrescoSettingsService.service';
import { AlfrescoAuthenticationService } from './AlfrescoAuthenticationService.service';
import { AlfrescoApiMock } from '../assets/AlfrescoApi.mock';
@@ -29,7 +29,7 @@ describe('AlfrescoAuthentication', () => {
service;
beforeEach(() => {
injector = Injector.resolveAndCreate([
injector = ReflectiveInjector.resolveAndCreate([
AlfrescoAuthenticationService,
AlfrescoSettingsService
]);

View File

@@ -15,9 +15,9 @@
* limitations under the License.
*/
import { Injectable } from 'angular2/core';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Rx';
import { Http, Headers, Response } from 'angular2/http';
import { Http, Headers, Response } from '@angular/http';
import { AlfrescoSettingsService } from './AlfrescoSettingsService.service';
declare let AlfrescoApi: any;

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Injectable } from 'angular2/core';
import { Injectable } from '@angular/core';
import { AlfrescoAuthenticationService } from './AlfrescoAuthenticationService.service';
import { AlfrescoSettingsService } from './AlfrescoSettingsService.service';

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Injectable, ChangeDetectorRef, Pipe } from 'angular2/core';
import { Injectable, ChangeDetectorRef, Pipe } from '@angular/core';
import { TranslatePipe } from 'ng2-translate/ng2-translate';
import { AlfrescoTranslationService } from './AlfrescoTranslationService.service';

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Injectable } from 'angular2/core';
import { Injectable } from '@angular/core';
@Injectable()
export class AlfrescoSettingsService {

View File

@@ -15,8 +15,8 @@
* limitations under the License.
*/
import { Injectable } from 'angular2/core';
import { Response, Http } from 'angular2/http';
import { Injectable } from '@angular/core';
import { Response, Http } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import { TranslateLoader } from 'ng2-translate/ng2-translate';
@@ -44,7 +44,7 @@ export class AlfrescoTranslationLoader implements TranslateLoader {
this._componentList.forEach((component) => {
observableBatch.push(this.http.get(`${component}/${self.prefix}/${lang}${self.suffix}`)
.map((res: Response) => res.json())
.catch( (err: any, source: Observable<any>, caught: Observable<any>) => {
.catch( (/*err: any, source: Observable<any>, caught: Observable<any>*/) => {
// Empty Observable just to go ahead
return Observable.of('');
}));

View File

@@ -15,8 +15,8 @@
* limitations under the License.
*/
import { Injectable, Optional } from 'angular2/core';
import { Http } from 'angular2/http';
import { Injectable, Optional } from '@angular/core';
import { Http } from '@angular/http';
import { MissingTranslationHandler, TranslateService } from 'ng2-translate/ng2-translate';
import { AlfrescoTranslationLoader } from './AlfrescoTranslationLoader.service';

View File

@@ -15,10 +15,10 @@
* limitations under the License.
*/
import {Injectable} from 'angular2/core';
import {Injectable} from '@angular/core';
import {Subject} from 'rxjs/Rx';
@Injectable()
export class ContextMenuService {
public show: Subject<{event: MouseEvent, obj: any[]}> = new Subject();
public show: Subject<{event: MouseEvent, obj: any[]}> = new Subject<{event: MouseEvent, obj: any[]}>();
}

View File

@@ -1,6 +1,7 @@
{
"ambientDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#5c182b9af717f73146399c2485f70f1e2ac0ff2b"
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
"jasmine": "registry:dt/jasmine#2.2.0+20160505161446",
"node": "registry:dt/node#4.0.0+20160509154515"
}
}

View File

@@ -11,16 +11,12 @@
<link rel="stylesheet" href="node_modules/material-design-icons/iconfont/material-icons.css">
<!-- 1. Load libraries -->
<!-- IE required polyfills, in this exact order -->
<script src="node_modules/es6-shim/es6-shim.min.js"></script>
<script src="node_modules/systemjs/dist/system-polyfills.js"></script>
<script src="node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
<!-- 1. Load libraries -->
<!-- Polyfill(s) for older browsers -->
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/rxjs/bundles/Rx.js"></script>
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
<script src="node_modules/angular2/bundles/router.dev.js"></script>
<script src="node_modules/angular2/bundles/http.dev.js"></script>
<script src="systemjs.config.js"></script>
<script>

View File

@@ -22,14 +22,24 @@
},
"license": "Apache-2.0",
"dependencies": {
"angular2": "2.0.0-beta.15",
"es6-promise": "3.0.2",
"es6-shim": "0.35.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.1",
"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",
"angular2-in-memory-web-api": "0.0.11",
"material-design-icons": "^2.2.3",
"material-design-lite": "^1.1.3",
"zone.js": "0.6.10",
"ng2-alfresco-datatable": "^0.1.0"
},
"devDependencies": {
@@ -37,7 +47,7 @@
"concurrently": "^2.0.0",
"tslint": "^3.8.1",
"typescript": "^1.8.10",
"typings": "^0.7.12",
"typings": "^1.0.4",
"wsrv": "^0.1.0"
},
"keywords": [

View File

@@ -15,8 +15,8 @@
* limitations under the License.
*/
import { Component } from 'angular2/core';
import { bootstrap } from 'angular2/platform/browser';
import { Component } from '@angular/core';
import { bootstrap } from '@angular/platform-browser-dynamic';
import {
ALFRESCO_DATATABLE_DIRECTIVES,
ObjectDataTableAdapter,

View File

@@ -1,44 +1,51 @@
/**
* @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 configuration for Angular 2 samples
* Adjust as necessary for your application needs.
*/
(function (global) {
(function(global) {
// map tells the System loader where to look for things
var map = {
'ng2-alfresco-datatable': 'node_modules/ng2-alfresco-datatable',
'rxjs': 'node_modules/rxjs',
'angular2' : 'node_modules/angular2',
'app': 'dist/main'
};
'app': 'dist', // 'dist',
'@angular': 'node_modules/@angular',
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
'rxjs': 'node_modules/rxjs',
'ng2-alfresco-datatable': 'node_modules/ng2-alfresco-datatable'
};
// packages tells the System loader how to load when no filename and/or no extension
var packages = {
'app': { format: 'register', defaultExtension: 'js' },
'ng2-alfresco-datatable': { defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' },
'angular2': { defaultExtension: 'js' }
};
'app': { main: 'main.js', defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' },
'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
'ng2-alfresco-datatable': { defaultExtension: 'js' }
};
var ngPackageNames = [
'common',
'compiler',
'core',
'http',
'platform-browser',
'platform-browser-dynamic',
'router',
'router-deprecated',
'upgrade'
];
// Individual files (~300 requests):
function packIndex(pkgName) {
packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' };
}
// Bundled (~40 requests):
function packUmd(pkgName) {
packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' };
}
// Most environments should use UMD; some (Karma) need the individual index files
var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;
// Add package entries for angular packages
ngPackageNames.forEach(setPackageConfig);
var config = {
defaultJSExtensions: true,
map: map,
packages: packages
};
System.config(config);
})(this);

View File

@@ -1,9 +1,7 @@
{
"name": "angular2-testing",
"dependencies": {},
"devDependencies": {},
"ambientDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#dd638012d63e069f2c99d06ef4dcc9616a943ee4"
}
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
"jasmine": "registry:dt/jasmine#2.2.0+20160505161446",
"node": "registry:dt/node#4.0.0+20160509154515"
}
}

View File

@@ -48,13 +48,21 @@
"alfresco"
],
"dependencies": {
"angular2": "2.0.0-beta.15",
"systemjs": "0.19.26",
"es6-shim": "^0.35.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"zone.js": "^0.6.12",
"es6-module-loader": "^0.17.8"
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.1",
"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",
"angular2-in-memory-web-api": "0.0.11"
},
"peerDependencies": {
"material-design-icons": "^2.2.3",
@@ -76,7 +84,7 @@
"traceur": "^0.0.91",
"tslint": "^3.8.1",
"typescript": "^1.8.10",
"typings": "^0.7.12",
"typings": "^1.0.4",
"wsrv": "^0.1.0"
},
"license-check-config": {

View File

@@ -14,7 +14,7 @@
</label>
</th>
<th class="mdl-data-table__cell--non-numeric non-selectable {{col.cssClass}}"
*ngFor="#col of data.getColumns()"
*ngFor="let col of data.getColumns()"
[class.column-header]="col.title"
[class.mdl-data-table__header--sorted-ascending]="isColumnSorted(col, 'asc')"
[class.mdl-data-table__header--sorted-descending]="isColumnSorted(col, 'desc')"
@@ -30,7 +30,7 @@
</thead>
<tbody>
<tr *ngFor="#row of data.getRows(); #idx = index">
<tr *ngFor="let row of data.getRows(); let idx = index">
<td *ngIf="multiselect">
<label
class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect mdl-data-table__select"
@@ -39,7 +39,7 @@
<input type="checkbox" [attr.id]="'row[' + idx + ']'" class="mdl-checkbox__input" [(ngModel)]="row.isSelected" />
</label>
</td>
<td *ngFor="#col of data.getColumns()" [ngSwitch]="col.type"
<td *ngFor="let col of data.getColumns()" [ngSwitch]="col.type"
class="mdl-data-table__cell--non-numeric non-selectable data-cell {{col.cssClass}}"
(click)="onRowClick(row, $event)" (dblclick)="onRowDblClick(row, $event)">
<div *ngSwitchWhen="'image'">

View File

@@ -20,7 +20,7 @@ import {
describe,
expect,
beforeEach
} from 'angular2/testing';
} from '@angular/core/testing';
import { DataTableComponent } from './datatable.component';
import {

View File

@@ -23,7 +23,7 @@ import {
Output,
EventEmitter,
AfterViewChecked
} from 'angular2/core';
} from '@angular/core';
import {
DataTableAdapter,

View File

@@ -19,7 +19,7 @@ import {
it,
describe,
expect
} from 'angular2/testing';
} from '@angular/core/testing';
import {
DataColumn,

View File

@@ -1,6 +1,7 @@
{
"ambientDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#5c182b9af717f73146399c2485f70f1e2ac0ff2b"
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
"jasmine": "registry:dt/jasmine#2.2.0+20160505161446",
"node": "registry:dt/node#4.0.0+20160509154515"
}
}

View File

@@ -11,16 +11,12 @@
<link rel="stylesheet" href="node_modules/material-design-icons/iconfont/material-icons.css">
<!-- 1. Load libraries -->
<!-- IE required polyfills, in this exact order -->
<script src="node_modules/es6-shim/es6-shim.min.js"></script>
<script src="node_modules/systemjs/dist/system-polyfills.js"></script>
<script src="node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
<!-- Polyfill(s) for older browsers -->
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/rxjs/bundles/Rx.js"></script>
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
<script src="node_modules/angular2/bundles/router.dev.js"></script>
<script src="node_modules/angular2/bundles/http.dev.js"></script>
<!-- Additional Alfresco libraries -->
<script src="node_modules/alfresco-js-api/bundle.js"></script>

View File

@@ -16,23 +16,35 @@
},
"license": "Apache-2.0",
"dependencies": {
"angular2": "2.0.0-beta.15",
"es6-promise": "3.0.2",
"es6-shim": "0.35.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"material-design-icons": "^2.2.3",
"material-design-lite": "^1.1.3",
"zone.js": "0.6.10",
"ng2-alfresco-documentlist": "^0.1.16"
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.1",
"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",
"angular2-in-memory-web-api": "0.0.11",
"material-design-icons": "^2.2.3",
"material-design-lite": "^1.1.3",
"ng2-alfresco-documentlist": "^0.1.16",
"alfresco-js-api": "^0.1.0",
"ng2-translate": "2.1.0"
},
"devDependencies": {
"browser-sync": "^2.10.0",
"connect-history-api-fallback": "^1.2.0",
"concurrently": "^2.0.0",
"tslint": "^3.8.1",
"typescript": "^1.8.10",
"typings": "^0.7.12"
"browser-sync": "^2.10.0",
"connect-history-api-fallback": "^1.2.0",
"concurrently": "^2.0.0",
"tslint": "^3.8.1",
"typescript": "^1.8.10",
"typings": "^1.0.4"
},
"keywords": [
"angular2",

View File

@@ -15,9 +15,9 @@
* limitations under the License.
*/
import { Component, OnInit } from 'angular2/core';
import { bootstrap } from 'angular2/platform/browser';
import { HTTP_PROVIDERS } from 'angular2/http';
import { Component, OnInit } from '@angular/core';
import { bootstrap } from '@angular/platform-browser-dynamic';
import { HTTP_PROVIDERS } from '@angular/http';
import {
ALFRESCO_CORE_PROVIDERS,

View File

@@ -1,48 +1,55 @@
/**
* @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 configuration for Angular 2 samples
* Adjust as necessary for your application needs.
*/
(function (global) {
(function(global) {
// map tells the System loader where to look for things
var map = {
'app': 'dist', // 'dist',
'@angular': 'node_modules/@angular',
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
'rxjs': 'node_modules/rxjs',
'ng2-translate': 'node_modules/ng2-translate',
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core',
'ng2-alfresco-documentlist': 'node_modules/ng2-alfresco-documentlist',
'rxjs': 'node_modules/rxjs',
'angular2' : 'node_modules/angular2',
'app': 'dist/main'
'ng2-alfresco-documentlist': 'node_modules/ng2-alfresco-documentlist'
};
// packages tells the System loader how to load when no filename and/or no extension
var packages = {
'app': { format: 'register', defaultExtension: 'js' },
'app': { main: 'main.js', defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' },
'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
'ng2-translate': { defaultExtension: 'js' },
'ng2-alfresco-core': { defaultExtension: 'js' },
'ng2-alfresco-documentlist': { defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' },
'angular2': { defaultExtension: 'js' }
'ng2-alfresco-documentlist': { defaultExtension: 'js' }
};
var ngPackageNames = [
'common',
'compiler',
'core',
'http',
'platform-browser',
'platform-browser-dynamic',
'router',
'router-deprecated',
'upgrade'
];
// Individual files (~300 requests):
function packIndex(pkgName) {
packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' };
}
// Bundled (~40 requests):
function packUmd(pkgName) {
packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' };
}
// Most environments should use UMD; some (Karma) need the individual index files
var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;
// Add package entries for angular packages
ngPackageNames.forEach(setPackageConfig);
var config = {
defaultJSExtensions: true,
map: map,
packages: packages
};
System.config(config);
})(this);

View File

@@ -1,9 +1,7 @@
{
"name": "angular2-testing",
"dependencies": {},
"devDependencies": {},
"ambientDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#dd638012d63e069f2c99d06ef4dcc9616a943ee4"
}
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
"jasmine": "registry:dt/jasmine#2.2.0+20160505161446",
"node": "registry:dt/node#4.0.0+20160509154515"
}
}

View File

@@ -54,16 +54,25 @@
"alfresco"
],
"dependencies": {
"angular2": "2.0.0-beta.15",
"es6-module-loader": "^0.17.8",
"es6-shim": "^0.35.0",
"ng2-alfresco-core": "^0.1.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"systemjs": "0.19.26",
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.1",
"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",
"angular2-in-memory-web-api": "0.0.11",
"ng2-alfresco-core": "^0.1.0",
"alfresco-js-api": "^0.1.0",
"ng2-translate": "1.11.1"
"ng2-translate": "2.1.0"
},
"devDependencies": {
"concurrently": "^2.1.0",
@@ -82,7 +91,7 @@
"traceur": "^0.0.91",
"tslint": "^3.8.1",
"typescript": "^1.8.10",
"typings": "^0.7.12"
"typings": "^1.0.4"
},
"license-check-config": {
"src": [

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import {Component} from 'angular2/core';
import {Component} from '@angular/core';
import {DocumentList} from './document-list';
import {ContentActionModel} from './../models/content-action.model';

View File

@@ -20,8 +20,8 @@ import {
describe,
expect,
beforeEach
} from 'angular2/testing';
import {EventEmitter} from 'angular2/core';
} from '@angular/core/testing';
import {EventEmitter} from '@angular/core';
import {DocumentList} from './document-list';
import {AlfrescoServiceMock} from '../assets/alfresco.service.mock';

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import {Component, OnInit, OnChanges, Input, Output, EventEmitter} from 'angular2/core';
import {Component, OnInit, OnChanges, Input, Output, EventEmitter} from '@angular/core';
import {ContentActionModel} from './../models/content-action.model';
import {ContentActionList} from './content-action-list';
import {DocumentActionsService} from '../services/document-actions.service';

View File

@@ -20,7 +20,7 @@ import {
describe,
expect,
beforeEach
} from 'angular2/testing';
} from '@angular/core/testing';
import {DocumentList} from './document-list';
import {AlfrescoServiceMock} from '../assets/alfresco.service.mock';

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import {Component} from 'angular2/core';
import {Component} from '@angular/core';
import {DocumentList} from './document-list';
import {ContentColumnModel} from './../models/content-column.model';

View File

@@ -20,7 +20,7 @@ import {
describe,
expect,
beforeEach
} from 'angular2/testing';
} from '@angular/core/testing';
import {DocumentList} from './document-list';
import {ContentColumn} from './content-column';

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component, OnInit, Input, OnChanges } from 'angular2/core';
import { Component, OnInit, Input, OnChanges } from '@angular/core';
import { ContentColumnList } from './content-column-list';
import { ContentColumnModel } from './../models/content-column.model';

View File

@@ -1,5 +1,5 @@
<ol *ngIf="breadcrumb" data-automation-id="breadcrumb" class="breadcrumb">
<li *ngFor="#r of route; #last = last" [class.active]="last" [ngSwitch]="last">
<li *ngFor="let r of route; let last = last" [class.active]="last" [ngSwitch]="last">
<span *ngSwitchWhen="true">{{r.name}}</span>
<a *ngSwitchDefault href="#" [attr.data-automation-id]="'breadcrumb_' + r.name" (click)="goToRoute(r, $event)">{{r.name}}</a>
</li>
@@ -9,7 +9,7 @@
<tr>
<!-- Columns -->
<th class="mdl-data-table__cell--non-numeric non-selectable {{col.cssClass}}"
*ngFor="#col of columns"
*ngFor="let col of columns"
[class.column-header]="col.title"
[attr.data-automation-id]="'auto_id_' + col.source"
[class.mdl-data-table__header--sorted-ascending]="sorting.key === col.source && sorting.direction === 'asc'"
@@ -37,10 +37,10 @@
</td>
</tr>
<tr *ngFor="#content of folder.list.entries; #idx = index"
<tr *ngFor="let content of folder.list.entries; let idx = index"
[attr.data-automation-id]="getObjectValue(content.entry, 'name')">
<!-- Columns -->
<td *ngFor="#col of columns" [ngSwitch]="col.type"
<td *ngFor="let col of columns" [ngSwitch]="col.type"
class="mdl-data-table__cell--non-numeric non-selectable data-cell {{col.cssClass}}"
(click)="onItemClick(content, $event)"
(dblclick)="onItemDblClick(content, $event)"
@@ -61,7 +61,7 @@
<td *ngIf="content.entry.isFolder">
<!-- action buttons -->
<button class="mdl-button mdl-js-button mdl-button--icon"
*ngFor="#action of getContentActions('folder', 'button')"
*ngFor="let action of getContentActions('folder', 'button')"
(click)="executeContentAction(content, action)">
<i class="material-icons">{{action.icon}}</i>
</button>
@@ -74,7 +74,7 @@
[attr.for]="'folder_action_menu_' + idx">
<li class="mdl-menu__item"
[attr.data-automation-id]="action.title"
*ngFor="#action of getContentActions('folder', 'menu')"
*ngFor="let action of getContentActions('folder', 'menu')"
(click)="executeContentAction(content, action)">
{{action.title}}
</li>
@@ -84,7 +84,7 @@
<td *ngIf="!content.entry.isFolder">
<!-- action buttons -->
<button class="mdl-button mdl-js-button mdl-button--icon"
*ngFor="#action of getContentActions('document', 'button')"
*ngFor="let action of getContentActions('document', 'button')"
(click)="executeContentAction(content, action)">
<i class="material-icons">{{action.icon}}</i>
</button>
@@ -97,7 +97,7 @@
[attr.for]="'document_action_menu_' + idx">
<li class="mdl-menu__item"
[attr.data-automation-id]="action.title"
*ngFor="#action of getContentActions('document', 'menu')"
*ngFor="let action of getContentActions('document', 'menu')"
(click)="executeContentAction(content, action)">
{{action.title}}
</li>

View File

@@ -20,7 +20,7 @@ import {
describe,
expect,
beforeEach
} from 'angular2/testing';
} from '@angular/core/testing';
import { DocumentList } from './document-list';
import { ContentColumnModel } from '../models/content-column.model';

View File

@@ -25,8 +25,8 @@ import {
AfterViewChecked,
OnChanges,
TemplateRef
} from 'angular2/core';
import { DatePipe } from 'angular2/common';
} from '@angular/core';
import { DatePipe } from '@angular/common';
import { Subject } from 'rxjs/Rx';
import { CONTEXT_MENU_DIRECTIVES } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
import { AlfrescoService } from './../services/alfresco.service';
@@ -92,7 +92,7 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit,
actions: ContentActionModel[] = [];
columns: ContentColumnModel[] = [];
emptyFolderTemplate: TemplateRef;
emptyFolderTemplate: TemplateRef<any>;
private _folder: NodePaging;
@@ -469,9 +469,7 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit,
if (col.type === 'date') {
let datePipe = new DatePipe();
if (datePipe.supports(value)) {
// TODO: to be changed to plan non-array value post angular2 beta.15
let pattern = col.format ? [col.format] : [];
return datePipe.transform(value, pattern);
return datePipe.transform(value, col.format);
}
}

View File

@@ -21,7 +21,7 @@ import {
TemplateRef,
OnInit,
AfterContentInit
} from 'angular2/core';
} from '@angular/core';
import { DocumentList } from './document-list';
@Directive({

View File

@@ -15,8 +15,8 @@
* limitations under the License.
*/
import { Injectable } from 'angular2/core';
import { Response } from 'angular2/http';
import { Injectable } from '@angular/core';
import { Response } from '@angular/http';
import { Observable } from 'rxjs/Rx';
import { NodePaging, MinimalNodeEntity } from './../models/document-library.model';
import {

View File

@@ -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 {Injectable} from 'angular2/core';
import {Subject} from 'rxjs/Rx';
@Injectable()
export class ContextMenuService {
public show: Subject<{event: MouseEvent, obj: any[]}> = new Subject();
}
*/

View File

@@ -20,7 +20,7 @@ import {
describe,
expect,
beforeEach
} from 'angular2/testing';
} from '@angular/core/testing';
import {ContentActionHandler} from '../models/content-action.model';
import {DocumentActionsService} from './document-actions.service';
import {AlfrescoServiceMock} from '../assets/alfresco.service.mock';

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import {Injectable} from 'angular2/core';
import {Injectable} from '@angular/core';
import {ContentActionHandler} from '../models/content-action.model';
import {AlfrescoService} from './alfresco.service';
import {

View File

@@ -20,7 +20,7 @@ import {
describe,
expect,
beforeEach
} from 'angular2/testing';
} from '@angular/core/testing';
import {FolderActionsService} from './folder-actions.service';
import {ContentActionHandler} from '../models/content-action.model';

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import {Injectable} from 'angular2/core';
import {Injectable} from '@angular/core';
import {ContentActionHandler} from '../models/content-action.model';
import {AlfrescoService} from './alfresco.service';

View File

@@ -1,6 +1,7 @@
{
"ambientDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#5c182b9af717f73146399c2485f70f1e2ac0ff2b"
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
"jasmine": "registry:dt/jasmine#2.2.0+20160505161446",
"node": "registry:dt/node#4.0.0+20160509154515"
}
}

View File

@@ -11,16 +11,13 @@
<link rel="stylesheet" href="node_modules/material-design-icons/iconfont/material-icons.css">
<!-- 1. Load libraries -->
<!-- IE required polyfills, in this exact order -->
<script src="node_modules/es6-shim/es6-shim.min.js"></script>
<script src="node_modules/systemjs/dist/system-polyfills.js"></script>
<script src="node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
<!-- Polyfill(s) for older browsers -->
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/rxjs/bundles/Rx.js"></script>
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
<script src="node_modules/angular2/bundles/router.dev.js"></script>
<script src="node_modules/angular2/bundles/http.dev.js"></script>
<!-- Additional Alfresco libraries -->
<script src="node_modules/alfresco-js-api/bundle.js"></script>
<script src="systemjs.config.js"></script>

View File

@@ -44,23 +44,36 @@
"alfresco"
],
"dependencies": {
"angular2": "2.0.0-beta.15",
"es6-shim": "^0.35.0",
"material-design-icons": "^2.2.3",
"material-design-lite": "^1.1.3",
"ng2-alfresco-login": "^0.1.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"systemjs": "0.19.26",
"zone.js": "0.6.10"
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.1",
"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",
"angular2-in-memory-web-api": "0.0.11",
"material-design-icons": "^2.2.3",
"material-design-lite": "^1.1.3",
"alfresco-js-api": "^0.1.0",
"ng2-alfresco-core": "^0.1.0",
"ng2-alfresco-login": "^0.1.0",
"ng2-translate": "2.1.0"
},
"devDependencies": {
"browser-sync": "^2.10.0",
"connect-history-api-fallback": "^1.2.0",
"concurrently": "^2.0.0",
"tslint": "^3.8.1",
"typescript": "^1.8.10",
"typings": "^0.7.12"
"browser-sync": "^2.10.0",
"connect-history-api-fallback": "^1.2.0",
"concurrently": "^2.0.0",
"tslint": "^3.8.1",
"typescript": "^1.8.10",
"typings": "^1.0.4"
},
"publishConfig": {
"registry": "http://devproducts.alfresco.me:4873/"

View File

@@ -15,14 +15,21 @@
* limitations under the License.
*/
import { bootstrap } from 'angular2/platform/browser';
import { Component } from 'angular2/core';
import { Router, RouteConfig, ROUTER_DIRECTIVES } from 'angular2/router';
import { AlfrescoSettingsService, AlfrescoAuthenticationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
import { bootstrap } from '@angular/platform-browser-dynamic';
import { Component } from '@angular/core';
import {
Router,
RouteConfig,
ROUTER_PROVIDERS,
ROUTER_DIRECTIVES
} from '@angular/router-deprecated';
import { AlfrescoLoginComponent } from 'ng2-alfresco-login/dist/ng2-alfresco-login';
import { ROUTER_PROVIDERS } from 'angular2/router';
import { HTTP_PROVIDERS } from 'angular2/http';
import { ALFRESCO_CORE_PROVIDERS, AlfrescoTranslationService, AlfrescoTranslationLoader } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
import { HTTP_PROVIDERS } from '@angular/http';
import {
ALFRESCO_CORE_PROVIDERS,
AlfrescoSettingsService,
AlfrescoAuthenticationService
} from 'ng2-alfresco-core/dist/ng2-alfresco-core';
@RouteConfig([
@@ -69,8 +76,5 @@ export class AppComponent {
bootstrap(AppComponent, [
ROUTER_PROVIDERS,
HTTP_PROVIDERS,
AlfrescoTranslationLoader,
AlfrescoTranslationService,
AlfrescoAuthenticationService,
ALFRESCO_CORE_PROVIDERS
]);

View File

@@ -1,57 +1,55 @@
/**
* @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 configuration for Angular 2 samples
* Adjust as necessary for your application needs.
*/
(function (global) {
(function(global) {
// map tells the System loader where to look for things
var map = {
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core',
'ng2-alfresco-login': 'node_modules/ng2-alfresco-login',
'rxjs': 'node_modules/rxjs',
'angular2' : 'node_modules/angular2',
'ng2-translate': 'node_modules/ng2-translate',
'app': 'dist/main'
};
'app': 'dist', // 'dist',
'@angular': 'node_modules/@angular',
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
'rxjs': 'node_modules/rxjs',
'ng2-translate': 'node_modules/ng2-translate',
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core',
'ng2-alfresco-login': 'node_modules/ng2-alfresco-login'
};
// packages tells the System loader how to load when no filename and/or no extension
var packages = {
'src': {
defaultExtension: 'js'
},
'ng2-alfresco-core': {
defaultExtension: 'js'
},
'ng2-alfresco-login': {
defaultExtension: 'js'
},
'rxjs': {
defaultExtension: 'js'
},
'angular2': {
defaultExtension: 'js'
}
};
'app': { main: 'main.js', defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' },
'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
'ng2-translate': { defaultExtension: 'js' },
'ng2-alfresco-login': { defaultExtension: 'js' },
'ng2-alfresco-core': { defaultExtension: 'js' }
};
var ngPackageNames = [
'common',
'compiler',
'core',
'http',
'platform-browser',
'platform-browser-dynamic',
'router',
'router-deprecated',
'upgrade'
];
// Individual files (~300 requests):
function packIndex(pkgName) {
packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' };
}
// Bundled (~40 requests):
function packUmd(pkgName) {
packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' };
}
// Most environments should use UMD; some (Karma) need the individual index files
var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;
// Add package entries for angular packages
ngPackageNames.forEach(setPackageConfig);
var config = {
defaultJSExtensions: true,
map: map,
packages: packages
};
System.config(config);
})(this);

View File

@@ -1,9 +1,7 @@
{
"name": "angular2-testing",
"dependencies": {},
"devDependencies": {},
"ambientDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#dd638012d63e069f2c99d06ef4dcc9616a943ee4"
}
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
"jasmine": "registry:dt/jasmine#2.2.0+20160505161446",
"node": "registry:dt/node#4.0.0+20160509154515"
}
}

View File

@@ -18,8 +18,8 @@
"copy-html-css:w": "cpx './src/**/*.{html,css}' dist/src -w",
"copy-i18n": "cpx './i18n/**/*.json' dist/i18n",
"copy-i18n:w": "cpx './i18n/**/*.json' dist/i18n -w",
"copy-images": "cpx './src/assets/images/**/*.png' dist",
"copy-images:w": "cpx './src/assets/images/**/*.png' dist/src/assets/images -w",
"copy-images": "cpx './src/**/*.{png,jpg,gif,svg}' dist/src",
"copy-images:w": "cpx './src/**/*.{png,jpg,gif,svg}' dist/src -w",
"tsc": "tsc",
"tsc:w": "tsc -w",
"pretest": "npm run build",
@@ -62,19 +62,25 @@
"alfresco"
],
"dependencies": {
"angular2": "2.0.0-beta.15",
"es6-module-loader": "^0.17.8",
"es6-shim": "^0.35.0",
"ng2-alfresco-core": "^0.1.7",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"systemjs": "0.19.26",
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.1",
"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",
"angular2-in-memory-web-api": "0.0.11",
"ng2-alfresco-core": "^0.1.0",
"alfresco-core-rest-api": "^0.1.0",
"ng2-translate": "1.11.1"
},
"peerDependencies": {
"angular2": "2.0.0-beta.15"
"ng2-translate": "2.1.0"
},
"devDependencies": {
"concurrently": "^2.1.0",
@@ -93,7 +99,7 @@
"traceur": "^0.0.91",
"tslint": "^3.8.1",
"typescript": "^1.8.10",
"typings": "^0.7.12",
"typings": "^1.0.4",
"xo": "^0.14.0",
"yargs": "^4.7.0"
},

View File

@@ -15,13 +15,13 @@
* limitations under the License.
*/
import { Observable } from 'rxjs/Observable';
import { provide } from 'angular2/core';
import { Observable } from 'rxjs/Rx';
import { provide } from '@angular/core';
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
export class AuthenticationMock {
login(username: string, password: string) {
login(username: string, password: string): Observable<boolean> {
if (username === 'fake-username' && password === 'fake-password') {
return Observable.of(true);
} else {

View File

@@ -15,8 +15,8 @@
* limitations under the License.
*/
import { Observable } from 'rxjs/Observable';
import { EventEmitter } from 'angular2/core';
import { Observable } from 'rxjs/Rx';
import { EventEmitter } from '@angular/core';
export interface LangChangeEvent {
lang: string;

View File

@@ -15,6 +15,13 @@
* limitations under the License.
*/
describe('AlfrescoLogin', () => {
it('should be upgraded to angular 2.0.0-rc.1', () => {
expect(false).toBe(true);
});
});
/*
import { TEST_BROWSER_PLATFORM_PROVIDERS, TEST_BROWSER_APPLICATION_PROVIDERS } from 'angular2/platform/testing/browser';
import {
it,
@@ -26,8 +33,8 @@ import {
beforeEachProviders,
TestComponentBuilder,
setBaseTestProviders
} from 'angular2/testing';
import { provide } from 'angular2/core';
} from '@angular/core/testing';
import { provide } from '@angular/core';
import { Location, Router, RouteRegistry, ROUTER_PRIMARY_COMPONENT, Route } from 'angular2/router';
import { RootRouter } from 'angular2/src/router/router';
import { SpyLocation } from 'angular2/src/mock/location_mock';
@@ -399,3 +406,4 @@ describe('AlfrescoLogin', () => {
});
*/

View File

@@ -15,9 +15,9 @@
* limitations under the License.
*/
import { Component, Output, EventEmitter } from 'angular2/core';
import { Router, ROUTER_DIRECTIVES } from 'angular2/router';
import { FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators } from 'angular2/common';
import { Component, Output, EventEmitter } from '@angular/core';
import { Router, ROUTER_DIRECTIVES } from '@angular/router-deprecated';
import { FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators } from '@angular/common';
import {
AlfrescoTranslationService,
AlfrescoPipeTranslate,

View File

@@ -1,6 +1,7 @@
{
"ambientDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#5c182b9af717f73146399c2485f70f1e2ac0ff2b"
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
"jasmine": "registry:dt/jasmine#2.2.0+20160505161446",
"node": "registry:dt/node#4.0.0+20160509154515"
}
}

View File

@@ -11,48 +11,18 @@
<link rel="stylesheet" href="node_modules/material-design-icons/iconfont/material-icons.css">
<!-- 1. Load libraries -->
<!-- IE required polyfills, in this exact order -->
<script src="node_modules/es6-shim/es6-shim.min.js"></script>
<script src="node_modules/systemjs/dist/system-polyfills.js"></script>
<script src="node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
<!-- Polyfill(s) for older browsers -->
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/rxjs/bundles/Rx.js"></script>
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
<script src="node_modules/angular2/bundles/router.dev.js"></script>
<script src="node_modules/angular2/bundles/http.dev.js"></script>
<!-- Additional Alfresco libraries -->
<script src="node_modules/alfresco-js-api/bundle.js"></script>
<script src="systemjs.config.js"></script>
<script>
System.config({
defaultJSExtensions: true,
map: {
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core',
'ng2-alfresco-search': 'node_modules/ng2-alfresco-search',
'rxjs': 'node_modules/rxjs',
'angular2': 'node_modules/angular2',
'ng2-translate': 'node_modules/ng2-translate',
'src': 'src'
},
packages: {
'src': {
defaultExtension: 'js'
},
'ng2-alfresco-core': {
defaultExtension: 'js'
},
'ng2-alfresco-search': {
defaultExtension: 'js'
},
'rxjs': {
defaultExtension: 'js'
},
'angular2': {
defaultExtension: 'js'
}
}
});
System.import('dist/main').catch(console.log.bind(console));
System.import('app').catch(function(err){ console.error(err); });
</script>
</head>

View File

@@ -5,10 +5,11 @@
"author": "Alfresco Software, Ltd.",
"main": "index.js",
"scripts": {
"postinstall": "typings install",
"typings": "typings install",
"start": "npm install && npm run typings && concurrently \"npm run build:w\" \"npm run server\" ",
"server": "node browser-sync-config.js",
"build": "npm run tslint && rm -rf dist && tsc",
"build": "npm run tslint && rm -rf dist && tsc",
"build:w": "npm run tslint && rm -rf dist && tsc -w",
"tslint": "npm run tslint-src && npm run tslint-root",
"tslint-src": "tslint -c tslint.json src/**/*.ts",
@@ -44,15 +45,28 @@
"alfresco"
],
"dependencies": {
"angular2": "2.0.0-beta.15",
"es6-shim": "^0.35.0",
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.1",
"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",
"angular2-in-memory-web-api": "0.0.11",
"material-design-icons": "^2.2.3",
"material-design-lite": "^1.1.3",
"ng2-alfresco-search": "^0.1.12",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"systemjs": "0.19.26",
"zone.js": "0.6.10"
"ng2-translate": "2.1.0",
"alfresco-js-api": "^0.1.0",
"ng2-alfresco-core": "^0.1.0",
"ng2-alfresco-search": "^0.1.12"
},
"devDependencies": {
"browser-sync": "^2.10.0",
@@ -60,7 +74,7 @@
"concurrently": "^2.0.0",
"tslint": "^3.8.1",
"typescript": "^1.8.10",
"typings": "^0.7.12"
"typings": "^1.0.4"
},
"publishConfig": {
"registry": "http://devproducts.alfresco.me:4873/"

View File

@@ -15,9 +15,9 @@
* limitations under the License.
*/
import { Component, OnInit } from 'angular2/core';
import { bootstrap } from 'angular2/platform/browser';
import { HTTP_PROVIDERS } from 'angular2/http';
import { Component, OnInit } from '@angular/core';
import { bootstrap } from '@angular/platform-browser-dynamic';
import { HTTP_PROVIDERS } from '@angular/http';
import {
ALFRESCO_CORE_PROVIDERS,

View File

@@ -0,0 +1,55 @@
/**
* System configuration for Angular 2 samples
* Adjust as necessary for your application needs.
*/
(function(global) {
// map tells the System loader where to look for things
var map = {
'app': 'dist', // 'dist',
'@angular': 'node_modules/@angular',
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
'rxjs': 'node_modules/rxjs',
'ng2-translate': 'node_modules/ng2-translate',
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core',
'ng2-alfresco-search': 'node_modules/ng2-alfresco-search'
};
// packages tells the System loader how to load when no filename and/or no extension
var packages = {
'app': { main: 'main.js', defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' },
'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
'ng2-translate': { defaultExtension: 'js' },
'ng2-alfresco-core': { defaultExtension: 'js' },
'ng2-alfresco-search': { defaultExtension: 'js' }
};
var ngPackageNames = [
'common',
'compiler',
'core',
'http',
'platform-browser',
'platform-browser-dynamic',
'router',
'router-deprecated',
'upgrade'
];
// Individual files (~300 requests):
function packIndex(pkgName) {
packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' };
}
// Bundled (~40 requests):
function packUmd(pkgName) {
packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' };
}
// Most environments should use UMD; some (Karma) need the individual index files
var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;
// Add package entries for angular packages
ngPackageNames.forEach(setPackageConfig);
var config = {
map: map,
packages: packages
};
System.config(config);
})(this);

View File

@@ -1,19 +1,19 @@
{
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"removeComments": true,
"declaration": true,
"outDir": "dist"
},
"exclude": [
"dist",
"node_modules",
"typings/main",
"typings/main.d.ts"
]
"compilerOptions": {
"target": "ES5",
"module": "system",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"removeComments": true,
"declaration": true,
"outDir": "dist"
},
"exclude": [
"dist",
"node_modules",
"typings/main",
"typings/main.d.ts"
]
}

View File

@@ -1,6 +1,7 @@
{
"ambientDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#d594ef506d1efe2fea15f8f39099d19b39436b71"
}
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
"jasmine": "registry:dt/jasmine#2.2.0+20160505161446",
"node": "registry:dt/node#4.0.0+20160509154515"
}
}

View File

@@ -48,19 +48,25 @@
"alfresco"
],
"dependencies": {
"angular2": "2.0.0-beta.15",
"systemjs": "0.19.26",
"es6-shim": "^0.35.0",
"ng2-alfresco-core": "^0.1.25",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.1",
"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",
"es6-module-loader": "^0.17.8",
"angular2-in-memory-web-api": "0.0.11",
"alfresco-js-api": "^0.1.0",
"ng2-translate": "1.11.1"
},
"peerDependencies": {
"angular2": "2.0.0-beta.15"
"ng2-alfresco-core": "^0.1.25",
"ng2-translate": "2.1.0"
},
"devDependencies": {
"concurrently": "^2.1.0",
@@ -79,7 +85,7 @@
"traceur": "^0.0.91",
"tslint": "^3.8.1",
"typescript": "^1.8.10",
"typings": "^0.7.12"
"typings": "^1.0.4"
},
"license-check-config": {
"src": [

View File

@@ -15,8 +15,7 @@
* limitations under the License.
*/
import {Http} from 'angular2/http';
import {Observable} from 'rxjs/Observable';
import {Observable} from 'rxjs/Rx';
import {
AlfrescoSettingsService,

View File

@@ -1,6 +1,6 @@
<table *ngIf="results && results.length && searchTerm" class="mdl-data-table mdl-js-data-table mdl-shadow--2dp full-width">
<tbody>
<tr *ngFor="#result of results; #idx = index">
<tr *ngFor="let result of results; let idx = index">
<td><a href="#" (click)="onItemClick(result, $event)">{{result.entry.name}}</a></td>
</tr>
</tbody>

View File

@@ -15,7 +15,15 @@
* limitations under the License.
*/
import { Component, ElementRef, EventEmitter, Input, OnChanges, Output, Renderer } from 'angular2/core';
import {
Component,
ElementRef,
EventEmitter,
Input,
OnChanges,
Output,
Renderer
} from '@angular/core';
import { AlfrescoService } from './../services/alfresco.service';
import { AlfrescoPipeTranslate, AlfrescoTranslationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';

View File

@@ -15,8 +15,8 @@
* limitations under the License.
*/
import { Control, Validators } from 'angular2/common';
import { Component, Input, Output, EventEmitter, AfterViewInit } from 'angular2/core';
import { Control, Validators } from '@angular/common';
import { Component, Input, Output, EventEmitter, AfterViewInit } from '@angular/core';
import { AlfrescoPipeTranslate, AlfrescoTranslationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';

View File

@@ -19,7 +19,7 @@
</thead>
<tbody>
<tr *ngFor="#result of results; #idx = index">
<tr *ngFor="let result of results; let idx = index">
<td><img src="{{getDocumentThumbnailUrl(result)}}" /></td>
<td>{{result.entry.name}}</td>
<td>{{result.entry.modifiedByUser.displayName}}</td>

View File

@@ -15,8 +15,8 @@
* limitations under the License.
*/
import { Component, Input, Optional, OnChanges, OnInit } from 'angular2/core';
import { RouteParams } from 'angular2/router';
import { Component, Input, Optional, OnChanges, OnInit } from '@angular/core';
import { RouteParams } from '@angular/router-deprecated';
import { AlfrescoService } from './../services/alfresco.service';
import { AlfrescoPipeTranslate, AlfrescoTranslationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';

View File

@@ -15,8 +15,8 @@
* limitations under the License.
*/
import { Injectable } from 'angular2/core';
import { Observable } from 'rxjs/Observable';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Rx';
import {
AlfrescoSettingsService,

View File

@@ -1,6 +1,7 @@
{
"ambientDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#5c182b9af717f73146399c2485f70f1e2ac0ff2b"
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
"jasmine": "registry:dt/jasmine#2.2.0+20160505161446",
"node": "registry:dt/node#4.0.0+20160509154515"
}
}

View File

@@ -1,10 +1,19 @@
# http://editorconfig.org
root = true
[{src,scripts}/**.{ts,json,js}]
end_of_line = crlf
[*]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[package.json]
indent_style = space
indent_size = 2
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false

View File

@@ -11,17 +11,15 @@
<link rel="stylesheet" href="node_modules/material-design-icons/iconfont/material-icons.css">
<!-- 1. Load libraries -->
<!-- IE required polyfills, in this exact order -->
<script src="node_modules/es6-shim/es6-shim.min.js"></script>
<script src="node_modules/systemjs/dist/system-polyfills.js"></script>
<script src="node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
<!-- Polyfill(s) for older browsers -->
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/rxjs/bundles/Rx.js"></script>
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
<script src="node_modules/angular2/bundles/router.dev.js"></script>
<script src="node_modules/angular2/bundles/http.dev.js"></script>
<script src="node_modules/alfresco-core-rest-api/bundle.js"></script>
<!-- Additional Alfresco libraries -->
<script src="node_modules/alfresco-js-api/bundle.js"></script>
<script src="systemjs.config.js"></script>
<script>
@@ -34,4 +32,4 @@
<my-app></my-app>
</body>
</html>
</html>

View File

@@ -44,15 +44,28 @@
"alfresco"
],
"dependencies": {
"angular2": "2.0.0-beta.15",
"es6-shim": "^0.35.0",
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.1",
"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",
"angular2-in-memory-web-api": "0.0.11",
"material-design-icons": "^2.2.3",
"material-design-lite": "^1.1.3",
"ng2-alfresco-upload": "^0.1.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"systemjs": "0.19.26",
"zone.js": "0.6.10"
"alfresco-js-api": "^0.1.0",
"ng2-alfresco-core": "^0.1.0",
"ng2-translate": "2.1.0",
"ng2-alfresco-upload": "^0.1.0"
},
"devDependencies": {
"browser-sync": "^2.10.0",
@@ -60,7 +73,7 @@
"concurrently": "^2.0.0",
"tslint": "^3.8.1",
"typescript": "^1.8.10",
"typings": "^0.7.12"
"typings": "^1.0.4"
},
"publishConfig": {
"registry": "http://devproducts.alfresco.me:4873/"

View File

@@ -1,117 +1,117 @@
/*!
* @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 { Component, OnInit } from 'angular2/core';
import { bootstrap } from 'angular2/platform/browser';
import { HTTP_PROVIDERS } from 'angular2/http';
import {
ALFRESCO_CORE_PROVIDERS,
AlfrescoSettingsService,
AlfrescoAuthenticationService
} from 'ng2-alfresco-core/dist/ng2-alfresco-core';
import { ALFRESCO_ULPOAD_COMPONENTS, UploadService } from 'ng2-alfresco-upload/dist/ng2-alfresco-upload';
@Component({
selector: 'my-app',
template: `<label for="token"><b>Insert a valid access token / ticket:</b></label><br>
<input id="token" type="text" size="48" (change)="updateToken()" [(ngModel)]="token"><br>
<label for="token"><b>Insert the ip of your Alfresco instance:</b></label><br>
<input id="token" type="text" size="48" (change)="updateHost()" [(ngModel)]="host"><br><br>
<div *ngIf="!authenticated" style="color:#FF2323">
Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid token to perform
operations.
</div>
<hr>
<alfresco-upload-button [showUdoNotificationBar]="true"
[uploadFolders]="false"
[multipleFiles]="false"
(onSuccess)="customMethod($event)">
</alfresco-upload-button>
<br><br>
<alfresco-upload-button [showUdoNotificationBar]="true"
[uploadFolders]="true"
[multipleFiles]="false"
(onSuccess)="customMethod($event)">
</alfresco-upload-button>
<br><br>
<alfresco-upload-button [showUdoNotificationBar]="true"
[uploadFolders]="false"
[multipleFiles]="true"
(onSuccess)="customMethod($event)">
</alfresco-upload-button>
<br><br>
<alfresco-upload-drag-area (onSuccess)="customMethod($event)" >
<div style="width: 200px; height: 100px; border: 1px solid #888888">
DRAG HERE
</div>
</alfresco-upload-drag-area>
<file-uploading-dialog></file-uploading-dialog>
`,
directives: [ALFRESCO_ULPOAD_COMPONENTS]
})
export class MyDemoApp implements OnInit {
authenticated: boolean;
host: string = 'http://192.168.99.100:8080';
token: string;
constructor(private authService: AlfrescoAuthenticationService, private alfrescoSettingsService: AlfrescoSettingsService) {
alfrescoSettingsService.host = this.host;
if (localStorage.getItem('token')) {
this.token = localStorage.getItem('token');
}
}
public updateToken(): void {
localStorage.setItem('token', this.token);
}
public updateHost(): void {
this.alfrescoSettingsService.host = this.host;
/*!
* @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 { Component, OnInit } from '@angular/core';
import { bootstrap } from '@angular/platform-browser-dynamic';
import { HTTP_PROVIDERS } from '@angular/http';
import {
ALFRESCO_CORE_PROVIDERS,
AlfrescoSettingsService,
AlfrescoAuthenticationService
} from 'ng2-alfresco-core/dist/ng2-alfresco-core';
import { ALFRESCO_ULPOAD_COMPONENTS, UploadService } from 'ng2-alfresco-upload/dist/ng2-alfresco-upload';
@Component({
selector: 'my-app',
template: `<label for="token"><b>Insert a valid access token / ticket:</b></label><br>
<input id="token" type="text" size="48" (change)="updateToken()" [(ngModel)]="token"><br>
<label for="token"><b>Insert the ip of your Alfresco instance:</b></label><br>
<input id="token" type="text" size="48" (change)="updateHost()" [(ngModel)]="host"><br><br>
<div *ngIf="!authenticated" style="color:#FF2323">
Authentication failed to ip {{ host }} with user: admin, admin, you can still try to add a valid token to perform
operations.
</div>
<hr>
<alfresco-upload-button [showUdoNotificationBar]="true"
[uploadFolders]="false"
[multipleFiles]="false"
(onSuccess)="customMethod($event)">
</alfresco-upload-button>
<br><br>
<alfresco-upload-button [showUdoNotificationBar]="true"
[uploadFolders]="true"
[multipleFiles]="false"
(onSuccess)="customMethod($event)">
</alfresco-upload-button>
<br><br>
<alfresco-upload-button [showUdoNotificationBar]="true"
[uploadFolders]="false"
[multipleFiles]="true"
(onSuccess)="customMethod($event)">
</alfresco-upload-button>
<br><br>
<alfresco-upload-drag-area (onSuccess)="customMethod($event)" >
<div style="width: 200px; height: 100px; border: 1px solid #888888">
DRAG HERE
</div>
</alfresco-upload-drag-area>
<file-uploading-dialog></file-uploading-dialog>
`,
directives: [ALFRESCO_ULPOAD_COMPONENTS]
})
export class MyDemoApp implements OnInit {
authenticated: boolean;
host: string = 'http://192.168.99.100:8080';
token: string;
constructor(private authService: AlfrescoAuthenticationService, private alfrescoSettingsService: AlfrescoSettingsService) {
alfrescoSettingsService.host = this.host;
if (localStorage.getItem('token')) {
this.token = localStorage.getItem('token');
}
}
public updateToken(): void {
localStorage.setItem('token', this.token);
}
public updateHost(): void {
this.alfrescoSettingsService.host = this.host;
this.login();
}
public customMethod(event: Object): void {
console.log('File uploaded');
}
public ngOnInit(): void {
this.login();
}
public login(): void {
this.authService.login('admin', 'admin').subscribe(token => {
this.authenticated = true;
});
}
}
bootstrap(MyDemoApp, [
HTTP_PROVIDERS,
ALFRESCO_CORE_PROVIDERS,
UploadService
]);
}
public customMethod(event: Object): void {
console.log('File uploaded');
}
public ngOnInit(): void {
this.login();
}
public login(): void {
this.authService.login('admin', 'admin').subscribe(token => {
this.authenticated = true;
});
}
}
bootstrap(MyDemoApp, [
HTTP_PROVIDERS,
ALFRESCO_CORE_PROVIDERS,
UploadService
]);

View File

@@ -1,57 +1,55 @@
/**
* @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 configuration for Angular 2 samples
* Adjust as necessary for your application needs.
*/
(function (global) {
(function(global) {
// map tells the System loader where to look for things
var map = {
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core',
'ng2-alfresco-upload': 'node_modules/ng2-alfresco-upload',
'rxjs': 'node_modules/rxjs',
'angular2': 'node_modules/angular2',
'ng2-translate': 'node_modules/ng2-translate',
'app': 'dist/main'
};
'app': 'dist', // 'dist',
'@angular': 'node_modules/@angular',
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
'rxjs': 'node_modules/rxjs',
'ng2-translate': 'node_modules/ng2-translate',
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core',
'ng2-alfresco-upload': 'node_modules/ng2-alfresco-upload'
};
// packages tells the System loader how to load when no filename and/or no extension
var packages = {
'src': {
defaultExtension: 'js'
},
'ng2-alfresco-core': {
defaultExtension: 'js'
},
'ng2-alfresco-upload': {
defaultExtension: 'js'
},
'rxjs': {
defaultExtension: 'js'
},
'angular2': {
defaultExtension: 'js'
}
};
'app': { main: 'main.js', defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' },
'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
'ng2-translate': { defaultExtension: 'js' },
'ng2-alfresco-core': { defaultExtension: 'js' },
'ng2-alfresco-upload': { defaultExtension: 'js' }
};
var ngPackageNames = [
'common',
'compiler',
'core',
'http',
'platform-browser',
'platform-browser-dynamic',
'router',
'router-deprecated',
'upgrade'
];
// Individual files (~300 requests):
function packIndex(pkgName) {
packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' };
}
// Bundled (~40 requests):
function packUmd(pkgName) {
packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' };
}
// Most environments should use UMD; some (Karma) need the individual index files
var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;
// Add package entries for angular packages
ngPackageNames.forEach(setPackageConfig);
var config = {
defaultJSExtensions: true,
map: map,
packages: packages
};
System.config(config);
})(this);

View File

@@ -1,6 +1,7 @@
{
"ambientDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#d594ef506d1efe2fea15f8f39099d19b39436b71"
}
"globalDependencies": {
"core-js": "registry:dt/core-js#0.0.0+20160317120654",
"jasmine": "registry:dt/jasmine#2.2.0+20160505161446",
"node": "registry:dt/node#4.0.0+20160509154515"
}
}

View File

@@ -43,6 +43,10 @@
{
"name": "Eugenio Romano",
"email": "eugenio.romano@alfresco.com"
},
{
"name": "Denys Vuika",
"email": "denys.vuika@gmail.com"
}
],
"keywords": [
@@ -53,19 +57,25 @@
"alfresco"
],
"dependencies": {
"alfresco-core-rest-api": "^0.1.0",
"angular2": "2.0.0-beta.15",
"es6-module-loader": "^0.17.8",
"es6-shim": "^0.35.0",
"ng2-alfresco-core": "^0.1.0",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.2",
"systemjs": "0.19.26",
"@angular/common": "2.0.0-rc.1",
"@angular/compiler": "2.0.0-rc.1",
"@angular/core": "2.0.0-rc.1",
"@angular/http": "2.0.0-rc.1",
"@angular/platform-browser": "2.0.0-rc.1",
"@angular/platform-browser-dynamic": "2.0.0-rc.1",
"@angular/router": "2.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.1",
"@angular/upgrade": "2.0.0-rc.1",
"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",
"ng2-translate": "1.11.1"
},
"peerDependencies": {
"angular2": "2.0.0-beta.15"
"angular2-in-memory-web-api": "0.0.11",
"alfresco-core-rest-api": "^0.1.0",
"ng2-alfresco-core": "^0.1.0",
"ng2-translate": "2.1.0"
},
"devDependencies": {
"concurrently": "^2.1.0",
@@ -86,7 +96,7 @@
"traceur": "^0.0.91",
"tslint": "^3.8.1",
"typescript": "^1.8.10",
"typings": "^0.7.12"
"typings": "^1.0.4"
},
"license-check-config": {
"src": [

View File

@@ -15,8 +15,8 @@
* limitations under the License.
*/
import { Observable } from 'rxjs/Observable';
import { EventEmitter } from 'angular2/core';
import { Observable } from 'rxjs/Rx';
import { EventEmitter } from '@angular/core';
export interface LangChangeEvent {
lang: string;

View File

@@ -15,6 +15,15 @@
* limitations under the License.
*/
import { describe, it, expect } from '@angular/core/testing';
describe('FileUploadDialog', () => {
it ('should be migrated to angular 2 rc.1', () => {
expect(false).toBe(true);
});
});
/*
import { TEST_BROWSER_PLATFORM_PROVIDERS, TEST_BROWSER_APPLICATION_PROVIDERS } from 'angular2/platform/testing/browser';
import { it, describe, expect, injectAsync, beforeEachProviders, TestComponentBuilder, setBaseTestProviders } from 'angular2/testing';
import { provide } from 'angular2/core';
@@ -53,3 +62,4 @@ describe('FileUploadDialog', () => {
});
}));
});
*/

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component, ChangeDetectorRef, OnInit } from 'angular2/core';
import { Component, ChangeDetectorRef, OnInit } from '@angular/core';
import { FileModel } from '../models/file.model';
import { FileUploadingListComponent } from './file-uploading-list.component';
import { AlfrescoTranslationService, AlfrescoPipeTranslate } from 'ng2-alfresco-core/dist/ng2-alfresco-core';

Some files were not shown because too many files have changed in this diff Show More