[ADF-3088] move sorting picker to a separate module (#3396)

* move sorting picker to a separate module

* update translation mock
This commit is contained in:
Denys Vuika
2018-05-25 09:58:49 +01:00
committed by GitHub
parent ed283c7386
commit 1064521fe9
9 changed files with 87 additions and 13 deletions

View File

@@ -81,7 +81,7 @@ import { UploadService } from './services/upload.service';
import { UserPreferencesService } from './services/user-preferences.service'; import { UserPreferencesService } from './services/user-preferences.service';
import { SearchConfigurationService } from './services/search-configuration.service'; import { SearchConfigurationService } from './services/search-configuration.service';
import { startupServiceFactory } from './services/startup-service-factory'; import { startupServiceFactory } from './services/startup-service-factory';
import { SortingPickerComponent } from './components/sorting-picker/sorting-picker.component'; import { SortingPickerModule } from './sorting-picker/sorting-picker.module';
export function createTranslateLoader(http: HttpClient, logService: LogService) { export function createTranslateLoader(http: HttpClient, logService: LogService) {
return new TranslateLoaderService(http, logService); return new TranslateLoaderService(http, logService);
@@ -162,7 +162,8 @@ export function providers() {
useFactory: (createTranslateLoader), useFactory: (createTranslateLoader),
deps: [HttpClient, LogService] deps: [HttpClient, LogService]
} }
}) }),
SortingPickerModule
], ],
exports: [ exports: [
AboutModule, AboutModule,
@@ -192,7 +193,8 @@ export function providers() {
DataTableModule, DataTableModule,
TranslateModule, TranslateModule,
ButtonsMenuModule, ButtonsMenuModule,
TemplatetModule TemplatetModule,
SortingPickerModule
] ]
}) })
export class CoreModuleLazy { export class CoreModuleLazy {
@@ -233,10 +235,8 @@ export class CoreModuleLazy {
useFactory: (createTranslateLoader), useFactory: (createTranslateLoader),
deps: [HttpClient, LogService] deps: [HttpClient, LogService]
} }
}) }),
], SortingPickerModule
declarations: [
SortingPickerComponent
], ],
exports: [ exports: [
AboutModule, AboutModule,
@@ -267,7 +267,7 @@ export class CoreModuleLazy {
TranslateModule, TranslateModule,
ButtonsMenuModule, ButtonsMenuModule,
TemplatetModule, TemplatetModule,
SortingPickerComponent SortingPickerModule
], ],
providers: [ providers: [
...providers(), ...providers(),

View File

@@ -34,9 +34,7 @@ export * from './form/index';
export * from './sidenav-layout/index'; export * from './sidenav-layout/index';
export * from './comments/index'; export * from './comments/index';
export * from './buttons-menu/index'; export * from './buttons-menu/index';
export * from './sorting-picker/index';
export * from './components/sorting-picker/sorting-picker.component';
export * from './templates/index'; export * from './templates/index';
export * from './pipes/index'; export * from './pipes/index';
export * from './services/index'; export * from './services/index';

View File

@@ -17,18 +17,20 @@
import { EventEmitter } from '@angular/core'; import { EventEmitter } from '@angular/core';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
import { TranslationService } from '../services/translation.service';
export interface LangChangeEvent { export interface LangChangeEvent {
lang: string; lang: string;
translations: any; translations: any;
} }
export class TranslationMock { export class TranslationMock implements TranslationService {
defaultLang: string = 'en'; defaultLang: string = 'en';
userLang: string; userLang: string;
customLoader: any; customLoader: any;
translate = {
translate: any = {
onLangChange: new EventEmitter<LangChangeEvent>() onLangChange: new EventEmitter<LangChangeEvent>()
}; };

View File

@@ -0,0 +1,18 @@
/*!
* @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.
*/
export * from './public-api';

View File

@@ -0,0 +1,19 @@
/*!
* @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.
*/
export * from './sorting-picker.component';
export * from './sorting-picker.module';

View File

@@ -0,0 +1,37 @@
/*!
* @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 { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { TranslateModule } from '@ngx-translate/core';
import { MaterialModule } from '../material.module';
import { SortingPickerComponent } from './sorting-picker.component';
@NgModule({
imports: [
CommonModule,
MaterialModule,
TranslateModule
],
declarations: [
SortingPickerComponent
],
exports: [
SortingPickerComponent
]
})
export class SortingPickerModule {}