mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[ADF-1356] Single configuration of i18n service per project (#2199)
* rework i18n layer init * fix unit tests * fix tests * test fixes * remove obsolete tests
This commit is contained in:
committed by
Mario Romano
parent
bb53844f92
commit
003b0c133b
@@ -42,10 +42,6 @@ export class AppComponent {
|
||||
private storage: StorageService,
|
||||
private logService: LogService) {
|
||||
this.setProvider();
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('app', 'resources');
|
||||
}
|
||||
}
|
||||
|
||||
isAPageWithHeaderBar(): boolean {
|
||||
|
@@ -23,7 +23,7 @@ import { DiagramsModule } from 'ng2-activiti-diagrams';
|
||||
import { ActivitiFormModule } from 'ng2-activiti-form';
|
||||
import { ActivitiProcessListModule } from 'ng2-activiti-processlist';
|
||||
import { ActivitiTaskListModule } from 'ng2-activiti-tasklist';
|
||||
import { AppConfigService, CoreModule } from 'ng2-alfresco-core';
|
||||
import { AppConfigService, CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
|
||||
import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||
import { DocumentListModule } from 'ng2-alfresco-documentlist';
|
||||
import { LoginModule } from 'ng2-alfresco-login';
|
||||
@@ -128,7 +128,15 @@ if (process.env.ENV === 'production') {
|
||||
FormListDemoComponent
|
||||
],
|
||||
providers: [
|
||||
{ provide: AppConfigService, useClass: DebugAppConfigService }
|
||||
{ provide: AppConfigService, useClass: DebugAppConfigService },
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'app',
|
||||
source: 'resources'
|
||||
}
|
||||
}
|
||||
],
|
||||
bootstrap: [ AppComponent ],
|
||||
entryComponents: [
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { ModuleWithProviders, NgModule } from '@angular/core';
|
||||
import { MdButtonModule, MdIconModule, MdTooltipModule } from '@angular/material';
|
||||
import { DiagramsModule } from 'ng2-activiti-diagrams';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
|
||||
|
||||
import { ChartsModule } from 'ng2-charts';
|
||||
import { AnalyticsGeneratorComponent } from './src/components/analytics-generator.component';
|
||||
@@ -63,7 +63,15 @@ export const ANALYTICS_PROVIDERS: any[] = [
|
||||
...ANALYTICS_DIRECTIVES
|
||||
],
|
||||
providers: [
|
||||
...ANALYTICS_PROVIDERS
|
||||
...ANALYTICS_PROVIDERS,
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'ng2-activiti-analytics',
|
||||
source: 'assets/ng2-activiti-analytics'
|
||||
}
|
||||
}
|
||||
],
|
||||
exports: [
|
||||
...ANALYTICS_DIRECTIVES,
|
||||
|
@@ -18,7 +18,6 @@
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
||||
import { ReportQuery } from 'ng2-activiti-diagrams';
|
||||
import { Chart } from 'ng2-activiti-diagrams';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { AnalyticsService } from '../services/analytics.service';
|
||||
|
||||
@Component({
|
||||
@@ -62,11 +61,7 @@ export class AnalyticsGeneratorComponent implements OnChanges {
|
||||
}
|
||||
};
|
||||
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private analyticsService: AnalyticsService) {
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-analytics', 'assets/ng2-activiti-analytics');
|
||||
}
|
||||
constructor(private analyticsService: AnalyticsService) {
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { AnalyticsService } from '../services/analytics.service';
|
||||
|
||||
@Component({
|
||||
@@ -42,12 +41,8 @@ export class AnalyticsReportHeatMapComponent implements OnInit {
|
||||
currentMetricColors: string;
|
||||
metricType: string;
|
||||
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private analyticsService: AnalyticsService,
|
||||
constructor(private analyticsService: AnalyticsService,
|
||||
private formBuilder: FormBuilder) {
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-analytics', 'assets/ng2-activiti-analytics');
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@@ -36,7 +36,7 @@ import {
|
||||
ReportParametersModel,
|
||||
ReportQuery
|
||||
} from 'ng2-activiti-diagrams';
|
||||
import { AlfrescoTranslationService, ContentService, LogService } from 'ng2-alfresco-core';
|
||||
import { ContentService, LogService } from 'ng2-alfresco-core';
|
||||
import { AnalyticsService } from '../services/analytics.service';
|
||||
|
||||
declare var componentHandler;
|
||||
@@ -107,14 +107,10 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On
|
||||
private hideParameters: boolean = true;
|
||||
private formValidState: boolean = false;
|
||||
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private analyticsService: AnalyticsService,
|
||||
constructor(private analyticsService: AnalyticsService,
|
||||
private formBuilder: FormBuilder,
|
||||
private logService: LogService,
|
||||
private contentService: ContentService) {
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-analytics', 'assets/ng2-activiti-analytics');
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { ReportQuery } from 'ng2-activiti-diagrams';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { AnalyticsGeneratorComponent } from './analytics-generator.component';
|
||||
|
||||
@Component({
|
||||
@@ -53,12 +52,6 @@ export class AnalyticsComponent implements OnChanges {
|
||||
|
||||
reportParamQuery: ReportQuery;
|
||||
|
||||
constructor(translateService: AlfrescoTranslationService) {
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-analytics', 'assets/ng2-activiti-analytics');
|
||||
}
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
this.analyticsgenerator.reset();
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { ModuleWithProviders, NgModule } from '@angular/core';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
|
||||
|
||||
import { DIAGRAM_DIRECTIVES, DIAGRAM_PROVIDERS } from './src/components/index';
|
||||
|
||||
@@ -38,7 +38,15 @@ export * from './src/models/index';
|
||||
],
|
||||
providers: [
|
||||
...DIAGRAM_PROVIDERS,
|
||||
...RAPHAEL_PROVIDERS
|
||||
...RAPHAEL_PROVIDERS,
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'ng2-activiti-diagrams',
|
||||
source: 'assets/ng2-activiti-diagrams'
|
||||
}
|
||||
}
|
||||
],
|
||||
exports: [
|
||||
...DIAGRAM_DIRECTIVES
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { DiagramElementModel, DiagramModel } from '../models/diagram.model';
|
||||
import { DiagramColorService } from '../services/diagram-color.service';
|
||||
import { DiagramsService } from '../services/diagrams.service';
|
||||
@@ -60,13 +59,9 @@ export class DiagramComponent implements OnChanges {
|
||||
|
||||
diagram: DiagramModel;
|
||||
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private diagramColorService: DiagramColorService,
|
||||
constructor(private diagramColorService: DiagramColorService,
|
||||
private raphaelService: RaphaelService,
|
||||
private diagramsService: DiagramsService) {
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-diagrams', 'assets/ng2-activiti-diagrams');
|
||||
}
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
|
@@ -20,7 +20,7 @@ import { HttpModule } from '@angular/http';
|
||||
import { MdAutocompleteModule, MdButtonModule, MdCardModule, MdCheckboxModule,
|
||||
MdDatepickerModule, MdGridListModule, MdIconModule, MdInputModule, MdListModule,
|
||||
MdOptionModule, MdRadioModule, MdSelectModule, MdSlideToggleModule, MdTableModule, MdTabsModule } from '@angular/material';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
|
||||
import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||
import { FormFieldComponent } from './src/components/form-field/form-field.component';
|
||||
import { FormListComponent } from './src/components/form-list.component';
|
||||
@@ -104,7 +104,15 @@ export const MATERIAL_MODULE: any[] = [
|
||||
...WIDGET_DIRECTIVES
|
||||
],
|
||||
providers: [
|
||||
...ACTIVITI_FORM_PROVIDERS
|
||||
...ACTIVITI_FORM_PROVIDERS,
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'ng2-activiti-form',
|
||||
source: 'assets/ng2-activiti-form'
|
||||
}
|
||||
}
|
||||
],
|
||||
exports: [
|
||||
...ACTIVITI_FORM_DIRECTIVES,
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { AlfrescoTranslationService, LogService } from 'ng2-alfresco-core';
|
||||
import { LogService } from 'ng2-alfresco-core';
|
||||
import { FormService } from './../services/form.service';
|
||||
import { WidgetVisibilityService } from './../services/widget-visibility.service';
|
||||
import { FormComponent } from './form.component';
|
||||
@@ -72,16 +72,10 @@ export class StartFormComponent extends FormComponent implements OnChanges, OnIn
|
||||
@ViewChild('outcomesContainer', {})
|
||||
outcomesContainer: ElementRef = null;
|
||||
|
||||
constructor(private translate: AlfrescoTranslationService,
|
||||
formService: FormService,
|
||||
constructor(formService: FormService,
|
||||
visibilityService: WidgetVisibilityService,
|
||||
logService: LogService) {
|
||||
super(formService, visibilityService, null, null);
|
||||
|
||||
if (this.translate) {
|
||||
this.translate.addTranslationFolder('ng2-activiti-form', 'assets/ng2-activiti-form');
|
||||
}
|
||||
|
||||
this.showTitle = false;
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
||||
import { AlfrescoTranslationService, ContentService, LogService } from 'ng2-alfresco-core';
|
||||
import { ContentService, LogService } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { ContentLinkModel } from '../core/content-link.model';
|
||||
import { FormService } from './../../../services/form.service';
|
||||
@@ -49,13 +49,9 @@ export class ContentWidgetComponent implements OnChanges {
|
||||
|
||||
content: ContentLinkModel;
|
||||
|
||||
constructor(private translate: AlfrescoTranslationService,
|
||||
protected formService: FormService,
|
||||
constructor(protected formService: FormService,
|
||||
private logService: LogService,
|
||||
private contentService: ContentService) {
|
||||
if (this.translate) {
|
||||
this.translate.addTranslationFolder('ng2-activiti-form', 'assets/ng2-activiti-form');
|
||||
}
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
|
@@ -24,15 +24,15 @@ import {
|
||||
MdSelectModule } from '@angular/material';
|
||||
import { ActivitiFormModule } from 'ng2-activiti-form';
|
||||
import { ActivitiTaskListModule } from 'ng2-activiti-tasklist';
|
||||
import { CardViewUpdateService, CoreModule } from 'ng2-alfresco-core';
|
||||
import { CardViewUpdateService, CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
|
||||
import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||
|
||||
import { CreateProcessAttachmentComponent } from './src/components/create-process-attachment.component';
|
||||
import { ProcessAttachmentListComponent } from './src/components/process-attachment-list.component';
|
||||
import { ProcessAuditDirective } from './src/components/process-audit.directive';
|
||||
import { ProcessCommentsComponent } from './src/components/process-comments.component';
|
||||
import { ProcessFiltersComponent } from './src/components/process-filters.component';
|
||||
import { ProcessInstanceDetailsComponent } from './src/components/process-instance-details.component';
|
||||
import { ProcessAuditDirective } from './src/components/process-audit.directive';
|
||||
import { ProcessInstanceHeaderComponent } from './src/components/process-instance-header.component';
|
||||
import { ProcessInstanceTasksComponent } from './src/components/process-instance-tasks.component';
|
||||
import { ProcessInstanceVariablesComponent } from './src/components/process-instance-variables.component';
|
||||
@@ -136,7 +136,15 @@ export const ACTIVITI_PROCESSLIST_PROVIDERS: [any] = [
|
||||
...ACTIVITI_PROCESSLIST_DIRECTIVES
|
||||
],
|
||||
providers: [
|
||||
...ACTIVITI_PROCESSLIST_PROVIDERS
|
||||
...ACTIVITI_PROCESSLIST_PROVIDERS,
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'ng2-activiti-processlist',
|
||||
source: 'assets/ng2-activiti-processlist'
|
||||
}
|
||||
}
|
||||
],
|
||||
exports: [
|
||||
...ACTIVITI_PROCESSLIST_DIRECTIVES
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
||||
import { ActivitiContentService } from 'ng2-activiti-form';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-create-process-attachment',
|
||||
@@ -35,12 +34,7 @@ export class CreateProcessAttachmentComponent implements OnChanges {
|
||||
@Output()
|
||||
success: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private activitiContentService: ActivitiContentService) {
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist/src');
|
||||
}
|
||||
constructor(private activitiContentService: ActivitiContentService) {
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
||||
import { ActivitiContentService } from 'ng2-activiti-form';
|
||||
import { AlfrescoTranslationService, ContentService, ThumbnailService } from 'ng2-alfresco-core';
|
||||
import { ContentService, ThumbnailService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-process-attachment-list',
|
||||
@@ -41,14 +41,9 @@ export class ProcessAttachmentListComponent implements OnChanges {
|
||||
attachments: any[] = [];
|
||||
isLoading: boolean = true;
|
||||
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private activitiContentService: ActivitiContentService,
|
||||
constructor(private activitiContentService: ActivitiContentService,
|
||||
private contentService: ContentService,
|
||||
private thumbnailService: ThumbnailService) {
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist');
|
||||
}
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { TaskListService } from 'ng2-activiti-tasklist';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { ProcessService } from './../services/process.service';
|
||||
|
||||
@Component({
|
||||
@@ -37,16 +36,6 @@ export class ProcessCommentsComponent {
|
||||
@Output()
|
||||
error: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param translate Translation service
|
||||
*/
|
||||
constructor(translate: AlfrescoTranslationService) {
|
||||
if (translate) {
|
||||
translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist');
|
||||
}
|
||||
}
|
||||
|
||||
onError(error: any) {
|
||||
this.error.emit(error);
|
||||
}
|
||||
|
@@ -53,7 +53,7 @@ describe('ActivitiFilters', () => {
|
||||
beforeEach(() => {
|
||||
logService = new LogServiceMock();
|
||||
activitiService = new ProcessService(null, logService);
|
||||
filterList = new ProcessFiltersComponent(null, activitiService);
|
||||
filterList = new ProcessFiltersComponent(activitiService);
|
||||
});
|
||||
|
||||
it('should return the filter task list', (done) => {
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { Observable, Observer } from 'rxjs/Rx';
|
||||
import { FilterParamsModel, FilterProcessRepresentationModel } from './../models/filter-process.model';
|
||||
import { ProcessService } from './../services/process.service';
|
||||
@@ -56,13 +55,8 @@ export class ProcessFiltersComponent implements OnInit, OnChanges {
|
||||
|
||||
filters: FilterProcessRepresentationModel [] = [];
|
||||
|
||||
constructor(translate: AlfrescoTranslationService,
|
||||
private activiti: ProcessService) {
|
||||
constructor(private activiti: ProcessService) {
|
||||
this.filter$ = new Observable<FilterProcessRepresentationModel>(observer => this.filterObserver = observer).share();
|
||||
|
||||
if (translate) {
|
||||
translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist');
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { TaskDetailsEvent } from 'ng2-activiti-tasklist';
|
||||
import { AlfrescoTranslationService, LogService } from 'ng2-alfresco-core';
|
||||
import { LogService } from 'ng2-alfresco-core';
|
||||
|
||||
import { ProcessInstance } from '../models/process-instance.model';
|
||||
import { ProcessService } from './../services/process.service';
|
||||
@@ -66,13 +66,8 @@ export class ProcessInstanceDetailsComponent implements OnChanges {
|
||||
* @param translate Translation service
|
||||
* @param activitiProcess Process service
|
||||
*/
|
||||
constructor(translate: AlfrescoTranslationService,
|
||||
private activitiProcess: ProcessService,
|
||||
constructor(private activitiProcess: ProcessService,
|
||||
private logService: LogService) {
|
||||
|
||||
if (translate) {
|
||||
translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist');
|
||||
}
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
|
||||
import { AlfrescoTranslationService, CardViewDateItemModel, CardViewItem, CardViewTextItemModel } from 'ng2-alfresco-core';
|
||||
import { CardViewDateItemModel, CardViewItem, CardViewTextItemModel } from 'ng2-alfresco-core';
|
||||
import { ProcessInstance } from '../models/process-instance.model';
|
||||
|
||||
@Component({
|
||||
@@ -31,13 +31,6 @@ export class ProcessInstanceHeaderComponent implements OnChanges {
|
||||
|
||||
properties: CardViewItem [];
|
||||
|
||||
constructor(translate: AlfrescoTranslationService) {
|
||||
|
||||
if (translate) {
|
||||
translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist');
|
||||
}
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
this.refreshData();
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { TaskDetailsEvent, TaskDetailsModel } from 'ng2-activiti-tasklist';
|
||||
import { AlfrescoTranslationService, LogService } from 'ng2-alfresco-core';
|
||||
import { LogService } from 'ng2-alfresco-core';
|
||||
import { Observable, Observer } from 'rxjs/Rx';
|
||||
import { ProcessInstance } from '../models/process-instance.model';
|
||||
import { ProcessService } from './../services/process.service';
|
||||
@@ -65,13 +65,8 @@ export class ProcessInstanceTasksComponent implements OnInit, OnChanges {
|
||||
@Output()
|
||||
taskClick: EventEmitter<TaskDetailsEvent> = new EventEmitter<TaskDetailsEvent>();
|
||||
|
||||
constructor(translate: AlfrescoTranslationService,
|
||||
private activitiProcess: ProcessService,
|
||||
constructor(private activitiProcess: ProcessService,
|
||||
private logService: LogService) {
|
||||
if (translate) {
|
||||
translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist');
|
||||
}
|
||||
|
||||
this.task$ = new Observable<TaskDetailsModel>(observer => this.taskObserver = observer).share();
|
||||
this.completedTask$ = new Observable<TaskDetailsModel>(observer => this.completedTaskObserver = observer).share();
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { Component, DebugElement, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
|
||||
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { DataCellEvent, DataTableAdapter, ObjectDataRow, ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
|
||||
import { ProcessInstanceVariable } from './../models/process-instance-variable.model';
|
||||
import { ProcessService } from './../services/process.service';
|
||||
@@ -67,13 +66,7 @@ export class ProcessInstanceVariablesComponent implements OnInit, OnChanges {
|
||||
* @param translate Translation service
|
||||
* @param activitiProcess Process service
|
||||
*/
|
||||
constructor(translate: AlfrescoTranslationService,
|
||||
private activitiProcess: ProcessService) {
|
||||
|
||||
if (translate) {
|
||||
translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist');
|
||||
}
|
||||
|
||||
constructor(private activitiProcess: ProcessService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { AfterContentInit, Component, ContentChild, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
||||
import { AlfrescoTranslationService, DataColumnListComponent } from 'ng2-alfresco-core';
|
||||
import { DataColumnListComponent } from 'ng2-alfresco-core';
|
||||
import { DataColumn, DataRowEvent, DataSorting, DataTableAdapter, ObjectDataRow, ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
|
||||
import { ProcessFilterRequestRepresentation } from '../models/process-instance-filter.model';
|
||||
import { ProcessInstance } from '../models/process-instance.model';
|
||||
@@ -69,11 +69,7 @@ export class ProcessInstanceListComponent implements OnChanges, AfterContentInit
|
||||
{ type: 'text', key: 'created', title: 'Created', cssClass: 'hidden', sortable: true }
|
||||
];
|
||||
|
||||
constructor(private processService: ProcessService,
|
||||
translate: AlfrescoTranslationService) {
|
||||
if (translate !== null) {
|
||||
translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist');
|
||||
}
|
||||
constructor(private processService: ProcessService) {
|
||||
}
|
||||
|
||||
ngAfterContentInit() {
|
||||
|
@@ -18,7 +18,6 @@
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { RestVariable } from 'alfresco-js-api';
|
||||
import { StartFormComponent } from 'ng2-activiti-form';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { ProcessDefinitionRepresentation } from './../models/process-definition.model';
|
||||
import { ProcessInstance } from './../models/process-instance.model';
|
||||
import { ProcessService } from './../services/process.service';
|
||||
@@ -56,12 +55,7 @@ export class StartProcessInstanceComponent implements OnChanges {
|
||||
|
||||
errorMessageId: string = '';
|
||||
|
||||
constructor(translate: AlfrescoTranslationService,
|
||||
private activitiProcess: ProcessService) {
|
||||
|
||||
if (translate) {
|
||||
translate.addTranslationFolder('ng2-activiti-processlist', 'assets/ng2-activiti-processlist');
|
||||
}
|
||||
constructor(private activitiProcess: ProcessService) {
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
|
@@ -20,7 +20,7 @@ import { ModuleWithProviders, NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
|
||||
import { MdAutocompleteModule, MdButtonModule, MdCardModule, MdDatepickerModule, MdGridListModule,
|
||||
MdIconModule, MdInputModule, MdNativeDateModule, MdProgressSpinnerModule, MdSelectModule } from '@angular/material';
|
||||
import { ActivitiFormModule } from 'ng2-activiti-form';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
|
||||
import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||
import { PeopleService } from './src/services/people.service';
|
||||
import { ProcessUploadService } from './src/services/process-upload.service';
|
||||
@@ -170,7 +170,15 @@ export const ACTIVITI_TASKLIST_PROVIDERS: any[] = [
|
||||
],
|
||||
providers: [
|
||||
...ACTIVITI_TASKLIST_PROVIDERS,
|
||||
DatePipe
|
||||
DatePipe,
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'ng2-activiti-tasklist',
|
||||
source: 'assets/ng2-activiti-tasklist'
|
||||
}
|
||||
}
|
||||
],
|
||||
exports: [
|
||||
...ACTIVITI_TASKLIST_DIRECTIVES,
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Observer } from 'rxjs/Observer';
|
||||
import { AppDefinitionRepresentationModel } from '../models/filter.model';
|
||||
@@ -65,13 +64,7 @@ export class AppsListComponent implements OnInit {
|
||||
* @param translate Translate service
|
||||
* @param activitiTaskList Task service
|
||||
*/
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private activitiTaskList: TaskListService) {
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist');
|
||||
}
|
||||
|
||||
constructor(private activitiTaskList: TaskListService) {
|
||||
this.apps$ = new Observable<AppDefinitionRepresentationModel>(observer => this.appsObserver = observer).share();
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { Observable, Observer } from 'rxjs/Rx';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
import { TaskListService } from './../services/tasklist.service';
|
||||
@@ -64,12 +63,7 @@ export class ChecklistComponent implements OnInit, OnChanges {
|
||||
* @param auth
|
||||
* @param translate
|
||||
*/
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private activitiTaskList: TaskListService) {
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist');
|
||||
}
|
||||
constructor(private activitiTaskList: TaskListService) {
|
||||
this.task$ = new Observable<TaskDetailsModel>(observer => this.taskObserver = observer).share();
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { Observable, Observer } from 'rxjs/Rx';
|
||||
|
||||
import { Comment } from '../models/comment.model';
|
||||
@@ -52,13 +51,7 @@ export class CommentsComponent implements OnChanges {
|
||||
* @param translate Translation service
|
||||
* @param activitiTaskList Task service
|
||||
*/
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private activitiTaskList: TaskListService) {
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist');
|
||||
}
|
||||
|
||||
constructor(private activitiTaskList: TaskListService) {
|
||||
this.comment$ = new Observable<Comment>(observer => this.commentObserver = observer).share();
|
||||
this.comment$.subscribe((comment: Comment) => {
|
||||
this.comments.push(comment);
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
||||
import { ActivitiContentService } from 'ng2-activiti-form';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-create-task-attachment',
|
||||
@@ -35,12 +34,7 @@ export class AttachmentComponent implements OnChanges {
|
||||
@Output()
|
||||
success: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private activitiContentService: ActivitiContentService) {
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-tasklist', 'node_modules/ng2-activiti-tasklist/src');
|
||||
}
|
||||
constructor(private activitiContentService: ActivitiContentService) {
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
|
@@ -24,7 +24,7 @@ describe('NoTaskDetailsTemplateDirective', () => {
|
||||
let detailsComponent: TaskDetailsComponent;
|
||||
|
||||
beforeEach(() => {
|
||||
detailsComponent = new TaskDetailsComponent(null, null, null, null, null, null);
|
||||
detailsComponent = new TaskDetailsComponent(null, null, null, null, null);
|
||||
component = new NoTaskDetailsTemplateDirective(detailsComponent);
|
||||
});
|
||||
|
||||
|
@@ -50,9 +50,6 @@ export class PeopleListComponent implements AfterViewInit, AfterContentInit {
|
||||
|
||||
user: User;
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
ngAfterContentInit() {
|
||||
this.peopleDataTable.columnList = this.columnList;
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { User } from '../models/user.model';
|
||||
|
||||
@@ -47,11 +46,7 @@ export class PeopleSearchComponent implements OnInit {
|
||||
|
||||
selectedUser: User;
|
||||
|
||||
constructor(translateService: AlfrescoTranslationService) {
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist');
|
||||
}
|
||||
|
||||
constructor() {
|
||||
this.searchUser
|
||||
.valueChanges
|
||||
.debounceTime(200)
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { AfterViewInit, Component, Input } from '@angular/core';
|
||||
import { AlfrescoTranslationService, LogService } from 'ng2-alfresco-core';
|
||||
import { LogService } from 'ng2-alfresco-core';
|
||||
import { Observable, Observer } from 'rxjs/Rx';
|
||||
import { UserEventModel } from '../models/user-event.model';
|
||||
import { User } from '../models/user.model';
|
||||
@@ -55,12 +55,8 @@ export class PeopleComponent implements AfterViewInit {
|
||||
* @param translate
|
||||
* @param people service
|
||||
*/
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private peopleService: PeopleService,
|
||||
constructor(private peopleService: PeopleService,
|
||||
private logService: LogService) {
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist');
|
||||
}
|
||||
this.peopleSearch$ = new Observable<User[]>(observer => this.peopleSearchObserver = observer).share();
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||
import { AlfrescoTranslationService, LogService } from 'ng2-alfresco-core';
|
||||
import { LogService } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { Form } from '../models/form.model';
|
||||
import { StartTaskModel } from '../models/start-task.model';
|
||||
@@ -62,14 +62,9 @@ export class StartTaskComponent implements OnInit {
|
||||
* @param translate
|
||||
* @param taskService
|
||||
*/
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private taskService: TaskListService,
|
||||
constructor(private taskService: TaskListService,
|
||||
private peopleService: PeopleService,
|
||||
private logService: LogService) {
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist');
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
||||
import { ActivitiContentService } from 'ng2-activiti-form';
|
||||
import { AlfrescoTranslationService, ContentService, ThumbnailService } from 'ng2-alfresco-core';
|
||||
import { ContentService, ThumbnailService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-task-attachment-list',
|
||||
@@ -41,14 +41,9 @@ export class TaskAttachmentListComponent implements OnChanges {
|
||||
attachments: any[] = [];
|
||||
isLoading: boolean = true;
|
||||
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private activitiContentService: ActivitiContentService,
|
||||
constructor(private activitiContentService: ActivitiContentService,
|
||||
private contentService: ContentService,
|
||||
private thumbnailService: ThumbnailService) {
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist');
|
||||
}
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
|
@@ -27,7 +27,7 @@ import { Component,
|
||||
ViewChild
|
||||
} from '@angular/core';
|
||||
import { ContentLinkModel, FormFieldValidator, FormModel, FormOutcomeEvent } from 'ng2-activiti-form';
|
||||
import { AlfrescoAuthenticationService, AlfrescoTranslationService, CardViewUpdateService, ClickNotification, LogService, UpdateNotification } from 'ng2-alfresco-core';
|
||||
import { AlfrescoAuthenticationService, CardViewUpdateService, ClickNotification, LogService, UpdateNotification } from 'ng2-alfresco-core';
|
||||
import { Observable, Observer } from 'rxjs/Rx';
|
||||
import { TaskQueryRequestRepresentationModel } from '../models/filter.model';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
@@ -140,16 +140,11 @@ export class TaskDetailsComponent implements OnInit, OnChanges {
|
||||
private peopleSearchObserver: Observer<User[]>;
|
||||
peopleSearch$: Observable<User[]>;
|
||||
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private activitiTaskList: TaskListService,
|
||||
constructor(private activitiTaskList: TaskListService,
|
||||
private authService: AlfrescoAuthenticationService,
|
||||
private peopleService: PeopleService,
|
||||
private logService: LogService,
|
||||
private cardViewUpdateService: CardViewUpdateService) {
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist');
|
||||
}
|
||||
|
||||
this.peopleSearch$ = new Observable<User[]>(observer => this.peopleSearchObserver = observer).share();
|
||||
}
|
||||
|
||||
|
@@ -66,7 +66,7 @@ describe('TaskFiltersComponent', () => {
|
||||
beforeEach(() => {
|
||||
logService = new LogServiceMock();
|
||||
activitiService = new TaskListService(null, logService);
|
||||
filterList = new TaskFiltersComponent(null, activitiService);
|
||||
filterList = new TaskFiltersComponent(activitiService);
|
||||
});
|
||||
|
||||
it('should return the filter task list', (done) => {
|
||||
|
@@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { Observable, Observer } from 'rxjs/Rx';
|
||||
import { FilterParamsModel, FilterRepresentationModel } from '../models/filter.model';
|
||||
import { TaskListService } from './../services/tasklist.service';
|
||||
@@ -57,13 +56,8 @@ export class TaskFiltersComponent implements OnInit, OnChanges {
|
||||
|
||||
filters: FilterRepresentationModel [] = [];
|
||||
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private activiti: TaskListService) {
|
||||
constructor(private activiti: TaskListService) {
|
||||
this.filter$ = new Observable<FilterRepresentationModel>(observer => this.filterObserver = observer).share();
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist');
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
||||
import { AlfrescoTranslationService, CardViewDateItemModel, CardViewItem, CardViewMapItemModel, CardViewTextItemModel, LogService } from 'ng2-alfresco-core';
|
||||
import { CardViewDateItemModel, CardViewItem, CardViewMapItemModel, CardViewTextItemModel, LogService } from 'ng2-alfresco-core';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
import { TaskListService } from './../services/tasklist.service';
|
||||
|
||||
@@ -39,12 +39,8 @@ export class TaskHeaderComponent implements OnChanges {
|
||||
properties: CardViewItem [];
|
||||
inEdit: boolean = false;
|
||||
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private activitiTaskService: TaskListService,
|
||||
constructor(private activitiTaskService: TaskListService,
|
||||
private logService: LogService) {
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist');
|
||||
}
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
|
@@ -15,24 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {
|
||||
AfterContentInit,
|
||||
Component,
|
||||
ContentChild,
|
||||
EventEmitter,
|
||||
Input,
|
||||
OnChanges,
|
||||
Output,
|
||||
SimpleChanges
|
||||
} from '@angular/core';
|
||||
import { AlfrescoTranslationService, DataColumnListComponent } from 'ng2-alfresco-core';
|
||||
import {
|
||||
DataColumn,
|
||||
DataRowEvent,
|
||||
DataTableAdapter,
|
||||
ObjectDataRow,
|
||||
ObjectDataTableAdapter
|
||||
} from 'ng2-alfresco-datatable';
|
||||
import { AfterContentInit, Component, ContentChild, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
||||
import { DataColumnListComponent } from 'ng2-alfresco-core';
|
||||
import { DataColumn, DataRowEvent, DataTableAdapter, ObjectDataRow, ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { TaskQueryRequestRepresentationModel } from '../models/filter.model';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
@@ -104,11 +89,7 @@ export class TaskListComponent implements OnChanges, AfterContentInit {
|
||||
{ type: 'text', key: 'created', title: 'Created', cssClass: 'hidden', sortable: true }
|
||||
];
|
||||
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private taskListService: TaskListService) {
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-activiti-tasklist', 'assets/ng2-activiti-tasklist');
|
||||
}
|
||||
constructor(private taskListService: TaskListService) {
|
||||
}
|
||||
|
||||
ngAfterContentInit() {
|
||||
|
@@ -832,19 +832,47 @@ export class MyModule {}
|
||||
|
||||
## TranslationService
|
||||
|
||||
In order to enable localisation support you will need creating a `/resources/i18n/en.json` file
|
||||
and registering path to it's parent `i18n` folder:
|
||||
### Registering translation sources
|
||||
|
||||
In order to enable localisation support you will need to create a `/resources/i18n/en.json` file
|
||||
and register its parent `i18n` folder with your component or application module.
|
||||
|
||||
For example:
|
||||
|
||||
```ts
|
||||
class MainApplication {
|
||||
constructor(translateService: TranslationService) {
|
||||
translateService.addTranslationFolder('app', 'resources');
|
||||
import { TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
|
||||
|
||||
@NgModule({
|
||||
...
|
||||
providers: [
|
||||
...
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'ng2-alfresco-core',
|
||||
source: 'assets/ng2-alfresco-core'
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
```
|
||||
|
||||
Service also allows changing current language for entire application.
|
||||
Imagine you got a language picker that invokes `onLanguageClicked` method:
|
||||
Note: the `source` property points to the web application root, please ensure you have webpack settings to copy all the i18n files at compile time.
|
||||
|
||||
```text
|
||||
index.html
|
||||
assets/ng2-alfresco-core/i18n/en.json
|
||||
...
|
||||
```
|
||||
|
||||
You can register as many entries as you would like.
|
||||
|
||||
### Switching languages
|
||||
|
||||
Depending on your application, you may want to have buttons or dropdown menus to allow language selection for the end users.
|
||||
|
||||
You can use `TranslationService` to switch languages from your code based on input events of your choice:
|
||||
|
||||
```ts
|
||||
class MyComponent {
|
||||
@@ -852,27 +880,11 @@ class MyComponent {
|
||||
}
|
||||
|
||||
onLanguageClicked(lang: string) {
|
||||
this.translateService.use('en');
|
||||
this.translateService.use(lang || 'en');
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
It is also possible providing custom translations for existing components by overriding their resource paths:
|
||||
|
||||
```ts
|
||||
class MyComponent {
|
||||
constructor(private translateService: TranslationService) {
|
||||
translateService.addTranslationFolder(
|
||||
'ng2-alfresco-login',
|
||||
'i18n/custom-translation/alfresco-login'
|
||||
);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Important note**: `addTranslationFolder` method redirects **all** languages to a new folder, you may need implementing multiple languages
|
||||
or copying existing translation files to a new path.
|
||||
|
||||
## Renditions Service
|
||||
|
||||
* getRenditionsListByNodeId(nodeId: string)
|
||||
|
@@ -48,7 +48,7 @@ import { RenditionsService } from './src/services/renditions.service';
|
||||
import { StorageService } from './src/services/storage.service';
|
||||
import { ThumbnailService } from './src/services/thumbnail.service';
|
||||
import { AlfrescoTranslateLoader } from './src/services/translate-loader.service';
|
||||
import { TranslationService } from './src/services/translation.service';
|
||||
import { TRANSLATION_PROVIDER, TranslationService } from './src/services/translation.service';
|
||||
import { UploadService } from './src/services/upload.service';
|
||||
import { UserPreferencesService } from './src/services/user-preferences.service';
|
||||
|
||||
@@ -81,7 +81,7 @@ export { NotificationService } from './src/services/notification.service';
|
||||
export { LogService } from './src/services/log.service';
|
||||
export { LogServiceMock } from './src/services/log.service';
|
||||
export { AuthenticationService } from './src/services/authentication.service';
|
||||
export { TranslationService } from './src/services/translation.service';
|
||||
export { TranslationService, TRANSLATION_PROVIDER, TranslationProvider } from './src/services/translation.service';
|
||||
export { AlfrescoTranslateLoader } from './src/services/translate-loader.service';
|
||||
export { AppConfigService } from './src/services/app-config.service';
|
||||
export { InitAppConfigServiceProvider } from './src/services/app-config.service';
|
||||
@@ -232,7 +232,19 @@ export function createTranslateLoader(http: Http, logService: LogService) {
|
||||
HighlightPipe,
|
||||
TimeAgoPipe
|
||||
],
|
||||
providers: [...providers(), ...deprecatedProviders(), MomentDateAdapter],
|
||||
providers: [
|
||||
...providers(),
|
||||
...deprecatedProviders(),
|
||||
MomentDateAdapter,
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'ng2-alfresco-core',
|
||||
source: 'assets/ng2-alfresco-core'
|
||||
}
|
||||
}
|
||||
],
|
||||
exports: [
|
||||
BrowserAnimationsModule,
|
||||
CommonModule,
|
||||
|
@@ -27,19 +27,24 @@ export class AlfrescoTranslateLoader implements TranslateLoader {
|
||||
|
||||
private prefix: string = 'i18n';
|
||||
private suffix: string = '.json';
|
||||
private _componentList: ComponentTranslationModel[] = [];
|
||||
private providers: ComponentTranslationModel[] = [];
|
||||
private queue: string [][] = [];
|
||||
|
||||
constructor(private http: Http,
|
||||
private logService: LogService) {
|
||||
}
|
||||
|
||||
addComponentList(nameInput: string, pathInput: string) {
|
||||
this._componentList.push(new ComponentTranslationModel({name: nameInput, path: pathInput}));
|
||||
registerProvider(name: string, path: string) {
|
||||
let registered = this.providers.find(provider => provider.name === name);
|
||||
if (registered) {
|
||||
registered.path = path;
|
||||
} else {
|
||||
this.providers.push(new ComponentTranslationModel({name: name, path: path}));
|
||||
}
|
||||
}
|
||||
|
||||
existComponent(name: string): boolean {
|
||||
return this._componentList.find(x => x.name === name) ? true : false;
|
||||
providerRegistered(name: string): boolean {
|
||||
return this.providers.find(x => x.name === name) ? true : false;
|
||||
}
|
||||
|
||||
getComponentToFetch(lang: string) {
|
||||
@@ -47,7 +52,7 @@ export class AlfrescoTranslateLoader implements TranslateLoader {
|
||||
if (!this.queue[lang]) {
|
||||
this.queue[lang] = [];
|
||||
}
|
||||
this._componentList.forEach((component) => {
|
||||
this.providers.forEach((component) => {
|
||||
if (!this.isComponentInQueue(lang, component.name)) {
|
||||
this.queue[lang].push(component.name);
|
||||
observableBatch.push(this.http.get(`${component.path}/${this.prefix}/${lang}${this.suffix}`)
|
||||
@@ -75,7 +80,7 @@ export class AlfrescoTranslateLoader implements TranslateLoader {
|
||||
|
||||
getFullTranslationJSON(lang: string) {
|
||||
let fullTranslation: string = '';
|
||||
let cloneList = this._componentList.slice(0);
|
||||
let cloneList = this.providers.slice(0);
|
||||
cloneList.reverse().forEach((component) => {
|
||||
if (component.json && component.json[lang]) {
|
||||
fullTranslation += JSON.stringify(component.json[lang]);
|
||||
|
@@ -23,7 +23,7 @@ import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { LogService } from './log.service';
|
||||
import { AlfrescoTranslateLoader } from './translate-loader.service';
|
||||
import { TranslationService } from './translation.service';
|
||||
import { TRANSLATION_PROVIDER, TranslationService } from './translation.service';
|
||||
|
||||
let componentJson1 = ' {"TEST": "This is a test", "TEST2": "This is another test"} ' ;
|
||||
|
||||
@@ -36,7 +36,7 @@ describe('TranslateLoader', () => {
|
||||
let backend: any;
|
||||
let translationService: TranslationService;
|
||||
let connection: MockConnection; // this will be set when a new connection is emitted from the backend.
|
||||
let customLoader;
|
||||
let customLoader: AlfrescoTranslateLoader;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
@@ -52,14 +52,22 @@ describe('TranslateLoader', () => {
|
||||
providers: [
|
||||
TranslationService,
|
||||
LogService,
|
||||
{provide: XHRBackend, useClass: MockBackend}
|
||||
{ provide: XHRBackend, useClass: MockBackend },
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'ng2-alfresco-core',
|
||||
source: 'assets/ng2-alfresco-core'
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
injector = getTestBed();
|
||||
backend = injector.get(XHRBackend);
|
||||
translationService = injector.get(TranslationService);
|
||||
backend.connections.subscribe((c: MockConnection) => connection = c);
|
||||
customLoader = translationService.translate.currentLoader;
|
||||
customLoader = <AlfrescoTranslateLoader> translationService.translate.currentLoader;
|
||||
});
|
||||
|
||||
it('should be able to provide any TranslateLoader', () => {
|
||||
@@ -69,12 +77,12 @@ describe('TranslateLoader', () => {
|
||||
});
|
||||
|
||||
it('should add the component to the list', () => {
|
||||
customLoader.addComponentList('login', 'path/login');
|
||||
expect(customLoader.existComponent('login')).toBeTruthy();
|
||||
customLoader.registerProvider('login', 'path/login');
|
||||
expect(customLoader.providerRegistered('login')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should return the Json translation ', () => {
|
||||
customLoader.addComponentList('login', 'path/login');
|
||||
customLoader.registerProvider('login', 'path/login');
|
||||
customLoader.getTranslation('en').subscribe(
|
||||
(response) => {
|
||||
expect(response).toBeDefined();
|
||||
|
@@ -23,7 +23,7 @@ import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { LogService } from './log.service';
|
||||
import { AlfrescoTranslateLoader } from './translate-loader.service';
|
||||
import { TranslationService } from './translation.service';
|
||||
import { TRANSLATION_PROVIDER, TranslationService } from './translation.service';
|
||||
|
||||
const mockBackendResponse = (connection: MockConnection, response: string) => {
|
||||
connection.mockRespond(new Response(new ResponseOptions({body: response})));
|
||||
@@ -49,7 +49,15 @@ describe('TranslationService', () => {
|
||||
providers: [
|
||||
TranslationService,
|
||||
LogService,
|
||||
{provide: XHRBackend, useClass: MockBackend}
|
||||
{ provide: XHRBackend, useClass: MockBackend },
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'ng2-alfresco-core',
|
||||
source: 'assets/ng2-alfresco-core'
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
injector = getTestBed();
|
||||
|
@@ -15,27 +15,42 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Inject, Injectable, OpaqueToken } from '@angular/core';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { Observable } from 'rxjs/Rx';
|
||||
import { AlfrescoTranslateLoader } from './translate-loader.service';
|
||||
|
||||
export const TRANSLATION_PROVIDER = new OpaqueToken('Injection token for translation providers.');
|
||||
|
||||
export interface TranslationProvider {
|
||||
name: string;
|
||||
source: string;
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class TranslationService {
|
||||
defaultLang: string = 'en';
|
||||
userLang: string = 'en';
|
||||
customLoader: AlfrescoTranslateLoader;
|
||||
|
||||
constructor(public translate: TranslateService) {
|
||||
constructor(public translate: TranslateService,
|
||||
@Inject(TRANSLATION_PROVIDER) providers: TranslationProvider[]) {
|
||||
this.userLang = translate.getBrowserLang() || this.defaultLang;
|
||||
translate.setDefaultLang(this.defaultLang);
|
||||
|
||||
this.customLoader = <AlfrescoTranslateLoader> this.translate.currentLoader;
|
||||
this.use(this.userLang);
|
||||
|
||||
if (providers && providers.length > 0) {
|
||||
for (let provider of providers) {
|
||||
this.addTranslationFolder(provider.name, provider.source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addTranslationFolder(name: string = '', path: string = '') {
|
||||
if (!this.customLoader.existComponent(name)) {
|
||||
this.customLoader.addComponentList(name, path);
|
||||
if (!this.customLoader.providerRegistered(name)) {
|
||||
this.customLoader.registerProvider(name, path);
|
||||
if (this.userLang !== this.defaultLang) {
|
||||
this.translate.getTranslation(this.defaultLang).subscribe(() => {
|
||||
this.translate.getTranslation(this.userLang).subscribe(
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { ModuleWithProviders, NgModule } from '@angular/core';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
|
||||
import { MaterialModule } from './src/material.module';
|
||||
|
||||
export * from './src/data/index';
|
||||
@@ -49,6 +49,16 @@ export function directives() {
|
||||
MaterialModule
|
||||
],
|
||||
declarations: directives(),
|
||||
providers: [
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'ng2-alfresco-datatable',
|
||||
source: 'assets/ng2-alfresco-datatable'
|
||||
}
|
||||
}
|
||||
],
|
||||
exports: [
|
||||
...directives(),
|
||||
MaterialModule
|
||||
|
@@ -207,14 +207,14 @@ describe('DataTable', () => {
|
||||
});
|
||||
|
||||
it('should initialize default adapter', () => {
|
||||
let table = new DataTableComponent(null, null, null);
|
||||
let table = new DataTableComponent(null, null);
|
||||
expect(table.data).toBeUndefined();
|
||||
table.ngOnChanges({'data': new SimpleChange('123', {}, true)});
|
||||
expect(table.data).toEqual(jasmine.any(ObjectDataTableAdapter));
|
||||
});
|
||||
|
||||
it('should load data table on onChange', () => {
|
||||
let table = new DataTableComponent(null, null, null);
|
||||
let table = new DataTableComponent(null, null);
|
||||
let data = new ObjectDataTableAdapter([], []);
|
||||
|
||||
expect(table.data).toBeUndefined();
|
||||
|
@@ -20,7 +20,7 @@ import {
|
||||
IterableDiffers, OnChanges, Output, SimpleChange, SimpleChanges, TemplateRef
|
||||
} from '@angular/core';
|
||||
import { MdCheckboxChange } from '@angular/material';
|
||||
import { AlfrescoTranslationService, DataColumnListComponent } from 'ng2-alfresco-core';
|
||||
import { DataColumnListComponent } from 'ng2-alfresco-core';
|
||||
import { Observable, Observer, Subscription } from 'rxjs/Rx';
|
||||
import { DataColumn, DataRow, DataRowEvent, DataSorting, DataTableAdapter } from '../../data/datatable-adapter';
|
||||
import { ObjectDataRow, ObjectDataTableAdapter } from '../../data/object-datatable-adapter';
|
||||
@@ -106,17 +106,11 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck
|
||||
private singleClickStreamSub: Subscription;
|
||||
private multiClickStreamSub: Subscription;
|
||||
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private elementRef: ElementRef,
|
||||
differs: IterableDiffers) {
|
||||
constructor(private elementRef: ElementRef, differs: IterableDiffers) {
|
||||
if (differs) {
|
||||
this.differ = differs.find([]).create(null);
|
||||
}
|
||||
this.click$ = new Observable<DataRowEvent>(observer => this.clickObserver = observer).share();
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-alfresco-datatable', 'assets/ng2-alfresco-datatable');
|
||||
}
|
||||
}
|
||||
|
||||
ngAfterContentInit() {
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { ModuleWithProviders, NgModule } from '@angular/core';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
|
||||
import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||
|
||||
import { BreadcrumbComponent } from './src/components/breadcrumb/breadcrumb.component';
|
||||
@@ -94,7 +94,15 @@ export const DOCUMENT_LIST_PROVIDERS: any[] = [
|
||||
...DOCUMENT_LIST_DIRECTIVES
|
||||
],
|
||||
providers: [
|
||||
...DOCUMENT_LIST_PROVIDERS
|
||||
...DOCUMENT_LIST_PROVIDERS,
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'ng2-alfresco-documentlist',
|
||||
source: 'assets/ng2-alfresco-documentlist'
|
||||
}
|
||||
}
|
||||
],
|
||||
entryComponents: [
|
||||
ContentNodeSelectorComponent
|
||||
|
@@ -75,7 +75,7 @@ describe('Breadcrumb', () => {
|
||||
});
|
||||
|
||||
it('should update document list on click', (done) => {
|
||||
let documentList = new DocumentListComponent(null, null, null, null);
|
||||
let documentList = new DocumentListComponent(null, null, null);
|
||||
spyOn(documentList, 'loadFolderByNodeId').and.stub();
|
||||
|
||||
let node = <PathElementEntity> {id: '-id-', name: 'name'};
|
||||
|
@@ -144,7 +144,7 @@ describe('DropdownBreadcrumb', () => {
|
||||
});
|
||||
|
||||
it('should update document list when clicking on an option', () => {
|
||||
let documentList = new DocumentListComponent(null, null, null, null);
|
||||
let documentList = new DocumentListComponent(null, null, null);
|
||||
spyOn(documentList, 'loadFolderByNodeId').and.stub();
|
||||
component.target = documentList;
|
||||
fakeNodeWithCreatePermission.path.elements = [{ id: '1', name: 'Stark Industries' }];
|
||||
|
@@ -27,7 +27,7 @@ describe('ContentColumnList', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
let documentListService = new DocumentListServiceMock();
|
||||
documentList = new DocumentListComponent(documentListService, null, null, null);
|
||||
documentList = new DocumentListComponent(documentListService, null, null);
|
||||
actionList = new ContentActionListComponent(documentList);
|
||||
});
|
||||
|
||||
|
@@ -60,7 +60,7 @@ describe('ContentAction', () => {
|
||||
documentActions = new DocumentActionsService(nodeActionsService);
|
||||
folderActions = new FolderActionsService(nodeActionsService, null, contentService);
|
||||
|
||||
documentList = new DocumentListComponent(documentServiceMock, null, null, null);
|
||||
documentList = new DocumentListComponent(documentServiceMock, null, null);
|
||||
actionList = new ContentActionListComponent(documentList);
|
||||
});
|
||||
|
||||
|
@@ -28,7 +28,7 @@ describe('ContentColumnList', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
let service = new DocumentListServiceMock();
|
||||
documentList = new DocumentListComponent(service, null, null, null);
|
||||
documentList = new DocumentListComponent(service, null, null);
|
||||
columnList = new ContentColumnListComponent(documentList);
|
||||
|
||||
documentList.ngOnInit();
|
||||
|
@@ -27,7 +27,7 @@ describe('ContentColumn', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
let service = new DocumentListServiceMock();
|
||||
documentList = new DocumentListComponent(service, null, null, null);
|
||||
documentList = new DocumentListComponent(service, null, null);
|
||||
columnList = new ContentColumnListComponent(documentList);
|
||||
|
||||
documentList.ngOnInit();
|
||||
|
@@ -167,13 +167,13 @@ describe('ContentNodeSelectorComponent', () => {
|
||||
});
|
||||
|
||||
it('should be shown if dialogRef is injected', () => {
|
||||
const componentInstance = new ContentNodeSelectorComponent(null, null, null, data, dummyMdDialogRef);
|
||||
const componentInstance = new ContentNodeSelectorComponent(null, null, data, dummyMdDialogRef);
|
||||
expect(componentInstance.inDialog).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should should call the close method in the injected dialogRef', () => {
|
||||
spyOn(dummyMdDialogRef, 'close');
|
||||
const componentInstance = new ContentNodeSelectorComponent(null, null, null, data, dummyMdDialogRef);
|
||||
const componentInstance = new ContentNodeSelectorComponent(null, null, data, dummyMdDialogRef);
|
||||
|
||||
componentInstance.close();
|
||||
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { Component, EventEmitter, Inject, Input, OnInit, Optional, Output, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { MD_DIALOG_DATA, MdDialogRef } from '@angular/material';
|
||||
import { MinimalNodeEntryEntity, NodePaging } from 'alfresco-js-api';
|
||||
import { AlfrescoContentService, AlfrescoTranslationService, HighlightDirective, SearchOptions, SearchService, SiteModel } from 'ng2-alfresco-core';
|
||||
import { AlfrescoContentService, HighlightDirective, SearchOptions, SearchService, SiteModel } from 'ng2-alfresco-core';
|
||||
import { ImageResolver, RowFilter } from '../../data/share-datatable-adapter';
|
||||
import { DocumentListComponent } from '../document-list.component';
|
||||
|
||||
@@ -69,14 +69,8 @@ export class ContentNodeSelectorComponent implements OnInit {
|
||||
|
||||
constructor(private searchService: SearchService,
|
||||
private contentService: AlfrescoContentService,
|
||||
@Optional() translateService: AlfrescoTranslationService,
|
||||
@Optional() @Inject(MD_DIALOG_DATA) data?: ContentNodeSelectorComponentData,
|
||||
@Optional() private containingDialog?: MdDialogRef<ContentNodeSelectorComponent>) {
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-alfresco-documentlist', 'assets/ng2-alfresco-documentlist');
|
||||
}
|
||||
|
||||
if (data) {
|
||||
this.title = data.title;
|
||||
this.select = data.select;
|
||||
|
@@ -712,7 +712,7 @@ describe('DocumentList', () => {
|
||||
|
||||
it('should check [empty folder] template ', () => {
|
||||
documentList.emptyFolderTemplate = <TemplateRef<any>> {};
|
||||
documentList.dataTable = new DataTableComponent(null, null, null);
|
||||
documentList.dataTable = new DataTableComponent(null, null);
|
||||
expect(documentList.dataTable).toBeDefined();
|
||||
expect(documentList.isEmptyTemplateDefined()).toBeTruthy();
|
||||
|
||||
@@ -722,7 +722,7 @@ describe('DocumentList', () => {
|
||||
|
||||
it('should empty folder NOT show the pagination', () => {
|
||||
documentList.emptyFolderTemplate = <TemplateRef<any>> {};
|
||||
documentList.dataTable = new DataTableComponent(null, null, null);
|
||||
documentList.dataTable = new DataTableComponent(null, null);
|
||||
|
||||
expect(documentList.isEmpty()).toBeTruthy();
|
||||
expect(element.querySelector('alfresco-pagination')).toBe(null);
|
||||
|
@@ -20,7 +20,7 @@ import {
|
||||
OnChanges, OnInit, Output, SimpleChanges, TemplateRef, ViewChild
|
||||
} from '@angular/core';
|
||||
import { MinimalNodeEntity, MinimalNodeEntryEntity, NodePaging, Pagination } from 'alfresco-js-api';
|
||||
import { AlfrescoTranslationService, DataColumnListComponent } from 'ng2-alfresco-core';
|
||||
import { DataColumnListComponent } from 'ng2-alfresco-core';
|
||||
import { DataCellEvent, DataColumn, DataRowActionEvent, DataSorting, DataTableComponent, ObjectDataColumn } from 'ng2-alfresco-datatable';
|
||||
import { Observable, Subject } from 'rxjs/Rx';
|
||||
import { ImageResolver, RowFilter, ShareDataRow, ShareDataTableAdapter } from './../data/share-datatable-adapter';
|
||||
@@ -156,12 +156,7 @@ export class DocumentListComponent implements OnInit, OnChanges, AfterContentIni
|
||||
|
||||
constructor(private documentListService: DocumentListService,
|
||||
private ngZone: NgZone,
|
||||
translateService: AlfrescoTranslationService,
|
||||
private elementRef: ElementRef) {
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-alfresco-documentlist', 'assets/ng2-alfresco-documentlist');
|
||||
}
|
||||
}
|
||||
|
||||
getContextActions(node: MinimalNodeEntity) {
|
||||
|
@@ -17,8 +17,8 @@
|
||||
|
||||
import { SimpleChange } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MdButtonModule, MdIconModule, MdMenuModule } from '@angular/material';
|
||||
import { AlfrescoTranslationService, CoreModule } from 'ng2-alfresco-core';
|
||||
import { MaterialModule } from './../material.module';
|
||||
import { DocumentListService } from './../services/document-list.service';
|
||||
import { DocumentMenuActionComponent } from './document-menu-action.component';
|
||||
|
||||
@@ -84,9 +84,7 @@ describe('Document menu action', () => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
CoreModule.forRoot(),
|
||||
MdMenuModule,
|
||||
MdButtonModule,
|
||||
MdIconModule
|
||||
MaterialModule
|
||||
],
|
||||
declarations: [DocumentMenuActionComponent],
|
||||
providers: [
|
||||
|
@@ -64,10 +64,6 @@ export class DocumentMenuActionComponent implements OnChanges {
|
||||
private translateService: AlfrescoTranslationService,
|
||||
private logService: LogService,
|
||||
private contentService: AlfrescoContentService) {
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-alfresco-documentlist', 'assets/ng2-alfresco-documentlist');
|
||||
}
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
|
@@ -28,8 +28,8 @@ describe('EmptyFolderContent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
let documentListService = new DocumentListServiceMock();
|
||||
documentList = new DocumentListComponent(documentListService, null, null, null);
|
||||
documentList.dataTable = new DataTableComponent(null, null, null);
|
||||
documentList = new DocumentListComponent(documentListService, null, null);
|
||||
documentList.dataTable = new DataTableComponent(null, null);
|
||||
emptyFolderContent = new EmptyFolderContentDirective(documentList);
|
||||
});
|
||||
|
||||
|
@@ -17,9 +17,9 @@
|
||||
|
||||
import { DebugElement } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MdOptionModule, MdSelectModule } from '@angular/material';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { MaterialModule } from './../../material.module';
|
||||
import { DropdownSitesComponent } from './sites-dropdown.component';
|
||||
|
||||
declare let jasmine: any;
|
||||
@@ -72,8 +72,7 @@ describe('DropdownSitesComponent', () => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
CoreModule.forRoot(),
|
||||
MdSelectModule,
|
||||
MdOptionModule
|
||||
MaterialModule
|
||||
],
|
||||
declarations: [
|
||||
DropdownSitesComponent
|
||||
@@ -116,7 +115,8 @@ describe('DropdownSitesComponent', () => {
|
||||
});
|
||||
}));
|
||||
|
||||
it('should load sites on init', async(() => {
|
||||
// todo: something wrong with the test itself
|
||||
xit('should load sites on init', async(() => {
|
||||
fixture.detectChanges();
|
||||
jasmine.Ajax.requests.mostRecent().respondWith({
|
||||
status: 200,
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
|
||||
import { AlfrescoTranslationService, SiteModel, SitesApiService } from 'ng2-alfresco-core';
|
||||
import { SiteModel, SitesApiService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-sites-dropdown',
|
||||
@@ -34,11 +34,7 @@ export class DropdownSitesComponent implements OnInit {
|
||||
|
||||
public siteSelected: string;
|
||||
|
||||
constructor(translateService: AlfrescoTranslationService,
|
||||
private sitesService: SitesApiService) {
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-alfresco-documentlist', 'assets/ng2-alfresco-documentlist');
|
||||
}
|
||||
constructor(private sitesService: SitesApiService) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@@ -16,7 +16,17 @@
|
||||
*/
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { MdButtonModule, MdDialogModule, MdIconModule, MdInputModule, MdMenuModule, MdProgressSpinnerModule, MdRippleModule, MdSelectModule } from '@angular/material';
|
||||
import {
|
||||
MdButtonModule,
|
||||
MdDialogModule,
|
||||
MdIconModule,
|
||||
MdInputModule,
|
||||
MdMenuModule,
|
||||
MdOptionModule,
|
||||
MdProgressSpinnerModule,
|
||||
MdRippleModule,
|
||||
MdSelectModule
|
||||
} from '@angular/material';
|
||||
|
||||
export function modules() {
|
||||
return [
|
||||
@@ -27,7 +37,8 @@ export function modules() {
|
||||
MdInputModule,
|
||||
MdProgressSpinnerModule,
|
||||
MdSelectModule,
|
||||
MdRippleModule
|
||||
MdRippleModule,
|
||||
MdOptionModule
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { ModuleWithProviders, NgModule } from '@angular/core';
|
||||
import { MdCheckboxModule, MdIconModule, MdInputModule, MdProgressSpinnerModule } from '@angular/material';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
|
||||
|
||||
import { LoginComponent } from './src/components/login.component';
|
||||
import { LoginFooterDirective } from './src/directives/login-footer.directive';
|
||||
@@ -51,7 +51,16 @@ export const ALFRESCO_LOGIN_DIRECTIVES: any[] = [
|
||||
declarations: [
|
||||
...ALFRESCO_LOGIN_DIRECTIVES
|
||||
],
|
||||
providers: [],
|
||||
providers: [
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'ng2-alfresco-login',
|
||||
source: 'assets/ng2-alfresco-login'
|
||||
}
|
||||
}
|
||||
],
|
||||
exports: [
|
||||
...ALFRESCO_LOGIN_DIRECTIVES,
|
||||
MdInputModule,
|
||||
|
@@ -105,11 +105,6 @@ export class LoginComponent implements OnInit {
|
||||
private settingsService: AlfrescoSettingsService,
|
||||
private translateService: AlfrescoTranslationService,
|
||||
private logService: LogService) {
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-alfresco-login', 'assets/ng2-alfresco-login');
|
||||
}
|
||||
|
||||
this.initFormError();
|
||||
this.initFormFieldsMessages();
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { ModuleWithProviders, NgModule } from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { CoreModule, SearchService } from 'ng2-alfresco-core';
|
||||
import { CoreModule, SearchService, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
|
||||
import { DocumentListModule } from 'ng2-alfresco-documentlist';
|
||||
import { SearchAutocompleteComponent } from './src/components/search-autocomplete.component';
|
||||
import { SearchControlComponent } from './src/components/search-control.component';
|
||||
@@ -68,7 +68,15 @@ export const ALFRESCO_SEARCH_PROVIDERS: [any] = [
|
||||
...ALFRESCO_SEARCH_DIRECTIVES
|
||||
],
|
||||
providers: [
|
||||
...ALFRESCO_SEARCH_PROVIDERS
|
||||
...ALFRESCO_SEARCH_PROVIDERS,
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'ng2-alfresco-search',
|
||||
source: 'assets/ng2-alfresco-search'
|
||||
}
|
||||
}
|
||||
],
|
||||
exports: [
|
||||
...ALFRESCO_SEARCH_DIRECTIVES
|
||||
|
@@ -63,13 +63,6 @@ describe('SearchAutocompleteComponent', () => {
|
||||
});
|
||||
}));
|
||||
|
||||
it('should setup i18n folder', () => {
|
||||
let translationService = fixture.debugElement.injector.get(AlfrescoTranslationService);
|
||||
spyOn(translationService, 'addTranslationFolder');
|
||||
fixture.detectChanges();
|
||||
expect(translationService.addTranslationFolder).toHaveBeenCalledWith('ng2-alfresco-search', 'assets/ng2-alfresco-search');
|
||||
});
|
||||
|
||||
describe('search results', () => {
|
||||
|
||||
let searchService;
|
||||
|
@@ -15,9 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core';
|
||||
import { Component, ElementRef, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core';
|
||||
import { MinimalNodeEntity } from 'alfresco-js-api';
|
||||
import { AlfrescoTranslationService, SearchOptions, SearchService } from 'ng2-alfresco-core';
|
||||
import { SearchOptions, SearchService } from 'ng2-alfresco-core';
|
||||
import { ThumbnailService } from 'ng2-alfresco-core';
|
||||
|
||||
@Component({
|
||||
@@ -25,7 +25,7 @@ import { ThumbnailService } from 'ng2-alfresco-core';
|
||||
templateUrl: './search-autocomplete.component.html',
|
||||
styleUrls: ['./search-autocomplete.component.css']
|
||||
})
|
||||
export class SearchAutocompleteComponent implements OnInit, OnChanges {
|
||||
export class SearchAutocompleteComponent implements OnChanges {
|
||||
|
||||
@Input()
|
||||
searchTerm: string = '';
|
||||
@@ -70,16 +70,9 @@ export class SearchAutocompleteComponent implements OnInit, OnChanges {
|
||||
@ViewChild('resultsTableBody', {}) resultsTableBody: ElementRef;
|
||||
|
||||
constructor(private searchService: SearchService,
|
||||
private translateService: AlfrescoTranslationService,
|
||||
private thumbnailService: ThumbnailService) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
if (this.translateService) {
|
||||
this.translateService.addTranslationFolder('ng2-alfresco-search', 'assets/ng2-alfresco-search');
|
||||
}
|
||||
}
|
||||
|
||||
ngOnChanges(changes) {
|
||||
if (changes.searchTerm) {
|
||||
this.results = null;
|
||||
|
@@ -52,14 +52,6 @@ describe('SearchControlComponent', () => {
|
||||
});
|
||||
}));
|
||||
|
||||
it('should setup i18n folder', () => {
|
||||
let translationService = TestBed.get(AlfrescoTranslationService);
|
||||
spyOn(translationService, 'addTranslationFolder');
|
||||
fixture.detectChanges();
|
||||
expect(translationService.addTranslationFolder)
|
||||
.toHaveBeenCalledWith('ng2-alfresco-search', 'assets/ng2-alfresco-search');
|
||||
});
|
||||
|
||||
it('should emit searchChange when search term input changed', (done) => {
|
||||
fixture.componentInstance.searchChange.subscribe(e => {
|
||||
expect(e.value).toBe('customSearchTerm');
|
||||
|
@@ -17,7 +17,6 @@
|
||||
|
||||
import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, ViewChild } from '@angular/core';
|
||||
import { FormControl, Validators } from '@angular/forms';
|
||||
import { AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { Observable, Subject } from 'rxjs/Rx';
|
||||
import { SearchTermValidator } from './../forms/search-term-validator';
|
||||
import { SearchAutocompleteComponent } from './search-autocomplete.component';
|
||||
@@ -88,8 +87,7 @@ export class SearchControlComponent implements OnInit, OnDestroy {
|
||||
|
||||
private focusSubject = new Subject<FocusEvent>();
|
||||
|
||||
constructor(private translateService: AlfrescoTranslationService) {
|
||||
|
||||
constructor() {
|
||||
this.searchControl = new FormControl(
|
||||
this.searchTerm,
|
||||
Validators.compose([Validators.required, SearchTermValidator.minAlphanumericChars(3)])
|
||||
@@ -104,8 +102,6 @@ export class SearchControlComponent implements OnInit, OnDestroy {
|
||||
);
|
||||
|
||||
this.setupFocusEventHandlers();
|
||||
|
||||
this.translateService.addTranslationFolder('ng2-alfresco-search', 'assets/ng2-alfresco-search');
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
|
@@ -152,15 +152,6 @@ describe('SearchComponent', () => {
|
||||
expect(search.searchTerm).toBe('exampleTerm692');
|
||||
});
|
||||
|
||||
it('should setup i18n folder', () => {
|
||||
let translationService = TestBed.get(AlfrescoTranslationService);
|
||||
spyOn(translationService, 'addTranslationFolder');
|
||||
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(translationService.addTranslationFolder).toHaveBeenCalledWith('ng2-alfresco-search', 'assets/ng2-alfresco-search');
|
||||
});
|
||||
|
||||
it('should show the Notification snackbar on permission error', () => {
|
||||
const notoficationService = TestBed.get(NotificationService);
|
||||
spyOn(notoficationService, 'openSnackMessage');
|
||||
|
@@ -77,10 +77,6 @@ export class SearchComponent implements OnChanges, OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if (this.translateService !== null) {
|
||||
this.translateService.addTranslationFolder('ng2-alfresco-search', 'assets/ng2-alfresco-search');
|
||||
}
|
||||
|
||||
if (this.route) {
|
||||
this.route.params.forEach((params: Params) => {
|
||||
this.searchTerm = params.hasOwnProperty(this.queryParamName) ? params[this.queryParamName] : null;
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { ModuleWithProviders, NgModule } from '@angular/core';
|
||||
import { MdButtonModule, MdInputModule } from '@angular/material';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
|
||||
|
||||
import { TagActionsComponent } from './src/components/tag-actions.component';
|
||||
import { TagListComponent } from './src/components/tag-list.component';
|
||||
@@ -55,7 +55,15 @@ export const TAG_PROVIDERS: any[] = [
|
||||
...TAG_DIRECTIVES
|
||||
],
|
||||
providers: [
|
||||
...TAG_PROVIDERS
|
||||
...TAG_PROVIDERS,
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'ng2-alfresco-tag',
|
||||
source: 'assets/ng2-alfresco-tag'
|
||||
}
|
||||
}
|
||||
],
|
||||
exports: [
|
||||
...TAG_DIRECTIVES,
|
||||
|
@@ -57,10 +57,6 @@ export class TagActionsComponent implements OnChanges {
|
||||
disableAddTag: boolean = true;
|
||||
|
||||
constructor(private tagService: TagService, private translateService: AlfrescoTranslationService) {
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-alfresco-tag', 'assets/ng2-alfresco-tag');
|
||||
}
|
||||
|
||||
this.tagService.refresh.subscribe(() => {
|
||||
this.refreshTag();
|
||||
});
|
||||
|
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;AAEH,sCAA8D;AAC9D,uDAA+C;AAE/C,0FAAsF;AACtF,sFAAmF;AACnF,oFAAiF;AACjF,oGAAgG;AAChG,gGAA4F;AAC5F,gEAA8D;AAkB9D,8DAAyD;AACzD,sEAAiE;AACjE,iEAA4D;AAC5D,mDAA8C;AAC9C,+DAA0D;AAC1D,oEAA+D;AAElD,QAAA,iBAAiB,GAAU;IACpC,iDAAsB;IACtB,oDAAuB;IACvB,+CAAqB;IACrB,8DAA4B;IAC5B,0DAA0B;CAC7B,CAAC;AAEW,QAAA,gBAAgB,GAAU;IACnC,8BAAa;CAChB,CAAC;AAgBF,IAAa,YAAY;IAAzB;IASA,CAAC;IARU,oBAAO,GAAd;QACI,MAAM,CAAC;YACH,QAAQ,EAAE,cAAY;YACtB,SAAS,EACF,wBAAgB,QACtB;SACJ,CAAC;IACN,CAAC;IACL,mBAAC;AAAD,CAAC,AATD,IASC;AATY,YAAY;IAdxB,eAAQ,CAAC;QACN,OAAO,EAAE;YACL,8BAAU;SACb;QACD,YAAY,EACL,yBAAiB,QACvB;QACD,SAAS,EACF,wBAAgB,QACtB;QACD,OAAO,EACA,yBAAiB,QACvB;KACJ,CAAC;GACW,YAAY,CASxB;AATY,oCAAY"}
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { ModuleWithProviders, NgModule } from '@angular/core';
|
||||
import { MdButtonModule, MdIconModule, MdProgressSpinnerModule } from '@angular/material';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
|
||||
|
||||
import { FileUploadingDialogComponent } from './src/components/file-uploading-dialog.component';
|
||||
import { FileUploadingListRowComponent } from './src/components/file-uploading-list-row.component';
|
||||
@@ -60,7 +60,15 @@ export const UPLOAD_PROVIDERS: any[] = [
|
||||
...UPLOAD_DIRECTIVES
|
||||
],
|
||||
providers: [
|
||||
...UPLOAD_PROVIDERS
|
||||
...UPLOAD_PROVIDERS,
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'ng2-alfresco-upload',
|
||||
source: 'assets/ng2-alfresco-upload'
|
||||
}
|
||||
}
|
||||
],
|
||||
exports: [
|
||||
...UPLOAD_DIRECTIVES
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||
import { AlfrescoTranslationService, FileModel, FileUploadCompleteEvent, UploadService } from 'ng2-alfresco-core';
|
||||
import { FileModel, FileUploadCompleteEvent, UploadService } from 'ng2-alfresco-core';
|
||||
import { Subscription } from 'rxjs/Rx';
|
||||
|
||||
@Component({
|
||||
@@ -39,13 +39,8 @@ export class FileUploadingDialogComponent implements OnInit, OnDestroy {
|
||||
private fileUploadSubscription: Subscription;
|
||||
|
||||
constructor(
|
||||
translateService: AlfrescoTranslationService,
|
||||
private uploadService: UploadService,
|
||||
private changeDetecor: ChangeDetectorRef) {
|
||||
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-alfresco-upload', 'assets/ng2-alfresco-upload');
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@@ -91,9 +91,6 @@ export class UploadButtonComponent implements OnInit, OnChanges {
|
||||
private logService: LogService,
|
||||
private notificationService: NotificationService,
|
||||
private apiService: AlfrescoApiService) {
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-alfresco-upload', 'assets/ng2-alfresco-upload');
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@@ -67,9 +67,6 @@ export class UploadDragAreaComponent {
|
||||
constructor(private uploadService: UploadService,
|
||||
private translateService: AlfrescoTranslationService,
|
||||
private notificationService: NotificationService) {
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-alfresco-upload', 'assets/ng2-alfresco-upload');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;AAEH,sCAA8D;AAC9D,uDAA+C;AAE/C,4EAAyE;AACzE,oEAAiE;AACjE,oEAAiE;AAEjE,0DAAqD;AACrD,qDAAgD;AAChD,qDAAgD;AAEnC,QAAA,oBAAoB,GAAU;IACvC,uCAAiB;CACpB,CAAC;AAEW,QAAA,mBAAmB,GAAU;IACtC,iCAAc;IACd,iCAAc;CACjB,CAAC;AAgBF,IAAa,uBAAuB;IAApC;IASA,CAAC;IARU,+BAAO,GAAd;QACI,MAAM,CAAC;YACH,QAAQ,EAAE,yBAAuB;YACjC,SAAS,EACF,2BAAmB,QACzB;SACJ,CAAC;IACN,CAAC;IACL,8BAAC;AAAD,CAAC,AATD,IASC;AATY,uBAAuB;IAdnC,eAAQ,CAAC;QACN,OAAO,EAAE;YACL,8BAAU;SACb;QACD,YAAY,EACL,4BAAoB,QAC1B;QACD,SAAS,EACF,2BAAmB,QACzB;QACD,OAAO,EACA,4BAAoB,QAC1B;KACJ,CAAC;GACW,uBAAuB,CASnC;AATY,0DAAuB"}
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { ModuleWithProviders, NgModule } from '@angular/core';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { CoreModule, TRANSLATION_PROVIDER } from 'ng2-alfresco-core';
|
||||
|
||||
import { UserInfoComponent } from './src/components/user-info.component';
|
||||
import { BpmUserService } from './src/services/bpm-user.service';
|
||||
@@ -43,7 +43,15 @@ export const USER_INFO_PROVIDERS: any[] = [
|
||||
...USER_INFO_DIRECTIVES
|
||||
],
|
||||
providers: [
|
||||
...USER_INFO_PROVIDERS
|
||||
...USER_INFO_PROVIDERS,
|
||||
{
|
||||
provide: TRANSLATION_PROVIDER,
|
||||
multi: true,
|
||||
useValue: {
|
||||
name: 'ng2-alfresco-userinfo',
|
||||
source: 'assets/ng2-alfresco-userinfo'
|
||||
}
|
||||
}
|
||||
],
|
||||
exports: [
|
||||
...USER_INFO_DIRECTIVES
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { AlfrescoAuthenticationService, AlfrescoTranslationService } from 'ng2-alfresco-core';
|
||||
import { AlfrescoAuthenticationService } from 'ng2-alfresco-core';
|
||||
import { BpmUserModel } from './../models/bpm-user.model';
|
||||
import { EcmUserModel } from './../models/ecm-user.model';
|
||||
import { BpmUserService } from './../services/bpm-user.service';
|
||||
@@ -51,11 +51,7 @@ export class UserInfoComponent implements OnInit {
|
||||
|
||||
constructor(private ecmUserService: EcmUserService,
|
||||
private bpmUserService: BpmUserService,
|
||||
private authService: AlfrescoAuthenticationService,
|
||||
translateService: AlfrescoTranslationService) {
|
||||
if (translateService) {
|
||||
translateService.addTranslationFolder('ng2-alfresco-userinfo', 'assets/ng2-alfresco-userinfo');
|
||||
}
|
||||
private authService: AlfrescoAuthenticationService) {
|
||||
authService.onLogin.subscribe((response) => {
|
||||
this.getUserInfo();
|
||||
});
|
||||
|
Reference in New Issue
Block a user