Fix a few edge cases with v1 views
This commit is contained in:
parent
0dd432f286
commit
8d87395a98
|
@ -48,7 +48,9 @@
|
|||
$: datasource = $datasources.list.find(ds => ds._id === table?.sourceId)
|
||||
$: tableSelectedBy = $userSelectedResourceMap[table?._id]
|
||||
$: tableEditable = table?._id !== TableNames.USERS
|
||||
$: activeId = $params.viewName ?? $params.viewId ?? $params.tableId
|
||||
$: activeId = decodeURIComponent(
|
||||
$params.viewName ?? $params.viewId ?? $params.tableId
|
||||
)
|
||||
$: views = Object.values(table?.views || {})
|
||||
.filter(x => x.version === 2)
|
||||
.slice()
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
let loading = false
|
||||
|
||||
$: view = $views.selected
|
||||
$: name = view.name
|
||||
$: schema = view.schema
|
||||
$: calculation = view.calculation
|
||||
$: name = view?.name
|
||||
$: schema = view?.schema
|
||||
$: calculation = view?.calculation
|
||||
$: supportedFormats = Object.values(ROW_EXPORT_FORMATS).filter(key => {
|
||||
if (calculation && key === ROW_EXPORT_FORMATS.JSON_WITH_SCHEMA) {
|
||||
return false
|
||||
|
@ -28,7 +28,7 @@
|
|||
})
|
||||
|
||||
// Fetch rows for specified view
|
||||
$: fetchViewData(name, view.field, view.groupBy, view.calculation)
|
||||
$: fetchViewData(name, view?.field, view?.groupBy, view?.calculation)
|
||||
|
||||
async function fetchViewData(name, field, groupBy, calculation) {
|
||||
loading = true
|
||||
|
|
|
@ -41,6 +41,7 @@ export function createViewsStore() {
|
|||
|
||||
const save = async view => {
|
||||
const savedView = await API.saveView(view)
|
||||
select(view.name)
|
||||
|
||||
// Update tables
|
||||
tables.update(state => {
|
||||
|
|
Loading…
Reference in New Issue