Store filter/column settings in localStorage
The filter and column settings in tables are stored per project and context in the browsers localStorage. This makes the table keep the settings even if the browser is refreshed or restarted. The table emits a "componentStateChanged" event containing the tables current state (filter/column settings) which then is saved by the top level component.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
let PillarTable = pillar.vuecomponents.table.PillarTable;
|
||||
import {TasksColumnFactory} from './columns/TasksColumnFactory'
|
||||
import {TaskRowsSource} from './rows/TaskRowsSource'
|
||||
import {RowFilter} from '../attracttable/filter/RowFilter'
|
||||
import {RowFilter} from '../attracttable/rows/filter/RowFilter'
|
||||
|
||||
const TEMPLATE =`
|
||||
<div class="pillar-table-actions">
|
||||
@@ -41,6 +41,18 @@ let TasksTable = Vue.component('attract-tasks-table', {
|
||||
return {
|
||||
columnFactory: new TasksColumnFactory(this.project),
|
||||
rowsSource: new TaskRowsSource(this.project._id),
|
||||
rowFilterConfig: {validStatuses: this.getValidStatuses()}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getValidStatuses() {
|
||||
for (const it of this.project.node_types) {
|
||||
if(it.name === 'attract_task'){
|
||||
return it.dyn_schema.status.allowed;
|
||||
}
|
||||
}
|
||||
console.warn('Did not find allowed statuses for node type attract_task');
|
||||
return [];
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
Reference in New Issue
Block a user