#1471 rollback className change (#1472)

This commit is contained in:
Mario Romano
2017-01-16 11:49:43 +00:00
committed by Denys Vuika
parent 473241f792
commit 9655e51943
119 changed files with 356 additions and 494 deletions

View File

@@ -22,23 +22,18 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { TranslateModule, TranslateLoader } from 'ng2-translate/ng2-translate';
import {
AuthService,
ContentService,
SettingsService,
AlfrescoAuthenticationService,
AlfrescoContentService,
AlfrescoSettingsService,
StorageService,
AlfrescoApiService,
AlfrescoTranslateLoader,
AlfrescoTranslateService,
AlfrescoTranslationService,
RenditionsService,
AuthGuard,
AuthGuardEcm,
AuthGuardBpm,
LogService, LogServiceMock,
/** @deprecated */ AlfrescoSettingsService,
/** @deprecated */ AlfrescoTranslationService,
/** @deprecated */ AlfrescoAuthenticationService,
/** @deprecated */ AlfrescoContentService
LogService, LogServiceMock
} from './src/services/index';
import { MATERIAL_DESIGN_DIRECTIVES } from './src/components/material/index';
@@ -50,23 +45,18 @@ export * from './src/utils/index';
export const ALFRESCO_CORE_PROVIDERS: any[] = [
LogService, LogServiceMock,
AuthService,
ContentService,
SettingsService,
AlfrescoAuthenticationService,
AlfrescoContentService,
AlfrescoSettingsService,
StorageService,
AlfrescoApiService,
AlfrescoTranslateLoader,
AlfrescoTranslateService,
AlfrescoTranslationService,
RenditionsService,
AuthGuard,
AuthGuardEcm,
AuthGuardBpm,
...CONTEXT_MENU_PROVIDERS,
/** @deprecated */ AlfrescoAuthenticationService,
/** @deprecated */ AlfrescoContentService,
/** @deprecated */ AlfrescoSettingsService,
/** @deprecated */ AlfrescoTranslationService
...CONTEXT_MENU_PROVIDERS
];
export function createTranslateLoader(http: Http, logService: LogService) {

View File

@@ -1,33 +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 '@angular/core';
import { LogService } from './log.service';
import { SettingsService } from './settings.service';
import { StorageService } from './storage.service';
import { AlfrescoApiService } from './alfresco-api.service';
/** @deprecated AlfrescoAuthenticationService is deprecated. Use AuthService instead */
@Injectable()
export class AlfrescoAuthenticationService {
constructor(settingsService: SettingsService,
apiService: AlfrescoApiService,
storage: StorageService,
logService: LogService) {
logService.error('ERROR: AlfrescoAuthenticationService is deprecated. Use AuthService instead.');
}
}

View File

@@ -1,32 +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 '@angular/core';
import { LogService } from './log.service';
import { AuthService } from './auth.service';
import { AlfrescoApiService } from './alfresco-api.service';
/** @deprecated AlfrescoContentService is deprecated. Use ContentService instead */
@Injectable()
export class AlfrescoContentService {
constructor(authService: AuthService,
apiService: AlfrescoApiService,
logService: LogService) {
logService.error('ERROR: AlfrescoContentService is deprecated. Use ContentService instead.');
}
}

View File

@@ -1,28 +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 '@angular/core';
import { LogService } from './log.service';
/** @deprecated AlfrescoSettingsService is deprecated. Use SettingsService instead */
@Injectable()
export class AlfrescoSettingsService {
constructor(logService: LogService) {
logService.error('ERROR: AlfrescoSettingsService is deprecated. Use SettingsService instead.');
}
}

View File

@@ -1,31 +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 '@angular/core';
import { TranslateService } from 'ng2-translate/ng2-translate';
import { LogService } from './log.service';
/** @deprecated AlfrescoTranslationService is deprecated. Use AlfrescoTranslateService instead */
@Injectable()
export class AlfrescoTranslationService {
constructor(translate: TranslateService,
logService: LogService) {
logService.error('ERROR: AlfrescoTranslationService is deprecated. Use AlfrescoTranslateService instead.');
}
}

View File

@@ -18,7 +18,7 @@
import { Injectable } from '@angular/core';
import { AlfrescoApi } from 'alfresco-js-api';
import * as alfrescoApi from 'alfresco-js-api';
import { SettingsService } from './settings.service';
import { AlfrescoSettingsService } from './alfresco-settings.service';
import { StorageService } from './storage.service';
@Injectable()
@@ -44,7 +44,7 @@ export class AlfrescoApiService {
return this.alfrescoApi;
}
constructor(private settingsService: SettingsService,
constructor(private settingsService: AlfrescoSettingsService,
private storage: StorageService) {
this.provider = this.settingsService.getProviders();

View File

@@ -16,31 +16,31 @@
*/
import { ReflectiveInjector } from '@angular/core';
import { SettingsService } from './settings.service';
import { AuthService } from './auth.service';
import { AlfrescoSettingsService } from './alfresco-settings.service';
import { AlfrescoAuthenticationService } from './alfresco-authentication.service';
import { AlfrescoApiService } from './alfresco-api.service';
import { StorageService } from './storage.service';
import { LogService } from './log.service';
declare let jasmine: any;
describe('AuthService', () => {
describe('AlfrescoAuthenticationService', () => {
let injector;
let authService: AuthService;
let settingsService: SettingsService;
let authService: AlfrescoAuthenticationService;
let settingsService: AlfrescoSettingsService;
let storage: StorageService;
beforeEach(() => {
injector = ReflectiveInjector.resolveAndCreate([
SettingsService,
AlfrescoSettingsService,
AlfrescoApiService,
AuthService,
AlfrescoAuthenticationService,
StorageService,
LogService
]);
authService = injector.get(AuthService);
settingsService = injector.get(SettingsService);
authService = injector.get(AlfrescoAuthenticationService);
settingsService = injector.get(AlfrescoSettingsService);
storage = injector.get(StorageService);
storage.clear();

View File

@@ -17,17 +17,17 @@
import { Injectable } from '@angular/core';
import { Observable, Subject } from 'rxjs/Rx';
import { SettingsService } from './settings.service';
import { AlfrescoSettingsService } from './alfresco-settings.service';
import { StorageService } from './storage.service';
import { LogService } from './log.service';
import { AlfrescoApiService } from './alfresco-api.service';
@Injectable()
export class AuthService {
export class AlfrescoAuthenticationService {
loginSubject: Subject<any> = new Subject<any>();
logoutSubject: Subject<any> = new Subject<any>();
constructor(private settingsService: SettingsService,
constructor(private settingsService: AlfrescoSettingsService,
public alfrescoApi: AlfrescoApiService,
private storage: StorageService,
private logService: LogService) {

View File

@@ -16,20 +16,20 @@
*/
import { ReflectiveInjector } from '@angular/core';
import { SettingsService } from './settings.service';
import { AuthService } from './auth.service';
import { ContentService } from './content.service';
import { AlfrescoSettingsService } from './alfresco-settings.service';
import { AlfrescoAuthenticationService } from './alfresco-authentication.service';
import { AlfrescoContentService } from './alfresco-content.service';
import { AlfrescoApiService } from './alfresco-api.service';
import { StorageService } from './storage.service';
import { LogService } from './log.service';
declare let jasmine: any;
describe('ContentService', () => {
describe('AlfrescoContentService', () => {
let injector, contentService: ContentService;
let authService: AuthService;
let settingsService: SettingsService;
let injector, contentService: AlfrescoContentService;
let authService: AlfrescoAuthenticationService;
let settingsService: AlfrescoSettingsService;
let storage: StorageService;
let node: any;
@@ -38,16 +38,16 @@ describe('ContentService', () => {
beforeEach(() => {
injector = ReflectiveInjector.resolveAndCreate([
AlfrescoApiService,
ContentService,
AuthService,
SettingsService,
AlfrescoContentService,
AlfrescoAuthenticationService,
AlfrescoSettingsService,
StorageService,
LogService
]);
authService = injector.get(AuthService);
settingsService = injector.get(SettingsService);
contentService = injector.get(ContentService);
authService = injector.get(AlfrescoAuthenticationService);
settingsService = injector.get(AlfrescoSettingsService);
contentService = injector.get(AlfrescoContentService);
storage = injector.get(StorageService);
storage.clear();

View File

@@ -17,13 +17,13 @@
import { Injectable } from '@angular/core';
import { AuthService } from './auth.service';
import { AlfrescoAuthenticationService } from './alfresco-authentication.service';
import { AlfrescoApiService } from './alfresco-api.service';
@Injectable()
export class ContentService {
export class AlfrescoContentService {
constructor(public authService: AuthService,
constructor(public authService: AlfrescoAuthenticationService,
public apiService: AlfrescoApiService) {
}

View File

@@ -15,18 +15,18 @@
* limitations under the License.
*/
import { SettingsService } from './settings.service';
import { AlfrescoSettingsService } from './alfresco-settings.service';
describe('SettingsService', () => {
describe('AlfrescoSettingsService', () => {
let service: SettingsService;
let service: AlfrescoSettingsService;
beforeEach(() => {
service = new SettingsService();
service = new AlfrescoSettingsService();
});
it('should have default ECM host', () => {
expect(service.ecmHost).toBe(SettingsService.DEFAULT_ECM_ADDRESS);
expect(service.ecmHost).toBe(AlfrescoSettingsService.DEFAULT_ECM_ADDRESS);
});
it('should change host ECM', () => {
@@ -37,7 +37,7 @@ describe('SettingsService', () => {
});
it('should have default BPM host', () => {
expect(service.bpmHost).toBe(SettingsService.DEFAULT_BPM_ADDRESS);
expect(service.bpmHost).toBe(AlfrescoSettingsService.DEFAULT_BPM_ADDRESS);
});
it('should change host BPM', () => {

View File

@@ -19,7 +19,7 @@ import { Injectable } from '@angular/core';
import { Subject } from 'rxjs/Subject';
@Injectable()
export class SettingsService {
export class AlfrescoSettingsService {
static DEFAULT_ECM_ADDRESS: string = 'http://' + window.location.hostname + ':8080';
static DEFAULT_BPM_ADDRESS: string = 'http://' + window.location.hostname + ':9999';
@@ -27,11 +27,11 @@ export class SettingsService {
static DEFAULT_BPM_CONTEXT_PATH: string = '/activiti-app';
private _ecmHost: string = SettingsService.DEFAULT_ECM_ADDRESS;
private _bpmHost: string = SettingsService.DEFAULT_BPM_ADDRESS;
private _csrfDisabled: boolean = SettingsService.DEFAULT_CSRF_CONFIG;
private _ecmHost: string = AlfrescoSettingsService.DEFAULT_ECM_ADDRESS;
private _bpmHost: string = AlfrescoSettingsService.DEFAULT_BPM_ADDRESS;
private _csrfDisabled: boolean = AlfrescoSettingsService.DEFAULT_CSRF_CONFIG;
private _bpmContextPath = SettingsService.DEFAULT_BPM_CONTEXT_PATH;
private _bpmContextPath = AlfrescoSettingsService.DEFAULT_BPM_CONTEXT_PATH;
private providers: string = 'ALL'; // ECM, BPM , ALL

View File

@@ -21,8 +21,8 @@ import { ResponseOptions, Response, XHRBackend, HttpModule } from '@angular/http
import { MockBackend, MockConnection } from '@angular/http/testing';
import {getTestBed, TestBed} from '@angular/core/testing';
import { AlfrescoTranslateLoader } from './translate-loader.service';
import { AlfrescoTranslateService } from './translate.service';
import { AlfrescoTranslateLoader } from './alfresco-translate-loader.service';
import { AlfrescoTranslationService } from './alfresco-translation.service';
import { LogService } from './log.service';
let componentJson1 = ' {"TEST": "This is a test", "TEST2": "This is another test"} ' ;
@@ -34,7 +34,7 @@ const mockBackendResponse = (connection: MockConnection, response: string) => {
describe('TranslateLoader', () => {
let injector: Injector;
let backend: MockBackend;
let alfrescoTranslationService: AlfrescoTranslateService;
let alfrescoTranslationService: AlfrescoTranslationService;
let connection: MockConnection; // this will be set when a new connection is emitted from the backend.
let customLoader;
@@ -48,14 +48,14 @@ describe('TranslateLoader', () => {
})
],
providers: [
AlfrescoTranslateService,
AlfrescoTranslationService,
LogService,
{provide: XHRBackend, useClass: MockBackend}
]
});
injector = getTestBed();
backend = injector.get(XHRBackend);
alfrescoTranslationService = injector.get(AlfrescoTranslateService);
alfrescoTranslationService = injector.get(AlfrescoTranslationService);
backend.connections.subscribe((c: MockConnection) => connection = c);
customLoader = alfrescoTranslationService.translate.currentLoader;
});

View File

@@ -21,18 +21,18 @@ import { ResponseOptions, Response, XHRBackend, HttpModule } from '@angular/http
import { MockBackend, MockConnection } from '@angular/http/testing';
import { getTestBed, TestBed } from '@angular/core/testing';
import { AlfrescoTranslateService } from './translate.service';
import { AlfrescoTranslateLoader } from './translate-loader.service';
import { AlfrescoTranslationService } from './alfresco-translation.service';
import { AlfrescoTranslateLoader } from './alfresco-translate-loader.service';
import { LogService } from './log.service';
const mockBackendResponse = (connection: MockConnection, response: string) => {
connection.mockRespond(new Response(new ResponseOptions({body: response})));
};
describe('AlfrescoTranslateService', () => {
describe('AlfrescoTranslationService', () => {
let injector: Injector;
let backend: MockBackend;
let alfrescoTranslationService: AlfrescoTranslateService;
let alfrescoTranslationService: AlfrescoTranslationService;
let connection: MockConnection; // this will be set when a new connection is emitted from the backend.
beforeEach(() => {
@@ -45,21 +45,21 @@ describe('AlfrescoTranslateService', () => {
})
],
providers: [
AlfrescoTranslateService,
AlfrescoTranslationService,
LogService,
{provide: XHRBackend, useClass: MockBackend}
]
});
injector = getTestBed();
backend = injector.get(XHRBackend);
alfrescoTranslationService = injector.get(AlfrescoTranslateService);
alfrescoTranslationService = injector.get(AlfrescoTranslationService);
backend.connections.subscribe((c: MockConnection) => connection = c);
alfrescoTranslationService.addTranslationFolder('fake-name', 'fake-path');
});
it('is defined', () => {
expect(AlfrescoTranslateService).toBeDefined();
expect(alfrescoTranslationService instanceof AlfrescoTranslateService).toBeTruthy();
expect(AlfrescoTranslationService).toBeDefined();
expect(alfrescoTranslationService instanceof AlfrescoTranslationService).toBeTruthy();
});
it('should be able to get translations of the KEY: TEST', () => {

View File

@@ -18,10 +18,10 @@
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Rx';
import { TranslateService } from 'ng2-translate/ng2-translate';
import { AlfrescoTranslateLoader } from './translate-loader.service';
import { AlfrescoTranslateLoader } from './alfresco-translate-loader.service';
@Injectable()
export class AlfrescoTranslateService {
export class AlfrescoTranslationService {
userLang: string = 'en';
customLoader: AlfrescoTranslateLoader;

View File

@@ -22,11 +22,11 @@ import {
RouterStateSnapshot
} from '@angular/router';
import { AuthService } from './auth.service';
import { AlfrescoAuthenticationService } from './alfresco-authentication.service';
@Injectable()
export class AuthGuardBpm implements CanActivate, CanActivateChild {
constructor(private authService: AuthService, private router: Router) {}
constructor(private authService: AlfrescoAuthenticationService, private router: Router) {}
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
let url: string = state.url;

View File

@@ -22,11 +22,11 @@ import {
RouterStateSnapshot
} from '@angular/router';
import { AuthService } from './auth.service';
import { AlfrescoAuthenticationService } from './alfresco-authentication.service';
@Injectable()
export class AuthGuardEcm implements CanActivate, CanActivateChild {
constructor(private authService: AuthService, private router: Router) {}
constructor(private authService: AlfrescoAuthenticationService, private router: Router) {}
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
let url: string = state.url;

View File

@@ -22,11 +22,11 @@ import {
RouterStateSnapshot
} from '@angular/router';
import { AuthService } from './auth.service';
import { AlfrescoAuthenticationService } from './alfresco-authentication.service';
@Injectable()
export class AuthGuard implements CanActivate, CanActivateChild {
constructor(private authService: AuthService, private router: Router) {}
constructor(private authService: AlfrescoAuthenticationService, private router: Router) {}
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
let url: string = state.url;

View File

@@ -17,18 +17,14 @@
export * from './storage.service';
export * from './alfresco-api.service';
export * from './AlfrescoSettings.service';
export * from './AlfrescoTranslation.service';
export * from './AlfrescoAuthentication.service';
export * from './AlfrescoContent.service';
export * from './alfresco-settings.service';
export * from './alfresco-content.service';
export * from './renditions.service';
export * from './auth-guard.service';
export * from './auth-guard-ecm.service';
export * from './auth-guard-bpm.service';
export * from './log.service';
export * from './auth.service';
export * from './content.service';
export * from './settings.service';
export * from './translate.service';
export * from './translate-loader.service';
export * from './alfresco-authentication.service';
export * from './alfresco-translation.service';
export * from './alfresco-translate-loader.service';

View File

@@ -18,7 +18,7 @@
import { ReflectiveInjector } from '@angular/core';
import { AlfrescoApiService } from './alfresco-api.service';
import { RenditionsService } from './renditions.service';
import { SettingsService } from './settings.service';
import { AlfrescoSettingsService } from './alfresco-settings.service';
import { StorageService } from './storage.service';
import { LogService } from './log.service';
import { fakeRedition, fakeReditionCreated, fakeReditionsList } from '../assets/renditionsService.mock';
@@ -33,7 +33,7 @@ describe('RenditionsService', () => {
injector = ReflectiveInjector.resolveAndCreate([
AlfrescoApiService,
RenditionsService,
SettingsService,
AlfrescoSettingsService,
StorageService,
LogService
]);