Generalized table to not depend on project id

This commit is contained in:
2019-03-15 10:18:23 +01:00
parent 4f5eee6705
commit 479b844174
8 changed files with 63 additions and 35 deletions

View File

@@ -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,

View File

@@ -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(),
]);
}
}