Updating tests and re-formatting.

This commit is contained in:
mike12345567 2020-10-09 19:30:50 +01:00
parent 763f7b3321
commit dc9552dbad
7 changed files with 10 additions and 15 deletions

View File

@ -52,7 +52,7 @@
onOk={deleteRow}
title="Confirm Delete" />
<Modal bind:this={modal}>
<CreateEditRowModal row={row} />
<CreateEditRowModal {row} />
</Modal>
<style>

View File

@ -36,7 +36,7 @@
title={table.name}
icon="ri-table-fill"
on:click={() => selectTable(table)}>
<EditTablePopover table={table} />
<EditTablePopover {table} />
</ListItem>
{#each Object.keys(table.views || {}) as viewName}
<ListItem

View File

@ -86,8 +86,8 @@
<div class="root">
{#if idFields.length === 0}
<div class="cannot-use">
Update row can only be used within a component that provides data, such
as a List
Update row can only be used within a component that provides data, such as
a List
</div>
{:else}
<Label size="m" color="dark">Row Id</Label>

View File

@ -218,8 +218,7 @@ exports.destroy = async function(ctx) {
// for automations include the row that was deleted
ctx.row = row
ctx.eventEmitter &&
ctx.eventEmitter.emitRow(`row:delete`, instanceId, row)
ctx.eventEmitter && ctx.eventEmitter.emitRow(`row:delete`, instanceId, row)
}
exports.validate = async function(ctx) {

View File

@ -116,9 +116,7 @@ exports.destroy = async function(ctx) {
include_docs: true,
})
)
await db.bulkDocs(
rows.rows.map(row => ({ _id: row.id, _deleted: true }))
)
await db.bulkDocs(rows.rows.map(row => ({ _id: row.id, _deleted: true })))
// update linked rows
await linkRows.updateLinks({

View File

@ -12,7 +12,6 @@ Object {
"field": "myField",
"filters": Array [],
"groupBy": undefined,
"tableId": "14f1c4e94d6a47b682ce89d35d4c78b0",
"schema": Object {
"avg": Object {
"type": "number",
@ -36,6 +35,7 @@ Object {
"type": "number",
},
},
"tableId": "14f1c4e94d6a47b682ce89d35d4c78b0",
},
"reduce": "_stats",
}
@ -65,8 +65,8 @@ Object {
},
],
"groupBy": undefined,
"tableId": "14f1c4e94d6a47b682ce89d35d4c78b0",
"schema": null,
"tableId": "14f1c4e94d6a47b682ce89d35d4c78b0",
},
}
`;
@ -83,8 +83,8 @@ Object {
"field": "score",
"filters": Array [],
"groupBy": "age",
"tableId": "14f1c4e94d6a47b682ce89d35d4c78b0",
"schema": null,
"tableId": "14f1c4e94d6a47b682ce89d35d4c78b0",
},
"reduce": "_stats",
}

View File

@ -67,9 +67,7 @@ exports.getRowParams = (tableId, rowId = null, otherProps = {}) => {
throw "Cannot build params for rows without a table ID"
}
const endOfKey =
rowId == null
? `${tableId}${SEPARATOR}`
: `${tableId}${SEPARATOR}${rowId}`
rowId == null ? `${tableId}${SEPARATOR}` : `${tableId}${SEPARATOR}${rowId}`
return getDocParams(DocumentTypes.ROW, endOfKey, otherProps)
}