1
0
Fork 0
mirror of synced 2024-07-05 06:20:55 +12:00

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

View file

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

View file

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

View file

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

View file

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