Generalized table to not depend on project id
This commit is contained in:
@@ -34,8 +34,15 @@ let TableActions = {
|
||||
|
||||
let TasksTable = Vue.component('attract-tasks-table', {
|
||||
extends: PillarTable,
|
||||
columnFactory: TasksColumnFactory,
|
||||
rowsSource: TaskRowsSource,
|
||||
props: {
|
||||
project: Object
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
columnFactory: new TasksColumnFactory(this.project),
|
||||
rowsSource: new TaskRowsSource(this.project._id),
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'pillar-table-actions': TableActions,
|
||||
'pillar-table-row-filter': RowFilter,
|
||||
|
@@ -10,17 +10,14 @@ let ColumnFactoryBase = pillar.vuecomponents.table.columns.ColumnFactoryBase;
|
||||
|
||||
class TasksColumnFactory extends ColumnFactoryBase{
|
||||
thenGetColumns() {
|
||||
return this.thenGetProject()
|
||||
.then((project) => {
|
||||
return [
|
||||
new Status(),
|
||||
new ParentName(),
|
||||
new RowObject(),
|
||||
new ShortCode(),
|
||||
new TaskType(),
|
||||
new TaskDueDate(),
|
||||
];
|
||||
})
|
||||
return Promise.resolve([
|
||||
new Status(),
|
||||
new ParentName(),
|
||||
new RowObject(),
|
||||
new ShortCode(),
|
||||
new TaskType(),
|
||||
new TaskDueDate(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user