Enable renaming views and lint
This commit is contained in:
parent
3eeb945934
commit
f5e5a883cf
|
@ -54,23 +54,20 @@ export function createViewsV2Store() {
|
|||
}
|
||||
|
||||
const save = async view => {
|
||||
// No dedicated save endpoint at this time
|
||||
// const savedView = await API.saveView(view)
|
||||
//
|
||||
// // Update tables
|
||||
// tables.update(state => {
|
||||
// const table = state.list.find(table => table._id === view.tableId)
|
||||
// if (table) {
|
||||
// if (view.originalName) {
|
||||
// delete table.views[view.originalName]
|
||||
// }
|
||||
// table.views[view.name] = savedView
|
||||
// }
|
||||
// return { ...state }
|
||||
// })
|
||||
}
|
||||
const savedView = await API.viewV2.update(view)
|
||||
|
||||
const replace = (id, view) => {}
|
||||
// Update tables
|
||||
tables.update(state => {
|
||||
const table = state.list.find(table => table._id === view.tableId)
|
||||
if (table) {
|
||||
if (view.originalName) {
|
||||
delete table.views[view.originalName]
|
||||
}
|
||||
table.views[view.name] = savedView
|
||||
}
|
||||
return { ...state }
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
subscribe: derivedStore.subscribe,
|
||||
|
@ -78,7 +75,6 @@ export function createViewsV2Store() {
|
|||
delete: deleteView,
|
||||
create,
|
||||
save,
|
||||
replace,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,8 +16,7 @@ export const createStores = context => {
|
|||
}
|
||||
|
||||
export const initialise = context => {
|
||||
const { sort, initialSortColumn, initialSortOrder, table, datasource } =
|
||||
context
|
||||
const { sort, initialSortColumn, initialSortOrder } = context
|
||||
|
||||
// Reset sort when initial sort props change
|
||||
initialSortColumn.subscribe(newSortColumn => {
|
||||
|
|
Loading…
Reference in New Issue