mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Upgrade Login to angular 2.0.0-rc.1
This commit is contained in:
@@ -11,16 +11,13 @@
|
|||||||
<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 src="systemjs.config.js"></script>
|
||||||
|
@@ -44,15 +44,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",
|
||||||
|
"alfresco-js-api": "^0.1.0",
|
||||||
|
"ng2-alfresco-core": "^0.1.0",
|
||||||
"ng2-alfresco-login": "^0.1.0",
|
"ng2-alfresco-login": "^0.1.0",
|
||||||
"reflect-metadata": "0.1.2",
|
"ng2-translate": "2.1.0"
|
||||||
"rxjs": "5.0.0-beta.2",
|
|
||||||
"systemjs": "0.19.26",
|
|
||||||
"zone.js": "0.6.10"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"browser-sync": "^2.10.0",
|
"browser-sync": "^2.10.0",
|
||||||
@@ -60,7 +73,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/"
|
||||||
|
@@ -15,14 +15,21 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { bootstrap } from 'angular2/platform/browser';
|
import { bootstrap } from '@angular/platform-browser-dynamic';
|
||||||
import { Component } from 'angular2/core';
|
import { Component } from '@angular/core';
|
||||||
import { Router, RouteConfig, ROUTER_DIRECTIVES } from 'angular2/router';
|
import {
|
||||||
import { AlfrescoSettingsService, AlfrescoAuthenticationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
|
Router,
|
||||||
|
RouteConfig,
|
||||||
|
ROUTER_PROVIDERS,
|
||||||
|
ROUTER_DIRECTIVES
|
||||||
|
} from '@angular/router-deprecated';
|
||||||
import { AlfrescoLoginComponent } from 'ng2-alfresco-login/dist/ng2-alfresco-login';
|
import { AlfrescoLoginComponent } from 'ng2-alfresco-login/dist/ng2-alfresco-login';
|
||||||
import { ROUTER_PROVIDERS } from 'angular2/router';
|
import { HTTP_PROVIDERS } from '@angular/http';
|
||||||
import { HTTP_PROVIDERS } from 'angular2/http';
|
import {
|
||||||
import { ALFRESCO_CORE_PROVIDERS, AlfrescoTranslationService, AlfrescoTranslationLoader } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
|
ALFRESCO_CORE_PROVIDERS,
|
||||||
|
AlfrescoSettingsService,
|
||||||
|
AlfrescoAuthenticationService
|
||||||
|
} from 'ng2-alfresco-core/dist/ng2-alfresco-core';
|
||||||
|
|
||||||
|
|
||||||
@RouteConfig([
|
@RouteConfig([
|
||||||
@@ -69,8 +76,5 @@ export class AppComponent {
|
|||||||
bootstrap(AppComponent, [
|
bootstrap(AppComponent, [
|
||||||
ROUTER_PROVIDERS,
|
ROUTER_PROVIDERS,
|
||||||
HTTP_PROVIDERS,
|
HTTP_PROVIDERS,
|
||||||
AlfrescoTranslationLoader,
|
|
||||||
AlfrescoTranslationService,
|
|
||||||
AlfrescoAuthenticationService,
|
|
||||||
ALFRESCO_CORE_PROVIDERS
|
ALFRESCO_CORE_PROVIDERS
|
||||||
]);
|
]);
|
||||||
|
@@ -1,57 +1,55 @@
|
|||||||
/**
|
/**
|
||||||
* @license
|
* System configuration for Angular 2 samples
|
||||||
* Copyright 2016 Alfresco Software, Ltd.
|
* Adjust as necessary for your application needs.
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*/
|
*/
|
||||||
|
(function(global) {
|
||||||
(function (global) {
|
|
||||||
|
|
||||||
// map tells the System loader where to look for things
|
// map tells the System loader where to look for things
|
||||||
var map = {
|
var map = {
|
||||||
'ng2-alfresco-core': 'node_modules/ng2-alfresco-core',
|
'app': 'dist', // 'dist',
|
||||||
'ng2-alfresco-login': 'node_modules/ng2-alfresco-login',
|
'@angular': 'node_modules/@angular',
|
||||||
|
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
|
||||||
'rxjs': 'node_modules/rxjs',
|
'rxjs': 'node_modules/rxjs',
|
||||||
'angular2' : 'node_modules/angular2',
|
|
||||||
'ng2-translate': 'node_modules/ng2-translate',
|
|
||||||
'app': 'dist/main'
|
|
||||||
};
|
|
||||||
|
|
||||||
|
'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
|
// packages tells the System loader how to load when no filename and/or no extension
|
||||||
var packages = {
|
var packages = {
|
||||||
'src': {
|
'app': { main: 'main.js', defaultExtension: 'js' },
|
||||||
defaultExtension: 'js'
|
'rxjs': { defaultExtension: 'js' },
|
||||||
},
|
'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
|
||||||
'ng2-alfresco-core': {
|
|
||||||
defaultExtension: 'js'
|
|
||||||
},
|
|
||||||
'ng2-alfresco-login': {
|
|
||||||
defaultExtension: 'js'
|
|
||||||
},
|
|
||||||
'rxjs': {
|
|
||||||
defaultExtension: 'js'
|
|
||||||
},
|
|
||||||
'angular2': {
|
|
||||||
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 = {
|
var config = {
|
||||||
defaultJSExtensions: true,
|
|
||||||
map: map,
|
map: map,
|
||||||
packages: packages
|
packages: packages
|
||||||
};
|
};
|
||||||
|
|
||||||
System.config(config);
|
System.config(config);
|
||||||
|
|
||||||
})(this);
|
})(this);
|
||||||
|
@@ -18,8 +18,8 @@
|
|||||||
"copy-html-css:w": "cpx './src/**/*.{html,css}' dist/src -w",
|
"copy-html-css:w": "cpx './src/**/*.{html,css}' dist/src -w",
|
||||||
"copy-i18n": "cpx './i18n/**/*.json' dist/i18n",
|
"copy-i18n": "cpx './i18n/**/*.json' dist/i18n",
|
||||||
"copy-i18n:w": "cpx './i18n/**/*.json' dist/i18n -w",
|
"copy-i18n:w": "cpx './i18n/**/*.json' dist/i18n -w",
|
||||||
"copy-images": "cpx './src/assets/images/**/*.png' dist",
|
"copy-images": "cpx './src/**/*.{png,jpg,gif,svg}' dist/src",
|
||||||
"copy-images:w": "cpx './src/assets/images/**/*.png' dist/src/assets/images -w",
|
"copy-images:w": "cpx './src/**/*.{png,jpg,gif,svg}' dist/src -w",
|
||||||
"tsc": "tsc",
|
"tsc": "tsc",
|
||||||
"tsc:w": "tsc -w",
|
"tsc:w": "tsc -w",
|
||||||
"pretest": "npm run build",
|
"pretest": "npm run build",
|
||||||
@@ -62,19 +62,25 @@
|
|||||||
"alfresco"
|
"alfresco"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular2": "2.0.0-beta.15",
|
"@angular/common": "2.0.0-rc.1",
|
||||||
"es6-module-loader": "^0.17.8",
|
"@angular/compiler": "2.0.0-rc.1",
|
||||||
"es6-shim": "^0.35.0",
|
"@angular/core": "2.0.0-rc.1",
|
||||||
"ng2-alfresco-core": "^0.1.7",
|
"@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",
|
||||||
"systemjs": "0.19.26",
|
"@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",
|
||||||
|
"angular2-in-memory-web-api": "0.0.11",
|
||||||
|
|
||||||
|
"ng2-alfresco-core": "^0.1.0",
|
||||||
"alfresco-core-rest-api": "^0.1.0",
|
"alfresco-core-rest-api": "^0.1.0",
|
||||||
"ng2-translate": "1.11.1"
|
"ng2-translate": "2.1.0"
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"angular2": "2.0.0-beta.15"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"concurrently": "^2.1.0",
|
"concurrently": "^2.1.0",
|
||||||
@@ -93,7 +99,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",
|
||||||
"xo": "^0.14.0",
|
"xo": "^0.14.0",
|
||||||
"yargs": "^4.7.0"
|
"yargs": "^4.7.0"
|
||||||
},
|
},
|
||||||
|
@@ -15,13 +15,13 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Rx';
|
||||||
import { provide } from 'angular2/core';
|
import { provide } from '@angular/core';
|
||||||
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
|
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
|
||||||
|
|
||||||
export class AuthenticationMock {
|
export class AuthenticationMock {
|
||||||
|
|
||||||
login(username: string, password: string) {
|
login(username: string, password: string): Observable<boolean> {
|
||||||
if (username === 'fake-username' && password === 'fake-password') {
|
if (username === 'fake-username' && password === 'fake-password') {
|
||||||
return Observable.of(true);
|
return Observable.of(true);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -15,8 +15,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
import { Observable } from 'rxjs/Rx';
|
||||||
import { EventEmitter } from 'angular2/core';
|
import { EventEmitter } from '@angular/core';
|
||||||
|
|
||||||
export interface LangChangeEvent {
|
export interface LangChangeEvent {
|
||||||
lang: string;
|
lang: string;
|
||||||
|
@@ -15,6 +15,13 @@
|
|||||||
* limitations under the License.
|
* 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 { TEST_BROWSER_PLATFORM_PROVIDERS, TEST_BROWSER_APPLICATION_PROVIDERS } from 'angular2/platform/testing/browser';
|
||||||
import {
|
import {
|
||||||
it,
|
it,
|
||||||
@@ -26,8 +33,8 @@ import {
|
|||||||
beforeEachProviders,
|
beforeEachProviders,
|
||||||
TestComponentBuilder,
|
TestComponentBuilder,
|
||||||
setBaseTestProviders
|
setBaseTestProviders
|
||||||
} from 'angular2/testing';
|
} from '@angular/core/testing';
|
||||||
import { provide } from 'angular2/core';
|
import { provide } from '@angular/core';
|
||||||
import { Location, Router, RouteRegistry, ROUTER_PRIMARY_COMPONENT, Route } from 'angular2/router';
|
import { Location, Router, RouteRegistry, ROUTER_PRIMARY_COMPONENT, Route } from 'angular2/router';
|
||||||
import { RootRouter } from 'angular2/src/router/router';
|
import { RootRouter } from 'angular2/src/router/router';
|
||||||
import { SpyLocation } from 'angular2/src/mock/location_mock';
|
import { SpyLocation } from 'angular2/src/mock/location_mock';
|
||||||
@@ -399,3 +406,4 @@ describe('AlfrescoLogin', () => {
|
|||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
|
@@ -15,9 +15,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, Output, EventEmitter } from 'angular2/core';
|
import { Component, Output, EventEmitter } from '@angular/core';
|
||||||
import { Router, ROUTER_DIRECTIVES } from 'angular2/router';
|
import { Router, ROUTER_DIRECTIVES } from '@angular/router-deprecated';
|
||||||
import { FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators } from 'angular2/common';
|
import { FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators } from '@angular/common';
|
||||||
import {
|
import {
|
||||||
AlfrescoTranslationService,
|
AlfrescoTranslationService,
|
||||||
AlfrescoPipeTranslate,
|
AlfrescoPipeTranslate,
|
||||||
|
Reference in New Issue
Block a user