mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-1724] Remove all log in favor of log service (#2465)
* remove console log from components * remove console log from demo shell * fix visibility issue * fix error template * remove console.log from spec * fix tests * fix test
This commit is contained in:
@@ -41,6 +41,7 @@ import {
|
|||||||
TaskListComponent,
|
TaskListComponent,
|
||||||
TaskListService
|
TaskListService
|
||||||
} from 'ng2-activiti-tasklist';
|
} from 'ng2-activiti-tasklist';
|
||||||
|
import { LogService } from 'ng2-alfresco-core';
|
||||||
import { AlfrescoApiService } from 'ng2-alfresco-core';
|
import { AlfrescoApiService } from 'ng2-alfresco-core';
|
||||||
import {
|
import {
|
||||||
DataSorting,
|
DataSorting,
|
||||||
@@ -133,6 +134,7 @@ export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit {
|
|||||||
private router: Router,
|
private router: Router,
|
||||||
private taskListService: TaskListService,
|
private taskListService: TaskListService,
|
||||||
private apiService: AlfrescoApiService,
|
private apiService: AlfrescoApiService,
|
||||||
|
private logService: LogService,
|
||||||
formRenderingService: FormRenderingService,
|
formRenderingService: FormRenderingService,
|
||||||
formService: FormService) {
|
formService: FormService) {
|
||||||
this.dataTasks = new ObjectDataTableAdapter();
|
this.dataTasks = new ObjectDataTableAdapter();
|
||||||
@@ -154,11 +156,11 @@ export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit {
|
|||||||
formRenderingService.setComponentTypeResolver('custom_stencil_01', () => CustomStencil01, true);
|
formRenderingService.setComponentTypeResolver('custom_stencil_01', () => CustomStencil01, true);
|
||||||
|
|
||||||
formService.formLoaded.subscribe((e: FormEvent) => {
|
formService.formLoaded.subscribe((e: FormEvent) => {
|
||||||
console.log(`Form loaded: ${e.form.id}`);
|
this.logService.log(`Form loaded: ${e.form.id}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
formService.formFieldValueChanged.subscribe((e: FormFieldEvent) => {
|
formService.formFieldValueChanged.subscribe((e: FormFieldEvent) => {
|
||||||
console.log(`Field value changed. Form: ${e.form.id}, Field: ${e.field.id}, Value: ${e.field.value}`);
|
this.logService.log(`Field value changed. Form: ${e.form.id}, Field: ${e.field.id}, Value: ${e.field.value}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
formService.validateDynamicTableRow.subscribe(
|
formService.validateDynamicTableRow.subscribe(
|
||||||
@@ -175,8 +177,8 @@ export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit {
|
|||||||
// Uncomment this block to see form event handling in action
|
// Uncomment this block to see form event handling in action
|
||||||
/*
|
/*
|
||||||
formService.formEvents.subscribe((event: Event) => {
|
formService.formEvents.subscribe((event: Event) => {
|
||||||
console.log('Event fired:' + event.type);
|
this.logService.log('Event fired:' + event.type);
|
||||||
console.log('Event Target:' + event.target);
|
this.logService.log('Event Target:' + event.target);
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
@@ -213,9 +215,9 @@ export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit {
|
|||||||
this.taskListService.tasksList$.subscribe(
|
this.taskListService.tasksList$.subscribe(
|
||||||
(tasks) => {
|
(tasks) => {
|
||||||
this.taskPagination = { count: tasks.data.length, maxItems: this.taskPagination.maxItems, skipCount: this.taskPagination.skipCount, totalItems: tasks.total };
|
this.taskPagination = { count: tasks.data.length, maxItems: this.taskPagination.maxItems, skipCount: this.taskPagination.skipCount, totalItems: tasks.total };
|
||||||
console.log({ count: tasks.data.length, maxItems: this.taskPagination.maxItems, skipCount: this.taskPagination.skipCount, totalItems: tasks.total });
|
this.logService.log({ count: tasks.data.length, maxItems: this.taskPagination.maxItems, skipCount: this.taskPagination.skipCount, totalItems: tasks.total });
|
||||||
}, (err) => {
|
}, (err) => {
|
||||||
console.log('err' + err);
|
this.logService.log('err' + err);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.router.url.includes('processes')) {
|
if (this.router.url.includes('processes')) {
|
||||||
@@ -381,11 +383,11 @@ export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onAuditClick(event: any) {
|
onAuditClick(event: any) {
|
||||||
console.log(event);
|
this.logService.log(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
onAuditError(event: any): void {
|
onAuditError(event: any): void {
|
||||||
console.error('My custom error message' + event);
|
this.logService.error('My custom error message' + event);
|
||||||
}
|
}
|
||||||
|
|
||||||
onTaskCreated(data: any): void {
|
onTaskCreated(data: any): void {
|
||||||
@@ -451,11 +453,11 @@ export class ActivitiDemoComponent implements AfterViewInit, OnDestroy, OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onRowClick(event): void {
|
onRowClick(event): void {
|
||||||
console.log(event);
|
this.logService.log(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
onRowDblClick(event): void {
|
onRowDblClick(event): void {
|
||||||
console.log(event);
|
this.logService.log(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
isTaskCompleted(): boolean {
|
isTaskCompleted(): boolean {
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
import { AlfrescoApiService } from 'ng2-alfresco-core';
|
import { AlfrescoApiService, LogService } from 'ng2-alfresco-core';
|
||||||
import { DataCellEvent, DataRowActionEvent, DataSorting, ObjectDataColumn, ObjectDataRow, ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
|
import { DataCellEvent, DataRowActionEvent, DataSorting, ObjectDataColumn, ObjectDataRow, ObjectDataTableAdapter } from 'ng2-alfresco-datatable';
|
||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Rx';
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@ export class DataTableDemoComponent {
|
|||||||
email: 'denys.vuika@alfresco.com'
|
email: 'denys.vuika@alfresco.com'
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService) {
|
constructor(private apiService: AlfrescoApiService, private logService: LogService) {
|
||||||
this.reset();
|
this.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,17 +162,17 @@ export class DataTableDemoComponent {
|
|||||||
|
|
||||||
onExecuteRowAction(event: DataRowActionEvent) {
|
onExecuteRowAction(event: DataRowActionEvent) {
|
||||||
let args = event.value;
|
let args = event.value;
|
||||||
console.log(args.row);
|
this.logService.log(args.row);
|
||||||
console.log(args.action);
|
this.logService.log(args.action);
|
||||||
window.alert(`My custom action: ${args.action.title}`);
|
window.alert(`My custom action: ${args.action.title}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
onRowClick(event) {
|
onRowClick(event) {
|
||||||
console.log(event);
|
this.logService.log(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
onRowDblClick(event) {
|
onRowDblClick(event) {
|
||||||
console.log(event);
|
this.logService.log(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
getRowForNode() {
|
getRowForNode() {
|
||||||
@@ -183,8 +183,8 @@ export class DataTableDemoComponent {
|
|||||||
|
|
||||||
Observable.fromPromise(this.apiService.getInstance().nodes
|
Observable.fromPromise(this.apiService.getInstance().nodes
|
||||||
.getNodeInfo('-my-', opts)).subscribe((data) => {
|
.getNodeInfo('-my-', opts)).subscribe((data) => {
|
||||||
console.log('FUnNy');
|
this.logService.log('FUnNy');
|
||||||
console.log(data);
|
this.logService.log(data);
|
||||||
let objects = new ObjectDataTableAdapter([
|
let objects = new ObjectDataTableAdapter([
|
||||||
{
|
{
|
||||||
id: data.id,
|
id: data.id,
|
||||||
|
@@ -21,7 +21,7 @@ import { ActivatedRoute, Params, Router } from '@angular/router';
|
|||||||
import { MinimalNodeEntity } from 'alfresco-js-api';
|
import { MinimalNodeEntity } from 'alfresco-js-api';
|
||||||
import {
|
import {
|
||||||
AlfrescoApiService, AlfrescoContentService, AlfrescoTranslationService, CreateFolderDialogComponent,
|
AlfrescoApiService, AlfrescoContentService, AlfrescoTranslationService, CreateFolderDialogComponent,
|
||||||
DownloadZipDialogComponent, FileUploadEvent, FolderCreatedEvent, NotificationService,
|
DownloadZipDialogComponent, FileUploadEvent, FolderCreatedEvent, LogService, NotificationService,
|
||||||
SiteModel, UploadService
|
SiteModel, UploadService
|
||||||
} from 'ng2-alfresco-core';
|
} from 'ng2-alfresco-core';
|
||||||
import { DataColumn, DataRow } from 'ng2-alfresco-datatable';
|
import { DataColumn, DataRow } from 'ng2-alfresco-datatable';
|
||||||
@@ -87,7 +87,8 @@ export class FilesComponent implements OnInit {
|
|||||||
private dialog: MdDialog,
|
private dialog: MdDialog,
|
||||||
private translateService: AlfrescoTranslationService,
|
private translateService: AlfrescoTranslationService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
@Optional() private route: ActivatedRoute) {
|
@Optional() private route: ActivatedRoute,
|
||||||
|
private logService: LogService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
showFile(event) {
|
showFile(event) {
|
||||||
@@ -151,8 +152,8 @@ export class FilesComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onFolderCreated(event: FolderCreatedEvent) {
|
onFolderCreated(event: FolderCreatedEvent) {
|
||||||
console.log('FOLDER CREATED');
|
this.logService.log('FOLDER CREATED');
|
||||||
console.log(event);
|
this.logService.log(event);
|
||||||
if (event && event.parentId === this.documentList.currentFolderId) {
|
if (event && event.parentId === this.documentList.currentFolderId) {
|
||||||
this.documentList.reload();
|
this.documentList.reload();
|
||||||
}
|
}
|
||||||
@@ -197,8 +198,8 @@ export class FilesComponent implements OnInit {
|
|||||||
dialogRef.afterClosed().subscribe(folderName => {
|
dialogRef.afterClosed().subscribe(folderName => {
|
||||||
if (folderName) {
|
if (folderName) {
|
||||||
this.contentService.createFolder('', folderName, this.documentList.currentFolderId).subscribe(
|
this.contentService.createFolder('', folderName, this.documentList.currentFolderId).subscribe(
|
||||||
node => console.log(node),
|
node => this.logService.log(node),
|
||||||
err => console.log(err)
|
err => this.logService.log(err)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -264,7 +265,7 @@ export class FilesComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
dialogRef.afterClosed().subscribe(result => {
|
dialogRef.afterClosed().subscribe(result => {
|
||||||
console.log(result);
|
this.logService.log(result);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
import { Component, Inject, OnInit } from '@angular/core';
|
import { Component, Inject, OnInit } from '@angular/core';
|
||||||
import { FormModel, FormService } from 'ng2-activiti-form';
|
import { FormModel, FormService } from 'ng2-activiti-form';
|
||||||
|
import { LogService } from 'ng2-alfresco-core';
|
||||||
import { InMemoryFormService } from '../../services/in-memory-form.service';
|
import { InMemoryFormService } from '../../services/in-memory-form.service';
|
||||||
import { DemoForm } from './demo-form';
|
import { DemoForm } from './demo-form';
|
||||||
|
|
||||||
@@ -32,11 +33,11 @@ export class FormDemoComponent implements OnInit {
|
|||||||
|
|
||||||
form: FormModel;
|
form: FormModel;
|
||||||
|
|
||||||
constructor(@Inject(FormService) private formService: InMemoryFormService) {
|
constructor(@Inject(FormService) private formService: InMemoryFormService, private logSevice: LogService) {
|
||||||
// Prevent default outcome actions
|
// Prevent default outcome actions
|
||||||
formService.executeOutcome.subscribe(e => {
|
formService.executeOutcome.subscribe(e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
console.log(e.outcome);
|
this.logSevice.log(e.outcome);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -0,0 +1,8 @@
|
|||||||
|
<adf-form-list [forms]="formList" (row-dblclick)="onRowDblClick($event)">
|
||||||
|
</adf-form-list>
|
||||||
|
<div class="form-container" *ngIf="!isEmptyForm()">
|
||||||
|
<adf-form [form]="form" [data]="restoredData">
|
||||||
|
</adf-form>
|
||||||
|
</div>
|
||||||
|
<button md-button (click)="store()" color="primary">{{'FORM-LIST.STORE' | translate }}</button>
|
||||||
|
<button md-button (click)="restore()" color="primary">{{'FORM-LIST.RESTORE' | translate }}</button>
|
@@ -0,0 +1,8 @@
|
|||||||
|
.form-container {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.store-form-container{
|
||||||
|
width: 80%;
|
||||||
|
height: 80%;
|
||||||
|
}
|
@@ -16,31 +16,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, ViewChild } from '@angular/core';
|
import { Component, ViewChild } from '@angular/core';
|
||||||
import { FormModel, FormService } from 'ng2-activiti-form';
|
import { ActivitiForm, FormModel, FormService } from 'ng2-activiti-form';
|
||||||
import { ActivitiForm } from 'ng2-activiti-form';
|
import { LogService } from 'ng2-alfresco-core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'form-list-demo',
|
selector: 'form-list-demo',
|
||||||
template: `
|
templateUrl: 'form-list-demo.component.html',
|
||||||
<adf-form-list [forms]="formList" (row-dblclick)="onRowDblClick($event)">
|
styleUrls: ['form-list-demo.component.scss']
|
||||||
</adf-form-list>
|
|
||||||
<div class="form-container" *ngIf="!isEmptyForm()">
|
|
||||||
<adf-form [form]="form" [data]="restoredData">
|
|
||||||
</adf-form>
|
|
||||||
</div>
|
|
||||||
<button md-button (click)="store()" color="primary">{{'FORM-LIST.STORE' | translate }}</button>
|
|
||||||
<button md-button (click)="restore()" color="primary">{{'FORM-LIST.RESTORE' | translate }}</button>
|
|
||||||
`,
|
|
||||||
styles: [`
|
|
||||||
.form-container {
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.store-form-container{
|
|
||||||
width: 80%;
|
|
||||||
height: 80%;
|
|
||||||
}
|
|
||||||
`]
|
|
||||||
})
|
})
|
||||||
export class FormListDemoComponent {
|
export class FormListDemoComponent {
|
||||||
|
|
||||||
@@ -55,11 +37,11 @@ export class FormListDemoComponent {
|
|||||||
storedData: any = {};
|
storedData: any = {};
|
||||||
restoredData: any = {};
|
restoredData: any = {};
|
||||||
|
|
||||||
constructor(private formService: FormService) {
|
constructor(private formService: FormService, private logService: LogService) {
|
||||||
// Prevent default outcome actions
|
// Prevent default outcome actions
|
||||||
formService.executeOutcome.subscribe(e => {
|
formService.executeOutcome.subscribe(e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
console.log(e.outcome);
|
this.logService.log(e.outcome);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +53,7 @@ export class FormListDemoComponent {
|
|||||||
this.form = form;
|
this.form = form;
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(rowForm);
|
this.logService.log(rowForm);
|
||||||
}
|
}
|
||||||
|
|
||||||
isEmptyForm() {
|
isEmptyForm() {
|
||||||
@@ -80,9 +62,9 @@ export class FormListDemoComponent {
|
|||||||
|
|
||||||
store() {
|
store() {
|
||||||
this.clone(this.activitiForm.form.values, this.storedData);
|
this.clone(this.activitiForm.form.values, this.storedData);
|
||||||
console.log('DATA SAVED');
|
this.logService.log('DATA SAVED');
|
||||||
console.log(this.storedData);
|
this.logService.log(this.storedData);
|
||||||
console.log('DATA SAVED');
|
this.logService.log('DATA SAVED');
|
||||||
this.restoredData = null;
|
this.restoredData = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -53,13 +53,13 @@ export class InMemoryFormService extends FormService {
|
|||||||
// Uncomment this to use original call
|
// Uncomment this to use original call
|
||||||
// return super.getRestFieldValues(taskId, fieldId);
|
// return super.getRestFieldValues(taskId, fieldId);
|
||||||
|
|
||||||
console.log(`getRestFieldValues: ${taskId} => ${fieldId}`);
|
this.logService.log(`getRestFieldValues: ${taskId} => ${fieldId}`);
|
||||||
return new Observable<FormFieldOption[]>(observer => {
|
return new Observable<FormFieldOption[]>(observer => {
|
||||||
let field = this.data.rest.fields.find(
|
let field = this.data.rest.fields.find(
|
||||||
f => f.taskId === taskId && f.fieldId === fieldId
|
f => f.taskId === taskId && f.fieldId === fieldId
|
||||||
);
|
);
|
||||||
let values: FormFieldOption[] = field.values || [];
|
let values: FormFieldOption[] = field.values || [];
|
||||||
console.log(values);
|
this.logService.log(values);
|
||||||
observer.next(values);
|
observer.next(values);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -69,13 +69,13 @@ export class InMemoryFormService extends FormService {
|
|||||||
// Uncomment this to use original call
|
// Uncomment this to use original call
|
||||||
// return super.getRestFieldValuesByProcessId(processDefinitionId, fieldId);
|
// return super.getRestFieldValuesByProcessId(processDefinitionId, fieldId);
|
||||||
|
|
||||||
console.log(`getRestFieldValuesByProcessId: ${processDefinitionId} => ${fieldId}`);
|
this.logService.log(`getRestFieldValuesByProcessId: ${processDefinitionId} => ${fieldId}`);
|
||||||
return new Observable<FormFieldOption[]>(observer => {
|
return new Observable<FormFieldOption[]>(observer => {
|
||||||
let field = this.data.rest.fields.find(
|
let field = this.data.rest.fields.find(
|
||||||
f => f.processId === processDefinitionId && f.fieldId === fieldId
|
f => f.processId === processDefinitionId && f.fieldId === fieldId
|
||||||
);
|
);
|
||||||
let values: FormFieldOption[] = field.values || [];
|
let values: FormFieldOption[] = field.values || [];
|
||||||
console.log(values);
|
this.logService.log(values);
|
||||||
observer.next(values);
|
observer.next(values);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -40,6 +40,7 @@
|
|||||||
"no-consecutive-blank-lines": true,
|
"no-consecutive-blank-lines": true,
|
||||||
"no-console": [
|
"no-console": [
|
||||||
true,
|
true,
|
||||||
|
"log",
|
||||||
"debug",
|
"debug",
|
||||||
"info",
|
"info",
|
||||||
"time",
|
"time",
|
||||||
|
@@ -93,13 +93,11 @@ export class WidgetComponent implements AfterViewInit {
|
|||||||
|
|
||||||
/** @deprecated used only to trigger visibility engine, components should do that internally if needed */
|
/** @deprecated used only to trigger visibility engine, components should do that internally if needed */
|
||||||
checkVisibility(field: FormFieldModel) {
|
checkVisibility(field: FormFieldModel) {
|
||||||
console.log('WidgetComponent.checkVisibility was used only to trigger visibility engine, components should do that internally if needed');
|
|
||||||
this.fieldChanged.emit(field);
|
this.fieldChanged.emit(field);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @deprecated used only to trigger visibility engine, components should do that internally if needed */
|
/** @deprecated used only to trigger visibility engine, components should do that internally if needed */
|
||||||
onFieldChanged(field: FormFieldModel) {
|
onFieldChanged(field: FormFieldModel) {
|
||||||
console.log('WidgetComponent.onFieldChanged was used only to trigger visibility engine, components should do that internally if needed');
|
|
||||||
this.fieldChanged.emit(field);
|
this.fieldChanged.emit(field);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -52,7 +52,7 @@ export class FormService {
|
|||||||
|
|
||||||
constructor(private ecmModelService: EcmModelService,
|
constructor(private ecmModelService: EcmModelService,
|
||||||
private apiService: AlfrescoApiService,
|
private apiService: AlfrescoApiService,
|
||||||
private logService: LogService) {
|
protected logService: LogService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
private get contentApi(): any {
|
private get contentApi(): any {
|
||||||
@@ -155,7 +155,7 @@ export class FormService {
|
|||||||
* @returns {Observable<any>}
|
* @returns {Observable<any>}
|
||||||
*/
|
*/
|
||||||
addFieldsToAForm(formId: string, formModel: FormDefinitionModel): Observable<any> {
|
addFieldsToAForm(formId: string, formModel: FormDefinitionModel): Observable<any> {
|
||||||
console.log('addFieldsToAForm is deprecated in 1.7.0, use saveForm API instead');
|
this.logService.log('addFieldsToAForm is deprecated in 1.7.0, use saveForm API instead');
|
||||||
return Observable.fromPromise(
|
return Observable.fromPromise(
|
||||||
this.editorApi.saveForm(formId, formModel)
|
this.editorApi.saveForm(formId, formModel)
|
||||||
);
|
);
|
||||||
@@ -173,10 +173,10 @@ export class FormService {
|
|||||||
return Observable.fromPromise(
|
return Observable.fromPromise(
|
||||||
this.modelsApi.getModels(opts)
|
this.modelsApi.getModels(opts)
|
||||||
)
|
)
|
||||||
.map(function (forms: any) {
|
.map(function (forms: any) {
|
||||||
return forms.data.find(formdata => formdata.name === name);
|
return forms.data.find(formdata => formdata.name === name);
|
||||||
})
|
})
|
||||||
.catch(err => this.handleError(err));
|
.catch(err => this.handleError(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -383,9 +383,9 @@ export class FormService {
|
|||||||
return Observable.fromPromise(this.usersWorkflowApi.getUsers(option))
|
return Observable.fromPromise(this.usersWorkflowApi.getUsers(option))
|
||||||
.switchMap((response: any) => <LightUserRepresentation[]> response.data || [])
|
.switchMap((response: any) => <LightUserRepresentation[]> response.data || [])
|
||||||
.map((user: any) => {
|
.map((user: any) => {
|
||||||
user.userImage = this.getUserProfileImageApi(user.id);
|
user.userImage = this.getUserProfileImageApi(user.id);
|
||||||
return Observable.of(user);
|
return Observable.of(user);
|
||||||
})
|
})
|
||||||
.combineAll()
|
.combineAll()
|
||||||
.defaultIfEmpty([])
|
.defaultIfEmpty([])
|
||||||
.catch(err => this.handleError(err));
|
.catch(err => this.handleError(err));
|
||||||
|
@@ -173,6 +173,5 @@ class BasicButtonComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onAuditClick(event: any) {
|
onAuditClick(event: any) {
|
||||||
console.log(event);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Directive, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
|
import { Directive, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
||||||
import { ContentService } from 'ng2-alfresco-core';
|
import { ContentService } from 'ng2-alfresco-core';
|
||||||
import { ProcessService } from './../services/process.service';
|
import { ProcessService } from './../services/process.service';
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ const PDF_FORMAT: string = 'pdf';
|
|||||||
'(click)': 'onClickAudit()'
|
'(click)': 'onClickAudit()'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
export class ProcessAuditDirective implements OnInit, OnChanges {
|
export class ProcessAuditDirective implements OnChanges {
|
||||||
|
|
||||||
@Input('process-id')
|
@Input('process-id')
|
||||||
processId: string;
|
processId: string;
|
||||||
@@ -60,9 +60,6 @@ export class ProcessAuditDirective implements OnInit, OnChanges {
|
|||||||
private processListService: ProcessService) {
|
private processListService: ProcessService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
console.log('OnInit');
|
|
||||||
}
|
|
||||||
ngOnChanges(changes: SimpleChanges): void {
|
ngOnChanges(changes: SimpleChanges): void {
|
||||||
if (!this.isValidType()) {
|
if (!this.isValidType()) {
|
||||||
this.setDefaultFormatType();
|
this.setDefaultFormatType();
|
||||||
|
@@ -158,6 +158,5 @@ class BasicButtonComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onAuditClick(event: any) {
|
onAuditClick(event: any) {
|
||||||
console.log(event);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -128,10 +128,6 @@ import { MimeTypeIconPipe } from './src/pipes/mime-type-icon.pipe';
|
|||||||
import { HighlightPipe } from './src/pipes/text-highlight.pipe';
|
import { HighlightPipe } from './src/pipes/text-highlight.pipe';
|
||||||
import { TimeAgoPipe } from './src/pipes/time-ago.pipe';
|
import { TimeAgoPipe } from './src/pipes/time-ago.pipe';
|
||||||
|
|
||||||
import { AlfrescoMdlMenuDirective } from './src/components/material/mdl-menu.directive';
|
|
||||||
import { AlfrescoMdlTextFieldDirective } from './src/components/material/mdl-textfield.directive';
|
|
||||||
import { MDLDirective } from './src/components/material/mdl-upgrade-element.directive';
|
|
||||||
|
|
||||||
export { ContextMenuModule } from './src/components/context-menu/context-menu.module';
|
export { ContextMenuModule } from './src/components/context-menu/context-menu.module';
|
||||||
export { CardViewModule } from './src/components/view/card-view.module';
|
export { CardViewModule } from './src/components/view/card-view.module';
|
||||||
export { CollapsableModule } from './src/components/collapsable/collapsable.module';
|
export { CollapsableModule } from './src/components/collapsable/collapsable.module';
|
||||||
@@ -211,14 +207,6 @@ export function deprecatedProviders() {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function obsoleteMdlDirectives() {
|
|
||||||
return [
|
|
||||||
MDLDirective,
|
|
||||||
AlfrescoMdlMenuDirective,
|
|
||||||
AlfrescoMdlTextFieldDirective
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
export function pipes() {
|
export function pipes() {
|
||||||
return [
|
return [
|
||||||
FileSizePipe,
|
FileSizePipe,
|
||||||
@@ -255,7 +243,6 @@ export function createTranslateLoader(http: Http, logService: LogService) {
|
|||||||
CollapsableModule
|
CollapsableModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
...obsoleteMdlDirectives(),
|
|
||||||
...pipes(),
|
...pipes(),
|
||||||
LogoutDirective,
|
LogoutDirective,
|
||||||
UploadDirective,
|
UploadDirective,
|
||||||
@@ -298,7 +285,6 @@ export function createTranslateLoader(http: Http, logService: LogService) {
|
|||||||
CollapsableModule,
|
CollapsableModule,
|
||||||
PaginationModule,
|
PaginationModule,
|
||||||
ToolbarModule,
|
ToolbarModule,
|
||||||
...obsoleteMdlDirectives(),
|
|
||||||
...pipes(),
|
...pipes(),
|
||||||
LogoutDirective,
|
LogoutDirective,
|
||||||
UploadDirective,
|
UploadDirective,
|
||||||
|
@@ -1,38 +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 { AfterViewInit, Directive, ElementRef } from '@angular/core';
|
|
||||||
|
|
||||||
declare var componentHandler;
|
|
||||||
|
|
||||||
@Directive({
|
|
||||||
selector: '[adf-mdl-menu], [alfresco-mdl-menu]'
|
|
||||||
})
|
|
||||||
export class AlfrescoMdlMenuDirective implements AfterViewInit {
|
|
||||||
|
|
||||||
constructor(private element: ElementRef) {}
|
|
||||||
|
|
||||||
ngAfterViewInit() {
|
|
||||||
if (componentHandler) {
|
|
||||||
let el = this.element.nativeElement;
|
|
||||||
el.classList.add('mdl-menu');
|
|
||||||
el.classList.add('mdl-js-menu');
|
|
||||||
el.classList.add('mdl-js-ripple-effect');
|
|
||||||
componentHandler.upgradeElement(el, 'MaterialMenu');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,38 +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 { AfterViewInit, Directive, ElementRef } from '@angular/core';
|
|
||||||
|
|
||||||
declare var componentHandler;
|
|
||||||
|
|
||||||
@Directive({
|
|
||||||
selector: '[adf-mdl-textfield]], [alfresco-mdl-textfield]'
|
|
||||||
})
|
|
||||||
export class AlfrescoMdlTextFieldDirective implements AfterViewInit {
|
|
||||||
|
|
||||||
constructor(private element: ElementRef) {}
|
|
||||||
|
|
||||||
ngAfterViewInit() {
|
|
||||||
if (componentHandler) {
|
|
||||||
let el = this.element.nativeElement;
|
|
||||||
el.classList.add('mdl-textfield');
|
|
||||||
el.classList.add('mdl-js-textfield');
|
|
||||||
el.classList.add('mdl-textfield--floating-label');
|
|
||||||
componentHandler.upgradeElement(el, 'MaterialTextfield');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -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 { AfterViewInit, Directive } from '@angular/core';
|
|
||||||
declare var componentHandler;
|
|
||||||
|
|
||||||
@Directive({
|
|
||||||
selector: '[mdl]'
|
|
||||||
})
|
|
||||||
export class MDLDirective implements AfterViewInit {
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
console.log('MDLDirective is deprecated and should not be used.');
|
|
||||||
}
|
|
||||||
|
|
||||||
ngAfterViewInit() {
|
|
||||||
componentHandler.upgradeAllRegistered();
|
|
||||||
}
|
|
||||||
}
|
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, Input, OnChanges } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
import { CardViewMapItemModel } from '../../models/card-view-mapitem.model';
|
import { CardViewMapItemModel } from '../../models/card-view-mapitem.model';
|
||||||
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
||||||
|
|
||||||
@@ -25,16 +25,12 @@ import { CardViewUpdateService } from '../../services/card-view-update.service';
|
|||||||
styleUrls: ['./card-view-mapitem.component.scss']
|
styleUrls: ['./card-view-mapitem.component.scss']
|
||||||
})
|
})
|
||||||
|
|
||||||
export class CardViewMapItemComponent implements OnChanges {
|
export class CardViewMapItemComponent {
|
||||||
@Input()
|
@Input()
|
||||||
property: CardViewMapItemModel;
|
property: CardViewMapItemModel;
|
||||||
|
|
||||||
constructor(private cardViewUpdateService: CardViewUpdateService) {}
|
constructor(private cardViewUpdateService: CardViewUpdateService) {}
|
||||||
|
|
||||||
ngOnChanges() {
|
|
||||||
console.log();
|
|
||||||
}
|
|
||||||
|
|
||||||
isClickable() {
|
isClickable() {
|
||||||
return this.property.clickable;
|
return this.property.clickable;
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,10 @@
|
|||||||
|
<h1 md-dialog-title>{{ 'CORE.DIALOG.DOWNLOAD_ZIP.TITLE' | translate }}</h1>
|
||||||
|
<div md-dialog-content>
|
||||||
|
<md-progress-bar color="primary" mode="indeterminate"></md-progress-bar>
|
||||||
|
</div>
|
||||||
|
<div md-dialog-actions>
|
||||||
|
<span class="spacer"></span>
|
||||||
|
<button md-button color="primary" (click)="cancelDownload()">
|
||||||
|
{{ 'CORE.DIALOG.DOWNLOAD_ZIP.ACTIONS.CANCEL' | translate }}
|
||||||
|
</button>
|
||||||
|
</div>
|
@@ -0,0 +1,5 @@
|
|||||||
|
.spacer { flex: 1 1 auto; }
|
||||||
|
|
||||||
|
.adf-download-zip-dialog .mat-dialog-actions .mat-button-wrapper {
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
@@ -17,31 +17,14 @@
|
|||||||
|
|
||||||
import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';
|
import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
import { MD_DIALOG_DATA, MdDialogRef } from '@angular/material';
|
import { MD_DIALOG_DATA, MdDialogRef } from '@angular/material';
|
||||||
|
|
||||||
import { DownloadEntry, MinimalNodeEntity } from 'alfresco-js-api';
|
import { DownloadEntry, MinimalNodeEntity } from 'alfresco-js-api';
|
||||||
|
import { LogService } from '../services/log.service';
|
||||||
import { AlfrescoApiService } from './../services/alfresco-api.service';
|
import { AlfrescoApiService } from './../services/alfresco-api.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-download-zip-dialog',
|
selector: 'adf-download-zip-dialog',
|
||||||
template: `
|
templateUrl: './download-zip.dialog.html',
|
||||||
<h1 md-dialog-title>{{ 'CORE.DIALOG.DOWNLOAD_ZIP.TITLE' | translate }}</h1>
|
styleUrls: ['./download-zip.dialog.scss'],
|
||||||
<div md-dialog-content>
|
|
||||||
<md-progress-bar color="primary" mode="indeterminate"></md-progress-bar>
|
|
||||||
</div>
|
|
||||||
<div md-dialog-actions>
|
|
||||||
<span class="spacer"></span>
|
|
||||||
<button md-button color="primary" (click)="cancelDownload()">
|
|
||||||
{{ 'CORE.DIALOG.DOWNLOAD_ZIP.ACTIONS.CANCEL' | translate }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
`,
|
|
||||||
styles: [`
|
|
||||||
.spacer { flex: 1 1 auto; }
|
|
||||||
|
|
||||||
.adf-download-zip-dialog .mat-dialog-actions .mat-button-wrapper {
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
`],
|
|
||||||
host: { 'class': 'adf-download-zip-dialog' },
|
host: { 'class': 'adf-download-zip-dialog' },
|
||||||
encapsulation: ViewEncapsulation.None
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
@@ -52,7 +35,8 @@ export class DownloadZipDialogComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(private apiService: AlfrescoApiService,
|
constructor(private apiService: AlfrescoApiService,
|
||||||
private dialogRef: MdDialogRef<DownloadZipDialogComponent>,
|
private dialogRef: MdDialogRef<DownloadZipDialogComponent>,
|
||||||
@Inject(MD_DIALOG_DATA) private data: { nodeIds?: string[] }) {
|
@Inject(MD_DIALOG_DATA) private data: { nodeIds?: string[] },
|
||||||
|
private logService: LogService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
private get downloadsApi() {
|
private get downloadsApi() {
|
||||||
@@ -74,7 +58,7 @@ export class DownloadZipDialogComponent implements OnInit {
|
|||||||
if (!this.cancelled) {
|
if (!this.cancelled) {
|
||||||
this.downloadZip(this.data.nodeIds);
|
this.downloadZip(this.data.nodeIds);
|
||||||
} else {
|
} else {
|
||||||
console.log('Cancelled');
|
this.logService.log('Cancelled');
|
||||||
}
|
}
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
@@ -90,17 +74,16 @@ export class DownloadZipDialogComponent implements OnInit {
|
|||||||
|
|
||||||
const promise: any = this.downloadsApi.createDownload({ nodeIds });
|
const promise: any = this.downloadsApi.createDownload({ nodeIds });
|
||||||
|
|
||||||
promise.on('progress', progress => console.log('Progress', progress));
|
promise.on('progress', progress => this.logService.log('Progress', progress));
|
||||||
promise.on('error', error => console.log('Error', error));
|
promise.on('error', error => this.logService.error('Error', error));
|
||||||
promise.on('abort', data => console.log('Abort', data));
|
promise.on('abort', data => this.logService.log('Abort', data));
|
||||||
|
|
||||||
promise.on('success', (data: DownloadEntry) => {
|
promise.on('success', (data: DownloadEntry) => {
|
||||||
console.log('Success', data);
|
|
||||||
if (data && data.entry && data.entry.id) {
|
if (data && data.entry && data.entry.id) {
|
||||||
const url = this.contentApi.getContentUrl(data.entry.id, true);
|
const url = this.contentApi.getContentUrl(data.entry.id, true);
|
||||||
// the call is needed only to get the name of the package
|
// the call is needed only to get the name of the package
|
||||||
this.nodesApi.getNode(data.entry.id).then((downloadNode: MinimalNodeEntity) => {
|
this.nodesApi.getNode(data.entry.id).then((downloadNode: MinimalNodeEntity) => {
|
||||||
console.log(downloadNode);
|
this.logService.log(downloadNode);
|
||||||
const fileName = downloadNode.entry.name;
|
const fileName = downloadNode.entry.name;
|
||||||
this.waitAndDownload(data.entry.id, url, fileName);
|
this.waitAndDownload(data.entry.id, url, fileName);
|
||||||
});
|
});
|
||||||
|
@@ -21,6 +21,7 @@ import { AlfrescoSettingsService } from './alfresco-settings.service';
|
|||||||
import { AppConfigModule } from './app-config.service';
|
import { AppConfigModule } from './app-config.service';
|
||||||
import { StorageService } from './storage.service';
|
import { StorageService } from './storage.service';
|
||||||
import { UserPreferencesService } from './user-preferences.service';
|
import { UserPreferencesService } from './user-preferences.service';
|
||||||
|
import { LogService } from './log.service';
|
||||||
|
|
||||||
describe('AlfrescoSettingsService', () => {
|
describe('AlfrescoSettingsService', () => {
|
||||||
|
|
||||||
@@ -35,7 +36,8 @@ describe('AlfrescoSettingsService', () => {
|
|||||||
AlfrescoApiService,
|
AlfrescoApiService,
|
||||||
AlfrescoSettingsService,
|
AlfrescoSettingsService,
|
||||||
UserPreferencesService,
|
UserPreferencesService,
|
||||||
StorageService
|
StorageService,
|
||||||
|
LogService
|
||||||
]
|
]
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}));
|
}));
|
||||||
|
@@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { AppConfigService } from './app-config.service';
|
import { AppConfigService } from './app-config.service';
|
||||||
|
import { LogService } from './log.service';
|
||||||
import { UserPreferencesService } from './user-preferences.service';
|
import { UserPreferencesService } from './user-preferences.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@@ -24,52 +25,53 @@ export class AlfrescoSettingsService {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private appConfig: AppConfigService,
|
private appConfig: AppConfigService,
|
||||||
|
private logService: LogService,
|
||||||
private preferences: UserPreferencesService) {
|
private preferences: UserPreferencesService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @deprecated in 1.6.0 */
|
/** @deprecated in 1.6.0 */
|
||||||
public get ecmHost(): string {
|
public get ecmHost(): string {
|
||||||
console.log('AlfrescoSettingsService.ecmHost is deprecated. Use AppConfigService instead.');
|
this.logService.log('AlfrescoSettingsService.ecmHost is deprecated. Use AppConfigService instead.');
|
||||||
return this.appConfig.get<string>('ecmHost');
|
return this.appConfig.get<string>('ecmHost');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @deprecated in 1.7.0 */
|
/** @deprecated in 1.7.0 */
|
||||||
public set csrfDisabled(csrfDisabled: boolean) {
|
public set csrfDisabled(csrfDisabled: boolean) {
|
||||||
console.log(`AlfrescoSettingsService.csrfDisabled is deprecated. Use UserPreferencesService.disableCSRF instead.`);
|
this.logService.log(`AlfrescoSettingsService.csrfDisabled is deprecated. Use UserPreferencesService.disableCSRF instead.`);
|
||||||
this.preferences.disableCSRF = csrfDisabled;
|
this.preferences.disableCSRF = csrfDisabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @deprecated in 1.6.0 */
|
/** @deprecated in 1.6.0 */
|
||||||
public set ecmHost(ecmHostUrl: string) {
|
public set ecmHost(ecmHostUrl: string) {
|
||||||
console.log('AlfrescoSettingsService.ecmHost is deprecated. Use AppConfigService instead.');
|
this.logService.log('AlfrescoSettingsService.ecmHost is deprecated. Use AppConfigService instead.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @deprecated in 1.6.0 */
|
/** @deprecated in 1.6.0 */
|
||||||
public get bpmHost(): string {
|
public get bpmHost(): string {
|
||||||
console.log('AlfrescoSettingsService.bpmHost is deprecated. Use AppConfigService instead.');
|
this.logService.log('AlfrescoSettingsService.bpmHost is deprecated. Use AppConfigService instead.');
|
||||||
return this.appConfig.get<string>('bpmHost');
|
return this.appConfig.get<string>('bpmHost');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @deprecated in 1.6.0 */
|
/** @deprecated in 1.6.0 */
|
||||||
public set bpmHost(bpmHostUrl: string) {
|
public set bpmHost(bpmHostUrl: string) {
|
||||||
console.log('AlfrescoSettingsService.bpmHost is deprecated. Use AppConfigService instead.');
|
this.logService.log('AlfrescoSettingsService.bpmHost is deprecated. Use AppConfigService instead.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @deprecated in 1.6.0 */
|
/** @deprecated in 1.6.0 */
|
||||||
public getBPMApiBaseUrl(): string {
|
public getBPMApiBaseUrl(): string {
|
||||||
console.log('AlfrescoSettingsService.getBPMApiBaseUrl is deprecated.');
|
this.logService.log('AlfrescoSettingsService.getBPMApiBaseUrl is deprecated.');
|
||||||
return this.bpmHost + '/activiti-app';
|
return this.bpmHost + '/activiti-app';
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @deprecated in 1.7.0 */
|
/** @deprecated in 1.7.0 */
|
||||||
public getProviders(): string {
|
public getProviders(): string {
|
||||||
console.log(`AlfrescoSettingsService.getProviders is deprecated. Use UserPreferencesService.authType instead.`);
|
this.logService.log(`AlfrescoSettingsService.getProviders is deprecated. Use UserPreferencesService.authType instead.`);
|
||||||
return this.preferences.authType;
|
return this.preferences.authType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @deprecated in 1.7.0 */
|
/** @deprecated in 1.7.0 */
|
||||||
public setProviders(providers: string) {
|
public setProviders(providers: string) {
|
||||||
console.log(`AlfrescoSettingsService.getProviders is deprecated. Use UserPreferencesService.authType instead.`);
|
this.logService.log(`AlfrescoSettingsService.getProviders is deprecated. Use UserPreferencesService.authType instead.`);
|
||||||
this.preferences.authType = providers;
|
this.preferences.authType = providers;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -24,11 +24,13 @@ import { MaterialModule } from '../../material.module';
|
|||||||
import { DocumentListService } from '../../services/document-list.service';
|
import { DocumentListService } from '../../services/document-list.service';
|
||||||
import { DocumentListComponent } from './../document-list.component';
|
import { DocumentListComponent } from './../document-list.component';
|
||||||
import { ContentColumnListComponent } from './content-column-list.component';
|
import { ContentColumnListComponent } from './content-column-list.component';
|
||||||
|
import { LogService } from 'ng2-alfresco-core';
|
||||||
|
|
||||||
describe('ContentColumnList', () => {
|
describe('ContentColumnList', () => {
|
||||||
|
|
||||||
let documentList: DocumentListComponent;
|
let documentList: DocumentListComponent;
|
||||||
let columnList: ContentColumnListComponent;
|
let columnList: ContentColumnListComponent;
|
||||||
|
let logService: LogService;
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
@@ -41,7 +43,8 @@ describe('ContentColumnList', () => {
|
|||||||
DocumentListComponent
|
DocumentListComponent
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
DocumentListService
|
DocumentListService,
|
||||||
|
LogService
|
||||||
],
|
],
|
||||||
schemas: [
|
schemas: [
|
||||||
CUSTOM_ELEMENTS_SCHEMA
|
CUSTOM_ELEMENTS_SCHEMA
|
||||||
@@ -51,7 +54,8 @@ describe('ContentColumnList', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
documentList = (TestBed.createComponent(DocumentListComponent).componentInstance as DocumentListComponent);
|
documentList = (TestBed.createComponent(DocumentListComponent).componentInstance as DocumentListComponent);
|
||||||
columnList = new ContentColumnListComponent(documentList);
|
logService = TestBed.get(LogService);
|
||||||
|
columnList = new ContentColumnListComponent(documentList, logService);
|
||||||
|
|
||||||
documentList.ngOnInit();
|
documentList.ngOnInit();
|
||||||
});
|
});
|
||||||
@@ -69,7 +73,7 @@ describe('ContentColumnList', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should require document list instance to register action', () => {
|
it('should require document list instance to register action', () => {
|
||||||
columnList = new ContentColumnListComponent(null);
|
columnList = new ContentColumnListComponent(null, logService);
|
||||||
let col = <DataColumn> {};
|
let col = <DataColumn> {};
|
||||||
expect(columnList.registerColumn(col)).toBeFalsy();
|
expect(columnList.registerColumn(col)).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
/* tslint:disable:component-selector */
|
/* tslint:disable:component-selector */
|
||||||
|
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { LogService } from 'ng2-alfresco-core';
|
||||||
import { DataColumn } from 'ng2-alfresco-datatable';
|
import { DataColumn } from 'ng2-alfresco-datatable';
|
||||||
|
|
||||||
import { DocumentListComponent } from './../document-list.component';
|
import { DocumentListComponent } from './../document-list.component';
|
||||||
@@ -28,8 +29,8 @@ import { DocumentListComponent } from './../document-list.component';
|
|||||||
})
|
})
|
||||||
export class ContentColumnListComponent {
|
export class ContentColumnListComponent {
|
||||||
|
|
||||||
constructor(private documentList: DocumentListComponent) {
|
constructor(private documentList: DocumentListComponent, private logService: LogService ) {
|
||||||
console.log('ContentColumnListComponent is deprecated starting with 1.7.0 and may be removed in future versions. Use DataColumnListComponent instead.');
|
this.logService.log('ContentColumnListComponent is deprecated starting with 1.7.0 and may be removed in future versions. Use DataColumnListComponent instead.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||||
import { async, TestBed } from '@angular/core/testing';
|
import { async, TestBed } from '@angular/core/testing';
|
||||||
import { CoreModule } from 'ng2-alfresco-core';
|
import { CoreModule, LogService } from 'ng2-alfresco-core';
|
||||||
import { DataTableModule } from 'ng2-alfresco-datatable';
|
import { DataTableModule } from 'ng2-alfresco-datatable';
|
||||||
import { MaterialModule } from '../../material.module';
|
import { MaterialModule } from '../../material.module';
|
||||||
import { DocumentListService } from '../../services/document-list.service';
|
import { DocumentListService } from '../../services/document-list.service';
|
||||||
@@ -29,6 +29,7 @@ describe('ContentColumn', () => {
|
|||||||
|
|
||||||
let documentList: DocumentListComponent;
|
let documentList: DocumentListComponent;
|
||||||
let columnList: ContentColumnListComponent;
|
let columnList: ContentColumnListComponent;
|
||||||
|
let logService: LogService;
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
@@ -41,7 +42,8 @@ describe('ContentColumn', () => {
|
|||||||
DocumentListComponent
|
DocumentListComponent
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
DocumentListService
|
DocumentListService,
|
||||||
|
LogService
|
||||||
],
|
],
|
||||||
schemas: [
|
schemas: [
|
||||||
CUSTOM_ELEMENTS_SCHEMA
|
CUSTOM_ELEMENTS_SCHEMA
|
||||||
@@ -51,7 +53,8 @@ describe('ContentColumn', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
documentList = (TestBed.createComponent(DocumentListComponent).componentInstance as DocumentListComponent);
|
documentList = (TestBed.createComponent(DocumentListComponent).componentInstance as DocumentListComponent);
|
||||||
columnList = new ContentColumnListComponent(documentList);
|
logService = TestBed.get(LogService);
|
||||||
|
columnList = new ContentColumnListComponent(documentList, logService);
|
||||||
|
|
||||||
documentList.ngOnInit();
|
documentList.ngOnInit();
|
||||||
});
|
});
|
||||||
@@ -59,7 +62,7 @@ describe('ContentColumn', () => {
|
|||||||
it('should register model within parent column list', () => {
|
it('should register model within parent column list', () => {
|
||||||
spyOn(columnList, 'registerColumn').and.callThrough();
|
spyOn(columnList, 'registerColumn').and.callThrough();
|
||||||
|
|
||||||
let column = new ContentColumnComponent(columnList);
|
let column = new ContentColumnComponent(columnList, logService);
|
||||||
column.ngAfterContentInit();
|
column.ngAfterContentInit();
|
||||||
|
|
||||||
expect(columnList.registerColumn).toHaveBeenCalled();
|
expect(columnList.registerColumn).toHaveBeenCalled();
|
||||||
@@ -70,7 +73,7 @@ describe('ContentColumn', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should setup screen reader title for thumbnail column', () => {
|
it('should setup screen reader title for thumbnail column', () => {
|
||||||
let column = new ContentColumnComponent(columnList);
|
let column = new ContentColumnComponent(columnList, logService);
|
||||||
column.key = '$thumbnail';
|
column.key = '$thumbnail';
|
||||||
column.ngOnInit();
|
column.ngOnInit();
|
||||||
|
|
||||||
@@ -78,7 +81,7 @@ describe('ContentColumn', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should register on init', () => {
|
it('should register on init', () => {
|
||||||
let column = new ContentColumnComponent(columnList);
|
let column = new ContentColumnComponent(columnList, logService);
|
||||||
spyOn(column, 'register').and.callThrough();
|
spyOn(column, 'register').and.callThrough();
|
||||||
|
|
||||||
column.ngAfterContentInit();
|
column.ngAfterContentInit();
|
||||||
@@ -86,10 +89,10 @@ describe('ContentColumn', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should require action list to register action with', () => {
|
it('should require action list to register action with', () => {
|
||||||
let column = new ContentColumnComponent(columnList);
|
let column = new ContentColumnComponent(columnList, logService);
|
||||||
expect(column.register()).toBeTruthy();
|
expect(column.register()).toBeTruthy();
|
||||||
|
|
||||||
column = new ContentColumnComponent(null);
|
column = new ContentColumnComponent(null, logService);
|
||||||
expect(column.register()).toBeFalsy();
|
expect(column.register()).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
/* tslint:disable:component-selector */
|
/* tslint:disable:component-selector */
|
||||||
|
|
||||||
import { AfterContentInit, Component, ContentChild, Input, OnInit, TemplateRef } from '@angular/core';
|
import { AfterContentInit, Component, ContentChild, Input, OnInit, TemplateRef } from '@angular/core';
|
||||||
|
import { LogService } from 'ng2-alfresco-core';
|
||||||
import { DataColumn } from 'ng2-alfresco-datatable';
|
import { DataColumn } from 'ng2-alfresco-datatable';
|
||||||
|
|
||||||
import { ContentColumnListComponent } from './content-column-list.component';
|
import { ContentColumnListComponent } from './content-column-list.component';
|
||||||
@@ -55,8 +56,8 @@ export class ContentColumnComponent implements OnInit, AfterContentInit, DataCol
|
|||||||
@Input('class')
|
@Input('class')
|
||||||
cssClass: string;
|
cssClass: string;
|
||||||
|
|
||||||
constructor(private list: ContentColumnListComponent) {
|
constructor(private list: ContentColumnListComponent, private logService: LogService) {
|
||||||
console.log('ContentColumnComponent is deprecated starting with 1.7.0 and may be removed in future versions. Use DataColumnComponent instead.');
|
this.logService.log('ContentColumnComponent is deprecated starting with 1.7.0 and may be removed in future versions. Use DataColumnComponent instead.');
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@@ -70,7 +70,6 @@ describe('DocumentList', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
eventMock = {
|
eventMock = {
|
||||||
preventDefault: function () {
|
preventDefault: function () {
|
||||||
console.log('mock preventDefault');
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -228,7 +227,6 @@ describe('DocumentList', () => {
|
|||||||
it('should not execute action without node provided', () => {
|
it('should not execute action without node provided', () => {
|
||||||
let action = new ContentActionModel();
|
let action = new ContentActionModel();
|
||||||
action.handler = function () {
|
action.handler = function () {
|
||||||
console.log('mock handler');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
spyOn(action, 'handler').and.stub();
|
spyOn(action, 'handler').and.stub();
|
||||||
|
@@ -41,6 +41,7 @@
|
|||||||
"no-consecutive-blank-lines": true,
|
"no-consecutive-blank-lines": true,
|
||||||
"no-console": [
|
"no-console": [
|
||||||
true,
|
true,
|
||||||
|
"log",
|
||||||
"debug",
|
"debug",
|
||||||
"info",
|
"info",
|
||||||
"time",
|
"time",
|
||||||
|
Reference in New Issue
Block a user