Fixing issues discovered by cypress tests.

This commit is contained in:
mike12345567 2021-06-21 13:04:41 +01:00
parent 03c5640856
commit 3919f8a5a3
5 changed files with 13 additions and 7 deletions

View File

@ -17,13 +17,14 @@
let data = []
let loading = false
$: isUsersTable = $tables.selected?._id === TableNames.USERS
$: title = $tables.selected.name
$: schema = $tables.selected.schema
$: title = $tables.selected?.name
$: schema = $tables.selected?.schema
$: tableView = {
schema,
name: $views.selected?.name,
}
$: isInternal = $tables.selected.type === "internal"
$: type = $tables.selected.type
$: isInternal = type === "internal"
// Fetch rows for specified table
$: {
@ -49,6 +50,7 @@
{schema}
tableId={$tables.selected?._id}
{data}
{type}
allowEditing={true}
bind:hideAutocolumns
{loading}

View File

@ -6,12 +6,13 @@
let loading = false
let error = false
let type = "external"
</script>
{#if error}
<div class="errors">{error}</div>
{/if}
<Table schema={query.schema} {data} {loading} rowCount={5} />
<Table schema={query.schema} {data} {loading} {type} rowCount={5} />
<style>
.errors {

View File

@ -15,6 +15,7 @@
$: linkedTable = $tables.list.find(table => table._id === linkedTableId)
$: schema = linkedTable?.schema
$: table = $tables.list.find(table => table._id === tableId)
$: type = table?.type
$: fetchData(tableId, rowId)
$: {
let rowLabel = row?.[table?.primaryDisplay]
@ -33,5 +34,5 @@
</script>
{#if row && row._id === rowId}
<Table {title} {schema} {data} />
<Table {title} {schema} {data} {type} />
{/if}

View File

@ -12,7 +12,6 @@
import {
TableNames,
UNEDITABLE_USER_FIELDS,
BUDIBASE_INTERNAL_DB,
} from "constants"
import RoleCell from "./cells/RoleCell.svelte"
@ -24,6 +23,7 @@
export let loading = false
export let hideAutocolumns
export let rowCount
export let type
let selectedRows = []
let editableColumn
@ -32,7 +32,7 @@
let editColumnModal
let customRenderers = []
$: isInternal = tableId === BUDIBASE_INTERNAL_DB
$: isInternal = type !== "external"
$: isUsersTable = tableId === TableNames.USERS
$: data && resetSelectedRows()
$: editRowComponent = isUsersTable ? CreateEditUser : CreateEditRow

View File

@ -15,6 +15,7 @@
let hideAutocolumns = true
let data = []
let loading = false
let type = "internal"
$: name = view.name
@ -56,6 +57,7 @@
tableId={view.tableId}
{data}
{loading}
{type}
allowEditing={!view?.calculation}
bind:hideAutocolumns
>