mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
#103 moved auth service to core library
This commit is contained in:
parent
48fe2264d3
commit
cdb7a0a359
@ -20,9 +20,13 @@ import { ControlGroup, FormBuilder, Validators } from 'angular2/common';
|
||||
import { Router, RouteConfig, ROUTER_DIRECTIVES } from 'angular2/router';
|
||||
import { MDL } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
|
||||
import { FilesComponent } from './components/files/files.component';
|
||||
import { AlfrescoAuthenticationService } from 'ng2-alfresco-login/dist/ng2-alfresco-login';
|
||||
import { AuthRouterOutlet } from './components/router/AuthRouterOutlet';
|
||||
import { AlfrescoSettingsService, AlfrescoTranslationService, AlfrescoPipeTranslate } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
|
||||
import {
|
||||
AlfrescoSettingsService,
|
||||
AlfrescoTranslationService,
|
||||
AlfrescoPipeTranslate,
|
||||
AlfrescoAuthenticationService
|
||||
} from 'ng2-alfresco-core/dist/ng2-alfresco-core';
|
||||
import { UploadButtonComponent } from 'ng2-alfresco-upload/dist/ng2-alfresco-upload';
|
||||
import { DataTableDemoComponent } from './components/datatable/datatable-demo.component';
|
||||
import { AlfrescoSearchComponent } from 'ng2-alfresco-search/dist/ng2-alfresco-search';
|
||||
|
@ -1,4 +1,4 @@
|
||||
/**
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2016 Alfresco Software, Ltd.
|
||||
*
|
||||
@ -14,9 +14,10 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ElementRef, DynamicComponentLoader, Directive, Attribute } from 'angular2/core';
|
||||
import { Router, RouterOutlet, ComponentInstruction } from 'angular2/router';
|
||||
import { AlfrescoAuthenticationService } from 'ng2-alfresco-login/dist/ng2-alfresco-login';
|
||||
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
|
||||
|
||||
@Directive({selector: 'auth-router-outlet'})
|
||||
export class AuthRouterOutlet extends RouterOutlet {
|
||||
|
@ -19,15 +19,12 @@ import { bootstrap } from 'angular2/platform/browser';
|
||||
import { AppComponent } from './app.component';
|
||||
import { ROUTER_PROVIDERS } from 'angular2/router';
|
||||
import { HTTP_PROVIDERS } from 'angular2/http';
|
||||
import { ALFRESCO_AUTHENTICATION } from 'ng2-alfresco-login/dist/ng2-alfresco-login';
|
||||
import { ALFRESCO_CORE_PROVIDERS, AlfrescoTranslationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
|
||||
import { ALFRESCO_CORE_PROVIDERS } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
|
||||
import { UploadService } from 'ng2-alfresco-upload/dist/ng2-alfresco-upload';
|
||||
|
||||
bootstrap(AppComponent, [
|
||||
ROUTER_PROVIDERS,
|
||||
HTTP_PROVIDERS,
|
||||
AlfrescoTranslationService,
|
||||
ALFRESCO_AUTHENTICATION,
|
||||
ALFRESCO_CORE_PROVIDERS,
|
||||
UploadService
|
||||
]);
|
||||
|
@ -15,28 +15,21 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import {AlfrescoSettingsService} from './src/services/AlfrescoSettingsService.service';
|
||||
import {AlfrescoTranslationLoader} from './src/services/AlfrescoTranslationLoader.service';
|
||||
import {AlfrescoTranslationService} from './src/services/AlfrescoTranslationService.service';
|
||||
import {AlfrescoPipeTranslate} from './src/services/AlfrescoPipeTranslate.service';
|
||||
import { AlfrescoAuthenticationService } from './src/services/alfresco-authentication.service';
|
||||
|
||||
export * from './src/services/AlfrescoSettingsService.service';
|
||||
export * from './src/services/AlfrescoTranslationLoader.service';
|
||||
export * from './src/services/AlfrescoTranslationService.service';
|
||||
export * from './src/services/AlfrescoPipeTranslate.service';
|
||||
export * from './src/material/MaterialDesignLiteUpgradeElement';
|
||||
|
||||
export default {
|
||||
providers: [
|
||||
AlfrescoSettingsService,
|
||||
AlfrescoTranslationLoader,
|
||||
AlfrescoTranslationService,
|
||||
AlfrescoPipeTranslate
|
||||
]
|
||||
};
|
||||
export * from './src/services/alfresco-authentication.service';
|
||||
|
||||
export const ALFRESCO_CORE_PROVIDERS: [any] = [
|
||||
AlfrescoAuthenticationService,
|
||||
AlfrescoSettingsService,
|
||||
AlfrescoTranslationLoader,
|
||||
AlfrescoTranslationService,
|
||||
|
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { it, describe } from 'angular2/testing';
|
||||
import { it, describe, beforeEach } from 'angular2/testing';
|
||||
import { provide, Injector } from 'angular2/core';
|
||||
import { Http, HTTP_PROVIDERS, XHRBackend, Response, ResponseOptions } from 'angular2/http';
|
||||
import { MockBackend } from 'angular2/http/testing';
|
@ -19,8 +19,6 @@ import { Injectable } from 'angular2/core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { Http, Headers, Response } from 'angular2/http';
|
||||
|
||||
declare let xml2json: any;
|
||||
|
||||
/**
|
||||
* The AlfrescoAuthenticationService provide the login service and store the token in the localStorage
|
||||
*/
|
@ -16,15 +16,7 @@
|
||||
*/
|
||||
|
||||
import { AlfrescoLoginComponent } from './src/components/alfresco-login.component';
|
||||
import { AlfrescoAuthenticationService } from './src/services/alfresco-authentication.service';
|
||||
|
||||
export * from './src/components/alfresco-login.component';
|
||||
export * from './src/services/alfresco-authentication.service';
|
||||
|
||||
export default {
|
||||
directives: [AlfrescoLoginComponent],
|
||||
providers: [AlfrescoAuthenticationService]
|
||||
};
|
||||
|
||||
export const ALFRESCO_LOGIN_DIRECTIVES: [any] = [AlfrescoLoginComponent];
|
||||
export const ALFRESCO_AUTHENTICATION: [any] = [AlfrescoAuthenticationService];
|
||||
|
@ -17,8 +17,7 @@
|
||||
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { provide } from 'angular2/core';
|
||||
|
||||
import { AlfrescoAuthenticationService } from './../services/alfresco-authentication.service';
|
||||
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
|
||||
|
||||
export class AuthenticationMock {
|
||||
|
||||
|
@ -18,8 +18,12 @@
|
||||
import { Component, Output, EventEmitter } from 'angular2/core';
|
||||
import { Router, ROUTER_DIRECTIVES } from 'angular2/router';
|
||||
import { FORM_DIRECTIVES, ControlGroup, FormBuilder, Validators } from 'angular2/common';
|
||||
import { AlfrescoAuthenticationService } from './../services/alfresco-authentication.service';
|
||||
import { AlfrescoTranslationService, AlfrescoPipeTranslate } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
|
||||
import {
|
||||
AlfrescoTranslationService,
|
||||
AlfrescoPipeTranslate,
|
||||
AlfrescoAuthenticationService
|
||||
} from 'ng2-alfresco-core/dist/ng2-alfresco-core';
|
||||
|
||||
declare let componentHandler: any;
|
||||
declare let __moduleName: string;
|
||||
|
||||
@ -52,6 +56,7 @@ export class AlfrescoLoginComponent {
|
||||
* @param _fb
|
||||
* @param auth
|
||||
* @param router
|
||||
* @param translate
|
||||
*/
|
||||
constructor(private _fb: FormBuilder,
|
||||
public auth: AlfrescoAuthenticationService,
|
||||
|
Loading…
x
Reference in New Issue
Block a user