Upgrade Search to angular 2.0.0-rc.1

This commit is contained in:
Denys Vuika
2016-06-14 10:24:06 +01:00
parent b97d5d0e22
commit 91cb3bf906
14 changed files with 146 additions and 94 deletions

View File

@@ -11,48 +11,18 @@
<link rel="stylesheet" href="node_modules/material-design-icons/iconfont/material-icons.css"> <link rel="stylesheet" href="node_modules/material-design-icons/iconfont/material-icons.css">
<!-- 1. Load libraries --> <!-- 1. Load libraries -->
<!-- IE required polyfills, in this exact order --> <!-- Polyfill(s) for older browsers -->
<script src="node_modules/es6-shim/es6-shim.min.js"></script> <script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/systemjs/dist/system-polyfills.js"></script> <script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script> <script src="node_modules/reflect-metadata/Reflect.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/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> <!-- Additional Alfresco libraries -->
<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-js-api/bundle.js"></script> <script src="node_modules/alfresco-js-api/bundle.js"></script>
<script src="systemjs.config.js"></script>
<script> <script>
System.config({ System.import('app').catch(function(err){ console.error(err); });
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));
</script> </script>
</head> </head>

View File

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

View File

@@ -15,9 +15,9 @@
* limitations under the License. * limitations under the License.
*/ */
import { Component, OnInit } from 'angular2/core'; import { Component, OnInit } from '@angular/core';
import { bootstrap } from 'angular2/platform/browser'; import { bootstrap } from '@angular/platform-browser-dynamic';
import { HTTP_PROVIDERS } from 'angular2/http'; import { HTTP_PROVIDERS } from '@angular/http';
import { import {
ALFRESCO_CORE_PROVIDERS, 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": { "compilerOptions": {
"target": "es5", "target": "ES5",
"module": "system", "module": "system",
"moduleResolution": "node", "moduleResolution": "node",
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"sourceMap": true, "sourceMap": true,
"removeComments": true, "removeComments": true,
"declaration": true, "declaration": true,
"outDir": "dist" "outDir": "dist"
}, },
"exclude": [ "exclude": [
"dist", "dist",
"node_modules", "node_modules",
"typings/main", "typings/main",
"typings/main.d.ts" "typings/main.d.ts"
] ]
} }

View File

@@ -1,6 +1,6 @@
{ {
"ambientDependencies": { "ambientDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#4de74cb527395c13ba20b438c3a7a419ad931f1c", "es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd",
"jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#d594ef506d1efe2fea15f8f39099d19b39436b71" "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#5c182b9af717f73146399c2485f70f1e2ac0ff2b"
} }
} }

View File

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

View File

@@ -15,8 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import {Http} from 'angular2/http'; import {Observable} from 'rxjs/Rx';
import {Observable} from 'rxjs/Observable';
import { import {
AlfrescoSettingsService, 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"> <table *ngIf="results && results.length && searchTerm" class="mdl-data-table mdl-js-data-table mdl-shadow--2dp full-width">
<tbody> <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> <td><a href="#" (click)="onItemClick(result, $event)">{{result.entry.name}}</a></td>
</tr> </tr>
</tbody> </tbody>

View File

@@ -15,7 +15,15 @@
* limitations under the License. * 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 { AlfrescoService } from './../services/alfresco.service';
import { AlfrescoPipeTranslate, AlfrescoTranslationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core'; import { AlfrescoPipeTranslate, AlfrescoTranslationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';

View File

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

View File

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

View File

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

View File

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