model bugfixes

This commit is contained in:
Martin McKeaveney 2020-06-02 11:40:33 +01:00
parent f59c13b686
commit 527a25c794
8 changed files with 14 additions and 12 deletions

View File

@ -32,7 +32,7 @@ export const getBackendUiStore = () => {
state.selectedDatabase = db
if (models && models.length > 0) {
state.selectedModel = models[0]
state.selectedView = `${models[0]._id}`
state.selectedView = `all_${models[0]._id}`
}
state.breadcrumbs = [db.name]
state.models = models
@ -76,7 +76,7 @@ export const getBackendUiStore = () => {
state.models.push(model)
state.models = state.models
state.selectedModel = model
state.selectedView = `${model._id}`
state.selectedView = `all_${model._id}`
return state
}),
},

View File

@ -46,7 +46,7 @@
function selectModel(model) {
backendUiStore.update(state => {
state.selectedModel = model
state.selectedView = `${model._id}`
state.selectedView = `all_${model._id}`
return state
})
}

View File

@ -12,13 +12,13 @@
const ACCESS_LEVELS = [
{
name: "Admin",
key: "ADMIN"
key: "ADMIN",
},
{
name: "Power User",
key: "POWER_USER"
}
];
key: "POWER_USER",
},
]
let selectedTab = "SETUP"
let testResult

View File

@ -43,7 +43,9 @@
{#if $backendUiStore.selectedDatabase._id && $backendUiStore.selectedModel.name}
<ModelDataTable {selectRecord} />
{:else}
<i style="color: var(--grey-dark)">create your first model to start building</i>
<i style="color: var(--grey-dark)">
create your first model to start building
</i>
{/if}
<style>

View File

@ -8,7 +8,7 @@ const router = Router()
router
.get(
"/api/:instanceId/view/:viewName",
"/api/:instanceId/views/:viewName",
authorized(READ_VIEW, ctx => ctx.params.viewName),
recordController.fetchView
)