[ADF-2102] Task List - Provide a way to support custom html template and static columns at same time (#2793)

* Removed lodash import from tasklist component.
* Refactored getschema method.
This commit is contained in:
siva kumar
2017-12-20 18:45:07 +05:30
committed by Maurizio Vitale
parent 553ae4db7b
commit 1b50094cc5

View File

@@ -19,7 +19,6 @@ import { DataColumn, DataRowEvent, DataTableAdapter, ObjectDataColumn, ObjectDat
import { AppConfigService, DataColumnListComponent } from '@alfresco/adf-core'; import { AppConfigService, DataColumnListComponent } from '@alfresco/adf-core';
import { AfterContentInit, Component, ContentChild, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core'; import { AfterContentInit, Component, ContentChild, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
import * as _ from 'lodash';
import { TaskQueryRequestRepresentationModel } from '../models/filter.model'; import { TaskQueryRequestRepresentationModel } from '../models/filter.model';
import { TaskListModel } from '../models/task-list.model'; import { TaskListModel } from '../models/task-list.model';
import { taskPresetsDefaultModel } from '../models/task-preset.model'; import { taskPresetsDefaultModel } from '../models/task-preset.model';
@@ -344,8 +343,7 @@ export class TaskListComponent implements OnChanges, OnInit, AfterContentInit {
getSchema(): any { getSchema(): any {
let customSchemaColumns = []; let customSchemaColumns = [];
customSchemaColumns = _.concat(customSchemaColumns, this.getSchemaFromConfig(this.presetColumn)); customSchemaColumns = this.getSchemaFromConfig(this.presetColumn).concat(this.getSchemaFromHtml());
customSchemaColumns = _.concat(customSchemaColumns, this.getSchemaFromHtml());
if (customSchemaColumns.length === 0) { if (customSchemaColumns.length === 0) {
customSchemaColumns = this.getDefaultLayoutPreset(); customSchemaColumns = this.getDefaultLayoutPreset();
} }