Enable renaming views and lint

This commit is contained in:
Andrew Kingston 2023-08-03 13:31:44 +01:00
parent 3eeb945934
commit f5e5a883cf
2 changed files with 14 additions and 19 deletions

View File

@ -54,23 +54,20 @@ export function createViewsV2Store() {
} }
const save = async view => { const save = async view => {
// No dedicated save endpoint at this time const savedView = await API.viewV2.update(view)
// 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 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 { return {
subscribe: derivedStore.subscribe, subscribe: derivedStore.subscribe,
@ -78,7 +75,6 @@ export function createViewsV2Store() {
delete: deleteView, delete: deleteView,
create, create,
save, save,
replace,
} }
} }

View File

@ -16,8 +16,7 @@ export const createStores = context => {
} }
export const initialise = context => { export const initialise = context => {
const { sort, initialSortColumn, initialSortOrder, table, datasource } = const { sort, initialSortColumn, initialSortOrder } = context
context
// Reset sort when initial sort props change // Reset sort when initial sort props change
initialSortColumn.subscribe(newSortColumn => { initialSortColumn.subscribe(newSortColumn => {